mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1168231 - Normalize file mode in jars. r=gps
This commit is contained in:
parent
9bf7b6e99e
commit
91f38690b4
@ -212,7 +212,20 @@ class File(BaseFile):
|
||||
if platform.system() == 'Windows':
|
||||
return None
|
||||
assert self.path is not None
|
||||
return os.stat(self.path).st_mode
|
||||
mode = os.stat(self.path).st_mode
|
||||
# Normalize file mode:
|
||||
# - keep file type (e.g. S_IFREG)
|
||||
ret = stat.S_IFMT(mode)
|
||||
# - expand user read and execute permissions to everyone
|
||||
if mode & 0400:
|
||||
ret |= 0444
|
||||
if mode & 0100:
|
||||
ret |= 0111
|
||||
# - keep user write permissions
|
||||
if mode & 0200:
|
||||
ret |= 0200
|
||||
# - leave away sticky bit, setuid, setgid
|
||||
return ret
|
||||
|
||||
class ExecutableFile(File):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user