From cfe603f34288ec9fe38eb6c57cb2e80675d4ddb2 Mon Sep 17 00:00:00 2001 From: Rohitt Vashishtha Date: Thu, 15 Nov 2018 10:00:47 +0000 Subject: [PATCH] scripts: Make manage.py use root checking from zulip_tools. --- manage.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manage.py b/manage.py index 83164e8190..d61be1e1d6 100755 --- a/manage.py +++ b/manage.py @@ -6,11 +6,10 @@ import types BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) import scripts.lib.setup_path_on_import +from scripts.lib.zulip_tools import script_should_not_be_root if __name__ == "__main__": - if 'posix' in os.name and os.geteuid() == 0: - print("manage.py should not be run as root. Use `su zulip` to drop root.") - sys.exit(1) + script_should_not_be_root() if (os.access('/etc/zulip/zulip.conf', os.R_OK) and not os.access('/etc/zulip/zulip-secrets.conf', os.R_OK)): # The best way to detect running manage.py as another user in