diff options
author | wpaul <wpaul@FreeBSD.org> | 1996-05-07 21:05:12 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1996-05-07 21:05:12 +0000 |
commit | c7393c8b14b0eefbb875488a8bd3e3f953d3b5e3 (patch) | |
tree | 01a44f34697336a33791d4c7cb1d2466c6651e56 /usr.bin/chpass | |
parent | c7584211d56c8f6c099ee4b612754113d399cffa (diff) | |
download | FreeBSD-src-c7393c8b14b0eefbb875488a8bd3e3f953d3b5e3.zip FreeBSD-src-c7393c8b14b0eefbb875488a8bd3e3f953d3b5e3.tar.gz |
In use_yp(), call _yp_check() to make ultra, super-duper sure that NIS
is available before trying to go hunting for a domain name. This fixes
the following problem: you have +::::::::: in /etc/master.passwd but
NIS isn't running (no ypbind, no domain name set) -- passwd and chpass
will still try to change an NIS password instead of the local one.
Diffstat (limited to 'usr.bin/chpass')
-rw-r--r-- | usr.bin/chpass/pw_yp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/chpass/pw_yp.c b/usr.bin/chpass/pw_yp.c index c86e4de..a334fee 100644 --- a/usr.bin/chpass/pw_yp.c +++ b/usr.bin/chpass/pw_yp.c @@ -35,7 +35,7 @@ * Center for Telecommunications Research * Columbia University, New York City * - * $Id: pw_yp.c,v 1.3 1996/02/23 16:08:58 wpaul Exp $ + * $Id: pw_yp.c,v 1.4 1996/03/04 15:34:43 wpaul Exp $ */ #ifdef YP @@ -277,7 +277,8 @@ int use_yp (user, uid, which) bf[0] = _PW_KEYYPENABLED; key.data = (u_char *)bf; key.size = 1; - if (!(dbp->get)(dbp,&key,&data,0) || (yp_domain && yp_server)) { + if ((!(dbp->get)(dbp,&key,&data,0) && _yp_check(NULL)) || + (yp_domain && yp_server)) { server = get_yp_master(0); /* Is the user in the NIS passwd map */ |