rug can not add a repo when the password contains special characters

  • 7008612
  • 19-May-2011
  • 27-Apr-2012

Environment

SUSE Linux Enterprise Desktop 10 Service Pack 3
SUSE Linux Enterprise Server 10 Service Pack 4

Situation

Note: This applies only to http repositories and NOT to the Novell Customer Center.

Example:

A site internal repository requires basic http authentication

User: foobar
password: s$cret?

This would end in:

rug sa -t YUM "http://foobar:s$cret?@wawa.suse.de/rug-test" wawa_foobar

Adding YUM service http://foobar:s$cret?@wawa.suse.de/rug-test...         0% 

ERROR: Could not add 'http://foobar:s$cret?@wawa.suse.de/rug-test': Download
failed: (http://foobar:s$cret/?@wawa.suse.de/rug-test/repodata/repomd.xml)
Error: NameResolutionFailure

The hostname is resolvable, though, the errormessage is a bit misleading.


Resolution

Some of the special characters in this password are reserved and and must not be used in a URI, here it's "$" and "?".

RFC2369 describes allowed and reserverd characters.

See http://www.ietf.org/rfc/rfc2396.txt
3.2.2. Server-based Naming Authority

for further information. In order to use strong passwords, these characters have to be escaped to pass through to the server.
The example's password: s$cret? would translate to:

s%24cret%3F

and using the escaped characters in the url finally works:

rug sa -t YUM "http://foobar:s%24cret%3F@wawa.suse.de/rug-test" wawa_foobar


Additional Information

Note: rug uses HTTP authentication mechanisms to send user and password to the remote server.
Using "Basic-Auth", these are transmitted as plaintext and can be read by any packet sniffer.
Make sure to use authentication methods that are not liable to be broken that easy.

Feedback service temporarily unavailable. For content questions or problems, please contact Support.