Fw: Re: small patch to fix android ndk build of busybox

Hin-Tak Leung htl10 at users.sourceforge.net
Thu Jan 5 19:48:45 UTC 2012


Resent from correct alias (bounced as non-subscriber).

--- On Thu, 5/1/12, Hin-Tak Leung <hintak_leung at yahoo.co.uk> wrote:

> --- On Thu, 5/1/12, Dan Fandrich
> <dan at coneharvesters.com>
> wrote:
> 
> > On Thu, Jan 05, 2012 at 03:06:06PM
> > +0000, Hin-Tak Leung wrote:
> > > The error message was in the change-log, included
> in
> > the patch:
> > > 
> > > ---------
> > > 
> >    libbb/lib.a(change_identity.o): In
> > function `change_identity':
> > > 
> >    change_identity.c:(.text.change_identity+0x28):
> > undefined reference to `endgrent'
> > >     collect2: ld returned 1 exit
> > status
> > >     make: *** [busybox_unstripped]
> > Error 1
> > > ---------
> > > 
> > > Maybe the problem is in libbb/change_identity.c
> ?
> > 
> > I've been getting the same problem lately. I worked
> around
> > it locally with
> > this patch:
> > 
> > --- a/libbb/change_identity.c
> > +++ b/libbb/change_identity.c
> > @@ -35,7 +35,9 @@ void FAST_FUNC
> change_identity(const
> > struct passwd *pw)
> >  {
> >      if (initgroups(pw->pw_name,
> > pw->pw_gid) == -1)
> >         
> > bb_perror_msg_and_die("can't set groups");
> > +#ifndef __ANDROID__
> >      endgrent(); /* helps to close a fd used
> > internally by libc */
> > +#endif
> >      xsetgid(pw->pw_gid);
> >      xsetuid(pw->pw_uid);
> >  }
> > 
> > but it seemed a bit inelegant to me. But, that that
> line
> > seems to have been
> > added to work around a specific libc issue, maybe it's
> not
> > to ugly to
> > remove it on libcs that don't have that issue.
> 
> Okay, I have bisected the problem. It was introduced by:
> 
> --------------------------
> commit 585541e8e338a85b9f18cf5f6ed88758b29e61f2
> Author: Denys Vlasenko <vda.linux at googlemail.com>
> Date:   Thu Sep 15 18:27:05 2011 +0200
> 
>     start_stop_daemon: set complementary group
> ids too. Closes 3253
>     
>     Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
> --------------------------
> 
> This commit added a change_identity() call to 
> debianutils/start_stop_daemon.c . Reverting this commit, or
> simply put a "#ifndef __BIONIC__" around that one line in
> debianutils/start_stop_daemon.c, both work.
> 
> So what's the correct way to deal with this regression
> introduced by commit
> 585541e8e338a85b9f18cf5f6ed88758b29e61f2 ?
> 
> Cheers,
> Hin-Tak
> 
> 
> 
> 


More information about the busybox mailing list