Bug 693483

Summary: Duplicate GIDs
Product: Red Hat Enterprise Linux 6 Reporter: Sigbjorn Lie <sigbjorn>
Component: doc-Identity_Management_GuideAssignee: Deon Ballard <dlackey>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1CC: benl, dpal, jgalipea, mhideo, nsoman, pkennedy, rcritten, tim
Target Milestone: rcKeywords: Documentation
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 18:21:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sigbjorn Lie 2011-04-04 19:27:43 UTC
There seem to be a bug in the relation between user private groups and public groups. When a user is created, the private group is created with same GID as the users UID. Looks OK until I create a public group with the same GID. Read on.

# ipa user-add user1 --uid=50201 --first="User" --last="Name"
------------------
Added user "user1"
------------------
  User login: user1
  First name: User
  Last name: Name
  Full name: User Name
  Display name: User Name
  Initials: UN
  Home directory: /home/user1
  GECOS field: user1
  Login shell: /bin/bash
  Kerberos principal: user1.COM
  UID: 50201

# ipa group-find --private --gid=50201
---------------
1 group matched
---------------
  Group name: user1
  Description: User private group for user1
  GID: 50201
----------------------------
Number of entries returned 1
----------------------------

# ipa group-add group1 --gid=50201 --desc="Group1"
--------------------
Added group "group1"
--------------------
  Group name: group1
  Description: Group1
  GID: 50201

So far so good, but look what happens when I use getent to get the GID for the user private group and the public group:

# getent group group1
group1:*:50201:
# getent group user1
user1:*:378400003:

A random GID has been selected for the user private group.

If I do this the other way around, creating a new user, then looking up the GID for the users private group using getent, followed by creating a group with the same GID, and looking up the groups GID using getent, the result is reversed. Also if I look up the public group using ipa group-find a different GID is returned than what was returned by getent. All this happens without a single error or warning from IPA.

# ipa user-add user2 --uid=50202 --first="User" --last="Name"
------------------
Added user "user2"
------------------
  User login: user2
  First name: User
  Last name: Name
  Full name: User Name
  Display name: User Name
  Initials: UN
  Home directory: /home/user2
  GECOS field: user2
  Login shell: /bin/bash
  Kerberos principal: user2.COM
  UID: 50202


# getent group user2
user2:*:50202:



# ipa group-add group2 --gid=50202 --desc="Group2"
--------------------
Added group "group2"
--------------------
  Group name: group2
  Description: Group2
  GID: 50202


# getent group user2
user2:*:50202:


# getent group group2
group2:*:378400004:


# ipa group-find group2
---------------
1 group matched
---------------
  Group name: group2
  Description: Group2
  GID: 50202
----------------------------
Number of entries returned 1
----------------------------

Comment 2 RHEL Program Management 2011-04-04 19:43:35 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 3 Dmitri Pal 2011-04-04 19:44:20 UTC
https://fedorahosted.org/freeipa/ticket/1156

Comment 4 Rob Crittenden 2011-05-11 18:02:50 UTC
*** Bug 697887 has been marked as a duplicate of this bug. ***

Comment 5 Rob Crittenden 2011-05-11 18:03:32 UTC
Duplicate UIDs are also possible.

Comment 6 Rob Crittenden 2011-05-11 18:04:58 UTC
We are going to treat this as a documentation issue

Comment 7 Dmitri Pal 2011-05-13 21:53:19 UTC
*** Bug 698671 has been marked as a duplicate of this bug. ***

Comment 8 Michael Hideo 2011-05-30 23:59:15 UTC
Hi Deon, over to you. - Mike

Comment 9 Deon Ballard 2011-07-14 22:31:05 UTC
The basic situation is that the DNA Plug-in makes sure that all *server* assigned UID/GID numbers are unique, because it assigns a discete range to each server or replica and then numbers are assigned sequentially. So, there's no overlap and no duplication. However, the DNA Plug-in doesn't enforce numbers that are *manually* assigned, so the duplicate situation can occur.

I added a note the GID/UID range management section:
http://documentation-stage.bne.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/96.2/html/Enterprise_Identity_Management_Guide/Managing-Unique_UID_and_GID_Attributes.html

And to the adding users sectoin (near the bottom of the page):
http://documentation-stage.bne.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/96.2/html/Enterprise_Identity_Management_Guide/adding-users.html

And to the adding groups section (just scroll a little):
http://documentation-stage.bne.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/96.2/html/Enterprise_Identity_Management_Guide/user-groups.html#Configuring_IPA_Groups-Creating_IPA_Groups

Comment 10 Deon Ballard 2011-07-14 22:33:30 UTC
*** Bug 698240 has been marked as a duplicate of this bug. ***

Comment 11 Deon Ballard 2011-07-14 22:34:09 UTC
*** Bug 698258 has been marked as a duplicate of this bug. ***

Comment 14 Jenny Severance 2011-10-26 15:48:57 UTC
Please explain what was changed in the code with  "ipa-2.1.0-1.el6"  if this is supposed to be a documentation bug?

Comment 15 Rob Crittenden 2011-10-26 17:33:15 UTC
Fixed-in version was set inadvertently, cleared.

Comment 17 errata-xmlrpc 2011-12-06 18:21:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2011-1533.html