Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootloader: onefile: set executable bit only on extracted binaries #7950

Merged
merged 3 commits into from Sep 22, 2023

Conversation

rokm
Copy link
Member

@rokm rokm commented Sep 22, 2023

When extracting files from onefile archive, restore the executable bits only on binary files (those that were collected with TOC type codes EXECUTABLE, BINARY, or EXTENSION˙, which all end up having PKG type code b`), as opposed to all files.

Binaries are now extracted with permissions bit set to 0700, while other files are extracted with permissions bit set to 0600.

This synchronizes onefile mode with onedir mode in terms of files that end up with executable bit being set.

When extracting files from onefile archive, restore the executable
bits only on binary files (those that were collected with TOC type
codes `EXECUTABLE`, `BINARY`, or `EXTENSION˙, which all end up
having PKG type code `b`), as opposed to all files.

Binaries are now extracted with permissions bit set to `0700`,
while other files are extracted with permissions bit set to `0600`.
@rokm rokm force-pushed the bootloader-onefile-executable-bit branch from fe8ace8 to 91a8fe3 Compare September 22, 2023 17:17
@rokm rokm changed the title bootloader: onefile: set executable bits only on extracted binaries bootloader: onefile: set executable bit only on extracted binaries Sep 22, 2023
Add a test to ensure that we preserve the executable bit on
collected shell script (a data file with executable bit set).
Add special handling for data files with executable bit set (such
as shell scripts).

In `COLLECT` and `BUNDLE`, we now set mode `0755` if typecode
matches the one for binary type OR if the source file has an
executable bit set.

In `PKG`, we manually force the PKG typecode for DATA entries to
`b` ("binary") if source file has an executable bit set.
@rokm rokm force-pushed the bootloader-onefile-executable-bit branch from 1a65dfa to 227b648 Compare September 22, 2023 19:43
@rokm rokm merged commit 87cda61 into pyinstaller:develop Sep 22, 2023
18 checks passed
@rokm rokm deleted the bootloader-onefile-executable-bit branch September 22, 2023 22:17
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2023
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.

None yet

2 participants