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 1023166 - Trim trailing whitespace from username when registering through CLI
Summary: Trim trailing whitespace from username when registering through CLI
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Bryan Kearney
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel70
TreeView+ depends on / blocked
 
Reported: 2013-10-24 19:08 UTC by Matt Reid
Modified: 2014-06-18 00:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 13:29:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Matt Reid 2013-10-24 19:08:29 UTC
Description of problem:
If you register through the GUI and accidentally include an extra space or two after the username, we handle it gracefully and trim it, allowing the user to successfully continue. While the GUI is the more important area to watch for that, due to copy/paste sometimes adding in trailing spaces, it would be nice if we did the same magic for the username on CLI registration. Currently if you input "admin " in the CLI, it will error out with Invalid Credentials, but the same "admin " is accepted as fine through the Registration Dialog in the GUI.

Should just be running the given username through a trim or something right?

Comment 3 Bryan Kearney 2013-10-30 12:23:02 UTC
commit 8f7e7cd7f085605796e703f6a1a4e82984da2fe9
Author: Bryan Kearney <bkearney>
Date:   Mon Oct 28 14:42:32 2013 -0400

    1023166: Strip leading and trailing whitespaces from all usernames and passwords provided on the cli

Comment 5 John Sefler 2013-11-07 19:20:27 UTC
Demonstration of rejected username (with trailing whitespace) credentials...

[root@jsefler-7 ~]# rpm -q subscription-manager
subscription-manager-1.10.5-1.el7.x86_64

[root@jsefler-7 ~]# subscription-manager config --server.hostname=subscription.rhn.stage.redhat.com --server.port=443 --server.prefix=/subscription
[root@jsefler-7 ~]# subscription-manager register --force --username="rhel7beta"
Password: 
The system has been registered with ID: bc800b82-9561-4c11-bbae-1139ab426c2a 
[root@jsefler-7 ~]# subscription-manager register --force --username="rhel7beta "
The system with UUID bc800b82-9561-4c11-bbae-1139ab426c2a has been unregistered
Password: 
Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html
[root@jsefler-7 ~]# 

^^ When --username="rhel7beta " has trailing whitespace, the registration is rejected.


Update subscription-manager (NOT SHOWN)


Verification that username with trailing whitespace credentials is now tolerated...

[root@jsefler-7 ~]# rpm -q subscription-manager
subscription-manager-1.10.6-1.el7.x86_64

[root@jsefler-7 ~]# subscription-manager register --force --username="rhel7beta "Password: 
The system has been registered with ID: 8fe534be-72d5-467a-9f2e-6ae7052c4332 
[root@jsefler-7 ~]# subscription-manager register --force --username=" rhel7beta"
The system with UUID 8fe534be-72d5-467a-9f2e-6ae7052c4332 has been unregistered
Password: 
The system has been registered with ID: 02f63b37-77c5-4890-9bb2-e861dd77e6aa 
[root@jsefler-7 ~]# 

VERIFIED: Specifying username with leading or trailing whitespace during registration is now tolerated.

Comment 6 Ludek Smid 2014-06-13 13:29:14 UTC
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.