diff options
author | guido <guido@FreeBSD.org> | 1996-07-01 19:38:50 +0000 |
---|---|---|
committer | guido <guido@FreeBSD.org> | 1996-07-01 19:38:50 +0000 |
commit | 70bae2bee199f1171426e884d9dd14bcf0c85eb7 (patch) | |
tree | 4bfb5d9e29eba41cf2d104fc69a77e860b476e6b /usr.bin | |
parent | 9f2f4504f0af05668863538cc309552906b0a9da (diff) | |
download | FreeBSD-src-70bae2bee199f1171426e884d9dd14bcf0c85eb7.zip FreeBSD-src-70bae2bee199f1171426e884d9dd14bcf0c85eb7.tar.gz |
Implement incremental passwd database updates. This is done by ading a '-u'
option to pwd_mkdb and adding this option to utilities invoking it.
Further, the filling of both the secure and insecure databases has been
merged into one loop giving also a performance improvemnet.
Note that I did *not* change the adduser command. I don't read perl
(it is a write only language anyway).
The change will drastically improve performance for passwd and
friends with large passwd files. Vipw's performance won't change.
In order to do that some kind of diff should be made between the
old and new master.passwd and depending the amount of changes, an
incremental or complete update of the databases should be agreed
upon.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/chpass/chpass.c | 6 | ||||
-rw-r--r-- | usr.bin/passwd/local_passwd.c | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c index f353b33..83d5498 100644 --- a/usr.bin/chpass/chpass.c +++ b/usr.bin/chpass/chpass.c @@ -40,7 +40,7 @@ static char copyright[] = #ifndef lint static char sccsid[] = "From: @(#)chpass.c 8.4 (Berkeley) 4/2/94"; static char rcsid[] = - "$Id: chpass.c,v 1.7 1996/02/23 16:08:56 wpaul Exp $"; + "$Id: chpass.c,v 1.8 1996/05/25 01:05:17 wpaul Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -84,6 +84,7 @@ main(argc, argv) { enum { NEWSH, LOADENTRY, EDITENTRY, NEWPW } op; struct passwd *pw, lpw; + char *username; int ch, pfd, tfd; char *arg; #ifdef YP @@ -180,6 +181,7 @@ main(argc, argv) default: usage(); } + username = pw->pw_name; if (op == NEWSH) { /* protect p_shell -- it thinks NULL is /bin/sh */ if (!arg[0]) @@ -250,7 +252,7 @@ main(argc, argv) #endif /* YP */ pw_copy(pfd, tfd, pw); - if (!pw_mkdb()) + if (!pw_mkdb(username)) pw_error((char *)NULL, 0, 1); #ifdef YP } diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index aefd9af..73ec1f8 100644 --- a/usr.bin/passwd/local_passwd.c +++ b/usr.bin/passwd/local_passwd.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: local_passwd.c,v 1.8 1995/12/16 09:45:12 markm Exp $ */ #ifndef lint @@ -176,7 +176,7 @@ local_passwd(uname) pw->pw_change = 0; pw_copy(pfd, tfd, pw); - if (!pw_mkdb()) + if (!pw_mkdb(uname)) pw_error((char *)NULL, 0, 1); return (0); } |