[Zope3-checkins] CVS: Zope3/src/zope/fssync - fssync.py:1.43

Fred L. Drake, Jr. fred at zope.com
Tue Aug 26 15:49:28 EDT 2003


Update of /cvs-repository/Zope3/src/zope/fssync
In directory cvs.zope.org:/tmp/cvs-serv25009

Modified Files:
	fssync.py 
Log Message:
If the URL is of the form http://username@host/..., ask the user for a
password interactively when making a request.  This doesn't save the
password on disk, so you can make a checkout available without
compromising your password as long as you're willing to type it once
per zsync operation that requires the Zope server to be available.


=== Zope3/src/zope/fssync/fssync.py 1.42 => 1.43 ===
--- Zope3/src/zope/fssync/fssync.py:1.42	Sun Aug 17 02:08:56 2003
+++ Zope3/src/zope/fssync/fssync.py	Tue Aug 26 14:49:27 2003
@@ -218,6 +218,11 @@
             conn.putheader("Content-type", content_type)
             conn.putheader("Transfer-encoding", "chunked")
         if self.user_passwd:
+            if ":" not in self.user_passwd:
+                import getpass
+                pw = getpass.getpass("Password for %s @ %s: "
+                                     % (self.user_passwd, self.host_port))
+                self.user_passwd = "%s:%s" % (self.user_passwd, pw)
             auth = base64.encodestring(self.user_passwd).strip()
             conn.putheader('Authorization', 'Basic %s' % auth)
         conn.putheader("Host", self.host_port)




More information about the Zope3-Checkins mailing list