[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Fix bugs in new code to get fresh passwords



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv22255/lib/mixminion

Modified Files:
	ClientMain.py ClientUtils.py 
Log Message:
Fix bugs in new code to get fresh passwords

Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- ClientMain.py	7 Nov 2003 07:08:35 -0000	1.125
+++ ClientMain.py	7 Nov 2003 07:31:42 -0000	1.126
@@ -71,7 +71,7 @@
         self.keyring = mixminion.ClientUtils.LazyEncryptedPickled(
             fn, passwordManager, pwdName="ClientKeyring",
             queryPrompt="Enter password for keyring:",
-            newPrompt="keyring",
+            newPrompt="Entrer new keyring password:",
             magic="KEYRING1",
             initFn=lambda:{})
 

Index: ClientUtils.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientUtils.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ClientUtils.py	7 Nov 2003 07:08:35 -0000	1.5
+++ ClientUtils.py	7 Nov 2003 07:31:42 -0000	1.6
@@ -56,12 +56,15 @@
         raise BadPassword()
     def getNewPassword(self, name, prompt):
         self.passwords[name] = self._getNewPassword(name, prompt)
+        return self.passwords[name]
 
 class CLIPasswordManager(PasswordManager):
     def __init__(self):
         PasswordManager.__init__(self)
     def _getPassword(self, name, prompt):
         return getPassword_term(prompt)
+    def _getNewPassword(self, name, prompt):
+        return getNewPassword_term(prompt)
 
 def getPassword_term(prompt):
     """Read a password from the console, then return it.  Use the string
@@ -85,7 +88,6 @@
     if nl: print >>f
     return p
 
-
 def getNewPassword_term(prompt):
     """Read a new password from the console, then return it."""
     s2 = "Verify password:".rjust(len(prompt))
@@ -203,7 +205,7 @@
     def setPassword(self, pwd):
         self.password = pwd
     def save(self):
-        assert self.loaded and self.password
+        assert self.loaded and self.password is not None
         writeEncryptedPickled(self.fname, self.password, self.magic,
                               self.object)