set_executable can set S_IX{GRP,OTH} (#3742)

`set_executable` now checks if a user/group.other had read permission
on a file and if it does then it sets the corresponding executable
bit.

See #1483.
This commit is contained in:
George Hartzell 2017-04-06 14:25:13 -07:00 committed by Adam J. Stewart
parent a526bcaf11
commit 84208523f9

View File

@ -394,8 +394,14 @@ def traverse_tree(source_root, dest_root, rel_path='', **kwargs):
def set_executable(path):
st = os.stat(path)
os.chmod(path, st.st_mode | stat.S_IEXEC)
mode = os.stat(path).st_mode
if mode & stat.S_IRUSR:
mode |= stat.S_IXUSR
if mode & stat.S_IRGRP:
mode |= stat.S_IXGRP
if mode & stat.S_IROTH:
mode |= stat.S_IXOTH
os.chmod(path, mode)
def remove_dead_links(root):