Bug 720966 - The interactive mode of rhn-channel doesn't handle entered user name correctly
Summary: The interactive mode of rhn-channel doesn't handle entered user name correctly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rhn-client-tools
Version: 5.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Tomas Lestach
QA Contact: Jiří Mikulka
URL:
Whiteboard:
: 773102 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-13 11:10 UTC by Radek Bíba
Modified: 2014-10-06 13:47 UTC (History)
6 users (show)

Fixed In Version: rhn-client-tools-0.4.20-63
Doc Type: Bug Fix
Doc Text:
Cause: Username not stripped. Consequence: Authentication fails, when entering username and password interactively. Result: Authentication succeeds, when entering correct credentials interactively.
Clone Of:
Environment:
Last Closed: 2012-02-21 06:30:19 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0250 0 normal SHIPPED_LIVE rhn-client-tools bug fix update 2012-02-20 15:07:09 UTC

Description Radek Bíba 2011-07-13 11:10:51 UTC
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')

Comment 1 Tomas Lestach 2011-10-05 09:54:36 UTC
Fixed within Bug 567901.

spacewalk.git: bb748540104fc834ead706bb6c4ac45659b6cd98

Comment 4 Tomas Lestach 2011-10-25 12:15:07 UTC
    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.

Comment 7 errata-xmlrpc 2012-02-21 06:30:19 UTC
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

Comment 8 Radek Bíba 2012-04-27 08:35:22 UTC
*** Bug 773102 has been marked as a duplicate of this bug. ***


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