Windows AppContainer: Python private temporary directories exclude the package SID #35

Open
opened 2026-11-16 00:42:23 +00:00 by futondestroyer · 0 comments
Member

Failure

A Windows AppContainer worker on official nightly-56-bd292bbd accepted the tester-specific PR 815 ticket successfully, then failed before compiling the shared main base. No gameplay or RT measurements occurred.

Farm report: https://beanstalk.magicbean.dev/reports/rp_c19169027a9a2c13
Retry request: MagicBeanDev/Longshot#815 (comment)

The new build log from PR 28 shows nx2/make_game.py check_mingw entering tempfile.TemporaryDirectory(), then failing to open t.c inside the newly created directory. Cleanup also fails to list/chmod that directory. This is distinct from the parent-stat error fixed by PR 25 and the tester-ticket error fixed by PR 31.

Game-free reproduction and ACL evidence

Managed Python 3.14.7, Windows 10.0.26300, agent AppContainer with no capabilities. Inside an already granted writable fixture directory:

import os
for mode in (0o777, 0o700):
    d = os.path.join(writable_fixture, 'case-' + oct(mode))
    os.mkdir(d, mode)
    with open(os.path.join(d, 'probe.txt'), 'w') as f:
        f.write('made-up fixture')
  • 0o777: directory creation and child write pass. Host ACL inspection: DACL is not protected; one AppContainer SID ACE is present.
  • 0o700: directory creation succeeds, child open fails with PermissionError. Host ACL inspection: protected DACL, zero AppContainer SID ACEs.
  • Existing and nested makedirs with default mode still pass; parent listing, sibling reads/writes and sibling stat remain denied as intended.

Python documents the Windows-specific owner/administrator ACL applied for mode 0o700: https://docs.python.org/3.14/library/os.html#os.mkdir. The observed protected ACL excludes the package SID needed for AppContainer access.

Additional temp-path observation

PR 28's diagnostic also shows TEMP/TMP arriving in Python as a redirected package AC/Temp path beneath the synthetic job home. That path and the local Temp fallback do not exist. Python falls back to the writable source checkout, where ordinary file/directory probes pass, but a private TemporaryDirectory immediately becomes unusable as above. Creating a valid temp root alone should not be assumed to resolve the protected-child-ACL issue; both need regression coverage.

Required acceptance

A safe fix should preserve the no-network AppContainer and private work/profile boundaries, cover private tempfile directory create/write/cleanup in a real AppContainer (not only ordinary mkdir), and complete the base build through a normal approved farm ticket. Do not work around this by granting the drive/profile broadly, disabling the sandbox or downgrading to an unpatched Python.

Only made-up local fixture files were used for the reproduction. The worker remains on the official signed release with its visible GUI and testing enabled; no permission workaround was installed.

## Failure A Windows AppContainer worker on official nightly-56-bd292bbd accepted the tester-specific PR 815 ticket successfully, then failed before compiling the shared main base. No gameplay or RT measurements occurred. Farm report: https://beanstalk.magicbean.dev/reports/rp_c19169027a9a2c13 Retry request: https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/815#issuecomment-31349 The new build log from PR 28 shows nx2/make_game.py check_mingw entering tempfile.TemporaryDirectory(), then failing to open t.c inside the newly created directory. Cleanup also fails to list/chmod that directory. This is distinct from the parent-stat error fixed by PR 25 and the tester-ticket error fixed by PR 31. ## Game-free reproduction and ACL evidence Managed Python 3.14.7, Windows 10.0.26300, agent AppContainer with no capabilities. Inside an already granted writable fixture directory: ```python import os for mode in (0o777, 0o700): d = os.path.join(writable_fixture, 'case-' + oct(mode)) os.mkdir(d, mode) with open(os.path.join(d, 'probe.txt'), 'w') as f: f.write('made-up fixture') ``` - 0o777: directory creation and child write pass. Host ACL inspection: DACL is not protected; one AppContainer SID ACE is present. - 0o700: directory creation succeeds, child open fails with PermissionError. Host ACL inspection: protected DACL, zero AppContainer SID ACEs. - Existing and nested makedirs with default mode still pass; parent listing, sibling reads/writes and sibling stat remain denied as intended. Python documents the Windows-specific owner/administrator ACL applied for mode 0o700: https://docs.python.org/3.14/library/os.html#os.mkdir. The observed protected ACL excludes the package SID needed for AppContainer access. ## Additional temp-path observation PR 28's diagnostic also shows TEMP/TMP arriving in Python as a redirected package AC/Temp path beneath the synthetic job home. That path and the local Temp fallback do not exist. Python falls back to the writable source checkout, where ordinary file/directory probes pass, but a private TemporaryDirectory immediately becomes unusable as above. Creating a valid temp root alone should not be assumed to resolve the protected-child-ACL issue; both need regression coverage. ## Required acceptance A safe fix should preserve the no-network AppContainer and private work/profile boundaries, cover private tempfile directory create/write/cleanup in a real AppContainer (not only ordinary mkdir), and complete the base build through a normal approved farm ticket. Do not work around this by granting the drive/profile broadly, disabling the sandbox or downgrading to an unpatched Python. Only made-up local fixture files were used for the reproduction. The worker remains on the official signed release with its visible GUI and testing enabled; no permission workaround was installed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Beanstalk#35
No description provided.