VirtualMailManager/password.py
branchv0.6.x
changeset 274 45ec5c3cfef4
parent 272 446483386914
child 284 ec1966828246
--- a/VirtualMailManager/password.py	Thu Apr 29 03:05:22 2010 +0000
+++ b/VirtualMailManager/password.py	Thu Apr 29 03:38:19 2010 +0000
@@ -52,7 +52,11 @@
     stdout, stderr = process.communicate()
     if process.returncode:
         raise VMMError(stderr.strip(), VMM_ERROR)
-    return stdout.strip()
+    hashed = stdout.strip()
+    if not hashed.startswith('{%s}' % scheme):
+        raise VMMError('Unexpected result from %s: %s' %
+                       (cfg_dget('bin.dovecotpw'), hashed), VMM_ERROR)
+    return hashed
 
 
 def _md4_new():