1.13.0 coreutils/id.c calls libc getgrouplist()

Tito farmatito at tiscali.it
Sun Nov 16 08:18:26 UTC 2008


On Sunday 16 November 2008 04:21:10 Denys Vlasenko wrote:
> > Hi,
> > i'm the culprit!!  ;-)
> > As the checks for the missing of getgrouplist in uClibc were in
> > the code.......I would dare to say uglyfied the code and due to
> > the fact that i did an integral rewrite of id.c I removed them.
> > The main reason that made me decide to remove the ifdefs was that:
> > 
> > 1) libc has getgrouplist
> > 2) getgrouplist was added to libbbpwdgrp
> > 3) getgrouplist was already in uClibc svn
> >      and the mantainer  was talking about releasing soon.
> > 
> > So for the sake of code cleaness I removed the ifdef hell.
> > In reality uClibc was 2 days late or we 2 days to early,
> > this is surely annoying, but was not intended to happen.
> > Now the problem is resolved anyway.....and we have 
> > clean, readable and maintenable code.
> 
> No, it is not resolved. Be realistic. You just got a complaint
> from a user. Do you think he wrote this email just to annoy you?
> Very unlikely. People typically wrote such emails when they
> got bitten by a problem, and in this case it is a legitimate
> problem (busybox can't be built with older uclibc),
> not a user error or something.

Hi,
i take the complaint seriously and I'm willing
to fix it but as i never used uClibc before
I needed a little extra time. 
Probably more experienced developers
familiar with uClibc would have needed far less time than me.

BTW.: you were informed about the removal of the
         uclibc test in the mail with which i sent the patch
         to the list:

	"PS: Denys I removed the #if HAVE_getgrouplist as it seems to me
      		that now we have getgrouplist in busybox libpwd, in gnu libc and also
      		in uclibc (svn?)."

and the test as it was didn't make sense in the new situation anyway:

 #if (defined(__GLIBC__) && !defined(__UCLIBC__))
  	 #define HAVE_getgrouplist 1
  	 #elif ENABLE_USE_BB_PWD_GRP
  	 #define HAVE_getgrouplist 1
  	 #else
  	 #define HAVE_getgrouplist 0
#endif

Maybe we can add some warning like:

#if defined (__UCLIBC__) \
&& (__UCLIBC_MAJOR__ == 0 && __UCLIBC_MINOR__ < 9) \
|| (__UCLIBC_MINOR__ == 9 &&  __UCLIBC_SUBLEVEL__ < 30)
#warning "Sorry, you need at least uClibc version 0.9.30 for getgrouplist :("
#endif

Attached you will find a patch with the above check,
please apply if you like it.
The patch is only roughly tested as i don't use uClibc 
(but seems to work as expected).

Ciao,
Tito 

> > @Walter
> > Nonetheless if you want to add some warning or 
> > maybe some advice in the id help text feel free
> > to send a patch.
> 
> So you removed the #ifdef test and Wanter should fix it?
> Nice...

@Walter
Yes, would have been nice.... :-)

> --
> vda
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20081116/d92b8c97/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: id_uclibc.patch
Type: text/x-diff
Size: 454 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20081116/d92b8c97/attachment.bin 


More information about the busybox mailing list