jail: replace /etc/resolv.conf with symlink in extroot+overlay
authorDaniel Golle <daniel@makrotopia.org>
Mon, 13 Apr 2020 01:03:53 +0000 (02:03 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 13 Apr 2020 01:05:42 +0000 (02:05 +0100)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
jail/jail.c

index 052a78e59ccc2be40f632fe7fa1a9e399f88ccc7..87b671befb4b9a4a2b869647516b33f15a528aff 100644 (file)
@@ -254,6 +254,8 @@ static int build_jail_fs(void)
                snprintf(jailetc, PATH_MAX, "%s/etc", jail_root);
                mkdir_p(jailetc, 0755);
                snprintf(jaillink, PATH_MAX, "%s/etc/resolv.conf", jail_root);
+               if (overlaydir)
+                       unlink(jaillink);
                symlink("../tmp/resolv.conf.d/resolv.conf.auto", jaillink);
        }