cmdline: stop overwriting --exec_file with positional argv[0]#269
Merged
robertswiecki merged 1 commit intoMay 28, 2026
Merged
Conversation
setupArgv() unconditionally called set_path(argv[optind]) when positional
arguments were present after --, clobbering any path previously set via
the -x / --exec_file flag. The intended behavior, documented in the help
text ("File to exec (default: argv[0])"), is for --exec_file to win and
fall back to argv[0] only when not given.
Remove the unconditional set_path; the existing fallback a few lines
below already sets the path from argv[0] when --exec_file was not
provided.
Member
Author
|
FYI @robertswiecki |
Collaborator
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When I bumped my
nsjailversion to the latest master, my remote execution backend suddenly failed to execute actions with errors like this:I traced this back to commit 91e692a ("net: support for network rules"), which seems to have accidentally introduced a regression in the handling of the
--exec_fileflag. It is now silently ignored whenever positional args are also passed:... ends up calling
execve("python3", …)instead ofexecve("/usr/bin/python3", …), which fails withENOENTfor me.Removing the unconditional
set_pathadded in that commit fixes it. The existing fallback below that code already handles the config-override case: if no-xwas given,has_path()is false, and the fallback sets the path from the positionalargv[0].Repro