From nobody@FreeBSD.ORG Fri Apr 16 11:34:59 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id AA40014E63; Fri, 16 Apr 1999 11:34:59 -0700 (PDT)
Message-Id: <19990416183459.AA40014E63@hub.freebsd.org>
Date: Fri, 16 Apr 1999 11:34:59 -0700 (PDT)
From: gene@nttmcl.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: pw(8) usermod does not recognize -w flag without -h flag
X-Send-Pr-Version: www-1.0

>Number:         11168
>Category:       bin
>Synopsis:       pw(8) usermod does not recognize -w flag without -h flag
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 16 11:40:01 PDT 1999
>Closed-Date:    Sat Jul 12 16:13:16 PDT 2003
>Last-Modified:  Sat Jul 12 16:13:16 PDT 2003
>Originator:     Eugene M. Kim
>Release:        3.1-RELEASE and 4.0-CURRENT
>Organization:
NTT Multimedia Communications Laboratories
>Environment:
FreeBSD asiale.ia.cp 4.0-CURRENT FreeBSD 4.0-CURRENT #0: Tue Apr  6 10:10:40 PDT 1999     root@asiale.ia.cp:/usr/src/sys/compile/ASIALE  i386
>Description:
The synopsis of pw(8) manpage says that `pw usermod' accepts -w flag, 
which resets a user's password in one of predefined ways.  However, -w 
flag does not work standalone but requires the special `-h' flag, and 
this fact is not stated in the manpage.
>How-To-Repeat:
Create a temporary user, say `test1', then issue the following command:

			pw usermod test1 -w none

According to the documentation, this will set the user's password to 
nothing (i.e. a null field in master.passwd), but pw does not touch the 
password field at all.

>Fix:
The manpage should be updated to state that the -w option takes effect 
only when it is used with the -h option'.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->davidn 
Responsible-Changed-By: nra 
Responsible-Changed-When: Wed Jul 19 20:37:24 PDT 2000 
Responsible-Changed-Why:  
David seems to be working with pw(8) alot these days. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=11168 
State-Changed-From-To: open->analyzed 
State-Changed-By: davidn 
State-Changed-When: Thu Jul 20 14:47:00 EST 2000 
State-Changed-Why:  
-w actually does work with useradd in the manner described in the 
manpage. It was originally designed to be used with -D, since it 
deals with setting a default (and pw.conf is the control file 
containing defaults). 

I'm not sure that -w is all that useful in the usermod case, 
though the intention was to allow -w random to reset the password 
to a random one. 

This *does* work (pw usermod -w random) and -h cannot be specified 
in that case since -h implies that you wish to set the password 
explicitly. Using them in combination makes no sense. 

pw usermod -w random actually only works if pw.conf specifies that 
a random password should be used. This is because -w's argument is 
ignored in the usermod case which is a bug that needs to be fixed. 
Fixing this will bring pw's behaviour in line with the documentation. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=11168 
Responsible-Changed-From-To: davidn->freebsd-bugs 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Fri Mar 14 21:45:46 PST 2003 
Responsible-Changed-Why:  

davidn is no longer with us 

http://www.freebsd.org/cgi/query-pr.cgi?pr=11168 
State-Changed-From-To: analyzed->feedback 
State-Changed-By: roam 
State-Changed-When: Mon Mar 17 06:43:42 PST 2003 
State-Changed-Why:  
Are you satisfied with David's explanation in his followup from 
the 20th of July, 2000?  In my experience, pw usermod -w seems to 
work just fine now, with all the methods: 'no', 'yes', 'none', and 
'random'. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=11168 
State-Changed-From-To: feedback->closed 
State-Changed-By: kris 
State-Changed-When: Sat Jul 12 16:13:08 PDT 2003 
State-Changed-Why:  
Feedback timeout 

http://www.freebsd.org/cgi/query-pr.cgi?pr=11168 
>Unformatted:
