Bug 1306141 - satpasswd do not work for logins including underscore char
satpasswd do not work for logins including underscore char
Status: CLOSED DUPLICATE of bug 1235827
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Client (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Tomáš Kašpárek
Red Hat Satellite QA List
Depends On:
  Show dependency treegraph
Reported: 2016-02-10 02:11 EST by Jan Hutař
Modified: 2016-02-10 03:03 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-02-10 03:03:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Hutař 2016-02-10 02:11:08 EST
Description of problem:
satpasswd do not work for logins including underscore char and most probably any other non-alphanumeric chars, but i do not know which ones are allowed in username (underscore is, tested on webUI)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Have user "jhutar_something"
2. Try to use `satpasswd` to change its password

Actual results:
# echo -e 'newpass\nnewpass' | satpasswd --stdin jhutar_something
Usage: satpasswd [OPTIONS] user

	-h, --help	Print this help message.
	-s, --stdin	Read the password from standard input.

Expected results:
Should work.

Additional info:
This is problematic "if" in the code:

    userIn = sys.argv.pop()
    if not userIn.isalnum():
Comment 1 Jan Hutař 2016-02-10 02:49:04 EST

    import re
    userIn = sys.argv.pop()
    if not re.match(r'^[A-Za-z0-9_]+$', userIn):

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