From: Daniel Golle Date: Sun, 19 Jul 2020 19:21:33 +0000 (+0100) Subject: jail: move /tmp/resolv.conf.d to /dev/resolv.conf.d X-Git-Url: http://git.openwrt.org/?p=project%2Fprocd.git;a=commitdiff_plain;h=f5f305e2973876e6f324127ed697a849dc6736e2 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 --- 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); } }