fix(01-05): retain executable permissions in offline copies

Preserve source read/write/execute bits without privileged mode bits. Verify copied Linux apphost byte identity and permissions.
This commit is contained in:
UnixNight committed 2026-11-13 11:43:51 -05:00
1 parent 857466568d
commit aa4b862a12
2 files changed
+11

No files matched your search

+8
View File
@@ -174,6 +174,14 @@ class FidelityCheckpoint(unittest.TestCase):
self.assertEqual({r['side'] for r in agenda['runs']}, self.assertEqual({r['side'] for r in agenda['runs']},
{'original-windows-dxwnd', 'port-windows-native'}) {'original-windows-dxwnd', 'port-windows-native'})
def test_package_copy_preserves_source_execution_permissions(self):
apphost = self.packages['linux-x64'] / 'GamePort'
apphost.chmod(0o755)
self.prepare()
copied = self.output / 'port/linux-x64/GamePort'
self.assertEqual(copied.stat().st_mode & 0o777, apphost.stat().st_mode & 0o777)
self.assertEqual(receipts.identify_file(copied), receipts.identify_file(apphost))
def test_skip_abort_remain_open_schema_valid_results(self): def test_skip_abort_remain_open_schema_valid_results(self):
self.prepare() self.prepare()
for status in ('skipped', 'aborted'): for status in ('skipped', 'aborted'):
+3
View File
@@ -35,6 +35,9 @@ def _copy_file(source, target):
shutil.copyfile(source, target) shutil.copyfile(source, target)
if identify_file(source) != identify_file(target): if identify_file(source) != identify_file(target):
raise ValueError('Source changed during copy: ' + str(source)) raise ValueError('Source changed during copy: ' + str(source))
# Byte-identical Unix apphosts still need their source execution permission.
# Do not propagate setuid/setgid/sticky bits into a generated checkpoint.
target.chmod(Path(source).stat().st_mode & 0o777)
def _copy_tree(source, target): def _copy_tree(source, target):