[jhbuild] Forbid running jhbuild as root



commit 8102e7abcb4aac23a1d2788ad5f53c9da7d64d2d
Author: Frédéric Péters <fpeters 0d be>
Date:   Wed Jun 9 19:54:13 2010 +0200

    Forbid running jhbuild as root
    
    This change has been sponsored by Ubuntu Forums.

 jhbuild/main.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/jhbuild/main.py b/jhbuild/main.py
index adba7e0..5c3ec35 100644
--- a/jhbuild/main.py
+++ b/jhbuild/main.py
@@ -94,6 +94,10 @@ def main(args):
         localedir = None
     gettext.install('jhbuild', localedir=localedir, unicode=True)
 
+    if hasattr(os, 'getuid'):
+        sys.stderr.write(_('You should not run jhbuild as root.\n').encode(_encoding, 'replace'))
+        sys.exit(1)
+
     logging.getLogger().setLevel(logging.INFO)
     logging_handler = logging.StreamHandler()
     logging_handler.setFormatter(LoggingFormatter())



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