summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw/pw_user.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-01-26 16:50:42 +0000
committerbapt <bapt@FreeBSD.org>2015-01-26 16:50:42 +0000
commit798d728a636c7efb6149c352a40e1173234a19e0 (patch)
tree14b215b716ccad2b7a93358bd09b487f7d025897 /usr.sbin/pw/pw_user.c
parent6258d2aa159b36879a8419a7131374cee9b7a3c9 (diff)
downloadFreeBSD-src-798d728a636c7efb6149c352a40e1173234a19e0.zip
FreeBSD-src-798d728a636c7efb6149c352a40e1173234a19e0.tar.gz
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 'usr.sbin/pw/pw_user.c')
-rw-r--r--usr.sbin/pw/pw_user.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index f146b46..483148a 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/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");
}
OpenPOWER on IntegriCloud