From: Daniel Golle Date: Thu, 12 Mar 2020 21:54:19 +0000 (+0100) Subject: jail: mount-bind /etc/resolv.conf for non-netns jails X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=77a6782d6e4eba2c49e642672de134aff443ef72;p=oweals%2Fprocd.git jail: mount-bind /etc/resolv.conf for non-netns jails Many applications won't work without name resolution and expect /etc/resolv.conf in place. While this is already handled for netns-jails, simply mount-bind /etc/resolv.conf for non-netns-jails. Signed-off-by: Daniel Golle --- diff --git a/jail/jail.c b/jail/jail.c index eb976cb..5414519 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -544,6 +544,10 @@ int main(int argc, char **argv) add_mount("/etc/passwd", 0, -1); add_mount("/etc/group", 0, -1); } + + if (!(opts.namespace & CLONE_NEWNET)) { + add_mount("/etc/resolv.conf", 0, -1); + } } if (opts.hostname)