Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 540544

Summary: backend API call up2date.subscribeChannels do not authenticate properly
Product: Red Hat Satellite 5 Reporter: Miroslav Suchý <msuchy>
Component: ServerAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Garik Khachikyan <gkhachik>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: cperry, gkhachik, jsherril, mkoci
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 540974 (view as bug list) Environment:
Last Closed: 2010-01-13 06:57:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 216808, 518256, 540974    

Description Miroslav Suchý 2009-11-23 16:16:06 UTC
Description of problem:
backend API call up2date.(un)subscribeChannels do not authenticate properly.
It call method rhnChannel.__auth_user() which compare crypted password with uncrypted password, which always fail. 

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

How reproducible:
always

Steps to Reproduce:
1. PYTHONPATH=/usr/share/rhn python
import rhnserver
import up2dateAuth

s = rhnserver.RhnServer()
s.up2date.subscribeChannels(up2dateAuth.getSystemId(), 'foo', 'username',
        'password')

  
Actual results:
Error Class Code: 2
Error Class Info: Invalid username and password combination.

Expected results:
correct username and password, and error about unknown channel.

Comment 1 Miroslav Suchý 2009-11-24 12:43:43 UTC
rhnUser.check_user_password check if password is correct
but we want rather call auth_username_password, which return object rhnUser. There is no need for additional checks.
And they even did not worked, becouse we usually have in db crypted
password, but password given as param is not crypted!

Commited to Spacewalk git as:
22bddd07e3ba11ee5b70f8e205ab04e729634f05
ee4f1d0d44bbf90a1396532c83b9b4a0da646c74

Comment 2 Clifford Perry 2009-11-24 15:58:14 UTC
Approved and moving to 531. 

We will need to collect this bug as part of an Errata. 

Server side fix being made in prep to support the proposed RFE to allow for the RHEL 5 client, with right username/password access to change child channels using the client, vs having to login to RHN or Satellite. 

Mirek will also clone to track for RHN fix. 

Cliff

Comment 3 Miroslav Suchý 2009-11-25 10:41:02 UTC
cherrypicked to satellite git as:
66256d0ae3e533ae55f669f516ad4640af74b160
2e4ff039c74eb7ac5c67294adc88a3f5ffe3eb76

Comment 5 Miroslav Suchý 2010-01-06 13:34:09 UTC
err, correct api call is:
s.up2date.subscribeChannels(up2dateAuth.getSystemId(), ['foo'] , 'username',
        'password')

or even simpler:

from up2date_client.rhnChannel import subscribeChannels, unsubscribeChannels
subscribeChannels(['rhn-tools-rhel-i386-server-5'], 'username', 'password')

Comment 6 Garik Khachikyan 2010-01-06 15:59:03 UTC
# VERIFIED

The call is now working correctly: in case of correct user/password subscribe/unsubscribes to/from the given channel.

Comment 8 errata-xmlrpc 2010-01-13 06:57:12 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0028.html