summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw/pw.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-07-28 21:10:58 +0000
committerbapt <bapt@FreeBSD.org>2015-07-28 21:10:58 +0000
commitae6e75a0368f864fa5e7370c164dcd8790d53650 (patch)
tree82c9c411d410f52f3c10b0ce3e5ae4e9d36d7317 /usr.sbin/pw/pw.c
parent39f3813b41e9677f563696f0ce3f25d9f82adc71 (diff)
downloadFreeBSD-src-ae6e75a0368f864fa5e7370c164dcd8790d53650.zip
FreeBSD-src-ae6e75a0368f864fa5e7370c164dcd8790d53650.tar.gz
Check uid/gid used when creating a user/group are not larger than UID_MAX/GID_MAX
PR: 173977 Reported by: nvass@gmx.com
Diffstat (limited to 'usr.sbin/pw/pw.c')
-rw-r--r--usr.sbin/pw/pw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c
index 3db427a..c1d9cd3 100644
--- a/usr.sbin/pw/pw.c
+++ b/usr.sbin/pw/pw.c
@@ -269,7 +269,7 @@ main(int argc, char *argv[])
}
if (strspn(optarg, "0123456789") != strlen(optarg))
errx(EX_USAGE, "-g expects a number");
- id = strtonum(optarg, 0, LONG_MAX, &errstr);
+ id = strtonum(optarg, 0, GID_MAX, &errstr);
if (errstr != NULL)
errx(EX_USAGE, "Bad id '%s': %s", optarg,
errstr);
@@ -281,7 +281,7 @@ main(int argc, char *argv[])
addarg(&arglist, 'u', optarg);
break;
}
- id = strtonum(optarg, 0, LONG_MAX, &errstr);
+ id = strtonum(optarg, 0, UID_MAX, &errstr);
if (errstr != NULL)
errx(EX_USAGE, "Bad id '%s': %s", optarg,
errstr);
OpenPOWER on IntegriCloud