summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorEivind Eklund <eivind@FreeBSD.org>1999-11-06 20:21:04 +0000
committerEivind Eklund <eivind@FreeBSD.org>1999-11-06 20:21:04 +0000
commitf9f3afba9754829f8a22ecfea8d3f1c0c8d23bff (patch)
tree24d81e4d82281f23c2e304e21610bcd7e8231e47 /libc
parent32769a2d949a4de80bda13a585a24889c2213ca8 (diff)
downloadpw-darwin-f9f3afba9754829f8a22ecfea8d3f1c0c8d23bff.tar.gz
pw-darwin-f9f3afba9754829f8a22ecfea8d3f1c0c8d23bff.tar.zst
pw-darwin-f9f3afba9754829f8a22ecfea8d3f1c0c8d23bff.zip
Flag empty UID entries as errors (to stop typos from turning into
alternate root accounts).
Diffstat (limited to 'libc')
-rw-r--r--libc/gen/pw_scan.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libc/gen/pw_scan.c b/libc/gen/pw_scan.c
index 5190686..0ce9b1d 100644
--- a/libc/gen/pw_scan.c
+++ b/libc/gen/pw_scan.c
@@ -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");