From owner-freebsd-isp Fri Aug 20 0:15:14 1999 Delivered-To: freebsd-isp@freebsd.org Received: from rucus.ru.ac.za (rucus.ru.ac.za [146.231.29.2]) by hub.freebsd.org (Postfix) with SMTP id 7EA2C151A4 for ; Fri, 20 Aug 1999 00:15:06 -0700 (PDT) (envelope-from nbm@rucus.ru.ac.za) Received: (qmail 74372 invoked by uid 1003); 20 Aug 1999 07:15:02 -0000 Date: Fri, 20 Aug 1999 09:15:02 +0200 From: Neil Blakey-Milner To: Alejandro Ramirez Cc: Mike Harshbarger , freebsd-isp@FreeBSD.ORG Subject: Re: pwd_mkdb and system processes Message-ID: <19990820091502.A71267@rucus.ru.ac.za> References: <006f01beea6c$ca62e940$d4630a0a@megared.net.mx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: <006f01beea6c$ca62e940$d4630a0a@megared.net.mx>; from Alejandro Ramirez on Thu, Aug 19, 1999 at 01:00:57PM -0500 Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Thu 1999-08-19 (13:00), Alejandro Ramirez wrote: > In FreeBSD 3.2, you can do this, from the man page: > > -u username > Only update the record for the specified user. Utilities > that operate on a single user can use this option to avoid the > overhead of rebuilding the entire database. I think he meant "When will _pw_ use pwd_mkdb's -u option" instead of plain pwd_mkdb without -u. > > On a related note, is there any chance in the future of the 'pw' command > > supporting a command line option like pwd_mkdb's '-u' so it doesn't have > > to reconstruct entire password databases? Mike, try this? cvs diff: Diffing . Index: pwupd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pw/pwupd.c,v retrieving revision 1.8 diff -u -r1.8 pwupd.c --- pwupd.c 1999/02/23 07:15:11 1.8 +++ pwupd.c 1999/08/20 07:08:02 @@ -168,8 +168,12 @@ */ if (pwd != NULL) fmtpwentry(pwbuf, pwd, PWF_MASTER); - if ((rc = fileupdate(getpwpath(_MASTERPASSWD), 0644, pwbuf, pfx, l, mode)) != 0) - rc = pwdb(NULL) == 0; + if ((rc = fileupdate(getpwpath(_MASTERPASSWD), 0644, pwbuf, pfx, l, mode)) != 0) { + if (mode == UPD_DELETE) + rc = pwdb(NULL) == 0; + else + rc = pwdb("-u", user, NULL) == 0; + } } } return rc; Good luck, Neil -- Neil Blakey-Milner nbm@rucus.ru.ac.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message