From 77a6782d6e4eba2c49e642672de134aff443ef72 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 12 Mar 2020 22:54:19 +0100 Subject: [PATCH] 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 --- jail/jail.c | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.25.1