Commit c59577a4 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Make build_utils.ZipDir() preserve group and other executable bits too.

Apparenly preserving the user x bit isn't enough for remoting's installer.
Follow-up to https://chromium-review.googlesource.com/c/chromium/src/+/1301793

Bug: 900303,875279,870611
Change-Id: Ibbdf71b1d33941b0d6bde5e6cc3c964404a653c0
Reviewed-on: https://chromium-review.googlesource.com/c/1308759Reviewed-by: default avataragrieve <agrieve@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604198}
parent e476c627
...@@ -325,8 +325,11 @@ def AddToZipHermetic(zip_file, zip_path, src_path=None, data=None, ...@@ -325,8 +325,11 @@ def AddToZipHermetic(zip_file, zip_path, src_path=None, data=None,
# external_attr = (os.stat(src_path)[0] & 0xFFFF) << 16L # external_attr = (os.stat(src_path)[0] & 0xFFFF) << 16L
# but we want to use _HERMETIC_FILE_ATTR, so manually set # but we want to use _HERMETIC_FILE_ATTR, so manually set
# the few attr bits we care about. # the few attr bits we care about.
if src_path and os.access(src_path, os.X_OK): if src_path:
zipinfo.external_attr |= stat.S_IXUSR << 16L st = os.stat(src_path)
for mode in (stat.S_IXUSR, stat.S_IXGRP, stat.S_IXOTH):
if st.st_mode & mode:
zipinfo.external_attr |= mode << 16L
if src_path: if src_path:
with open(src_path, 'rb') as f: with open(src_path, 'rb') as f:
......
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