[PATCH] chown user: w/o group

Luciano Miguel Ferreira Rocha strange at nsk.no-ip.org
Fri Sep 22 20:10:52 UTC 2006


On Fri, Sep 22, 2006 at 09:55:45PM +0200, Tito wrote:
> > With the format:
> > 
> > chown <newuser>:<newgroup> <files> ...
> > 
> > If <newgroup> is empty, and <newuser> isn't, then get the passwd entry
> > for <newuser> and use its default group.
> > 
> > It isn't necessary to create a new function, I could put that code in
> > the chown applet. But this way it simplified the applet and make the
> > funcionality available as a function for other applets.
> > 
> 
> Can you think of some other applet that could need this kind of
> funcionality?
> If yes it is a good idea to put it in libbb else
> it should better go in the applet itself.

Not really. There'll probably others that also need uid+gid from
username, but not uid+gid iff gname is empty, or that *only* need those
two values from the passwd entry.

As busbybox's build system splits each libbb's function to each file, I
didn't expect busybox's size to increase even if the function was
unused, so making that funcionality a single function helped to make
chown's code cleaner (imho).

Actually, my busybox's size remains unchaged either with or without the
patch. I find that disturbing...

Anyway, I don't mind where it ends. I'll make a version w/o that
function and send it.

-- 
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060922/fed7b969/attachment-0002.pgp 


More information about the busybox mailing list