From owner-freebsd-bugs@FreeBSD.ORG Tue May 13 23:30:16 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D13EF37B401 for ; Tue, 13 May 2003 23:30:16 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7597843FAF for ; Tue, 13 May 2003 23:30:16 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h4E6UGUp090936 for ; Tue, 13 May 2003 23:30:16 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h4E6UGPY090935; Tue, 13 May 2003 23:30:16 -0700 (PDT) Date: Tue, 13 May 2003 23:30:16 -0700 (PDT) Message-Id: <200305140630.h4E6UGPY090935@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Masachika ISHIZUKA Subject: Re: bin/38676 change request for pw command X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Masachika ISHIZUKA List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2003 06:30:17 -0000 The following reply was made to PR bin/38676; it has been noted by GNATS. From: Masachika ISHIZUKA To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: bin/38676 change request for pw command Date: Wed, 14 May 2003 15:29:30 +0900 (JST) > The following reply was made to PR bin/38676; it has been noted by GNATS. > > From: Paul Herman > To: FreeBSD-gnats-submit@FreeBSD.ORG > Cc: Takumi ISHII , > "Geoffrey C. Speicher" , > "Matthew D. Fuller" > Subject: Re: bin/38676 change request for pw command > Date: Mon, 24 Jun 2002 22:52:50 -0700 (PDT) > > Here is an better version of the patch in bin/23501. In addition > to the advisory lock, link counts are checked to avoid any > unlink/rename issues. This has been tested by myself and seems to > also fix the problem. Hi, this is ishizuka@ish.org. I tested this patch for 5.1-BETA-20030514-JPSNAP and I think this patch is good for 5.1-BETA. The test procedure is as follows. (1) create 5000 new accounts in /etc/master.passwd. % su # sh $ uid=10000 $ while [ $uid -lt 15000 ]; do > echo "test$uid:*:$uid:$uid::0:0:User &:/nonexistent:/sbin/nologin" >> /tmp/users.txt > uid=$(($uid+1)) > done $ vipw :$ :r /tmp/users.txt :wq $ wc -l /etc/master.passwd /etc/passwd (2) create 100 accounts more with pw command as follows. $ uid=20000 $ while [ $uid -lt 20100 ]; do > pw useradd test$uid -u $uid -d /nonexistent -s /sbin/nologin -h - & > uid=$(($uid+1)) > done (3) Wait until (2) is done. (4) Count lines for /etc/master.passwd and /etc/passwd $ wc -l /etc/master.passwd /etc/passwd Before applying this patch, /etc/master.passwd and /etc/passwd are broken, After this patch is applied, they are not broken. -- ishizuka@ish.org