diff options
author | Andrew Leeming <andrew.leeming@codethink.co.uk> | 2016-10-24 16:37:43 +0100 |
---|---|---|
committer | GitLab <gitlab@gitlab.com> | 2016-10-26 11:46:03 +0000 |
commit | 08b699b0f026078424d846f74f037b5ed9ee464e (patch) | |
tree | 500b0fec53050111eb4a6c9f5863de05a94fc385 /ybd/app.py | |
parent | 4e3a725db190e4416bf1578e47c8304ba82876e4 (diff) | |
download | ybd-08b699b0f026078424d846f74f037b5ed9ee464e.tar.gz |
Patch for bubblewrap backendleeming/bwrap-dev-patch
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)
Diffstat (limited to 'ybd/app.py')
-rw-r--r-- | ybd/app.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -34,6 +34,8 @@ try: except ImportError: riemann_available = False +import sandbox +import sandboxlib config = {} defs = {} @@ -160,7 +162,9 @@ def setup(args, original_cwd=""): os.path.join(os.path.dirname(__file__), '..', 'ybd.conf'), os.path.join(os.path.dirname(__file__), 'config', 'ybd.conf')]) - if not os.geteuid() == 0 and config.get('mode') == 'normal': + # chroot and linux_user_chroot both need to be run as root + 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) if config.get('kbas-url', 'http://foo.bar/') == 'http://foo.bar/': |