Bug 837364 - DNA-assigned uid/gid numbers given when asked for 999
DNA-assigned uid/gid numbers given when asked for 999
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa (Show other bugs)
7.0
Unspecified Unspecified
medium Severity unspecified
: rc
: ---
Assigned To: Rob Crittenden
IDM QE LIST
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-03 11:53 EDT by Dmitri Pal
Modified: 2015-01-21 15:05 EST (History)
3 users (show)

See Also:
Fixed In Version: ipa-3.2.1-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 09:18:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dmitri Pal 2012-07-03 11:53:41 EDT
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/freeipa/ticket/2886

{{{
# ipa user-add administrator --uid=999 --gidnumber=132
--first=administrator --last=administrator
--------------------------
Added user "administrator"
--------------------------
…
  UID: 721000062
…
}}}

We should not silently assign numbers different than the user has specified. Either the DNA magic value should be non-numeric, or the above command should fail.

The client sends the default value when the number is left out, so there's currently no way to distinguish between 999 and missing value on the server, but we could use the API version to see if the client is fixed.
Comment 2 Martin Kosek 2013-03-11 12:09:45 EDT
Fixed upstream:
master: https://fedorahosted.org/freeipa/changeset/91606e6679f3a18b1c1789efd240eed982a563d4

Behavior summary for user-add command:

With --uid 999:
  old client, old server: sends 999, creates random UID
  old client, new server: sends 999, creates random UID
  new client, old server: incompatible
  new client, new server: sends 999, creates UID 999
Without --uid:
   old client, old server: sends 999, creates random UID
   old client, new server: sends 999, creates random UID
   new client, old server: incompatible
   new client, new server: doesn't send UID, creates random UID

Above behavior sheet also applies for --gidnumber option.
Comment 5 Xiyang Dong 2013-10-11 10:33:08 EDT
Should these user-add commands be running in server or client ?
I ran them all in server ,but unable to verify 

With --uid 999:
  old client, new server: sends 999, creates random UID
  
Version :
ipa-server-3.2.2-1.el7.x86_64
ipa-client-3.0.0-37.el6.x86_64
Automated test results :


[root@rhel7 adduser]# ipa host-find |grep "Host name:"
  Host name: 65client.testrelm.com
  Host name: rhel7.testrelm.com


[root@rhel7 adduser]# ipa user-add tuser1 --uid=999 --gidnumber=999 --first=tuser1 --last=tuser1
-------------------
Added user "tuser1"
-------------------
  User login: tuser1
  First name: tuser1
  Last name: tuser1
  Full name: tuser1 tuser1
  Display name: tuser1 tuser1
  Initials: tt
  Home directory: /home/tuser1
  GECOS field: tuser1 tuser1
  Login shell: /bin/sh
  Kerberos principal: tuser1@TESTRELM.COM
  Email address: tuser1@testrelm.com
  UID: 999
  GID: 999
  Password: False
  Member of groups: ipausers
  Kerberos keys available: False
Comment 6 Rob Crittenden 2013-10-11 10:42:59 EDT
The commands should be executed on a client, per the table that Martin created in comment 2. A client < 3.2 is considered "old" in this context.
Comment 7 Xiyang Dong 2013-10-22 22:06:16 EDT
Verified

new server new client:
ipa-server-3.3.2-3.el7.x86_64
ipa-client-3.3.2-3.el7.x86_64

Automated test results :
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: ipa-user-add-bugzilla-010: bz837364 DNA-assigned uid/gid numbers given when asked for 999
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 20:47:40 ] ::  Test for https://bugzilla.redhat.com/show_bug.cgi?id=837364
spawn /usr/bin/kinit -V admin
SecUsing default cache: /tmp/krb5cc_0
Using principal: admin@TESTRELM.COM
ret123
Password for admin@TESTRELM.COM: 
Authenticated to Kerberos v5
Default principal: admin@TESTRELM.COM
:: [ 20:47:40 ] ::  Success: kinit as [admin] with password [Secret123] was successful.
Red Hat Enterprise Linux Server release 7.0 Beta (Maipo)
:: [   PASS   ] :: File '/tmp/bz010a.txt' should contain 'UID: 999' 
:: [   PASS   ] :: File '/tmp/bz010a.txt' should contain 'GID: 999' 
:: [   PASS   ] :: File '/tmp/bz010b.txt' should contain 'UID' 
:: [   PASS   ] :: File '/tmp/bz010b.txt' should contain 'GID' 
:: [   PASS   ] :: File '/tmp/bz010b.txt' should not contain 'UID: 999' 
:: [   PASS   ] :: File '/tmp/bz010b.txt' should not contain 'GID: 999' 
----------------------------
Deleted user "tuser1,tuser2"
----------------------------
'761cb05e-e7d8-4a9e-92cf-ddf3e372be2e'
ipa-user-add-bugzilla-010 result: PASS

new server old client:
ipa-server-3.3.2-3.el7.x86_64
ipa-client-3.0.0-25.el6.x86_64

Automated test results :
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: ipa-user-add-bugzilla-010: bz837364 DNA-assigned uid/gid numbers given when asked for 999
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 18:52:06 ] ::  Test for https://bugzilla.redhat.com/show_bug.cgi?id=837364
kdestroy: No credentials cache found while destroying cache
spawn /usr/bin/kinit -V admin
Using default cache: /tmp/krb5cc_0
Using principal: admin@TESTRELM.COM
Password for admin@TESTRELM.COM: 
Authenticated to Kerberos v5
Default principal: admin@TESTRELM.COM
:: [ 18:52:08 ] ::  kinit as admin with password Secret123 was successful.
Red Hat Enterprise Linux Client release 6.4 (Santiago)
:: [   PASS   ] :: File '/tmp/bz010c.txt' should contain 'UID' 
:: [   PASS   ] :: File '/tmp/bz010c.txt' should contain 'GID' 
:: [   PASS   ] :: File '/tmp/bz010c.txt' should not contain 'UID: 999' 
:: [   PASS   ] :: File '/tmp/bz010c.txt' should not contain 'GID: 999' 
:: [   PASS   ] :: File '/tmp/bz010d.txt' should contain 'UID' 
:: [   PASS   ] :: File '/tmp/bz010d.txt' should contain 'GID' 
:: [   PASS   ] :: File '/tmp/bz010d.txt' should not contain 'UID: 999' 
:: [   PASS   ] :: File '/tmp/bz010d.txt' should not contain 'GID: 999' 
----------------------------
Deleted user "tuser1,tuser2"
----------------------------
'5306ffcf-c0bb-4219-8610-c9c045c42e37'
ipa-user-add-bugzilla-010 result: PASS
Comment 8 Ludek Smid 2014-06-13 09:18:21 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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