]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Flag empty UID entries as errors (to stop typos from turning into
authorEivind Eklund <eivind@FreeBSD.org>
Sat, 6 Nov 1999 20:21:04 +0000 (20:21 +0000)
committerEivind Eklund <eivind@FreeBSD.org>
Sat, 6 Nov 1999 20:21:04 +0000 (20:21 +0000)
alternate root accounts).

libc/gen/pw_scan.c

index 5190686e5e78c180622ddb08026cecaaae382914..0ce9b1d6b19ae8e6e183b53391393cfd65baafe3 100644 (file)
@@ -78,7 +78,12 @@ pw_scan(bp, pw)
 
        if (!(p = strsep(&bp, ":")))                    /* uid */
                goto fmt;
-       if(p[0]) pw->pw_fields |= _PWF_UID;
+       if (p[0])
+               pw->pw_fields |= _PWF_UID;
+       else {
+               warnx("no uid for user %s", pw->pw_name);
+               return (0);
+       }
        id = atol(p);
        if (root && id) {
                warnx("root uid should be 0");