aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-04-19 20:26:09 +0200
committerKim Alvefur <zash@zash.se>2017-04-19 20:26:09 +0200
commit1584f132bfc93e111548948e916cb1f2f6aa6587 (patch)
treea8141a5b313fcd38426d5c3d007018d3bb5af50b
parent71582ed712975252a9db4e99067ffdf048c6c419 (diff)
downloadprosody-1584f132bfc93e111548948e916cb1f2f6aa6587.tar.gz
prosody-1584f132bfc93e111548948e916cb1f2f6aa6587.zip
prosodyctl: Remove --root from arg array
-rwxr-xr-xprosodyctl4
1 files changed, 3 insertions, 1 deletions
diff --git a/prosodyctl b/prosodyctl
index 90e59991..63fd6485 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -141,7 +141,9 @@ local ok, pposix = pcall(require, "util.pposix");
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;