# HG changeset patch # User Kim Alvefur # Date 1492626369 -7200 # Node ID ee1c8145034530e83c41186e1a6137b7f70deae7 # Parent e24263db33800483a45925a14c50e04974dcb4ec prosodyctl: Remove --root from arg array diff -r e24263db3380 -r ee1c81450345 prosodyctl --- a/prosodyctl Wed Apr 19 20:02:58 2017 +0200 +++ b/prosodyctl Wed Apr 19 20:26:09 2017 +0200 @@ -141,7 +141,9 @@ if ok and pposix then if pposix._VERSION ~= want_pposix_version then print(string.format("Unknown version (%s) of binary pposix module, expected %s", tostring(pposix._VERSION), want_pposix_version)); return; end current_uid = pposix.getuid(); - if current_uid == 0 and config.get("*", "run_as_root") ~= true and arg[1] ~= "--root" then + local arg_root = arg[1] == "--root"; + if arg_root then table.remove(arg, 1); end + if current_uid == 0 and config.get("*", "run_as_root") ~= true and not arg_root then -- We haz root! local desired_user = config.get("*", "prosody_user") or "prosody"; local desired_group = config.get("*", "prosody_group") or desired_user;