Applet adduser hurds Busybox standalone feature

Harald Becker ralda at gmx.de
Thu Feb 24 17:53:17 UTC 2011


 Hallo Tito!
Hallo Denys!

Normaly I do all changes of passwd and group files with sed or an visual
editor. As I'm just trying to step up to newer Busybox version I wanted
to check those changes in deluser / delgroup. Just being at that point I
wanted to use adduser to add a new user for those tests ...

$ ./busybox adduser -D -Gusers my_user
sh: addgroup: command not found

... outsch!

The reason for this error message is, that I do not have installed the
symlinks pointing to busybox (in that chroot environment, to be
correct). As busybox sh does not have any trouble to find other
commands, due to it's stand alone feature, I was a bit afraid (yesterday
I had kernel crash that hurt several files). But it's no file damage, it
is a violation of busybox stand alone feature. The applet adduser uses a
system() call for addgroup activation. An activation, which shouldn't
have been done either, as the group "users" already exist and primary
users shall normally not be added to the group file (in my opinion). A
quick grep for "system(" showed up that there are some other violations
of the stand alone feature (but looks like there is only one more, that
may hurt: bootchartd).

Beside the question if adduser shall really call an external application
to add the user to a group, the main topic is: Shall/can we work at
this, to remove those nasty traps. I'm not that familiar with libbb,
things changed a lot over the time. What would be the right function to
replace that system() calls, which do not need a new shell invocation?

... really willing to do at least part of that work

--
Harald


More information about the busybox mailing list