summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/check_perms11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/check_perms b/bin/check_perms
index c3f2ef926..c45a8de9b 100755
--- a/bin/check_perms
+++ b/bin/check_perms
@@ -64,6 +64,7 @@ STATE = State()
DIRPERMS = S_ISGID | S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH
QFILEPERMS = S_ISGID | S_IRWXU | S_IRWXG
+PYFILEPERMS = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
@@ -119,6 +120,16 @@ def checkwalk(arg, dirname, names):
os.chmod(path, mode | targetperms)
else:
print
+ elif os.path.splitext(path)[1] in ('.py', '.pyc', '.pyo'):
+ octperms = oct(PYFILEPERMS)
+ if mode & PYFILEPERMS <> PYFILEPERMS:
+ print _('source perms must be %(octperms)s: %(path)s'),
+ arg.ERRORS += 1
+ if STATE.FIX:
+ print _('(fixing)')
+ os.chmod(path, mode | PYFILEPERMS)
+ else:
+ print
def checkall():
# first check PREFIX