From f31ec719878d9025a455971cbe1d0976dc9ef719 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Mon, 26 Jan 2015 16:50:42 +0000 Subject: 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) --- pw/pw_group.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'pw/pw_group.c') diff --git a/pw/pw_group.c b/pw/pw_group.c index 51166cd..b20ce88 100644 --- a/pw/pw_group.c +++ b/pw/pw_group.c @@ -68,11 +68,7 @@ pw_group(struct userconf * cnf, int mode, struct cargs * args) }; if (a_gid != NULL) { - const char *teststr; - teststr = a_gid->val; - if (*teststr == '-') - teststr++; - if (strspn(teststr, "0123456789") != strlen(teststr)) + if (strspn(a_gid->val, "0123456789") != strlen(a_gid->val)) errx(EX_USAGE, "-g expects a number"); } -- cgit v1.2.3