From b07f424116833ad94061c5610646ae2c6ef00265 Mon Sep 17 00:00:00 2001 From: Guido van Rooij Date: Mon, 1 Jul 1996 19:38:50 +0000 Subject: 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. --- chpass/chpass.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'chpass') 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 @@ -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 } -- cgit v1.2.3-56-ge451