Quoting Teodor MICU (mteo...@gmail.com): > Well, I guess you mised the part where the custom user 'staff' (by > custom I mean created manually by me) does _not_ have the primary > group 'staff' but a custom group 'partners' (ID=1000) thus these two > are only related by the same name. My point is that 'userdel' must not > try to delete a group that has the same name as the user being deleted > _unless_ there is no other user belonging to this UPG.
Oh, right. In this case I do agree there's a problem. I reproduced this: r...@mykerinos:~# addgroup partners Adding group `partners' (GID 1003) ... Done. r...@mykerinos:~# adduser --ingroup partners staff Adding user `staff' ... Adding new user `staff' (1002) with group `partners' ... Creating home directory `/home/staff' ... Copying files from `/etc/skel' ... Entrez le nouveau mot de passe UNIX : Retapez le nouveau mot de passe UNIX : Aucun mot de passe fourni Entrez le nouveau mot de passe UNIX : Retapez le nouveau mot de passe UNIX : passwd : le mot de passe a été mis à jour avec succès Changing the user information for staff Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] r...@mykerinos:~# userdel -r staff r...@mykerinos:~# grep staff /etc/group r...@mykerinos:~# So, *even though* "staff" was not member of "staff", the staff group was deleted because the system uses UPG. Apparently, userdel unconditionnally deletes the group of the same name than the user when deleting the user *even though* the user is not (or no longer) member of this group. *that* is more a candidate for being called a bug. The question that's coming then becomes: should this behaviour be prohibited in all cases or should the group removal be prohibited for system groups only? After all, let's imagine the situation where I once added a "bubulle" user, with UPG activated on the system. That added a "bubulle" group too. For whatever reason, I later on changed the primary group for "bubulle" to something else. Should I really expect that deleting "bubulle" would then delete the "bubulle" grop *just because* it shares the same name than the user? The argument against being a bug is the same I sued: by changing bubulle's PG from bubulle to something else on a system where UPG are ON, I'm somewhat shooting in my own foot.
signature.asc
Description: Digital signature