From 34876b91378a9fe34bc902d5c0758e65af56f981 Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Thu, 23 Mar 1995 17:22:37 +0000 Subject: [PATCH] Summarily enable YP as soon as any a '+' is detected instead of generating special values when +user substitutions are in effect. The new getpwent code can handle all the special cases itself now. --- usr.sbin/pwd_mkdb/pwd_mkdb.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c index 0bea7f9f3641..92bb558689c5 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c @@ -179,13 +179,8 @@ main(argc, argv) data.data = (u_char *)buf; key.data = (u_char *)tbuf; for (cnt = 1; scan(fp, &pwd); ++cnt) { - if(pwd.pw_name[0] == '+') { - if(pwd.pw_name[1] && !yp_enabled) { - yp_enabled = 1; - } else if(!pwd.pw_name[1]) { - yp_enabled = -1; - } - } + if(pwd.pw_name[0] == '+') + yp_enabled = 1; #define COMPACT(e) t = e; while (*p++ = *t++); /* Create insecure data. */ p = buf; @@ -231,7 +226,7 @@ main(argc, argv) /* Store insecure special plus and special minus */ if ((pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-') - && pwd.pw_name[1] == '@') { + && pwd.pw_name[1]) { tbuf[0] = (pwd.pw_name[0] == '+') ? _PW_KEYPLUSBYNUM : _PW_KEYMINUSBYNUM; memmove(tbuf + 1, (pwd.pw_name[0] == '+') ? @@ -341,7 +336,7 @@ main(argc, argv) /* Store secure special plus and special minus */ if ((pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-') - && pwd.pw_name[1] == '@') { + && pwd.pw_name[1]) { tbuf[0] = (pwd.pw_name[0] == '+') ? _PW_KEYPLUSBYNUM : _PW_KEYMINUSBYNUM; memmove(tbuf + 1, (pwd.pw_name[0] == '+') ?