Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Feb 2001 02:59:23 -0800 (PST)
From:      dima@unixfreak.org
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/25187: [PATCH] pw(8) seg faults; man page doesn't document lock feature
Message-ID:  <200102181059.f1IAxN195336@hornet.unixfreak.org>

next in thread | raw e-mail | index | archive | help

>Number:         25187
>Category:       bin
>Synopsis:       [PATCH] pw(8) seg faults; man page doesn't document lock feature
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 18 03:00:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Dima Dorfman
>Release:        FreeBSD 4.2-20010102-STABLE i386
>Organization:
Private
>Environment:

pw(8) since October 1999.  Tested on 3.5-STABLE, 4.2-STABLE, and
5.0-CURRENT (about a month old).  Patch below applies to 4-STABLE and
5-CURRENT.

>Description:

When the user locking feature was added to pw(8), the help text in the
program and the manual page were not ammended.  The former problem
causes a segmentation fault due to an out-of-range array index when
trying to do `pw (un)lock help`.  The latter, combined with the
former, makes it unnecessarily difficult to figure out what lock and
unlock do.

>How-To-Repeat:

dima@hornet% /usr/sbin/pw lock help
Segmentation fault (core dumped)
dima@hornet% /usr/sbin/pw unlock help
Segmentation fault (core dumped)

>Fix:

The following patch,
  - documents the 'lock' and 'unlock' commands in the pw.8 manual page,
  - adds help text to pw.c which prevents the segmentation fault, and
  - mentions, in the built-in help, that the '-q' option is accepted
    for the 'usernext' and 'groupnext' commands (not entirely relevant
    to this problem).

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"
 			}
 		};



>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102181059.f1IAxN195336>