On Thu, Feb 19, 2015 at 9:04 PM, tito <farmat...@tiscali.it> wrote:
> On Wednesday 18 February 2015 17:11:33 tito wrote:
>> while experimenting with a modified version of deluser.c
>
>> I've hit a bug in libpwdgrp. The attached drop in replacement
>
>> for deluser.c triggers the bug if compiled with bb's libpwdgrp
>
>> and instead works correctly with glibc.
>
>>
>
>> To reproduce:
>
>> adduser prova
>
>> addgroup test1
>
>> addgroup test2
>
>> addgroup prova test1
>
>> addgroup prova test2
>
>> grep prova /etc/passwd /etc/group
>
>> /etc/passwd:prova:x:1004:1005:,,,:/home/prova:/bin/bash
>
>> /etc/group:test1:x:1008:prova
>
>> /etc/group:test2:x:1009:prova
>
>> /etc/group:prova:x:1005:
>
>>
>
>> with glibc:
>
>> ./busybox deluser prova
>
>> groups[2]=1009
>
>> groups[2] gr->gr_name=test2
>
>> groups[1]=1008
>
>> groups[1] gr->gr_name=test1
>
>> grep prova /etc/passwd /etc/group
>
>>
>
>> with bb's pwdgrp
>
>>
>
>> ./busybox deluser prova
>
>> groups[2]=1009
>
>> groups[2] gr->gr_name=test2
>
>> groups[1]=1008
>
>> getgrgid failed errno=0
>
>>
>
>> grep prova /etc/passwd /etc/group
>
>> /etc/group:test1:x:1008:prova
>
>> /etc/group:prova:x:1005:
>
>>
>
>> seems to me that subsequent calls
>
>> to getgrgid and getgrnam fail
>
>>
>
>> Ciao,
>
>> Tito
>
>>
>
> Hi Denys,
>
> the attached patch fixes the bug. Looks like a copy paste error to me.
>
> Could you please double check as this db_and_field_pos stuff is a little
>
> like black magic to me.


You are absolutely right! Applied, thanks!
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to