[PATCH] size reduction and better error reporting for deluser/delgroup

Tito farmatito at tiscali.it
Mon Sep 27 05:44:42 UTC 2010


On Monday 27 September 2010 02:36:04 Harald Becker wrote:
> Hi Tito!
> 
> > the patch previously sent reduces the size of the deluser/delgroup
> > commands. Size reduction with all options enabled is:
> Fine! My approch was just a quick rewrite (without size considerations),
> as I needed that applets function in some scripts.
> 
> > 1) we don't warn about removing user's primary group when doing delgroup
> 
> IMHO the only test required would be deleting a group (not user from
> group) that is still used as a primary group in /etc/passwd.

Yes.

> It is not  necessary to check if it's the users primary group while removing a user
> from a group. This check would even be wrong, as it is a valid usage of
> a group being used as a users primary group without user being
> explicitly listed in the group file. The user this way has full group
> privileges, but can't change back to that group if the group gets
> changed (either explicitly or more likely implicitly by executing a SGID
> program = tricky usage of that feature).

Was not aware of that, so lets drop it.
 
> 
> > 2) we don't remove users primary group when doing deluser
> 
> That would be fine, if this could be done ... else we may get left overs
> of unknown users in the group file. Especially as admins tend to be
> forgetfully ;-)

A quick and dirty solution would be to call deluser_main with the 
correct args one more time or use system().
The question is when to do it, befor or after having deleted the user?
 
> 
> >         3) -h --help are treated as user/group names
> 
> Isn't the processing of those options done by the busybox main?
> deluser/delgroup --help worked before ... so what has changed at this part?

It is taken care of it in the getopt32() function, but we don't use it here.
I think this was there also before, but maybe it is overkill to fix it
as we get the help text by simply running deluser without arguments.


> 
> --
> Harald
> 

Ciao,
Tito



More information about the busybox mailing list