Parsing remote URIs fails when username or password contains ':', '@','/' or '?'

Bug #671785 reported by ludw
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
sbackup
Status tracked in Trunk
0.11
Fix Released
Low
Jean-Peer Lorenz
Trunk
Fix Released
Low
Jean-Peer Lorenz
sbackup (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Dist: Ubuntu 10.10
SBackup version: 0.11.3
Installed from: apt

When setting up a remote target as backup destination the program crashes if a / is used in the password field.
Steps to reproduce:
1) Open Simple Backup-Configuration
2) Destination -> Use a remote site -> Connect...
3) Enter a / character in the password field (or any password containing one)
4) Connect

Stacktrace:
Traceback (most recent call last):
  File "/usr/share/sbackup/sbackup/ui/configgui.py", line 1625, in __show_connect_remote_dialog
    self.__destination_uri_obj.set_and_parse_uri(_uri)
  File "/usr/share/sbackup/sbackup/util/pathparse.py", line 193, in set_and_parse_uri
    if splituri.port is not None:
  File "/usr/lib/python2.6/urlparse.py", line 102, in port
    return int(port, 10)
ValueError: invalid literal for int() with base 10: ''

Related branches

Revision history for this message
Jonathon Schrader (jlschrad) wrote :

The same situation appears to happen with SMB connections as well - at least it does for me.

It fails with the exact same error message as above - lines 1625 of configgui.py and 193 of pathparse.py.

I imagine that it will with any of the selected protocols.

Maybe something with the path parser not expecting '/' before the @ symbol in the URL?

Revision history for this message
Jim Caughran (caughranjim) wrote :

entering SMB address, password had * but no /

Sorry, this should not have happened

An uncaught error occurred. Close this message window and restart the application.

Please report this error on https://bugs.launchpad.net/sbackup.

Max. number of password inputs reached. Aborted.

Traceback (most recent call last):
  File "/usr/share/sbackup/sbackup/fs_backend/_gio_utils.py", line 232, in _ask_password_cb
    raise exceptions.RemoteMountFailedError("Max. number of password inputs reached. Aborted.")
RemoteMountFailedError: Max. number of password inputs reached. Aborted.

Revision history for this message
Jean-Peer Lorenz (peer.loz) wrote :

Thank you for using SBackup and for taking the time reporting this bug.

@Jim Caughran: I'm not sure whether your problem is the same as reported here. Please consider to file a new bug report if the issue still happens.

@others:

Stacktrace:
Traceback (most recent call last):
  File "/usr/share/sbackup/sbackup/ui/configgui.py", line 1625, in __show_connect_remote_dialog
    self.__destination_uri_obj.set_and_parse_uri(_uri)
  File "/usr/share/sbackup/sbackup/util/pathparse.py", line 193, in set_and_parse_uri
    if splituri.port is not None:
  File "/usr/lib/python2.6/urlparse.py", line 102, in port
    return int(port, 10)
ValueError: invalid literal for int() with base 10: ''

The stacktrace points to a failure that happens when parsing a given URI. Confirmed.

Changed in sbackup:
status: New → Confirmed
importance: Undecided → Low
summary: - Uncaught error when using ssh password with / in
+ Parsing remote URIs fails when username or password contains ':', '@' or
+ '/'
Revision history for this message
Jean-Peer Lorenz (peer.loz) wrote : Re: Parsing remote URIs fails when username or password contains ':', '@' or '/'

RFC1738 sec. 3.1 (http://tools.ietf.org/html/rfc1738.html): Within the user and password field, any ":", "@", or "/" must be encoded.
This was not the case. Therefore, parsing such URIs failed. Now, any special characters contained in username or passphrase are encoded before parsing.

Please note: URIs are written in their encoded version into the configuration file. If you want to set a username/password containing special characters AND want to modify the configuration file directly, you'll have to use an URI with encoded special characters. If you use the configuration GUI, this is done for you automatically.

affects: ubuntu → sbackup (Ubuntu)
Changed in sbackup (Ubuntu):
status: New → Confirmed
Revision history for this message
Jean-Peer Lorenz (peer.loz) wrote :

@Jim Caughran: I've filed a separate report concerning your issue here: https://bugs.launchpad.net/sbackup/+bug/697386

Changed in sbackup (Ubuntu):
status: Confirmed → In Progress
summary: - Parsing remote URIs fails when username or password contains ':', '@' or
- '/'
+ Parsing remote URIs fails when username or password contains ':',
+ '@','/' or '?'
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sbackup - 0.11.4-0ubuntu1

---------------
sbackup (0.11.4-0ubuntu1) natty; urgency=low

  * [Fix] LP: #714916 Unhandled error in gio backend when looking up
                      verbose error message
  * [Fix] LP: #662613 sbackup crashes with 'NonValidOptionException'
  * [Fix] LP: #709338 Restore/revert of non-toplevel items produces only
                      empty folders
  * [Fix] LP: #689016 Uncaught error 'invalid literal for int() when
                      processing invalid configuration files
  * [Fix] LP: #697386 RemoteMountFailedError 'Max. number of password inputs
                      reached' not handled properly
  * [Fix] LP: #697654 No desktop session found: no notification icon:
  * [Fix] LP: #701403 Unable to use remote target without giving a password:
  * [Fix] LP: #588578 Email notification/reporting doesn't work with GMAIL
  * [Fix] LP: #706037 Email reports not working; enable debug output
                      for sending mail
  * [Fix] LP: #683990 Uncaught 'NoSectionError' when adding report settings
                      (SMTP server etc.)
  * [Fix] LP: #695613 Empty notification popup due to invalid markup
  * [Fix] LP: #671785 Parsing remote URIs fails when username or password
                      contains special characters; quote special characters
                      to comply with RFC 1738 sec. 3.1
  * [Fix] LP: #675361 Restore process fails with error 'is not a file' while
                      copying
  * [Fix] LP: #696183 Failed to set GID to `admin`; improved handling of
                      non-existent user groups
  * [Fix] LP: #507177 update translations
  * debian/control: added gconf2 and desktop-file-utils to Depends
 -- Jean-Peer Lorenz <email address hidden> Tue, 08 Feb 2011 13:58:43 +0100

Changed in sbackup (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.