aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-05-03 01:11:21 +0100
committerMatthew Wild <mwild1@gmail.com>2009-05-03 01:11:21 +0100
commit67c94f50f4dfd8d3f3de0e84bafb56d37d5cdd83 (patch)
tree7aac7e2c38a5a98eb1c3d84103800a3a9e09e9d9 /plugins
parent29b41d9efd7e4a84f043b38cfdb51893a4504616 (diff)
parent7be3d9f227ff8083e396497507dbdfe9a6049ca8 (diff)
downloadprosody-67c94f50f4dfd8d3f3de0e84bafb56d37d5cdd83.tar.gz
prosody-67c94f50f4dfd8d3f3de0e84bafb56d37d5cdd83.zip
Merge with 0.4
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_posix.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua
index b1c7e01b..e6f17cc1 100644
--- a/plugins/mod_posix.lua
+++ b/plugins/mod_posix.lua
@@ -14,6 +14,15 @@ local logger_set = require "util.logger".setwriter;
module.host = "*"; -- we're a global module
+-- 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");
+ _G.prosody_shutdown("Refusing to run as root");
+ end
+ end);
+
local pidfile_written;
local function remove_pidfile()