Bug 881022 - system-config-users should look for used group id in /etc/passwd file while deleting user account account
Summary: system-config-users should look for used group id in /etc/passwd file while d...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-users
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nils Philippsen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 880186
TreeView+ depends on / blocked
 
Reported: 2012-11-28 12:49 UTC by Nils Philippsen
Modified: 2018-12-03 18:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 880186
Environment:
Last Closed: 2013-01-12 00:06:47 UTC
Type: Bug


Attachments (Terms of Use)

Description Nils Philippsen 2012-11-28 12:49:39 UTC
+++ This bug was initially created as a clone of Bug #880186 +++

Description of problem:

User's primary group information is stored in /etc/passwd file.
When two user share same primary group and one of the users is deleted using system-config-users tool, other user looses its primary group.
s-c-u should check /etc/passwd file for group id shared among other users and should not delete the group if so.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 6
libuser-0.56.13-5.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Add user foo and foo1 with foo as primary group
useradd foo
useradd -g foo foo1
useradd -g foo foo2

2. Delete foo2 user with userdel and see foo and foo1 still has foo as primary group

3. Delete foo1 using s-c-u and see foo looses its group membership as group foo is deleted by s-c-u
  
Actual results:
group foo is deleted when there are other members associated with it in /etc/passwd file.

Expected results:
group foo should not be deleted when there are other members associated with it in /etc/passwd file


Additional info:
The behavior is same in F17 as well.
No option seen in /etc/libuser.conf to prevent this.

--- Additional comment from Miloslav Trmač on 2012-11-26 14:28:34 EST ---

Thanks for your report.

The code that deletes the group is actually in system-configusers: mainWindow.py:mainWindow:on_delete_activate.  It preserves primary groups with nonempty list of libuser.MEMBERNAME, but it doesn't look for other users that have this group set as primary.

(A reasonably convenient way to do this is to use admin.enumerateUsersByGroup(groupname)).

Comment 1 Fedora Update System 2012-11-29 13:43:24 UTC
system-config-users-1.3.2-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/system-config-users-1.3.2-1.fc18

Comment 2 Fedora Update System 2012-11-30 06:41:48 UTC
Package system-config-users-1.3.2-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing system-config-users-1.3.2-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-19392/system-config-users-1.3.2-1.fc18
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2012-12-11 20:05:20 UTC
Package system-config-users-1.3.3-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing system-config-users-1.3.3-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-19392/system-config-users-1.3.3-1.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-12-19 10:55:59 UTC
system-config-users-1.3.3-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/system-config-users-1.3.3-1.fc16

Comment 5 Fedora Update System 2012-12-19 10:56:17 UTC
system-config-users-1.3.3-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/system-config-users-1.3.3-1.fc17

Comment 6 Fedora Update System 2013-01-12 00:06:49 UTC
system-config-users-1.3.3-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2013-01-12 14:58:24 UTC
system-config-users-1.3.3-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2013-01-12 15:12:33 UTC
system-config-users-1.3.3-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


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