Skip to content

Commit

Permalink
Merge pull request #5222 from benjaoming/fix-uid-check
Browse files Browse the repository at this point in the history
test getuid() == 0 instead of arbitrary 502
  • Loading branch information
benjaoming committed Jul 28, 2016
2 parents 4e1e996 + 82637c5 commit 6954468
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions kalite/distributed/management/commands/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,8 @@ def handle(self, *args, **options):
"--------------------------------------------------------------------------------")
raw_input("Press [enter] to continue...")

# Tried not to be os-specific, but ... hey. :-/
# benjaoming: This doesn't work, why is 502 hard coded!? Root is normally
# '0' And let's not care about stuff like this, people can be free to
# run this as root if they want :)
if not is_windows() and hasattr(os, "getuid") and os.getuid() == 502:
# Assuming uid '0' is always root
if not is_windows() and hasattr(os, "getuid") and os.getuid() == 0:
print(
"-------------------------------------------------------------------")
print("WARNING: You are installing KA-Lite as root user!")
Expand Down

0 comments on commit 6954468

Please sign in to comment.