On Mon, 14 Nov 2022 12:13:55 +0200
Magnus Armholt <[email protected]> wrote:

> Deleting a user will automatically delete a group with the same
> name (as user) if group deletion is enabled, no matter if other
> users are part of that group. Make it possible to disable the
> functionality in the configuration, but leave it on by default 
> so that the default behaviour stays the same as in previous releases.
> 
> Magnus Armholt (1):
>   Add config option to delete group with same name
> 
>  loginutils/deluser.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 

Hi,
man deluser/delgroup on devuan says:

Remove a group
       If deluser is called with the --group option, or delgroup is called, a 
group will be removed.

       Warning: The primary group of an existing user cannot be removed.

       If the option --only-if-empty is given, the group won't be removed if it 
has any members left.


So it seems to me that the default is to remove a group even if there are still 
users in it.
It should not be difficult to add the --only-if-empy option, check for gr->mem 
!= NULL
and exit with an error. 

Ciao,
Tito 
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to