busybox with single applet enabled

Sergey Naumov sknaumov at gmail.com
Fri May 20 18:08:30 UTC 2011


To Tito:
> Maybe something like this in adduser.c:
>
> /* We assume that if bb's addgroup applet is enabled we will use it */
> if (ENABLE_ADDGROUP && !ENABLE_FEATURE_ADDGROUP_LONG_OPTIONS) {
>                argv[1] = (char*)"-g";
> } else {
>                /* external addgroup or bb's addgroup with long options */
>                argv[1] = (char*)"--gid";
> }
>                argv[2] = utoa(p->pw_gid);
>                argv[3] = (char*)"--";
>                argv[4] = p->pw_name;
>                argv[5] = NULL;
>
> Untested, just an idea.
> Ciao,
> Tito

Tito, I think your code is fine for common case, but won't work in
corner ones: let's assume that you configured busybox with adduser
support (without long options), may be even installed it, but then you
installed (let it be desktop system) adduser package. Your wrapper
script was rewritten by full-blown adduser, but condition in if
remains true => -g option used.

To Ralf:
Of course I use symlink now, ./applet -> ./busybox in my description
points to it =). I investigated this issue just because I thought that
it is busybox bug and wanted to solve it.
But may be It is better to warn others at compiling stage by final
message when result of compilation is reported.


More information about the busybox mailing list