From f5f305e2973876e6f324127ed697a849dc6736e2 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 19 Jul 2020 20:21:33 +0100 Subject: [PATCH] jail: move /tmp/resolv.conf.d to /dev/resolv.conf.d OCI spec implicitely intends /dev to be used as tmpfs mounted by default while /tmp may not be mounted or may not even exist. Hence move /tmp/resolv.conf.d to /dev/resolv.conf.d inside container. Signed-off-by: Daniel Golle --- jail/jail.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jail/jail.c b/jail/jail.c index 62da3ec..a9f473e 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -585,7 +585,7 @@ static int build_jail_fs(void) if (overlaydir) unlink(jaillink); - symlink("../tmp/resolv.conf.d/resolv.conf.auto", jaillink); + symlink("../dev/resolv.conf.d/resolv.conf.auto", jaillink); } run_hooks(opts.hooks.createContainer); @@ -2051,7 +2051,7 @@ int main(int argc, char **argv) snprintf(hostdir, PATH_MAX, "/tmp/resolv.conf-%s.d", opts.name); mkdir_p(hostdir, 0755); - add_mount(hostdir, "/tmp/resolv.conf.d", NULL, MS_BIND | MS_NOEXEC | MS_NOATIME | MS_NOSUID | MS_NODEV | MS_RDONLY, NULL, -1); + add_mount(hostdir, "/dev/resolv.conf.d", NULL, MS_BIND | MS_NOEXEC | MS_NOATIME | MS_NOSUID | MS_NODEV | MS_RDONLY, NULL, -1); } } -- 2.30.2