From owner-freebsd-bugs Tue Aug 24 1:51:48 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id BFA13150B7 for ; Tue, 24 Aug 1999 01:51:43 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id BAA75064; Tue, 24 Aug 1999 01:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from rucus.ru.ac.za (rucus.ru.ac.za [146.231.29.2]) by hub.freebsd.org (Postfix) with SMTP id B0FF315089 for ; Tue, 24 Aug 1999 01:47:17 -0700 (PDT) (envelope-from nbm@rucus.ru.ac.za) Received: (qmail 82715 invoked by uid 1003); 24 Aug 1999 08:48:10 -0000 Message-Id: <19990824084810.82714.qmail@rucus.ru.ac.za> Date: 24 Aug 1999 08:48:10 -0000 From: nbm@rucus.ru.ac.za Reply-To: nbm@rucus.ru.ac.za To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/13346: Allow pw to use pwd_mkdb's -u option Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 13346 >Category: bin >Synopsis: Allow pw to use pwd_mkdb's -u option >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Aug 24 01:50:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Neil Blakey-Milner >Release: FreeBSD 3.0-STABLE i386 >Organization: Rhodes University Computer Users' Society >Environment: FreeBSD rucus.ru.ac.za 3.0-STABLE FreeBSD 3.0-STABLE #0: Tue Feb 9 22:52:23 GMT 1999 grahams@rucus.ru.ac.za:/usr/src/sys/compile/RUCUS-SMP i386 >Description: pw issues a full pwd_mkdb for each pw useradd or usermod operation, which was complained about on the ISP mailing list. This patch teaches pw to use -u user if the operation is not deletion. >How-To-Repeat: Have a few thousand pwd entries Do a hundred pw usermods to achieve something Realize you're late for supper. >Fix: 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; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message