Merge pull request #452 from espidev/master

Change detecting sudo priviliges to check if process euid is 0
This commit is contained in:
boltgolt 2020-12-02 21:50:18 +01:00 committed by GitHub
commit 75ce383207
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,7 +80,7 @@ builtins.howdy_user = args.user
# Check if we have rootish rights
# This is this far down the file so running the command for help is always possible
if os.getenv("SUDO_USER") is None:
if not os.geteuid()==0:
print("Please run this command as root:\n")
print("\tsudo howdy " + " ".join(sys.argv[1:]))
sys.exit(1)