Add support for escaping resolv.conf symlinks#318
Merged
AkihiroSuda merged 3 commits intorootless-containers:masterfrom Aug 17, 2023
Merged
Add support for escaping resolv.conf symlinks#318AkihiroSuda merged 3 commits intorootless-containers:masterfrom
AkihiroSuda merged 3 commits intorootless-containers:masterfrom
Conversation
b8b5b23 to
f5c4a92
Compare
Signed-off-by: Jason T. Greene <[email protected]>
94a57ff to
6d6620d
Compare
Signed-off-by: Jason T. Greene <[email protected]>
Contributor
Author
|
PTAL @AkihiroSuda @giuseppe |
AkihiroSuda
reviewed
Aug 17, 2023
Previously if resolv.conf was symlinked to a location other than /etc, or /run, a warning message would be printed and DNS would be non-functional. Instead, attempt to bind an equiavlent resolv.conf link target path in the namespace structure, so that symlink continues to function, and DNS remains operational. Signed-off-by: Jason T. Greene <[email protected]>
Contributor
Author
|
@AkihiroSuda you're welcome! Thanks for including this in your 1.2.1 release plans! It will be great to get this one out to users. |
Member
|
Thank you for this PR! It's great to see support for escaping |
This was referenced Dec 24, 2023
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.
Previously if resolv.conf was symlinked to a location other than /etc, or /run, a warning message would be printed and DNS would be non-functional.
Instead, attempt to bind an equivalent resolv.conf link target path in the namespace structure, so that symlink continues to function, and DNS remains operational.
This fixes usage in WSL environments which symlinks /etc/resolv.conf under a shared location under /mnt. Although I suspect this usage pattern is fairly common in other environments.
Alternatively, instead of mirroring the target path, this could have utilized the newer open_tree/move_mount syscalls, to bind mount on top of the /etc/resolv.conf symlink. However, this would have limited the support to 5.2 kernels and later, so just cloning the target seemed the way to go.
Note: this PR also includes some commits to fix CI