Conversation
This tests checks that "runc exec --env VAR=VAR ..." actually appends VAR=VAL to the exec's environment. Add additional checks that: - process.env from config.json is also inherited; - HOME is set. Those checks do not reveal any new issues. (cherry picked from commit 6210ceb) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
All existing tests check runc run, and there is no single runc exec environment test except for one in exec.bats. Add it (no new issues found). (cherry picked from commit d530786) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Before commit 7dc2486, when process.env was nil, prepareEnv returned a flag telling HOME is not set, and it was added. Commit 7dc2486 moved the functionality of adding HOME into prepareEnv but did not properly handle nil case. As a result, runc exec -p with process.json having no env set resulted in an exec with no HOME set. Fix this, and add unit and integration tests. Fixes: 7dc2486 ("libct: switch to numeric UID/GID/groups") (cherry picked from commit 321073e) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
AkihiroSuda
approved these changes
Sep 14, 2026
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.
Backport of #5266 to release-1.5. Original description follows.
runc exec -p: fix adding HOME to nil env
Before commit 7dc2486, when process.env was nil, prepareEnv
returned a flag telling HOME is not set, and it was added.
Commit 7dc2486 moved the functionality of adding HOME into
prepareEnv but did not properly handle nil case. As a result,
runc exec -p with process.json having no env set resulted in
an exec with no HOME set.
Fix this, and add unit and integration tests.
Fixes: 7dc2486 ("libct: switch to numeric UID/GID/groups")
Fixes: runc exec -p with absent env doesn't add HOME (regression in v1.3.0) #5265.
Misc related tests additions (no new issues found).