Bug 773102

Summary: spacewalk-channel reads username wrong
Product: Red Hat Enterprise Linux 5 Reporter: Roy Keene <roy.keene>
Component: rhn-client-toolsAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: medium    
Version: 5.7CC: cperry, gouyang, jhutar, leiwang, rbiba, slukasik, ycui
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-27 08:35:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Patch to correct this bug none

Description Roy Keene 2012-01-10 22:54:21 UTC
Created attachment 551961 [details]
Patch to correct this bug

Description of problem:
"spacewalk-channel" from (rhn-setup-0.4.20-56.el5) reads the username from stdin if not presented on the commandline, however it does not truncate the newline from the input.

    if not OPTIONS.user and not OPTIONS.list:
        print("Username: ")
        OPTIONS.user = sys.stdin.readline()

This results in all usernames being rejected as such:
# spacewalk-channel -c epel-x86_64-5 -a 
Username: 
rkeene
Password: 
Error validating data at server:

Error Message:
    Invalid username/password combination
Error Class Code: 2
Error Class Info: Invalid username and password combination.
Explanation: 
     An error has occurred while processing your request. If this problem
     persists please enter a bug report at bugzilla.redhat.com.
     If you choose to submit the bug report, please be sure to include
     details of what you were trying to do when this error occurred and
     details on how to reproduce this problem.




Version-Release number of selected component (if applicable):
0.4.20-56.el5

How reproducible:
100%

Steps to Reproduce:
1. Run spacewalk-channel without the "-u" option
2. Specify a username
3. Specify a password
  
Actual results:
"Invalid username/password combination" and channel not added

Expected results:
Channel added and no output

Additional info:
See attached patch

Comment 1 Roy Keene 2012-01-10 22:57:25 UTC
I typed in the component as "rhn-setup", not sure why this got changed to "rhn-hypervisor5" -- changing it to something closer since the particular RHN package is not listed.

Comment 2 Milan Zázrivec 2012-01-11 09:55:17 UTC
(In reply to comment #1)
> I typed in the component as "rhn-setup", not sure why this got changed to
> "rhn-hypervisor5" -- changing it to something closer since the particular RHN
> package is not listed.

Just FYI -- it's the source package name that makes the component choice.

Thank you for your report.

Comment 4 RHEL Program Management 2012-04-02 10:40:28 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 5 Radek Bíba 2012-04-27 08:35:22 UTC
I believe this has already been fixed in RHEL 5, see bug 720966.

*** This bug has been marked as a duplicate of bug 720966 ***