pmbootstrap: Disallow running as root (#1120)

This commit is contained in:
Oliver Smith 2018-01-14 08:13:35 +00:00 committed by GitHub
parent 1992f37036
commit 4715c0f1bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -37,8 +37,10 @@ def main():
# Wrap everything to display nice error messages
try:
# Sanity check
# Sanity checks
other.check_grsec(args)
if not args.as_root and os.geteuid() == 0:
raise RuntimeError("Do not run pmbootstrap as root!")
# Initialize or require config
if args.action == "init":