Bug 78620 - deleting a user fails to remove the default group entry that is added by default
deleting a user fails to remove the default group entry that is added by default
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-users (Show other bugs)
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Brent Fox
: 98911 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2002-11-26 11:08 EST by Michael Lee Yohe
Modified: 2008-05-01 11:38 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-05-25 10:30:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Michael Lee Yohe 2002-11-26 11:08:52 EST
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 11:20:29 EST

*** This bug has been marked as a duplicate of 78619 ***
Comment 2 Brent Fox 2003-01-07 17:45:52 EST
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-15 21:43:10 EST
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 16:14:37 EST
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-25 19:45:22 EST
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-25 19:45:57 EST
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 14:52:55 EST
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 10:30:56 EDT
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 16:42:30 EDT
*** 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.