On Thursday 24 February 2011 18:53:17 Harald Becker wrote:
>  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

this could be easily fixed by reverting to the old behaviour,
as before commit 38d3e64d2593aa5bc6bb578e1cd9a73a2d4b26fa
but this was Denys's patch so it's up to him.

> 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?

I agree with you that using system() calls is not the most elegant
solution... but unless we remove all functions that could call exit
in addgroup_main() we cannot use it directly.

> ... really willing to do at least part of that work
> 
> --
> Harald

Tito
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to