Bug 78620 - deleting a user fails to remove the default group entry that is added by default
Summary: deleting a user fails to remove the default group entry that is added by default
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-users
Version: 8.0
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Brent Fox
QA Contact:
: 98911 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2002-11-26 16:08 UTC by Michael Lee Yohe
Modified: 2008-05-01 15:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-05-25 14:30:56 UTC

Attachments (Terms of Use)

Description Michael Lee Yohe 2002-11-26 16:08:52 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020830

Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Delete a user that no longer needs an account using the redhat-config-users

Actual Results:  User entry in the passwd and shadow files are removed.

Expected Results:  User entry in the passwd and shadow files are removed.  The
entry that is created by default (if groupid == userid, then remove groupid)
should also be removed.

Additional info:

$ rpm -qf `which redhat-config-users`

Comment 1 Brent Fox 2002-11-26 16:20:29 UTC

*** This bug has been marked as a duplicate of 78619 ***

Comment 2 Brent Fox 2003-01-07 22:45:52 UTC
Well, I can't delete the group automatically because it may have other users in
it, and it would be wrong to delete a group that other users belong to.

So here's what I did.  When you select a user to delete, we look at that user's
primary group.  If that user is the only member of that group, we pop up a
dialog offering to delete the group as well.  The user can say yes or no.

If there are group members other than the one selected for deletion, we do not
show the dialog to delete the group.  I think this is a reasonable way to solve
it.  Can you think of anything wrong with this?  If so, please reopen this bug.
 If not, please test with redhat-config-users-1.1.1-9 in Rawhide (should appear
tomorrow morning).  

QA, please verify.

Comment 3 Mike McLean 2003-01-16 02:43:10 UTC
dialog verified in redhat-config-users-1.1.2-2.

verified that groups are deleted/remain as appropriate

verified that dialog does not appear when group is not private
*However note that when group is not private the remove home directory dialog is
also skipped.

I propose this feature be merged with the other user delete options.
Please see bug#69712

Comment 4 Brent Fox 2003-01-16 21:14:37 UTC
Actually, I've changed this behavior again.  If the user's primary group has
only one user in it, we will delete the group automatically.  This makes sense
because the user will almost always want to delete the group associated with
that user.  If they recreate the user, the group will also be recreated.  

Please test with redhat-config-users-1.1.3-3.

Comment 5 Mike McLean 2003-02-26 00:45:22 UTC
This change breaks the tool in the following scenario:

1) Create a user and opt not to create a group for the user (the user will be
assigned to the group 'users').
2) Delete the user that you have just created.  Since this user is the only
member of the group users, that group is deleted.
3) Now try to create another user without creating a group (as in step 1).  The
dialog window locks up with the waiting cursor and a traceback appears on
standard error. 

In general this practice of autodeleting the group is not right, what if user_a
happens to be the only member of an important system group like floppy or disk?

At the very least, you need to exclude groups <500, and possibly only do the
autodelete thing when the name_of_group=name_of_user (or both restrictions). 
Better yet, implement my suggestion from bug#69712.

Comment 6 Mike McLean 2003-02-26 00:45:57 UTC
Here is the traceback I mentioned.

Traceback (most recent call last):
  File "/usr/share/redhat-config-users/userWindow.py", line 315, in
    self.addToUsersGroup(userEnt, userName)
  File "/usr/share/redhat-config-users/userWindow.py", line 332, in addToUsersGroup
    cn = groupEnt.get(libuser.GROUPNAME)[0]
AttributeError: 'NoneType' object has no attribute 'get'

Comment 7 Brent Fox 2003-04-03 19:52:55 UTC
Ok, should be fixed in 1.1.5-8.  It will no longer automatically delete groups
with gid < 500.  Built in dist-10

Comment 8 Brent Fox 2003-05-25 14:30:56 UTC
There is a stack of 64 bugs that have been in Modified state for a long period
of time.  I am closing these as Rawhide now.  If you find that the issue is not
fixed, please reopen this report.

Comment 9 Brent Fox 2003-07-11 20:42:30 UTC
*** Bug 98911 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.