-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add support for escaping resolv.conf symlinks #318
Add support for escaping resolv.conf symlinks #318
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]>
PTAL @AkihiroSuda @giuseppe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@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. |
Thank you, released v1.2.1 |
Thank you for this PR! It's great to see support for escaping |
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