aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_posix.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-08-15 12:19:07 +0200
committerTobias Markmann <tm@ayena.de>2009-08-15 12:19:07 +0200
commit9d799a32c82fe16655cc4996b9ac96538dc04ed9 (patch)
treed94ef3ee549775f92d94503e3661a1ef2d1e1f25 /plugins/mod_posix.lua
parent6a260eaa2cdffb9105c31a6967dfae78d6738a26 (diff)
downloadprosody-9d799a32c82fe16655cc4996b9ac96538dc04ed9.tar.gz
prosody-9d799a32c82fe16655cc4996b9ac96538dc04ed9.zip
Make mod_posix not complain about root user, if setuid is set to something different as root.
Diffstat (limited to 'plugins/mod_posix.lua')
-rw-r--r--plugins/mod_posix.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua
index a0830d82..0184ef36 100644
--- a/plugins/mod_posix.lua
+++ b/plugins/mod_posix.lua
@@ -40,10 +40,13 @@ module:add_event_hook("server-started", function ()
-- Don't even think about it!
module:add_event_hook("server-starting", function ()
- if pposix.getuid() == 0 and not config_get("*", "core", "run_as_root") then
- module:log("error", "Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!");
- module:log("error", "For more information on running Prosody as root, see http://prosody.im/doc/root");
- prosody.shutdown("Refusing to run as root");
+ local suid = config_get("*", "core", "setuid");
+ if not suid or suid == 0 or suid == "root" then
+ if pposix.getuid() == 0 and not config_get("*", "core", "run_as_root") then
+ module:log("error", "Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!");
+ module:log("error", "For more information on running Prosody as root, see http://prosody.im/doc/root");
+ prosody.shutdown("Refusing to run as root");
+ end
end
end);