[jhbuild] Allow running jhbuild as root



commit dc4e4e6ff28d9a7a3acd3e09298406f2d7a45eee
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Jun 20 19:39:08 2017 +0100

    Allow running jhbuild as root
    
    In some environments, like a Docker container, it's perfectly acceptable
    to run Jhbuild as root; in some case, it's actually required in order to
    work at all without hacking around the file permissions.
    
    For this reason, we should modify the UID check performed at startup,
    and if there is a specific variable in the environment, keep running
    even as root.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783965

 jhbuild/main.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/jhbuild/main.py b/jhbuild/main.py
index a5cf99b..dd72259 100644
--- a/jhbuild/main.py
+++ b/jhbuild/main.py
@@ -94,7 +94,7 @@ def main(args):
         localedir = None
     gettext.install('jhbuild', localedir=localedir, unicode=True)
 
-    if hasattr(os, 'getuid') and os.getuid() == 0:
+    if not 'JHBUILD_RUN_AS_ROOT' in os.environ and hasattr(os, 'getuid') and os.getuid() == 0:
         sys.stderr.write(_('You should not run jhbuild as root.\n').encode(_encoding, 'replace'))
         sys.exit(1)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]