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

Bug 916563

Summary: Spacewalk proxy settings in rhn.conf with special characters (#, @)
Product: [Community] Spacewalk Reporter: Joao Amaro <joao.amaro>
Component: ServerAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.8CC: jpazdziora
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-17 14:49:39 UTC Type: Bug
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: 1484117    

Description Joao Amaro 2013-02-28 10:33:42 UTC
Description of problem:
When server.satellite.http_proxy_password in /etc/rhn/rhn.conf as special characters like # or @ it doesn't work.

If it as a # in the password, the string is automatically truncated. yum_src interprets it as a comment.


Version-Release number of selected component (if applicable):
spacewalk-repo-1.8-4

How reproducible:
Define a http proxy with user and password, and define a password with a '@' or a '#' in it. Probably it will fail with other special characters also.

Steps to Reproduce:
1. Define proxy, user and password in /etc/rhn/rhn.conf
2. Do a spacewalk-repo-sync
3. It will fail
  
Actual results:
No repository synchronization 

Expected results:
Repository synchronization 

Additional info:

Comment 1 Jan Pazdziora (Red Hat) 2013-03-08 16:14:01 UTC
The change 29054252e2cfdb108677155ef9982c3d0d98a40a in Spacewalk master should make the hash-signs stay in the passwords.

I'm not certain about the @ sign though -- are you sure @ in proxy password (as opposed to database password) causes problems?

Comment 2 Joao Amaro 2013-03-08 16:54:36 UTC
I've solved my problem with the '#' sign changing the code of /usr/lib/python2.6/site-packages/spacewalk/common/rhnConfig.py 

I've opted to escape the # sign with a backslash in rhn.conf and change the code in rhnConfig.py to:

    # Strip out any comments.
    i = line.find('#')
#    if i >= 0:
#        line = line[:i]
    if ( i >= 0):
        if (line[i-1] != '\\'):
                line = line[:i]
    line = line.replace("\\", "")

With this I've managed to use '#' in the password, when backslashed
The problem with @ is other. It is accepted, but then the proxy won't work, because it is in the format
                 
             http://user:password@proxy:port

and somehow is is misinterpted when the password as as '@' in it.

Rgds

Comment 3 Milan Zázrivec 2014-01-17 14:49:39 UTC
I'm confirming that this problem is fixed in current Spacewalk 2.0

In the proxy password, you are able to use both '#' and '@' characters
without any problems.

Comment 4 Eric Herget 2017-09-28 17:56:40 UTC
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.