From owner-freebsd-questions Mon Jan 11 10:16:46 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA06842 for freebsd-questions-outgoing; Mon, 11 Jan 1999 10:16:46 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA06786 for ; Mon, 11 Jan 1999 10:16:33 -0800 (PST) (envelope-from ben@scientia.demon.co.uk) Received: from ben by scientia.demon.co.uk with local (Exim 2.10 #3) id 0zzccA-0009xH-00; Mon, 11 Jan 1999 08:22:22 +0000 Date: Mon, 11 Jan 1999 08:22:22 +0000 From: Ben Smithurst To: Cch Cc: freebsd-questions@FreeBSD.ORG Subject: Re: About pw command in FreeBSD 3.0-CURRENT Message-ID: <19990111082222.A38198@scientia.demon.co.uk> References: <369993BF.E1602BD2@market.net.tw> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <369993BF.E1602BD2@market.net.tw> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Cch wrote: > When I use the command: > pw useradd master2 -u 2001 -c "test" -d "/home/user/master2" -g 0 -s > "/bin/sh" > in FreeBSD 3.0-CURRENT, it halts and has no response. But this command > works in FreeBSD 2.2.7-RELEASE. I beleive this was fixed within the last few days. If you don't want to resup your sources, try this patch, which is the one which was commited: =================================================================== RCS file: /home/ncvs/src/usr.sbin/pw/pw.c,v retrieving revision 1.10 retrieving revision 1.11 diff -p -u -r1.10 -r1.11 --- src/usr.sbin/pw/pw.c 1998/08/04 22:31:26 1.10 +++ /home/ncvs/src/usr.sbin/pw/pw.c 1999/01/08 10:52:38 1.11 @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] = - "$Id: pw.c,v 1.10 1998/08/04 22:31:26 nate Exp $"; + "$Id: pw.c,v 1.11 1999/01/08 10:52:38 davidn Exp $"; #endif /* not lint */ #include "pw.h" @@ -50,7 +50,6 @@ static struct cargs arglist; static int getindex(const char *words[], const char *word); static void cmdhelp(int mode, int which); -static void filelock(const char *filename); int @@ -150,12 +149,6 @@ main(int argc, char *argv[]) */ cnf = read_userconfig(getarg(&arglist, 'C') ? getarg(&arglist, 'C')->val : NULL); - /* - * Try to lock the master passowrd and group files right away (we - * don't care if it works, since this is just advisory locking. - */ - filelock(_PATH_GROUP); - filelock(_PATH_MASTERPASSWD); ch = funcs[which] (cnf, mode, &arglist); /* @@ -186,11 +179,6 @@ main(int argc, char *argv[]) return ch; } -static void -filelock(const char *filename) -{ - open(filename, O_RDONLY | O_EXLOCK, 0); -} static int getindex(const char *words[], const char *word) -- Ben Smithurst ben@scientia.demon.co.uk send a blank message to ben+pgp@scientia.demon.co.uk for PGP key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message