diff options
| author | bwarsaw | 1998-05-26 19:16:37 +0000 |
|---|---|---|
| committer | bwarsaw | 1998-05-26 19:16:37 +0000 |
| commit | 786d559d6b973a3250c233bb20d546db72690a14 (patch) | |
| tree | 329eccabf26badb9dd1fd8311f55e9919a4788d8 /modules/mm_security.py | |
| parent | 2cf1a4a14d086b7e8e072b6699c99207b5fba50a (diff) | |
| download | mailman-786d559d6b973a3250c233bb20d546db72690a14.tar.gz mailman-786d559d6b973a3250c233bb20d546db72690a14.tar.zst mailman-786d559d6b973a3250c233bb20d546db72690a14.zip | |
Calculate site password file location in global scope, using a
different variable from mm_cfg. The file location is stored in
SITE_PW_FILE.
Diffstat (limited to 'modules/mm_security.py')
| -rw-r--r-- | modules/mm_security.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/mm_security.py b/modules/mm_security.py index 016620d1e..311a680d0 100644 --- a/modules/mm_security.py +++ b/modules/mm_security.py @@ -17,23 +17,25 @@ """Handle passwords and sanitize approved messages.""" -__version__ = "$Revision: 547 $" - import crypt, types, string, os import mm_err, mm_utils, mm_cfg +# TBD: is this the best location for the site password? +SITE_PW_FILE = os.path.join(mm_cfg.LIST_DATA_DIR, 'adm.pw') + + class SecurityManager: def SetSiteAdminPassword(self, pw): old = os.umask(0022) - f = open(os.path.join(mm_cfg.MAILMAN_DIR, "adm.pw"), "w+") + f = open(SITE_PW_FILE, "w+") f.write(crypt.crypt(pw, mm_utils.GetRandomSeed())) f.close() os.umask(old) def CheckSiteAdminPassword(self, str): try: - f = open(os.path.join(mm_cfg.MAILMAN_DIR, "adm.pw"), "r+") + f = open(SITE_PW_FILE, "r+") pw = f.read() f.close() return crypt.crypt(str, pw) == pw |
