diff options
author | des <des@FreeBSD.org> | 1999-03-27 21:51:33 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 1999-03-27 21:51:33 +0000 |
commit | 73cdac043ec54380df2835bb70d1480dbe4db0b7 (patch) | |
tree | e918dd90b14ff6d5627403cf8ba192eeb0099576 /lib | |
parent | c9eccc7347cc4051a3db16f68f3a854908494917 (diff) | |
download | FreeBSD-src-73cdac043ec54380df2835bb70d1480dbe4db0b7.zip FreeBSD-src-73cdac043ec54380df2835bb70d1480dbe4db0b7.tar.gz |
Partial fix for the forking problem: if we can't access the master maps,
try again with the unrestricted map.
PR: bin/10821
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/getpwent.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 2ee0e32..f46683f 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -747,14 +747,21 @@ _getyppass(struct passwd *pw, const char *name, const char *map) return 0; } - sprintf(mastermap,"%s",map); - if (_gotmaster == YP_HAVE_MASTER) sprintf(mastermap,"master.%s", map); + else + sprintf(mastermap,"%s",map); if(yp_match(_pw_yp_domain, (char *)&mastermap, name, strlen(name), - &result, &resultlen)) - return 0; + &result, &resultlen)) { + if (_gotmaster != YP_HAVE_MASTER) + return 0; + sprintf(mastermap,"%s",map); + if (yp_match(_pw_yp_domain, (char *)&mastermap, + name, strlen(name), &result, &resultlen)) + return 0; + _gotmaster = YP_HAVE_NONE; + } if (!_pw_stepping_yp) { s = strchr(result, ':'); |