Applet adduser hurds Busybox standalone feature

Tito farmatito at tiscali.it
Sun Feb 27 09:40:45 UTC 2011


On Sunday 27 February 2011 04:03:02 Denys Vlasenko wrote:
> On Thursday 24 February 2011 22:30, Harald Becker wrote:
> >  Hallo Tito!
> > > On Thursday 24 February 2011 18:53:17 Harald Becker wrote:
> > >> 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).
> > > 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.
> > I noted that Denys was somehow involved in the changes, therefore I
> > added his name in the top. So it's up to Denys to tell why he did this.
> > Is this upstream conform or what was the reason to add the user to
> > /etc/group at this place?
> > 
> > > 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.
> 
> > We don't talk about elegance here. Ok, it would be really fine, if the
> > addgroup_main could be called directly, but that wasn't my topic.
> > Fork/exec at this time is ok, but doing that via an extra shell is
> > overdone. At other places the running busybox shell calls such applets
> > by executing itself. This has at least to be done here.
> 
> Please see attached patch. Does it look ok?
> 
> > There should be 
> > a function in libbb for this, and probably it is already there ...
> > uhhhhh ... we need a listing of in libbb available functions with a
> > short description what they do (function name, argument names without
> > types, short description as a one or two liner; functions possibly
> > grouped by category like exec functions, string handling functions,
> > etc.).
> > Can me modify the source and place such short descriptions ahead 
> > of each function and than extract that with a make option to create a
> > library doku? Just as an idea (brain storming).
> 
> This list exists. It is called libbb.h
> 

Hi,
if i understood it correctly the other complaint was that if we add the new user
to a existing primary group the user should not be added
as member to this group:

busybox adduser -D -G users pippo

cat /etc/passwd | grep pippo
pippo:x:1000:1100:pippo:/home/pippo:/bin/bash
users:x:1100:

and not
users:x:1100:pippo

Am i correct or did i misunderstood something?

Ciao,
Tito






More information about the busybox mailing list