summaryrefslogtreecommitdiffstats
path: root/chpass/pw_yp.c
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1996-10-23 14:43:39 +0000
committerBill Paul <wpaul@FreeBSD.org>1996-10-23 14:43:39 +0000
commit326af800ad8e2a80ceffaa3ec3a2ceb3d6e2f30f (patch)
tree079a5ec3e7d20a79e0c5af3afe92d7f8168ea756 /chpass/pw_yp.c
parent5472820c2d866cf9e98f4030d89367b5c559b55b (diff)
downloadpw-darwin-326af800ad8e2a80ceffaa3ec3a2ceb3d6e2f30f.tar.gz
pw-darwin-326af800ad8e2a80ceffaa3ec3a2ceb3d6e2f30f.tar.zst
pw-darwin-326af800ad8e2a80ceffaa3ec3a2ceb3d6e2f30f.zip
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 'chpass/pw_yp.c')
-rw-r--r--chpass/pw_yp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/chpass/pw_yp.c b/chpass/pw_yp.c
index 3cf65d1..a02327d 100644
--- a/chpass/pw_yp.c
+++ b/chpass/pw_yp.c
@@ -81,6 +81,7 @@ static HASHINFO openinfo = {
int force_old = 0;
int _use_yp = 0;
int suser_override = 0;
+int yp_in_pw_file = 0;
char *yp_domain = NULL;
char *yp_server = NULL;
@@ -278,8 +279,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_check(NULL)) ||
- (yp_domain && yp_server)) {
+ yp_in_pw_file = !(dbp->get)(dbp,&key,&data,0);
+ if (_yp_check(NULL) || (yp_domain && yp_server)) {
server = get_yp_master(0);
/* Is the user in the NIS passwd map */
@@ -324,6 +325,7 @@ int use_yp (user, uid, which)
return(USER_LOCAL_ONLY);
else if (!user_exists)
return(USER_UNKNOWN);
+
return(-1);
}