summaryrefslogtreecommitdiffstats
path: root/pw
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-05-31 21:44:09 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-05-31 21:44:09 +0000
commit52819077bb4348529466a387988b6785585c3829 (patch)
tree4293b16a347aa51d971fa48a10e33b3c86b6dc12 /pw
parent861c9030d5b3c835e61181480716d6af26d463e4 (diff)
downloadpw-darwin-52819077bb4348529466a387988b6785585c3829.tar.gz
pw-darwin-52819077bb4348529466a387988b6785585c3829.tar.zst
pw-darwin-52819077bb4348529466a387988b6785585c3829.zip
Cast -1 to uid_t and bump WARNING level to 3
Diffstat (limited to 'pw')
-rw-r--r--pw/Makefile2
-rw-r--r--pw/pw_group.c2
-rw-r--r--pw/pw_user.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/pw/Makefile b/pw/Makefile
index 69953da..4bcf691 100644
--- a/pw/Makefile
+++ b/pw/Makefile
@@ -6,7 +6,7 @@ SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \
grupd.c pwupd.c fileupd.c psdate.c \
bitmap.c cpdir.c rm_r.c
-WARNS?= 2
+WARNS?= 3
LIBADD= crypt util sbuf
diff --git a/pw/pw_group.c b/pw/pw_group.c
index 78adbf1..53757f5 100644
--- a/pw/pw_group.c
+++ b/pw/pw_group.c
@@ -116,7 +116,7 @@ pw_group(struct userconf * cnf, int mode, struct cargs * args)
char *fmems[1];
fmems[0] = NULL;
fakegroup.gr_name = a_name ? a_name->val : "nogroup";
- fakegroup.gr_gid = a_gid ? (gid_t) atol(a_gid->val) : -1;
+ fakegroup.gr_gid = a_gid ? (gid_t) atol(a_gid->val) : (uid_t)-1;
fakegroup.gr_mem = fmems;
return print_group(&fakegroup, getarg(args, 'P') != NULL);
}
diff --git a/pw/pw_user.c b/pw/pw_user.c
index 95a4519..112d018 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -335,7 +335,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
if (pwd == NULL) {
if (mode == M_PRINT && getarg(args, 'F')) {
fakeuser.pw_name = a_name ? a_name->val : "nouser";
- fakeuser.pw_uid = a_uid ? (uid_t) atol(a_uid->val) : -1;
+ fakeuser.pw_uid = a_uid ? (uid_t) atol(a_uid->val) : (uid_t) -1;
return print_user(&fakeuser,
getarg(args, 'P') != NULL,
getarg(args, '7') != NULL);
@@ -791,7 +791,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
grp = GETGRGID(pwd->pw_gid);
pw_log(cnf, mode, W_USER, "%s(%ld):%s(%ld):%s:%s:%s",
pwd->pw_name, (long) pwd->pw_uid,
- grp ? grp->gr_name : "unknown", (long) (grp ? grp->gr_gid : -1),
+ grp ? grp->gr_name : "unknown", (long) (grp ? grp->gr_gid : (uid_t)-1),
pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell);
/*