On Tue, Aug 19, 2008 at 05:58:05PM +1000, Brian May wrote:
> Trent W. Buck wrote:
>> As a resolution to #431853, simply leaving a broken user and group
>> lying around is *not* sensible.  It would be better to call deluser,
>> but succeed on error 127 (deluser not found).  The attached patch
>> demonstrates this.  Note that this approach is taken by many other
>> packages: bitlbee, ntp, openssh-server, logcheck, dnsmasq and
>> dhcp3-client, on my system.
>>   
> I think you might have accidentally reversed the patches. This is confusing.

I did; sorry.

>>  diff -wpurNd amavisd-new-2.6.1/debian/amavisd-new.postrm 
>> amavisd-new-2.6.1.dfsg.old/debian/amavisd-new.postrm
>> --- amavisd-new-2.6.1/debian/amavisd-new.postrm      2008-08-19 
>> 15:27:33.554286445 +1000
>> +++ amavisd-new-2.6.1.dfsg.old/debian/amavisd-new.postrm     2008-08-19 
>> 15:18:01.000000000 +1000
>> @@ -33,10 +33,8 @@ case "$1" in
>>              dpkg-statoverride --remove $i || true
>>      done
>>  -   echo "Removing amavis user and files..."
>> -       # The test prevents purge from failing if there is no amavis user.
>> -       delgroup --quiet --system amavis || test $? -eq 2 -o $? -eq 127
>> -       deluser --quiet --system --remove-home amavis || test $? -eq 2 -o $? 
>> -eq 127
>> +    echo "Removing amavis files and directories..."
>> +    [ -d /var/lib/amavis ] && rm -fr /var/lib/amavis
>>      [ -d /etc/amavis ] && rm -fr /etc/amavis
>>          ;;
>
> The --remove-home option was deliberately removed after it caused
> data [loss].  See <http://bugs.debian.org/190427>.

Fair enough.

> Maybe change that to:
>
>       echo "Removing amavis user and files..."
>        # The test prevents purge from failing if there is no amavis user.
>        delgroup --quiet --system amavis || test $? -eq 2 -o $? -eq 127
>        deluser --quiet --system || test $? -eq 2 -o $? -eq 127
>       echo "Removing amavis files and directories..."
>       [ -d /var/lib/amavis ] && rm -fr /var/lib/amavis
>       [ -d /etc/amavis ] && rm -fr /etc/amavis
>
> ?

Fine with me.  First echo should have s/files/group/.  Also, delgroup
should be deleted (or at least moved down below deluser), because

    # deluser --system --remove-home amavis; delgroup --system amavis
    [...]
    Warning: Removing group `amavis', since no other user is part of it.

PS: based on the code in /usr/bin/sensible-editor, those tests should
also -o $? -eq 126.  Alternatively, you could use the style often seen
with invoke-rc.d:

    if test -x /usr/sbin/deluser
    then /usr/sbin/deluser ... || test $? -eq 2
    fi



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to