From nobody@FreeBSD.ORG  Mon Jul 17 21:53:15 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 2DCB937B7C0; Mon, 17 Jul 2000 21:53:15 -0700 (PDT)
Message-Id: <20000718045315.2DCB937B7C0@hub.freebsd.org>
Date: Mon, 17 Jul 2000 21:53:15 -0700 (PDT)
From: andyf@speednet.com.au
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: pw(8) '-h -' option does not disable password [PATCH]
X-Send-Pr-Version: www-1.0

>Number:         19999
>Category:       bin
>Synopsis:       pw(8) '-h -' option does not disable password [PATCH]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    davidn
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 17 22:00:00 PDT 2000
>Closed-Date:    Thu Jul 20 10:09:53 EST 2000
>Last-Modified:  Thu Jul 20 10:12:05 EST 2000
>Originator:     Andy Farkas
>Release:        FreeBSD 4.1-RC
>Organization:
Speednet Communications Pty Ltd
>Environment:
FreeBSD 4.1-RC #0: Mon Jul 17 04:07:41 EST 2000
>Description:
According to the man page for pw(8) you can disable a password (ie.
set the pasword to '*') by giving the '-h -' option.  This option is
currently broken.  See patch.
>How-To-Repeat:
Execute 'pw usermod -n <username> -h -' and notice that the user can
still login.  Confirm by checking in /etc/master.passwd that username
still has a password and not a '*'.
>Fix:
Cut/pasted, sorry:

--- pw_user.c.orig      Tue Jul 18 14:20:31 2000
+++ pw_user.c   Tue Jul 18 14:04:27 2000
@@ -624,8 +624,8 @@
                        if (!*line)
                                errx(EX_DATAERR, "empty password read on file descriptor %d", fd);
                        pwd->pw_passwd = pw_pwcrypt(line);
-                       edited = 1;
                }
+               edited = 1;
        }

        /*


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->davidn 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Jul 18 01:30:41 PDT 2000 
Responsible-Changed-Why:  
David's interested in these. :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19999 
State-Changed-From-To: open->closed 
State-Changed-By: davidn 
State-Changed-When: Thu Jul 20 10:09:53 EST 2000 
State-Changed-Why:  
Fixed by: 
/home/ncvs/src/usr.sbin/pw/pw_user.c,v  <--  pw_user.c 
new revision: 1.40; previous revision: 1.39 

Thanks for the bug report! 

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