From: Daniel Golle Date: Thu, 26 Nov 2020 01:01:14 +0000 (+0000) Subject: jail: don't fail if can't mount-bind /etc/resolv.conf X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=19ac9df87738a3e694ce68c716c5bc80174440f8;p=project%2Fprocd.git jail: don't fail if can't mount-bind /etc/resolv.conf Signed-off-by: Daniel Golle --- diff --git a/jail/jail.c b/jail/jail.c index 34fec71..8c1b563 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -2696,13 +2696,13 @@ static void post_main(struct uloop_timeout *t) #endif if (!(opts.namespace & CLONE_NEWNET)) { - add_mount_bind("/etc/resolv.conf", 1, -1); + add_mount_bind("/etc/resolv.conf", 1, 0); } else if (opts.setns.net == -1) { char hostdir[PATH_MAX]; snprintf(hostdir, PATH_MAX, "/tmp/resolv.conf-%s.d", opts.name); mkdir_p(hostdir, 0755); - add_mount(hostdir, "/dev/resolv.conf.d", NULL, MS_BIND | MS_NOEXEC | MS_NOATIME | MS_NOSUID | MS_NODEV | MS_RDONLY, 0, NULL, -1); + add_mount(hostdir, "/dev/resolv.conf.d", NULL, MS_BIND | MS_NOEXEC | MS_NOATIME | MS_NOSUID | MS_NODEV | MS_RDONLY, 0, NULL, 0); } /* default mounts */