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

Support running interpreter scripts #7

Merged
merged 2 commits into from
Jun 23, 2020
Merged

Support running interpreter scripts #7

merged 2 commits into from
Jun 23, 2020

Conversation

iliana
Copy link
Member

@iliana iliana commented Jun 23, 2020

If the program starts with #! (a shebang or hash-bang), the kernel will (almost always; depends if BINFMT_SCRIPT is enabled) determine which interpreter to exec and pass the script along as the first argument. In this case, the argument will be /proc/self/fd/{}, which gets closed if MFD_CLOEXEC is set.

We now check for #! and only set MFD_CLOEXEC if it's not there.

cc @tjkirch, @webern

If the program starts with `#!` (a shebang or hash-bang), the kernel
will (almost always; depends if `BINFMT_SCRIPT` is enabled) determine
which interpreter to exec and pass the script along as the first
argument. In this case, the argument will be `/proc/self/fd/{}`, which
gets closed if MFD_CLOEXEC is set.

We now check for `#!` and only set MFD_CLOEXEC if it's not there.
@iliana iliana changed the title Shebang Support running interpreter scripts Jun 23, 2020
@iliana
Copy link
Member Author

iliana commented Jun 23, 2020

bors r=iliana,webern,tjkirch

@bors
Copy link
Contributor

bors bot commented Jun 23, 2020

Build succeeded:

@bors bors bot merged commit 9cc5c27 into magick Jun 23, 2020
@iliana iliana deleted the shebang branch March 26, 2024 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants