Flag empty UID entries as errors (to stop typos from turning into

alternate root accounts).
This commit is contained in:
Eivind Eklund 1999-11-06 20:21:04 +00:00
parent 5cb03e7cb2
commit aa510d6741
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52921
2 changed files with 12 additions and 2 deletions

View 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");

View 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");