From 28f8e182ad5ac9eabae4a9fb6aed6b8ec3db71e3 Mon Sep 17 00:00:00 2001 From: viega Date: Sat, 30 May 1998 16:15:08 +0000 Subject: Added mm_crypt, which trys to import crypt, and provides a wrapper interface to an md5 digest if the import fails. This way, we don't have to tell people to recompile python if they compiled it out of the box. (since crypt is no longer in by default). mm_security now uses mm_crypt instead of crypt. --- modules/mm_security.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/mm_security.py') diff --git a/modules/mm_security.py b/modules/mm_security.py index f487f4c13..be7f75130 100644 --- a/modules/mm_security.py +++ b/modules/mm_security.py @@ -18,7 +18,7 @@ """Handle passwords and sanitize approved messages.""" -import crypt, types, string, os +import mm_crypt, types, string, os import mm_err, mm_utils, mm_cfg # TBD: is this the best location for the site password? @@ -29,7 +29,7 @@ class SecurityManager: def SetSiteAdminPassword(self, pw): old = os.umask(0022) f = open(SITE_PW_FILE, "w+") - f.write(crypt.crypt(pw, mm_utils.GetRandomSeed())) + f.write(mm_crypt.crypt(pw, mm_utils.GetRandomSeed())) f.close() os.umask(old) @@ -38,7 +38,7 @@ class SecurityManager: f = open(SITE_PW_FILE, "r+") pw = f.read() f.close() - return crypt.crypt(str, pw) == pw + return mm_crypt.crypt(str, pw) == pw # There probably is no site admin password if there was an exception except: return 0 @@ -55,7 +55,7 @@ class SecurityManager: if self.CheckSiteAdminPassword(pw): return 1 return ((type(pw) == types.StringType) and - (crypt.crypt(pw, self.password) == self.password)) + (mm_crypt.crypt(pw, self.password) == self.password)) def ConfirmAdminPassword(self, pw): if(not self.ValidAdminPassword(pw)): -- cgit v1.2.3-70-g09d2