Skip to content

bootloader: make creation of temporary directories AppContainer-aware - #8291

Merged
rokm merged 2 commits into
pyinstaller:developfrom
rokm:win-appcontainer-onefile
Feb 7, 2024
Merged

rokm merged 2 commits into
pyinstaller:developfrom
rokm:win-appcontainer-onefile

Conversation

@rokm

@rokm rokm commented Feb 7, 2024 •

Copy link
Copy Markdown
Member

Make bootloader codepaths involved in creation of temporary directories for onefile builds on Windows AppContainer-aware. If the process runs inside an AppContainer, the temporary directory's DACL needs to explicitly include the AppContainerSID, otherwise the directory becomes inaccessible to the process. This is bootloader equivalent of #8290.

Refactor pyi_win32_mkdir to use pre-initialized security descriptor, instead of constructing descriptor string and parsing it on each call. This also avoids querying user SID and AppContainer SID on every call.

rokm added 2 commits February 7, 2024 12:41
Refactor `pyi_win32_mkdir` to use pre-initialized security
descriptor, instead of constructing descriptor string and parsing
it on each call. This also avoids querying user SID on every call.

The shared security descriptor must be now explicitly initialized
using `pyi_win32_initialize_security_descriptor` before first call
to `pyi_win32_mkdir` is made, and freed using
`pyi_win32_free_security_descriptor` when not needed anymore (after
extraction to temporary directory is complete).
Make bootloader codepaths involved in creation of temporary
directories for `onefile` builds AppContainer-aware. If the process
runs inside an AppContainer, the temporary directory's DACL needs to
explicitly include the AppContainerSID, otherwise the directory
becomes inaccessible to the process.
@rokm
rokm merged commit 1516019 into pyinstaller:develop Feb 7, 2024
@rokm
rokm deleted the win-appcontainer-onefile branch February 7, 2024 17:07
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants