diff options
| author | bwarsaw | 2002-11-05 03:03:13 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-11-05 03:03:13 +0000 |
| commit | e640507fd4045346ad763cb207f78044844f9bf1 (patch) | |
| tree | bacffb3f5eff814fc89e5cb4ac447e72e4ec15b3 /bin | |
| parent | db7546e94047096e8f0ece23ff5f36c4923da497 (diff) | |
| download | mailman-e640507fd4045346ad763cb207f78044844f9bf1.tar.gz mailman-e640507fd4045346ad763cb207f78044844f9bf1.tar.zst mailman-e640507fd4045346ad763cb207f78044844f9bf1.zip | |
checkwalk(): Make sure py, pyc, and pyo files are at least 644.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/check_perms | 11 |
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 |
