summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Leeming <andrew.leeming@codethink.co.uk>2016-10-24 16:37:43 +0100
committerAndrew Leeming <andrew.leeming@codethink.co.uk>2016-11-08 13:36:21 +0000
commitb3d8018df26f5577d24f9d57f52163696d8b2539 (patch)
treeb54cda7332b0317fe2955f3671af8869251705eb
parent86994916ada28006394f168999e72b719ba876d4 (diff)
downloadybd-b3d8018df26f5577d24f9d57f52163696d8b2539.tar.gz
Patch for bubblewrap backend
Since Bubblewrap is able to run without root permissions, the alert that YBD shows when running non-root has been modified to pass if sandboxlib backend is bubblewrap. /dev is also explicitly listed as a mount in bootstrap mode due to the way bubblewrap arguments need to be listed (dev is special)
-rw-r--r--ybd/app.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/ybd/app.py b/ybd/app.py
index 4261569..4403605 100644
--- a/ybd/app.py
+++ b/ybd/app.py
@@ -35,11 +35,9 @@ except ImportError:
riemann_available = False
import sys
-# FIXME sandboxlib-bubblewrap not in pypi yet. Checkout locally and set path
-SANDBOX_LIB_PATH = "/home/andrewleeming/baserock/sandboxlib"
-sys.path.insert(0, SANDBOX_LIB_PATH)
-import sandboxlib
import sandbox
+import sandboxlib
+
config = {}
defs = {}
@@ -167,7 +165,7 @@ def setup(args, original_cwd=""):
os.path.join(os.path.dirname(__file__), 'config', 'ybd.conf')])
# chroot and linux_user_chroot both need to be run as root
- if sandbox.executor in [sandboxlib.chroot,sandboxlib.linux_user_chroot] \
+ if sandbox.executor in [sandboxlib.chroot, sandboxlib.linux_user_chroot] \
and not os.geteuid() == 0 and config.get('mode') == 'normal':
log('SETUP', '%s needs root permissions' % sys.argv[0], exit=True)