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

Re: locking system users on package removal



On Sat, 30 Jun 2012 14:36:47 +0100, Roger Leigh <rleigh@codelibre.net>
wrote:
>On Sat, Jun 30, 2012 at 02:12:45PM +0100, Simon McVittie wrote:
>> [in the preinst]
>> > -    usermod -U -e '' quake-server
>> > +    if [ -f /etc/shadow ]; then
>> > +      usermod -U -e '' quake-server
>> > +    else
>> > +      usermod -U quake-server
>> > +    fi
>> [in the postrm]
>> >      # Lock account on purge
>> > -    usermod -L -e 1 quake-server
>> > +    if [ -f /etc/shadow ]; then
>> > +        usermod -L -e 1 quake-server
>> > +    else
>> > +        usermod -L quake-server
>> > +    fi
>
>It looks sane to me.  Having a dh_ command or some other dpkg
>maintscript helper shell function to do this automatically would
>IMO be a very nice improvement.

Given the amount of code lines that were spent in adduser to allow its
transparent usage in maintainer scripts, I would prefer having that
code in adduser. with adduser --lock locking an account and adduser
--system unlocking a locked user that is present but locked.

Having debhelper code for that is wrong since it means rebuilding
packages to fix bugs in that code.

Greetings
Marc
-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber         |   " Questions are the         | Mailadresse im Header
Mannheim, Germany  |     Beginning of Wisdom "     | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834


Reply to: