Bug 1306141 - satpasswd do not work for logins including underscore char
Summary: satpasswd do not work for logins including underscore char
Keywords:
Status: CLOSED DUPLICATE of bug 1235827
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Client
Version: 570
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-10 07:11 UTC by Jan Hutař
Modified: 2016-02-10 08:03 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-10 08:03:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Hutař 2016-02-10 07:11:08 UTC
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):
spacewalk-backend-tools-2.3.3-33.el6sat.noarch


How reproducible:
always


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

Options:
	-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():
        print_help()
        sys.exit(1)

Comment 1 Jan Hutař 2016-02-10 07:49:04 UTC
Maybe?:

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


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