From 637bc59616010594c7e18488a99c9aa55fa714dc Mon Sep 17 00:00:00 2001 From: Eivind Eklund Date: Mon, 22 Nov 1999 12:42:38 +0000 Subject: [PATCH] Allow empty UIDs if we are processing NIS records. I am not entirely happy with how this end up and will re-visit the entire empty field problem, but this patch solves the NIS problem for now. Submitted by: Dan Nelson PR: 14865,14984 --- lib/libc/gen/pw_scan.c | 6 ++++-- usr.sbin/pwd_mkdb/pw_scan.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libc/gen/pw_scan.c b/lib/libc/gen/pw_scan.c index a24380f60814..09556a3e320f 100644 --- a/lib/libc/gen/pw_scan.c +++ b/lib/libc/gen/pw_scan.c @@ -88,8 +88,10 @@ pw_scan(bp, pw) if (p[0]) pw->pw_fields |= _PWF_UID; else { - warnx("no uid for user %s", pw->pw_name); - return (0); + if (pw->pw_name[0] != '+' && pw->pw_name[0] != '-') { + warnx("no uid for user %s", pw->pw_name); + return (0); + } } id = atol(p); if (root && id) { diff --git a/usr.sbin/pwd_mkdb/pw_scan.c b/usr.sbin/pwd_mkdb/pw_scan.c index a24380f60814..09556a3e320f 100644 --- a/usr.sbin/pwd_mkdb/pw_scan.c +++ b/usr.sbin/pwd_mkdb/pw_scan.c @@ -88,8 +88,10 @@ pw_scan(bp, pw) if (p[0]) pw->pw_fields |= _PWF_UID; else { - warnx("no uid for user %s", pw->pw_name); - return (0); + if (pw->pw_name[0] != '+' && pw->pw_name[0] != '-') { + warnx("no uid for user %s", pw->pw_name); + return (0); + } } id = atol(p); if (root && id) {