diff options
author | Guido van Rooij <guido@FreeBSD.org> | 1996-07-01 19:38:50 +0000 |
---|---|---|
committer | Guido van Rooij <guido@FreeBSD.org> | 1996-07-01 19:38:50 +0000 |
commit | b07f424116833ad94061c5610646ae2c6ef00265 (patch) | |
tree | 8b25e30bbe07799c60e7658cab5dd25442df8f36 /chpass/chpass.c | |
parent | a0255957bf49be5d05204ae7ddd57c25148fb5df (diff) | |
download | pw-darwin-b07f424116833ad94061c5610646ae2c6ef00265.tar.gz pw-darwin-b07f424116833ad94061c5610646ae2c6ef00265.tar.zst pw-darwin-b07f424116833ad94061c5610646ae2c6ef00265.zip |
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 'chpass/chpass.c')
-rw-r--r-- | chpass/chpass.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chpass/chpass.c b/chpass/chpass.c index f353b33..83d5498 100644 --- a/chpass/chpass.c +++ b/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 } |