From 574105908284f8aedf21aed46b2dfca487c33e0a Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Tue, 7 May 1996 21:05:12 +0000 Subject: [PATCH] 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. --- usr.bin/chpass/pw_yp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/chpass/pw_yp.c b/usr.bin/chpass/pw_yp.c index c86e4deea5cb..a334fee91b82 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 */