mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +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
@ -78,7 +78,12 @@ pw_scan(bp, pw)
|
|||||||
|
|
||||||
if (!(p = strsep(&bp, ":"))) /* uid */
|
if (!(p = strsep(&bp, ":"))) /* uid */
|
||||||
goto fmt;
|
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);
|
id = atol(p);
|
||||||
if (root && id) {
|
if (root && id) {
|
||||||
warnx("root uid should be 0");
|
warnx("root uid should be 0");
|
||||||
|
@ -78,7 +78,12 @@ pw_scan(bp, pw)
|
|||||||
|
|
||||||
if (!(p = strsep(&bp, ":"))) /* uid */
|
if (!(p = strsep(&bp, ":"))) /* uid */
|
||||||
goto fmt;
|
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);
|
id = atol(p);
|
||||||
if (root && id) {
|
if (root && id) {
|
||||||
warnx("root uid should be 0");
|
warnx("root uid should be 0");
|
||||||
|
Loading…
Reference in New Issue
Block a user