Bug 916563 - Spacewalk proxy settings in rhn.conf with special characters (#, @)
Summary: Spacewalk proxy settings in rhn.conf with special characters (#, @)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.8
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space27
TreeView+ depends on / blocked
 
Reported: 2013-02-28 10:33 UTC by Joao Amaro
Modified: 2017-09-28 17:56 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-17 14:49:39 UTC
Embargoed:


Attachments (Terms of Use)

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 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.


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