summaryrefslogtreecommitdiffstats
path: root/pw
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>1999-02-08 21:26:44 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>1999-02-08 21:26:44 +0000
commitdd4b9c99676c5f69ef988362df49dac4f9272a8d (patch)
treebd34740c5019eb298a5887812b11e4e36be62c07 /pw
parent2defa2b7e4954e7974189d2fb663254e3ac88f68 (diff)
downloadpw-darwin-dd4b9c99676c5f69ef988362df49dac4f9272a8d.tar.gz
pw-darwin-dd4b9c99676c5f69ef988362df49dac4f9272a8d.tar.zst
pw-darwin-dd4b9c99676c5f69ef988362df49dac4f9272a8d.zip
Don't assume a_name is a number just because the first character
is a digit. PR: bin/9484 Submitted by: Matthew D. Fuller <fullermd@futuresouth.com>
Diffstat (limited to 'pw')
-rw-r--r--pw/pw_user.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c
index 87ec76c..d339381 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: pw_user.c,v 1.24 1999/01/02 04:37:46 billf Exp $";
+ "$Id: pw_user.c,v 1.25 1999/01/04 14:07:53 billf Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -291,7 +291,9 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
* really don't really care which we have, but we need to
* know.
*/
- if (mode != M_ADD && pwd == NULL && isdigit(*a_name->val) && atoi(a_name->val) > 0) { /* Assume uid */
+ if (mode != M_ADD && pwd == NULL
+ && strspn(a_name->val, "0123456789") == strlen(a_name->val)
+ && atoi(a_name->val) > 0) { /* Assume uid */
(a_uid = a_name)->ch = 'u';
a_name = NULL;
}