[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#5168: adduser doesn't update /etc/shadow



Package: adduser
Version: 2.11

adduser doesn't update /etc/shadow (if present).  When using shadow
passwords, it is necessary to update /etc/shadow by running pwconv5
afterwards.  The shadow package provides its own tools to perform
the same tasks as adduser (useradd, userdel, usermod, groupadd,
groupdel, groupmod), which work with both shadow and non-shadow
passwords, and even seem to be standard (SVID 3), so in the long
run they might make adduser unnecessary except for compatibility
with previous system releases.

In the meantime (someone may be using adduser in scripts etc.),
adduser should update /etc/shadow after the user has been added
(or deleted) in /etc/passwd.  This can be done by running
/usr/sbin/pwconv5 if /etc/shadow exists.

I'd suggest to do something like this in adduser after it makes
changes to /etc/passwd:

if [ -f /usr/sbin/shadowconvert ] ; then
	/usr/sbin/shadowconvert update
elif [ -f /etc/shadow -a -f /usr/sbin/pwconv5 ] ; then
	/usr/sbin/pwconv5
fi

shadowconvert is a script which will hopefully be shipped with
the shadow package, called with one argument: on/off/update.
This should nicely hide shadow implementation details.  If
shadowconvert is not present, try to do it the old way (just
in case someone tries to use this with the current shadow
package which doesn't provide shadowconvert yet).

Marek

--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: