From owner-freebsd-stable Tue Feb 13 15:58:44 2001 Delivered-To: freebsd-stable@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id D8B1F37B503 for ; Tue, 13 Feb 2001 15:58:39 -0800 (PST) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id 1728A3E02; Tue, 13 Feb 2001 15:58:39 -0800 (PST) To: Forrest Aldrich Cc: freebsd-stable@freebsd.org Subject: Re: Core dump with "pw" command In-Reply-To: Message from Forrest Aldrich of "Tue, 13 Feb 2001 13:44:25 EST." <5.0.2.1.2.20010213134353.00a72400@216.67.14.69> Date: Tue, 13 Feb 2001 15:58:39 -0800 From: Dima Dorfman Message-Id: <20010213235839.1728A3E02@bazooka.unixfreak.org> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Made a typo today, but found that this command will dump core: > > su-2.04# pw lock help > Segmentation fault (core dumped) > su-2.04# > > Is this normal behavior for this command. Nope. As it is right now, pw(8) doesn't have help text for the lock and unlock commands, so it dumps core when you request it (bad array index). These two commands aren't documented in the manual page, either. Attached is a patch which, - adds a short section to the manual page about lock and unlock, - adds help text for lock and unlock which fixes the core dump, and - mentions that the -q option is accepted by usernext and groupnext (not related to this problem; just thought I'd stick it there while I'm doing this). If you would, please try it out (at least the core dump remedy) and see if it solves the problem. Thanks Dima Dorfman dima@unixfreak.org Index: pw.8 =================================================================== RCS file: /st/src/FreeBSD/src/usr.sbin/pw/pw.8,v retrieving revision 1.21 diff -u -r1.21 pw.8 --- pw.8 2001/02/01 16:43:57 1.21 +++ pw.8 2001/02/13 23:50:32 @@ -169,6 +169,18 @@ .Ar groupnext .Op Fl C Ar config .Op Fl q +.Nm +.Op Fl V Ar etcdir +.Ar lock +.Op name|uid +.Op Fl C Ar config +.Op Fl q +.Nm +.Op Fl V Ar etcdir +.Ar unlock +.Op name|uid +.Op Fl C Ar config +.Op Fl q .Sh DESCRIPTION .Nm Pw is a command-line based editor for the system @@ -758,6 +770,26 @@ The command .Ar groupnext returns the next available group id on standard output. +.Sh USER LOCKING +.Nm Pw +supports a simple password locking mechanism for users; it works by +prepending the string +.Ql *LOCKED* +to the beginning of the password field in +.Pa master.passwd +to prevent successful authentication. +.Pp +The +.Ar lock +and +.Ar unlock +commands take a user name or uid of the account to lock or unlock, +respectively. The +.Ql Fl V , +.Ql Fl C , +and +.Ql Fl q +options as described above are accepted by these commands. .Sh DIAGNOSTICS .Nm Pw returns EXIT_SUCCESS on successful operation, otherwise Index: pw.c =================================================================== RCS file: /st/src/FreeBSD/src/usr.sbin/pw/pw.c,v retrieving revision 1.23 diff -u -r1.23 pw.c --- pw.c 2000/12/29 18:04:49 1.23 +++ pw.c 2001/02/13 23:16:03 @@ -370,6 +370,15 @@ "usage: pw usernext [switches]\n" "\t-V etcdir alternate /etc location\n" "\t-C config configuration file\n" + "\t-q quiet operation\n", + "usage pw: lock [switches]\n" + "\t-V etcdir alternate /etc locations\n" + "\t-C config configuration file\n" + "\t-q quiet operation\n", + "usage pw: unlock [switches]\n" + "\t-V etcdir alternate /etc locations\n" + "\t-C config configuration file\n" + "\t-q quiet operation\n" }, { "usage: pw groupadd [group|gid] [switches]\n" @@ -409,6 +418,7 @@ "usage: pw groupnext [switches]\n" "\t-V etcdir alternate /etc location\n" "\t-C config configuration file\n" + "\t-q quiet operation\n" } }; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message