diff options
| author | Baptiste Daroussin <bapt@FreeBSD.org> | 2012-10-01 17:00:33 +0000 |
|---|---|---|
| committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2012-10-01 17:00:33 +0000 |
| commit | 6844cbad609c7fe499b4e759a0157ae704c84ccc (patch) | |
| tree | 0963ef2431d8a4565f00cba23093e4a042c29ec7 | |
| parent | 16a83217757124fac1897ac4703ecc8ad072cdd2 (diff) | |
| download | pw-darwin-6844cbad609c7fe499b4e759a0157ae704c84ccc.tar.gz pw-darwin-6844cbad609c7fe499b4e759a0157ae704c84ccc.zip | |
Do not treat empty name as an uid 0
Reported by: Robert Bonomi <bonomi@mail.r-bonomi.com>
| -rw-r--r-- | pw/pw_user.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c index fd3136c..1b72cbd 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -314,7 +314,8 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) * know. */ if (mode != M_ADD && pwd == NULL - && strspn(a_name->val, "0123456789") == strlen(a_name->val)) { + && strspn(a_name->val, "0123456789") == strlen(a_name->val) + && *a_name->val) { (a_uid = a_name)->ch = 'u'; a_name = NULL; } |
