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

Backport spawn fixes to 9.2 #6568

Merged
merged 13 commits into from Feb 18, 2021
Merged

Backport spawn fixes to 9.2 #6568

merged 13 commits into from Feb 18, 2021

Conversation

headius
Copy link
Member

@headius headius commented Feb 18, 2021

This PR backports the spawn-related cleanup and fixes to 9.2 from #6226.

See also #6565.

This change helps make our sh-based chdir work properly without
us mashing the command + arguments together into a string that may
parse badly when passed to sh -c. The primary trick here is to use
sh to do the chdir followed by an exec of the explicit argument
list passed in. The chdir will run in the intermediate shell, as
with a fork/exec, and then the exec will receive the actual target
program and its arguments unpolluted.

With this change, the example from jruby#6153 works properly, and the
Ruby script is passed along without sh seeing it as part of a
shell script.
* Avoid having user values in $0 for sh.
* Use -- to terminate chdir argument list.
We'll do a CRuby exclude sweep soon.
This uncomments some paths that are not yet used but will be once
Windows support comes along.
@headius headius added this to the JRuby 9.2.15.0 milestone Feb 18, 2021
This allows platform, "travis", and "hangs" tags.
Tainting is deprecated and was never reliable as a security
mechanism.
@headius headius merged commit d752d3d into jruby:jruby-9.2 Feb 18, 2021
@headius headius deleted the spawn_fixes_9.2 branch February 18, 2021 19:19
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.

None yet

1 participant