aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2017-04-19 12:40:03 +0100
committerMatthew Wild <mwild1@gmail.com>2017-04-19 12:40:03 +0100
commit91a21b8f754027ff4b401a93c6be0c9d89d00183 (patch)
tree7999ce2b758b3fcd4a9f0e6ebd987a01900f2733
parent193ed93b1c8c8bd4024baa2697cbb8efe7ec3bc1 (diff)
downloadprosody-91a21b8f754027ff4b401a93c6be0c9d89d00183.tar.gz
prosody-91a21b8f754027ff4b401a93c6be0c9d89d00183.zip
prosodyctl: Don't switch user if we are root and run_as_root is enabled
-rwxr-xr-xprosodyctl2
1 files changed, 1 insertions, 1 deletions
diff --git a/prosodyctl b/prosodyctl
index efdc214c..c8accd82 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -141,7 +141,7 @@ 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 then
+ if current_uid == 0 and config.get("*", "run_as_root") ~= true then
-- We haz root!
local desired_user = config.get("*", "prosody_user") or "prosody";
local desired_group = config.get("*", "prosody_group") or desired_user;