CVSROOT:        /cvs
Module name:    src
Changes by:     mes...@cvs.openbsd.org  2016/05/03 15:05:14

Modified files:
        usr.sbin/user  : user.c 

Log message:
Fix regression on usermod/userdel by calling getpwnam_shadow(3) and saving
passwd hash early, instead of getpwnam(3), then close fds by calling
endpwent(3) and finally only call pledge(2) after it, otherwise on any
modification to the user it would destroy the passwd hash and therefore
forbidding him/her to login again to the machine.

Reported and tested by Edgar Pettijohn <edgar ! pettijohn-web at com>

According to deraadt@ "that looks better then"

Reply via email to