Bug in the deluser applet

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Wed Feb 18 07:54:19 UTC 2015


On February 18, 2015 8:34:14 AM GMT+01:00, Laszlo Papp <lpapp at kde.org> wrote:
>I thought about this, too, when writing the patch, but I rejected it
>because it is not simpler, in fact more complex, it is also not the
>right
>layer for the change. In addition, it would also be somewhat slower to
>execute.
>
>On Wednesday, February 18, 2015, tito <farmatito at tiscali.it> wrote:
>> On Tuesday 17 February 2015 17:52:06 Laszlo Papp wrote:
>>
>>> Hi,
>>
>>>
>>
>>> 1) busybox addgroup user
>>
>>> 2) busybox adduser -G user testuser1
>>
>>> 3) busybox adduser -G user testuser2
>>
>>> 4) busybox deluser testuser1
>>
>>> 5) grep user /etc/passwd /etc/group
>>
>>>
>>
>>> ...
>>
>>> /etc/passwd:testuser2:x:1010:1007:Linux
>User,,,:/home/testuser2:/bin/bash
>>
>>> ...
>>
>>> /etc/group:user:x:1007:testuser,testuser2
>>
>>> ^^^^^^
>>
>>> ...
>>
>>>
>>
>>> This is not how the desktop util behaves and I agree with the
>desktop
>>
>>> util in this case. A non-existent user should not remain in
>>
>>> /etc/group.
>>
>>>
>>
>>> Do you agree or disagree?
>>
>>>
>>
>>> Cheers, L.
>>
>>
>>
>> Hi,
>>
>> i agree that this case is not covered by actual bb's deluser code.
>>
>> What we cover at the moment is:
>>
>>
>>
>> deluser USER (and group with same name if empty)
>>
>> deluser USER from GROUP
>>
>>
>>
>>
>>
>> The desktop util behaviour could be added tough.
>>
>> By looking at the pseudo code you posted in a later
>>
>> mail I wonder if it could be easier to change
>>
>> deluser rather than update_passwd which is more complex.
>>
>> Like:
>>
>>
>>
>> do_deluser
>>
>> get_user_group_list
>>
>> do_delgroup of primary group
>>
>> while_list
>>
>> do_deluser_from_group
>>
>> or
>>
>> do_deluser
>>
>> while getgrent
>>
>> do_deluser_from_group(user, grname)
>>
>> do_delgroup of primary group

I'd do the latter I think.
Tito, can you please cook a patch?
TIA!




More information about the busybox mailing list