You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ro...@apache.org on 2020/12/29 13:41:15 UTC

[buildstream] 02/02: sandbox/_sandboxbwrap.py: Bind mount /etc/resolv.conf for bst shell

This is an automated email from the ASF dual-hosted git repository.

root pushed a commit to branch juerg/gnome
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 1912d0e4b80adf2a86869f8099838f38e7407d56
Author: Jürg Billeter <j...@bitron.ch>
AuthorDate: Thu Feb 8 07:38:43 2018 +0100

    sandbox/_sandboxbwrap.py: Bind mount /etc/resolv.conf for bst shell
    
    Fixes #241
---
 buildstream/sandbox/_sandboxbwrap.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/buildstream/sandbox/_sandboxbwrap.py b/buildstream/sandbox/_sandboxbwrap.py
index 75250df..cca597a 100644
--- a/buildstream/sandbox/_sandboxbwrap.py
+++ b/buildstream/sandbox/_sandboxbwrap.py
@@ -96,7 +96,9 @@ class SandboxBwrap(Sandbox):
         # complete, root is remounted as RO
         bwrap_command += ["--bind", root_mount_source, "/"]
 
-        if not flags & SandboxFlags.NETWORK_ENABLED:
+        if flags & SandboxFlags.NETWORK_ENABLED:
+            bwrap_command += ['--ro-bind', '/etc/resolv.conf', '/etc/resolv.conf']
+        else:
             bwrap_command += ['--unshare-net']
             bwrap_command += ['--unshare-uts', '--hostname', 'buildstream']
             bwrap_command += ['--unshare-ipc']