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 807417

Summary: user-mod --rename is successful for more than 32 characters
Product: Red Hat Enterprise Linux 6 Reporter: Asha Akkiangady <aakkiang>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: jgalipea, mkosek
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-2.2.0-9.el6 Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:25:59 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 Asha Akkiangady 2012-03-27 18:07:50 UTC
Description of problem:
user-mod --rename is successful for more than 32 characters.

Version-Release number of selected component (if applicable):
ipa-server-2.2.0-4.el6.x86_64

How reproducible:


Steps to Reproduce:
1.# ipa user-mod --rename=max32charactersmax32charactersmax sup34
---------------------
Modified user "sup34"
---------------------
  User login: max32charactersmax32charactersmax
  First name: Superuser
  Last name: crazylastnametoolong
  Home directory: /home2/sup34
  Login shell: /bin/sh
  Email address: sup34.domain.co.uk.us.fi.com
  UID: 243400008
  GID: 243400008
  Telephone Number: 9999999999
  Account disabled: False
  Password: False
  Member of groups: ipausers
  Kerberos keys available: False

# ipa user-mod --rename=max32charactersmax32charactersmax123456789 max32charactersmax32charactersmax
-------------------------------------------------
Modified user "max32charactersmax32charactersmax"
-------------------------------------------------
  User login: max32charactersmax32charactersmax123456789
  First name: Superuser
  Last name: crazylastnametoolong
  Home directory: /home2/sup34
  Login shell: /bin/sh
  Email address: sup34.domain.co.uk.us.fi.com
  UID: 243400008
  GID: 243400008
  Telephone Number: 9999999999
  Account disabled: False
  Password: False
  Member of groups: ipausers
  Kerberos keys available: False

Observed that user-add does not allow more than 32 characters:
# ipa user-add max32charactersmax32charactersmax
First name: superuser
Last name: crazylastname2
ipa: ERROR: invalid 'login': can be at most 32 characters

  
Actual results:
user-mod --rename allows login name with more than 32 characters.

Expected results:
user-mod --rename login name should be at most 32 characters. Should throw error if there is more than 32 characters.

Additional info:

Comment 2 Martin Kosek 2012-03-28 06:38:31 UTC
Yes, this is a bug, we don't apply validation on --rename option. I will open a bug.

Comment 3 Martin Kosek 2012-03-28 06:39:03 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2587

Comment 4 Rob Crittenden 2012-04-09 14:19:42 UTC
fixed upstream

master: dcea80fc1700aff5a87e3f3bff442e80455243a0

ipa-2-2: 9e2ee3ecb5489e2393763857e50485aa588872e9

Comment 7 Asha Akkiangady 2012-04-11 20:35:13 UTC
FailedQA :

Error message when try to rename a user with more than 32 characters is inconsistent with the other error messages for rename (example: ipa: ERROR: invalid 'rename': may only include letters, numbers, _, -, . and $).

GOT: ipa: ERROR: invalid 'login': can be at most 32 characters
EXPECTED: ipa: ERROR: invalid 'rename': can be at most 32 characters


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: ipa-user-cli-mod-057: Rename user with a string of 33 characters (more than allowed)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   LOG    ] :: Executing: ipa user-mod --rename=max32charactersmax32charactersmax max32charactersmax32charactersma
:: [   LOG    ] :: "ipa user-mod --rename=max32charactersmax32charactersmax max32charactersmax32charactersma" failed as expected.
:: [   FAIL   ] :: ERROR: Message not as expected. GOT: ipa: ERROR: invalid 'login': can be at most 32 characters  EXP: ipa: ERROR: invalid 'rename': can be at most 32 characters 
:: [   FAIL   ] :: Verify expected error message for --rename=max32charactersmax32charactersmax (Expected 0, got 1)
:: [   FAIL   ] :: Renaming user to max32charactersmax32charactersma (Expected 0, got 2)
:: [   LOG    ] :: Duration: 19s
:: [   LOG    ] :: Assertions: 0 good, 3 bad
:: [   FAIL   ] :: RESULT: ipa-user-cli-mod-057: Rename user with a string of 33 characters (more than allowed)

Comment 8 Rob Crittenden 2012-04-11 20:41:28 UTC
I think the expected error is incorrect. There is no rename attribute, this is saying that the new login attribute is too long.

Comment 10 Asha Akkiangady 2012-04-16 14:38:31 UTC
Corrected the expected message in automation script to be "ipa: ERROR: invalid 'login': can be at most 32 characters".

Version :: ipa-server.x86_64 0:2.2.0-9.el6

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: ipa-user-cli-mod-057: Rename user with a string of 33 characters (more than allowed)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   LOG    ] :: Executing: ipa user-mod --rename=max32charactersmax32charactersmax max32charactersmax32charactersma
:: [   LOG    ] :: "ipa user-mod --rename=max32charactersmax32charactersmax max32charactersmax32charactersma" failed as expected.
:: [   PASS   ] :: Error message as expected: ipa: ERROR: invalid 'login': can be at most 32 characters
:: [   PASS   ] :: Verify expected error message for --rename=max32charactersmax32charactersmax
:: [   LOG    ] :: Duration: 7s
:: [   LOG    ] :: Assertions: 2 good, 0 bad
:: [   PASS   ] :: RESULT: ipa-user-cli-mod-057: Rename user with a string of 33 characters (more than allowed)


Marking bug verified.

Comment 12 Martin Kosek 2012-04-25 11:05:51 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation needed.

Comment 14 errata-xmlrpc 2012-06-20 13:25:59 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/RHBA-2012-0819.html