Bug#295416: [Pkg-shadow-devel] Bug#295416: Deleting a user group in userdel should only be done if the group is empty

Alexander Gattin Alexander Gattin <arg@online.com.ua>, 295416@bugs.debian.org
Tue, 19 Apr 2005 08:18:09 +0300


tags 295416 confirmed
thanks

Hi!

On Mon, Apr 18, 2005 at 06:30:28PM +0200, Christian Perrier wrote:
> However, if for some (good or bad) reason, the suer groups has other
> members than the currently deleted user, I agree with the bug
> submitterš: userdel should at least issue a warning....or maybe even
> *not* delete the group (and issue an "error" message).
> 
> Any thoughtsš?

Yes. :)

This is not about removing groups which have other
members in them. And userdel never did this anyway
(userdel tries to remove personal groups since r1.16
CVS version, but only if USERGROUPS_ENAB is set and
group has no other members):
> 	/*
> 	 * we've removed their name from all the groups above, so
> 	 * now if they have a group with the same name as their
> 	 * user name, with no members, we delete it.
> 	 */
> 
> 	grp = getgrnam (user_name);
> 	if (grp && getdef_bool ("USERGROUPS_ENAB")
> 	    && (grp->gr_mem[0] == NULL)) {
> 
> 		gr_remove (grp->gr_name);

IMHO the problem is in removing groups which are empty
but are refered in /etc/passwd as primary for someone
else!

_This_ is a bug.

And proposed verbose indication of group removal is of
very low priority/value, IMHO again.

-- 
WBR,
xrgtn