]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Only mount /etc/resolv.conf if it actually exists
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 11 Mar 2024 18:53:46 +0000 (19:53 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 11 Mar 2024 19:52:22 +0000 (20:52 +0100)
mkosi/sandbox.py

index c6098f49030a061f3e75a69914e5947d9e5a2131..2cfedb32fa1d0e763b0d73f9fcf4f3c3b53a05ba 100644 (file)
@@ -171,7 +171,7 @@ def sandbox_cmd(
     if scripts:
         cmdline += ["--ro-bind", scripts, "/scripts"]
 
-    if network and not relaxed:
+    if network and not relaxed and Path("/etc/resolv.conf").exists():
         cmdline += ["--bind", "/etc/resolv.conf", "/etc/resolv.conf"]
 
     # bubblewrap creates everything with a restricted mode so relax stuff as needed.