aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/MTA/Postfix.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Mailman/MTA/Postfix.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Mailman/MTA/Postfix.py b/Mailman/MTA/Postfix.py
index b2d433e4..cee0eb1d 100644
--- a/Mailman/MTA/Postfix.py
+++ b/Mailman/MTA/Postfix.py
@@ -339,7 +339,7 @@ def checkperms(state):
owner = pwd.getpwuid(stat[ST_UID])[0]
except KeyError:
owner = 'uid %d' % stat[ST_UID]
- print _('%(dbfile)s owned by %(owner)s (must be owned by %(user)s')
+ print _('%(dbfile)s owned by %(owner)s (must be owned by %(user)s'),
state.ERRORS += 1
if state.FIX:
print _('(fixing)')
@@ -348,3 +348,12 @@ def checkperms(state):
os.chown(dbfile, uid, gid)
else:
print
+ if stat and (stat[ST_MODE] & targetmode) <> targetmode:
+ state.ERRORS += 1
+ octmode = oct(stat[ST_MODE])
+ print _('%(dbfile)s permissions must be 066x (got %(octmode)s)'),
+ if state.FIX:
+ print _('(fixing)')
+ os.chmod(dbfile, stat[ST_MODE] | targetmode)
+ else:
+ print