← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~ed.so/duplicity/lftp.netrc into lp:duplicity

 

edso has proposed merging lp:~ed.so/duplicity/lftp.netrc into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~ed.so/duplicity/lftp.netrc/+merge/134788

allow .netrc auth for lftp backend
-- 
https://code.launchpad.net/~ed.so/duplicity/lftp.netrc/+merge/134788
Your team duplicity-team is requested to review the proposed merge of lp:~ed.so/duplicity/lftp.netrc into lp:duplicity.
=== modified file 'duplicity/backends/ftpsbackend.py'
--- duplicity/backends/ftpsbackend.py	2012-02-12 13:28:10 +0000
+++ duplicity/backends/ftpsbackend.py	2012-11-17 22:18:20 +0000
@@ -80,7 +80,9 @@
         os.write(self.tempfile, "set net:max-retries %s\n" % globals.num_retries)
         os.write(self.tempfile, "set ftp:passive-mode %s\n" % self.conn_opt)
         os.write(self.tempfile, "open %s %s\n" % (self.portflag, self.parsed_url.hostname))
-        os.write(self.tempfile, "user %s %s\n" % (self.parsed_url.username, self.password))
+        # allow .netrc auth by only setting user/pass when user was actually given
+        if self.parsed_url.username:
+            os.write(self.tempfile, "user %s %s\n" % (self.parsed_url.username, self.password))
         os.close(self.tempfile)
 
         self.flags = "-f %s" % self.tempname


Follow ups