0

Add warning if Overviewer is run as root

This commit is contained in:
Nicolas F
2014-10-18 17:44:59 +02:00
parent 00c2782bf5
commit 3c3db5d909

View File

@@ -50,6 +50,16 @@ def main():
# bootstrap the logger with defaults
logger.configure()
if os.name == "posix":
if os.geteuid() == 0:
logging.warning("You are running Overviewer as root. "
"It is recommended that you never do this, "
"as it is dangerous for your system. If you are running "
"into permission errors, fix your file/directory "
"permissions instead. Overviewer does not need access to "
"critical system resources and therefore does not require "
"root access.")
try:
cpus = multiprocessing.cpu_count()
except NotImplementedError: