diff options
| author | bwarsaw | 2000-10-02 20:40:41 +0000 |
|---|---|---|
| committer | bwarsaw | 2000-10-02 20:40:41 +0000 |
| commit | e32aecde449efe46b465f2f637ca85ffb7e84b48 (patch) | |
| tree | 029a52bd44ba3cbd7cc1d5d9f99c49c74342583c /Mailman/SecurityManager.py | |
| parent | bedb5d55b33143823a2cdd2fc8d06219c383bfd0 (diff) | |
| download | mailman-e32aecde449efe46b465f2f637ca85ffb7e84b48.tar.gz mailman-e32aecde449efe46b465f2f637ca85ffb7e84b48.tar.zst mailman-e32aecde449efe46b465f2f637ca85ffb7e84b48.zip | |
Diffstat (limited to 'Mailman/SecurityManager.py')
| -rw-r--r-- | Mailman/SecurityManager.py | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/Mailman/SecurityManager.py b/Mailman/SecurityManager.py index 10332469f..65f7e36aa 100644 --- a/Mailman/SecurityManager.py +++ b/Mailman/SecurityManager.py @@ -32,26 +32,8 @@ from Mailman import Cookie from Mailman import mm_cfg -# TBD: is this the best location for the site password? -SITE_PW_FILE = os.path.join(mm_cfg.DATA_DIR, 'adm.pw') - - + class SecurityManager: - def SetSiteAdminPassword(self, pw): - fp = Utils.open_ex(SITE_PW_FILE, 'w', perms=0640) - fp.write(Crypt.crypt(pw, Utils.GetRandomSeed())) - fp.close() - - def CheckSiteAdminPassword(self, str): - try: - f = open(SITE_PW_FILE, "r") - pw = f.read() - f.close() - return Crypt.crypt(str, pw) == pw - # There probably is no site admin password if there was an exception - except: - return 0 - def InitVars(self, crypted_password): # Configurable, however, we don't pass this back in GetConfigInfo # because it's a special case as it requires confirmation to change. @@ -60,7 +42,7 @@ class SecurityManager: self.passwords = {} def ValidAdminPassword(self, pw): - if self.CheckSiteAdminPassword(pw): + if Utils.CheckSiteAdminPassword(pw): return 1 return type(pw) == StringType and \ Crypt.crypt(pw, self.password) == self.password |
