diff options
| author | bwarsaw | 1999-07-12 20:34:25 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-07-12 20:34:25 +0000 |
| commit | 13c499467648bc2bd24ea05ff14f5661e546d69b (patch) | |
| tree | 632c83e04293e3c9930346147f14f59639a7b306 | |
| parent | 9330b890a2330fb9f95a5158920ebccb1c8ad31e (diff) | |
| download | mailman-13c499467648bc2bd24ea05ff14f5661e546d69b.tar.gz mailman-13c499467648bc2bd24ea05ff14f5661e546d69b.tar.zst mailman-13c499467648bc2bd24ea05ff14f5661e546d69b.zip | |
Use os.error instead of OSError for older Pythons
checkadminpw(): wrap stat of data/adm.pw in a try/except to catch
situations where there is no site password.
| -rwxr-xr-x | bin/check_perms | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/check_perms b/bin/check_perms index d965bc56e..1ef0f82ab 100755 --- a/bin/check_perms +++ b/bin/check_perms @@ -49,7 +49,7 @@ def checkwalk(arg, dirname, names): print 'checking gid and modes for', path try: mode, gid = statgidmode(path) - except OSError, (code, msg): + except os.error, (code, msg): if code == errno.ENOENT: continue raise @@ -125,7 +125,13 @@ def checkadminpw(): targetmode = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP if STATE.VERBOSE: print 'checking perms on', adminpw - mode = statmode(adminpw) + try: + mode = statmode(adminpw) + except os.error, (code, msg): + # adm.pw may not exist + if code == errno.ENOENT: + return + raise if mode <> targetmode: STATE.ERRORS = STATE.ERRORS + 1 print adminpw, 'permissions must be exactly 0640 (got %s)' % oct(mode) |
