Date: Fri, 20 Aug 1999 09:15:02 +0200 From: Neil Blakey-Milner <nbm@mithrandr.moria.org> To: Alejandro Ramirez <ales@megared.net.mx> Cc: Mike Harshbarger <mharsh@fsr.net>, freebsd-isp@FreeBSD.ORG Subject: Re: pwd_mkdb and system processes Message-ID: <19990820091502.A71267@rucus.ru.ac.za> In-Reply-To: <006f01beea6c$ca62e940$d4630a0a@megared.net.mx>; from Alejandro Ramirez on Thu, Aug 19, 1999 at 01:00:57PM -0500 References: <Pine.BSF.3.96.990818113022.7774f-100000@archer.fsr.net> <006f01beea6c$ca62e940$d4630a0a@megared.net.mx>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990820091502.A71267>
