jail: don't fail if can't mount-bind /etc/resolv.conf
authorDaniel Golle <daniel@makrotopia.org>
Thu, 26 Nov 2020 01:01:14 +0000 (01:01 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 27 Nov 2020 01:06:09 +0000 (01:06 +0000)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
jail/jail.c

index 34fec71a31b481e55207ead416c9450376ea42b5..8c1b5630cd6ac8ec3dba3312d7673b2870589071 100644 (file)
@@ -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 */