diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-08-26 03:28:31 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-08-26 03:28:31 +0000 |
commit | 3aa55c5fded04d24e49a5ef347143a81e77baa25 (patch) | |
tree | 7f23149ee747e1fa19de85a37c1c84dbf849dadd /usr.bin/passwd/local_passwd.c | |
parent | 8eae4adcc3f2ca8d68e42305f860c7a0bfe53885 (diff) |
Change the second arg to pw_mkdb() from a boolean flag to a set of
bit flags ORed together. Currently the only flags defined are
_PASSWORD_SECUREONLY and _PASSWORD_OMITV7 but this is enough to
cause pw_mkdb() to run pwd_mkdb with the options we want.
With this change we no longer generate the old V7 passwd file when
only the extra fields in master.passwd (or the encrypted password)
have changed. There are other programs that could probably use
the _PASSWORD_OMITV7 flag; they will be converted at a future date.
Diffstat (limited to 'usr.bin/passwd/local_passwd.c')
-rw-r--r-- | usr.bin/passwd/local_passwd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index cbe650cd212..231570ae3d8 100644 --- a/usr.bin/passwd/local_passwd.c +++ b/usr.bin/passwd/local_passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: local_passwd.c,v 1.19 2001/08/18 19:58:46 millert Exp $ */ +/* $OpenBSD: local_passwd.c,v 1.20 2001/08/26 03:28:30 millert Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -35,7 +35,7 @@ #ifndef lint /*static const char sccsid[] = "from: @(#)local_passwd.c 5.5 (Berkeley) 5/6/91";*/ -static const char rcsid[] = "$OpenBSD: local_passwd.c,v 1.19 2001/08/18 19:58:46 millert Exp $"; +static const char rcsid[] = "$OpenBSD: local_passwd.c,v 1.20 2001/08/26 03:28:30 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -70,7 +70,7 @@ local_passwd(uname, authenticated) sigset_t fullset; time_t period; int pfd, tfd = -1; - int secureonly = 0; + int pwflags = _PASSWORD_OMITV7; char *s = NULL; if (!(pw = getpwnam(uname))) { @@ -107,7 +107,7 @@ local_passwd(uname, authenticated) if (pw->pw_change != 0) pw->pw_change = 0; else - secureonly = 1; + pwflags = _PASSWORD_SECUREONLY; } /* Drop user's real uid and block all signals to avoid a DoS. */ @@ -161,7 +161,7 @@ local_passwd(uname, authenticated) /* Update master.passwd file and rebuild spwd.db. */ pw_copy(pfd, tfd, pw); - if (pw_mkdb(uname, secureonly) < 0) + if (pw_mkdb(uname, pwflags) < 0) pw_error(NULL, 0, 1); return(0); |