libcontainer: create Cwd when it does not exist#1604
Merged
crosbymichael merged 1 commit intoopencontainers:masterfrom Oct 5, 2017
Merged
libcontainer: create Cwd when it does not exist#1604crosbymichael merged 1 commit intoopencontainers:masterfrom
crosbymichael merged 1 commit intoopencontainers:masterfrom
Conversation
crosbymichael
requested changes
Oct 4, 2017
| } | ||
| } | ||
|
|
||
| // Setup Cwd before running the pre-start hooks, so that hooks can play with Cwd. |
Member
There was a problem hiding this comment.
why not do this right before chdir to the cwd when the rootfs is already setup and every other mount is done and we are jailed inside the rootfs?
Member
There was a problem hiding this comment.
That's what I was about to comment 😉. That way we don't need to use CleanPath we can just use MkdirAll and nothing else. If a hook wants to mess with the cwd, they could create it themselves.
The benefit for doing this within runc is that it works well with userns. Actually, runc already does the same thing for mount points. Signed-off-by: Akihiro Suda <[email protected]>
Member
Author
|
Updated PR. PTAL. @crosbymichael @cyphar However, I didn't do this right before |
Member
|
@AkihiroSuda That's fine, this should (semantically) be part of |
Member
Member
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.
The benefit for doing this within runc is that it works well with
userns.
Actually, runc already does the same thing for mount points.
discussed in containerd/containerd#1585 (cc @crosbymichael @estesp )
If this change is fine, I'll open a PR to runtime-spec correspondingly.
Signed-off-by: Akihiro Suda [email protected]