diff options
| author | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-01-26 16:50:42 +0000 |
|---|---|---|
| committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-01-26 16:50:42 +0000 |
| commit | 189e321d5d94ca77eab7e74e1ac94c51c4054e68 (patch) | |
| tree | 364b59df0e4314ead1751b89af2ac9f5bfb8ca9c /pw/pw_user.c | |
| parent | ecce87b75197d392a8adcdbd6f11dcf1ddd573d2 (diff) | |
| download | pw-darwin-189e321d5d94ca77eab7e74e1ac94c51c4054e68.tar.gz pw-darwin-189e321d5d94ca77eab7e74e1ac94c51c4054e68.zip | |
Revert r277652
uid and gid are never and should never be negative. The pw(8) manpage clearly
states the -u and -g arguments are for uids/gids, hence using negative values is
abusing a bug in former versions of pw(8)
Diffstat (limited to 'pw/pw_user.c')
| -rw-r--r-- | pw/pw_user.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c index f146b46..483148a 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -322,10 +322,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) a_name = NULL; } } else { - const char *teststr = a_uid->val; - if (*teststr == '-') - teststr++; - if (strspn(teststr, "0123456789") != strlen(teststr)) + if (strspn(a_uid->val, "0123456789") != strlen(a_uid->val)) errx(EX_USAGE, "-u expects a number"); } |
