summaryrefslogtreecommitdiffstats
path: root/usr.bin/chpass/pw_yp.h
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1996-10-23 14:43:39 +0000
committerwpaul <wpaul@FreeBSD.org>1996-10-23 14:43:39 +0000
commita989e7ab3adeebc74c56fb507cefab2427a59411 (patch)
treee03096a9bc472271084b116fba4b7c692e5ed1b5 /usr.bin/chpass/pw_yp.h
parentdae500bcdcbdeba564b7bcce072b8db99828902a (diff)
downloadFreeBSD-src-a989e7ab3adeebc74c56fb507cefab2427a59411.zip
FreeBSD-src-a989e7ab3adeebc74c56fb507cefab2427a59411.tar.gz
Add a flag to allow the 'use NIS or local?' logic to tell when NIS is
enabled in /etc/master.passwd & friends. This allows the 'USER_YP_AND_LOCAL' case to make a more sensible guess (if NIS is enabled, default to NIS, otherwise default to local -- this is better than defaulting to NIS all the time).
Diffstat (limited to 'usr.bin/chpass/pw_yp.h')
-rw-r--r--usr.bin/chpass/pw_yp.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/chpass/pw_yp.h b/usr.bin/chpass/pw_yp.h
index 7d37560..2bda1ec 100644
--- a/usr.bin/chpass/pw_yp.h
+++ b/usr.bin/chpass/pw_yp.h
@@ -35,7 +35,7 @@
* Center for Telecommunications Research
* Columbia University, New York City
*
- * $Id: pw_yp.h,v 1.8 1996/02/17 18:14:23 wpaul Exp $
+ * $Id: pw_yp.h,v 1.3 1996/02/23 16:08:59 wpaul Exp $
*/
#ifdef YP
@@ -60,6 +60,7 @@ extern char *yp_server;
extern void yp_submit __P(( struct passwd * ));
extern int use_yp __P(( char * , uid_t , int ));
extern char *get_yp_master __P(( int ));
+extern int yp_in_pw_file;
/*
* Yucky.
@@ -84,7 +85,7 @@ extern char *get_yp_master __P(( int ));
} else \
errx(1, "unknown NIS user: uid %u", X); \
} else if (_use_yp == USER_YP_AND_LOCAL) { \
- if (!force_local) { \
+ if (!force_local && (force_yp || yp_in_pw_file)) { \
_use_yp = 1; \
pw = (struct passwd *)&yp_password; \
} else { \
@@ -113,7 +114,7 @@ extern char *get_yp_master __P(( int ));
} else \
errx(1, "unknown NIS user: %s.", X); \
} else if (_use_yp == USER_YP_AND_LOCAL) { \
- if (!force_local) { \
+ if (!force_local && (force_yp || yp_in_pw_file)) { \
_use_yp = 1; \
pw = (struct passwd *)&yp_password; \
} else { \
OpenPOWER on IntegriCloud