busybox with single applet enabled
Denys Vlasenko
vda.linux at googlemail.com
Sat May 21 19:33:29 UTC 2011
On Saturday 21 May 2011 20:33, Sergey Naumov wrote:
> > I propose that we at least make "fuller" config (one with more options
> > set to "yes") work properly:
> >
> > + /* Add user to his own group with the first free gid
> > + * found in passwd_study.
> > + * We try to use --gid, not -g, because "standard" addgroup
> > + * has no such short option, it has only long --gid.
> > + */
> > +#if ENABLE_FEATURE_ADDGROUP_LONG_OPTIONS
> > + argv[1] = (char*)"--gid";
> > +#else
> > argv[1] = (char*)"-g";
> > +#endif
> >
> > If FEATURE_ADDGROUP_LONG_OPTIONS=y, this will work with any "addgroup" -
> > busybox or standard. If FEATURE_ADDGROUP_LONG_OPTIONS!=y, then user
> > takes responsibility to ensure that "addgroup" on his system comes from bbox.
>
> That will not work if addgroup is disabled.
>
> This is better I think:
> #if ENABLE_FEATURE_ADDGROUP_LONG_OPTIONS || ! ENABLE_ADDGROUP
> argv[1] = (char*)"--gid";
> #else
> /* applet is enabled, but without long options
> * here we can try to directly call applet within busybox
> * if FEATURE_PREFER_APPLETS is disabled
> * to ensure correct work if applet is not installed,
> * but that will bloat the code
> */
> argv[1] = (char*)"-g";
> #endif
Ok. Did this in git.
--
vda
More information about the busybox
mailing list