From e640507fd4045346ad763cb207f78044844f9bf1 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 5 Nov 2002 03:03:13 +0000 Subject: checkwalk(): Make sure py, pyc, and pyo files are at least 644. --- bin/check_perms | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bin') 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 -- cgit v1.3.1