mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Do not allow empty GIDs for non-NIS entries.
MFC after: 2 weeks
This commit is contained in:
parent
72566b4251
commit
65edeb2358
1 changed files with 7 additions and 0 deletions
|
|
@ -124,6 +124,13 @@ __pw_scan(char *bp, struct passwd *pw, int flags)
|
|||
goto fmt;
|
||||
if (p[0])
|
||||
pw->pw_fields |= _PWF_GID;
|
||||
else {
|
||||
if (pw->pw_name[0] != '+' && pw->pw_name[0] != '-') {
|
||||
if (flags & _PWSCAN_WARN)
|
||||
warnx("no gid for user %s", pw->pw_name);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
id = strtoul(p, &ep, 10);
|
||||
if (errno == ERANGE) {
|
||||
if (flags & _PWSCAN_WARN)
|
||||
|
|
|
|||
Loading…
Reference in a new issue