X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=prosodyctl;h=8fa12807d1832db705e9decd9e1e16f9d268fa51;hb=a1d7c415c23f8ba63feea6e1ca71fbb5e60290dc;hp=9bb8d4ad7173137887bd36d9e00b8e36d3eaf245;hpb=fb5391005fe7b5e644688b2b86f8c157e2fb002c;p=prosody.git diff --git a/prosodyctl b/prosodyctl index 9bb8d4ad..8fa12807 100755 --- a/prosodyctl +++ b/prosodyctl @@ -79,7 +79,7 @@ require "util.datamanager".set_data_path(data_path); -- Switch away from root and into the prosody user -- local switched_user, current_uid; -local want_pposix_version = "0.3.3"; +local want_pposix_version = "0.3.5"; local ok, pposix = pcall(require, "util.pposix"); if ok and pposix then @@ -90,6 +90,9 @@ if ok and pposix then local desired_user = config.get("*", "core", "prosody_user") or "prosody"; local desired_group = config.get("*", "core", "prosody_group") or desired_user; local ok, err = pposix.setgid(desired_group); + if ok then + ok, err = pposix.initgroups(desired_user); + end if ok then ok, err = pposix.setuid(desired_user); if ok then @@ -157,6 +160,7 @@ local error_messages = setmetatable({ ["no-such-user"] = "The given user does not exist on the server"; ["unable-to-save-data"] = "Unable to store, perhaps you don't have permission?"; ["no-pidfile"] = "There is no 'pidfile' option in the configuration file, see http://prosody.im/doc/prosodyctl#pidfile for help"; + ["no-posix"] = "The mod_posix module is not enabled in the Prosody config file, see http://prosody.im/doc/prosodyctl for more info"; ["no-such-method"] = "This module has no commands"; ["not-running"] = "Prosody is not running"; }, { __index = function (t,k) return "Error: "..(tostring(k):gsub("%-", " "):gsub("^.", string.upper)); end }); @@ -164,7 +168,11 @@ local error_messages = setmetatable({ hosts = prosody.hosts; local function make_host(hostname) - return { events = prosody.events, users = require "core.usermanager".new_null_provider(hostname) }; + return { + type = "local", + events = prosody.events, + users = require "core.usermanager".new_null_provider(hostname) + }; end for hostname, config in pairs(config.getconfig()) do