[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Duplicity-talk] unbalanced parenthesis in password breaks duplicity

From: edgar . soldin
Subject: [Duplicity-talk] unbalanced parenthesis in password breaks duplicity
Date: Sat, 24 Oct 2009 21:00:00 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090915 Thunderbird/3.0b4

In connection to a bug in duply i stumbled over this one in duplicity ... I used a password containing an unclosed parenthesis eg. 'test)foo' ... I also spend some time to figure out a fix. It could be the replacement of line 359 in backend.py (version 0.6.05) .. here a modified version of the function. The commented line is the original. The replacement above splits the url in protocol, credentials, rest and creates 'prot://[user:address@hidden' string which should suffice for obfuscation . The documentation has to be adapted of course.



    def munge_password(self, commandline):
        if self.parsed_url.password:
return re.sub(r'^([^:/]+)://(([^:/@]*):?([^:/@]*))@?(.*)$', r'\1://\3:address@hidden', commandline) #return re.sub(self.parsed_url.password, '<passwd>', commandline)
            return commandline


Traceback (most recent call last):
File "/srv/www/vhosts/jamoke.net/_apps/duplicity-0.6.05/bin/duplicity", line 1242, in <module>
File "/srv/www/vhosts/jamoke.net/_apps/duplicity-0.6.05/bin/duplicity", line 1235, in with_tempdir
File "/srv/www/vhosts/jamoke.net/_apps/duplicity-0.6.05/bin/duplicity", line 1136, in main
File "/srv/www/vhosts/jamoke.net/_apps/duplicity-0.6.05/bin/duplicity", line 915, in sync_archive
    remlist = globals.backend.list()
File "/srv/www/vhosts/jamoke.net/_apps/duplicity-0.6.05/duplicity/backends/ftpbackend.py", line 109, in list
    l = self.popen_persist(commandline).split('
File "/srv/www/vhosts/jamoke.net/_apps/duplicity-0.6.05/bin/../duplicity/backend.py", line 416, in popen_persist
    private = self.munge_password(commandline)
File "/srv/www/vhosts/jamoke.net/_apps/duplicity-0.6.05/bin/../duplicity/backend.py", line 360, in munge_password
    return re.sub(self.parsed_url.password, '<passwd>', commandline)
  File "/usr/lib/python2.6/re.py", line 150, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "/usr/lib/python2.6/re.py", line 243, in _compile
    raise error, v # invalid expression
error: unbalanced parenthesis

reply via email to

[Prev in Thread] Current Thread [Next in Thread]