diff options
| author | bwarsaw | 2000-12-06 22:46:00 +0000 |
|---|---|---|
| committer | bwarsaw | 2000-12-06 22:46:00 +0000 |
| commit | 43be9323af8289296770c9cd9beaf115e381cf57 (patch) | |
| tree | a1917cb7c463197e0a9e89097a9c9757363c60e8 | |
| parent | 0eb626aaedc40aff107a221ce456b45de98da506 (diff) | |
| download | mailman-43be9323af8289296770c9cd9beaf115e381cf57.tar.gz mailman-43be9323af8289296770c9cd9beaf115e381cf57.tar.zst mailman-43be9323af8289296770c9cd9beaf115e381cf57.zip | |
checkmboxfile(): Ensures that the various archive .mbox files have at
least 0660 permissions.
| -rwxr-xr-x | bin/check_perms | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/bin/check_perms b/bin/check_perms index 03b8f1ca2..f8edd50e6 100755 --- a/bin/check_perms +++ b/bin/check_perms @@ -153,6 +153,26 @@ def checkarchives(): print +MBOXPERMS = S_IRGRP | S_IWGRP | S_IRUSR | S_IWUSR + + +def checkmboxfile(mboxdir): + absdir = os.path.join(mm_cfg.PRIVATE_ARCHIVE_FILE_DIR, mboxdir) + for f in os.listdir(absdir): + if f[-5:] <> '.mbox': + continue + mboxfile = os.path.join(absdir, f) + mode = statmode(mboxfile) + if (mode & MBOXPERMS) <> MBOXPERMS: + STATE.ERRORS = STATE.ERRORS + 1 + print 'mbox file must be at least 0660', mboxfile + if STATE.FIX: + print '(fixing)' + os.chmod(mboxfile, mode | MBOXPERMS) + else: + print + + def checkarchivedbs(): # The archives/private/listname/database file must not be other readable # or executable otherwise those files will be accessible when the archives @@ -160,7 +180,7 @@ def checkarchivedbs(): # anyway. for dir in os.listdir(mm_cfg.PRIVATE_ARCHIVE_FILE_DIR): if dir[-5:] == '.mbox': - continue + checkmboxfile(dir) dbdir = os.path.join(mm_cfg.PRIVATE_ARCHIVE_FILE_DIR, dir, 'database') try: mode = statmode(dbdir) |
