summaryrefslogtreecommitdiffstats
path: root/usr.bin/chpass
diff options
context:
space:
mode:
authorguido <guido@FreeBSD.org>1996-07-01 19:38:50 +0000
committerguido <guido@FreeBSD.org>1996-07-01 19:38:50 +0000
commit70bae2bee199f1171426e884d9dd14bcf0c85eb7 (patch)
tree4bfb5d9e29eba41cf2d104fc69a77e860b476e6b /usr.bin/chpass
parent9f2f4504f0af05668863538cc309552906b0a9da (diff)
downloadFreeBSD-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/chpass')
-rw-r--r--usr.bin/chpass/chpass.c6
1 files changed, 4 insertions, 2 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
}
OpenPOWER on IntegriCloud