summaryrefslogtreecommitdiffstats
path: root/chpass
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1996-05-07 21:05:12 +0000
committerBill Paul <wpaul@FreeBSD.org>1996-05-07 21:05:12 +0000
commit346a63c95a04ba84385c7ffbf97538523c4885f1 (patch)
tree18d7a8474a3c1e25738bfc19603f85ae58d11239 /chpass
parent67c956f4295255e54027c4a05528dccc9d027fdb (diff)
downloadpw-darwin-346a63c95a04ba84385c7ffbf97538523c4885f1.tar.gz
pw-darwin-346a63c95a04ba84385c7ffbf97538523c4885f1.tar.zst
pw-darwin-346a63c95a04ba84385c7ffbf97538523c4885f1.zip
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 'chpass')
-rw-r--r--chpass/pw_yp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/chpass/pw_yp.c b/chpass/pw_yp.c
index c86e4de..a334fee 100644
--- a/chpass/pw_yp.c
+++ b/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 */