mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-28 14:24:09 +01:00
Flag empty UID entries as errors (to stop typos from turning into
alternate root accounts).
This commit is contained in:
parent
5cb03e7cb2
commit
aa510d6741
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52921
@ -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");
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user