something looks broken :(

Denys Vlasenko vda.linux at googlemail.com
Wed May 21 06:42:20 UTC 2008


On Tuesday 20 May 2008 23:33, Cristian Ionescu-Idbohrn wrote:
> > Well, setgroups is a pretty standard libc routine.
> > Can you send your .config?
> 
> As showed in the beginning of the message:
> 
> # make clean
> # make defconfig
> 
> Problem seems to be located in include/grp_.h which redefines the
> setgroups prototype (line 42):
> 
>     31  /* The group structure.  */
>     32  struct group {
>     33          char *gr_name;          /* Group name.  */
>     34          char *gr_passwd;        /* Password.    */
>     35          gid_t gr_gid;           /* Group ID.    */
>     36          char **gr_mem;          /* Member list. */
>     37  };
>     38
>     39  /* We don't reimplement this, just supplying prototype */
>     40  /* The function itself is in libc */
>     41  /* Set the group set for the current user to GROUPS (N of them).  */
>     42  extern int setgroups(size_t __n, __const gid_t *__groups);
>     43
>     44
>     45  #define setgrent     bb_internal_setgrent
>     46  #define endgrent     bb_internal_endgrent
>     47  #define getgrent     bb_internal_getgrent
>     48  #define fgetgrent    bb_internal_fgetgrent
>     49  #define putgrent     bb_internal_putgrent
>     50  #define getgrgid     bb_internal_getgrgid
> 
> If I comment out that prototype I get a few warnings, like:
> 
> runit/chpst.c: In function 'suidgid':
> runit/chpst.c:87: warning: implicit declaration of function 'setgroups'
> 
> But linking works fine:
> 
>   LINK    busybox_unstripped
> Trying libraries: crypt m
>  Library crypt is needed
>  Library m is needed
> Final link with: crypt m

Wow?! So, now setgrous suddenly exist?

Can you dump "broken" chpst.o (from the tree witl link error)
and "working" chpst.o with "objdump -xdr chpst.o"?
What is the difference?
--
vda



More information about the busybox mailing list