Bug 19999

Summary: pw(8) '-h -' option does not disable password [PATCH]
Product: Base System Reporter: Andy Farkas <andyf>
Component: binAssignee: davidn
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Andy Farkas 2000-07-18 06:00:00 UTC
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.

Fix: Cut/pasted, sorry:



/*--6Ror18y3zSisHIzO48g0Xz9Qvn5CtHXsYjRkMZvqOGVPZecI
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- 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;
        }
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 '*'.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-07-18 09:30:41 UTC
Responsible Changed
From-To: freebsd-bugs->davidn

David's interested in these. :-)
Comment 2 davidn freebsd_committer freebsd_triage 2000-07-20 16:09:53 UTC
State Changed
From-To: open->closed

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!