summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2012-10-01 17:00:33 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2012-10-01 17:00:33 +0000
commit6844cbad609c7fe499b4e759a0157ae704c84ccc (patch)
tree0963ef2431d8a4565f00cba23093e4a042c29ec7 /pw/pw_user.c
parent16a83217757124fac1897ac4703ecc8ad072cdd2 (diff)
downloadpw-darwin-6844cbad609c7fe499b4e759a0157ae704c84ccc.tar.gz
pw-darwin-6844cbad609c7fe499b4e759a0157ae704c84ccc.tar.zst
pw-darwin-6844cbad609c7fe499b4e759a0157ae704c84ccc.zip
Do not treat empty name as an uid 0
Reported by: Robert Bonomi <bonomi@mail.r-bonomi.com>
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r--pw/pw_user.c3
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;
}