summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pwd_mkdb
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1995-03-23 17:22:37 +0000
committerwpaul <wpaul@FreeBSD.org>1995-03-23 17:22:37 +0000
commitf1a6a16e953b537b73b1fdc6808ca8b97deab796 (patch)
treeecbf14a6cd3de8086d2aa6f8eadf5dbab4a52f8a /usr.sbin/pwd_mkdb
parent0e5a707fe6407d4dd09b31554e36bada093fe395 (diff)
downloadFreeBSD-src-f1a6a16e953b537b73b1fdc6808ca8b97deab796.zip
FreeBSD-src-f1a6a16e953b537b73b1fdc6808ca8b97deab796.tar.gz
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.
Diffstat (limited to 'usr.sbin/pwd_mkdb')
-rw-r--r--usr.sbin/pwd_mkdb/pwd_mkdb.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c
index 0bea7f9..92bb558 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] == '+') ?
OpenPOWER on IntegriCloud