зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1168231 - Normalize file mode in jars. r=gps
This commit is contained in:
Родитель
c42da15045
Коммит
2818f32729
|
@ -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):
|
||||
'''
|
||||
|
|
Загрузка…
Ссылка в новой задаче