Commit 8141b780 authored by maruel@chromium.org's avatar maruel@chromium.org

Make checkperms.py look for shebang.

This should enable removing most (if not all) of the whitelist.

R=thestig@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/10083003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132258 0039d316-1c4b-4281-b951-d872f2087c98
parent 2db9bd7f
......@@ -177,6 +177,12 @@ def CheckFile(file_path):
return 'Failed to stat file: %s' % e
if EXECUTABLE_PERMISSION & st_mode:
# Look if the file starts with #!/
with open(file_path, 'rb') as f:
if f.read(3) == '#!/':
# That's fine.
return None
# TODO(maruel): Check that non-executable file do not start with a shebang.
error = 'Contains executable permission'
if VERBOSE:
return '%s: %06o' % (error, st_mode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment