Subject: chsh bug ?
To: None <netbsd-help@netbsd.org>
From: gabriel ware <ware_g@epita.fr>
List: netbsd-help
Date: 03/03/2004 18:19:23
Readed on bugs@openbsd :
  Using chsh to change the login field does change the old line in passwd, 
  but creates a second line with the same user id and different login
  name. 
  This leads to warnings from the daily security scan and unexpected
  behaviour from various programs. 



This has been tested on this machine (NetBSD i386 1.6.1) and seems produce
the same error. 
I cannot anymore test that on -current or 1.6.2 .


After reading chpass's source files it seems that it's the correct
behavior since it uses pw_copy to update passwd fields.
man pw_copy says :
" If an entry is not found to match pw, a new entry is appended to the
  passwd file only if the real user ID is 0."
 
Should I open a pr ?
If so, the fix would probably be on this call to pw_copy (replacing it
    by a new function).

thanks for reading this, 
  
-- 
Gabriel WARE
tel  :  06 64 35 91 19
mail :  ware_g@epita.fr
http://www.epita.fr/~ware_g