Red Hat Bugzilla – Bug 720966
The interactive mode of rhn-channel doesn't handle entered user name correctly
Last modified: 2014-10-06 09:47:04 EDT
Description of problem: rhn-channel is now able to accept user name and/or password interactively (bug 641029). However, when both the user name and the password are entered interactively, rhn-channel fails to alter the channel subscription. Even though I'm absolutely sure that I'm entering the right data. Version-Release number of selected component (if applicable): rhn-client-tools-0.4.20-56.el5 How reproducible: Always Steps to Reproduce: e.g., # rhn-channel -r -c rhel-i386-server-5-sts Username: (not copied here) Password: Error validating data at server: Error Message: Invalid username/password combination Error Class Code: 2 Error Class Info: Invalid username and password combination. Additional info: The problem is here in the script: 62 if not OPTIONS.user and not OPTIONS.list: 63 print("Username: ") 64 OPTIONS.user = sys.stdin.readline() First of all, the prompt should stay on the same line, but that's not fatal. What makes rhn-channel fail is the fact that readline() keeps the new line character and sends the entered user name and the new line to RHN. The code should read: if not OPTIONS.user and not OPTIONS.list: print "Username: ", OPTIONS.user = sys.stdin.readline().rstrip('\n')
Fixed within Bug 567901. spacewalk.git: bb748540104fc834ead706bb6c4ac45659b6cd98
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: Cause: Username not stripped. Consequence: Authentication fails, when entering username and password interactively. Result: Authentication succeeds, when entering correct credentials interactively.
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-0250.html
*** Bug 773102 has been marked as a duplicate of this bug. ***