Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 692945

Summary: postalcode for user not being added correctly with ipa user-add or user-mod
Product: Red Hat Enterprise Linux 6 Reporter: Jenny Severance <jgalipea>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1CC: benl, dpal
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-2.0.0-20.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:44:50 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 Jenny Severance 2011-04-01 18:47:54 UTC
Description of problem:

# ipa user-add --first=test --last=test --postalcode=01730 test
-----------------
Added user "test"
-----------------
  User login: test
  First name: test
  Last name: test
  Full name: test test
  Display name: test test
  Initials: tt
  Home directory: /home/test
  GECOS field: test
  Login shell: /bin/sh
  Kerberos principal: test@TESTRELM
  UID: 684200063
  ZIP: 984


ldapsearch:

# test, users, accounts, testrelm
dn: uid=test,cn=users,cn=accounts,dc=testrelm
displayName: test test
cn: test test
objectClass: top
objectClass: person
objectClass: organizationalperson
objectClass: inetorgperson
objectClass: inetuser
objectClass: posixaccount
objectClass: krbprincipalaux
objectClass: krbticketpolicyaux
objectClass: ipaobject
objectClass: mepOriginEntry
loginShell: /bin/sh
sn: test
postalCode: 984
gecos: test
homeDirectory: /home/test
krbPwdPolicyReference: cn=global_policy,cn=TESTRELM,cn=kerberos,dc=testrelm
krbPrincipalName: test@TESTRELM
givenName: test
uid: test
initials: tt
uidNumber: 684200063
gidNumber: 684200063
ipaUniqueID: fcadb392-5c8f-11e0-a286-5254002c918f
mepManagedEntry: cn=test,cn=groups,cn=accounts,dc=testrelm
memberOf: cn=ipausers,cn=groups,cn=accounts,dc=testrelm



Version-Release number of selected component (if applicable):
ipa-server-2.0.0-17.el6.x86_64
ipa-admintools-2.0.0-17.el6.x86_64


How reproducible:


Steps to Reproduce:
1. ipa user-add --first=test --last=test --postalcode=01730 test
2.
3.
  
Actual results:


Expected results:
postalcode to be 01730

Additional info:

Comment 1 Jenny Severance 2011-04-01 18:49:18 UTC
looks like it is when it starts with a 0

Comment 5 Rob Crittenden 2011-04-06 02:31:20 UTC
master: 316efbc32f7b586df36653aa894e686313a64764

ipa-2-0: c4fb150837d9e141eb95e5d4d97934271703551b

To Test:

Scenario 1: Testing on the master itself

- ipa-server-install <your favorite options>
- kinit admin
- ipa user-add --first=Tim --last=User --postalcode=01234-1111 tuser

Verify in output that ZIP is correct.

Scenario 2: Test with a previous version of ipa-client

Using the IPA server from Scenario 1, on another machine:

- yum install ipa-client
- ipa-client-install
Enter the server from Scenario 1
Enroll using admin credentials
- kinit admin
- ipa user-add --first=Tim --last=User --postalcode=01234-1111 tuser

Expected error:

ipa: ERROR: invalid 'postalcode': must be an integer

- ipa user-add --first=Tim --last=User --postalcode=01234 tuser

Expected output:

ZIP = 668

The expectation here is not that the zip will be correct, it won't with older bits and a leading 0. We just want to confirm that it won't blow up.

Comment 7 Jenny Severance 2011-04-07 19:00:54 UTC
verified:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: ipa-user-cli-mod-047: modify user's postalcode - bug 692945
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Setting user postalcode - code beginning with 0
:: [   LOG    ] :: Value of ZIP for user sup34 is as expected: 01730
:: [   PASS   ] :: Verify user's postalcode
:: [   LOG    ] :: Duration: 6s
:: [   LOG    ] :: Assertions: 2 good, 0 bad
:: [   PASS   ] :: RESULT: ipa-user-cli-mod-047: modify user's postalcode - bug 692945


# ipa user-add --first=Tim --last=User --postalcode=01234-1111 tuser
------------------
Added user "tuser"
------------------
  User login: tuser
  First name: Tim
  Last name: User
  Full name: Tim User
  Display name: Tim User
  Initials: TU
  Home directory: /home/tuser
  GECOS field: tuser
  Login shell: /bin/sh
  Kerberos principal: tuser@TESTRELM
  UID: 167200007
  ZIP: 01234-1111

version:
ipa-server-2.0.0-20.el6.x86_64
ipa-admintools-2.0.0-20.el6.x86_64

Comment 8 errata-xmlrpc 2011-05-19 13:44:50 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0631.html