aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-23 01:30:58 +0100
committerKim Alvefur <zash@zash.se>2017-03-23 01:30:58 +0100
commit597d3174276ee35ac59a7eb2109469126d054310 (patch)
tree8907b93b95ab3e10a7e3fc7aaef48a769cd190b0
parent6e9e2d5167ba8b5261b2038bb9360f06681e9483 (diff)
parent711e2c8713466ff5fa8d1ed29dcf04d6e2b6e0da (diff)
downloadprosody-597d3174276ee35ac59a7eb2109469126d054310.tar.gz
prosody-597d3174276ee35ac59a7eb2109469126d054310.zip
Merge 0.10->trunk
-rw-r--r--core/storagemanager.lua2
-rw-r--r--plugins/mod_http_files.lua2
-rw-r--r--plugins/mod_posix.lua2
-rw-r--r--plugins/muc/lock.lib.lua1
-rw-r--r--util-src/encodings.c2
-rw-r--r--util/datamanager.lua26
-rw-r--r--util/dependencies.lua2
7 files changed, 13 insertions, 24 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index f1b70615..1c0ef3bb 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -164,7 +164,7 @@ function open(host, store, typ)
end
if ret then
local event_data = { host = host, store_name = store, store_type = typ, store = ret };
- prosody.hosts[host].events.fire_event("store-opened", event_data);
+ hosts[host].events.fire_event("store-opened", event_data);
ret, err = event_data.store, event_data.store_err;
end
return ret, err;
diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua
index b9a84cd3..e477bafe 100644
--- a/plugins/mod_http_files.lua
+++ b/plugins/mod_http_files.lua
@@ -16,7 +16,7 @@ local stat = lfs.attributes;
local build_path = require"socket.url".build_path;
local path_sep = package.config:sub(1,1);
-local base_path = module:get_option_string("http_files_dir", module:get_option_string("http_path"));
+local base_path = module:get_option_path("http_files_dir", module:get_option_path("http_path"));
local cache_size = module:get_option_number("http_files_cache_size", 128);
local cache_max_file_size = module:get_option_number("http_files_cache_max_file_size", 4096);
local dir_indices = module:get_option_array("http_index_files", { "index.html", "index.htm" });
diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua
index 122f550a..46151117 100644
--- a/plugins/mod_posix.lua
+++ b/plugins/mod_posix.lua
@@ -80,7 +80,7 @@ local function write_pidfile()
if pidfile_handle then
remove_pidfile();
end
- pidfile = module:get_option_string("pidfile");
+ pidfile = module:get_option_path("pidfile", nil, "data");
if pidfile then
local err;
local mode = stat(pidfile) and "r+" or "w+";
diff --git a/plugins/muc/lock.lib.lua b/plugins/muc/lock.lib.lua
index 15dd624b..928805ec 100644
--- a/plugins/muc/lock.lib.lua
+++ b/plugins/muc/lock.lib.lua
@@ -42,6 +42,7 @@ end
-- Don't let users into room while it is locked
module:hook("muc-occupant-pre-join", function(event)
if not event.is_new_room and is_locked(event.room) then -- Deny entry
+ module:log("debug", "Room is locked, denying entry");
event.origin.send(st.error_reply(event.stanza, "cancel", "item-not-found"));
return true;
end
diff --git a/util-src/encodings.c b/util-src/encodings.c
index a633d7fa..465819d5 100644
--- a/util-src/encodings.c
+++ b/util-src/encodings.c
@@ -173,7 +173,7 @@ static const luaL_Reg Reg_base64[] = {
* Decode one UTF-8 sequence, returning NULL if byte sequence is invalid.
*/
static const char *utf8_decode(const char *o, int *val) {
- static unsigned int limits[] = {0xFF, 0x7F, 0x7FF, 0xFFFF};
+ static const unsigned int limits[] = {0xFF, 0x7F, 0x7FF, 0xFFFF};
const unsigned char *s = (const unsigned char *)o;
unsigned int c = s[0];
unsigned int res = 0; /* final result */
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 2b47c3c4..b825cb33 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -24,8 +24,10 @@ local t_insert = table.insert;
local t_concat = table.concat;
local envloadfile = require"util.envload".envloadfile;
local serialize = require "util.serialization".serialize;
-local path_separator = assert ( package.config:match ( "^([^\n]+)" ) , "package.config not in standard form" ) -- Extract directory seperator from package.config (an undocumented string that comes with lua)
local lfs = require "lfs";
+-- Extract directory seperator from package.config (an undocumented string that comes with lua)
+local path_separator = assert ( package.config:match ( "^([^\n]+)" ) , "package.config not in standard form" )
+
local prosody = prosody;
local raw_mkdir = lfs.mkdir;
@@ -130,15 +132,8 @@ local function load(username, host, datastore)
-- No such file, ok to ignore
return nil;
end
- local mode = lfs.attributes(getpath(username, host, datastore), "mode");
- if not mode then
- log("debug", "Assuming empty %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil");
- return nil;
- else -- file exists, but can't be read
- -- TODO more detailed error checking and logging?
- log("error", "Failed to load %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil");
- return nil, "Error reading storage";
- end
+ log("error", "Failed to load %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil");
+ return nil, "Error reading storage";
end
local success, ret = pcall(data);
@@ -304,15 +299,8 @@ local function list_load(username, host, datastore)
-- No such file, ok to ignore
return nil;
end
- local mode = lfs.attributes(getpath(username, host, datastore, "list"), "mode");
- if not mode then
- log("debug", "Assuming empty %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil");
- return nil;
- else -- file exists, but can't be read
- -- TODO more detailed error checking and logging?
- log("error", "Failed to load %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil");
- return nil, "Error reading storage";
- end
+ log("error", "Failed to load %s storage ('%s') for user: %s@%s", datastore, err, username or "nil", host or "nil");
+ return nil, "Error reading storage";
end
local success, ret = pcall(data);
diff --git a/util/dependencies.lua b/util/dependencies.lua
index 38aced70..9b0afd77 100644
--- a/util/dependencies.lua
+++ b/util/dependencies.lua
@@ -93,7 +93,7 @@ local function check_dependencies()
if not ssl then
missingdep("LuaSec", {
- ["Debian/Ubuntu"] = "https://prosody.im/download/start#debian_and_ubuntu";
+ ["Debian/Ubuntu"] = "sudo apt-get install lua-sec";
["luarocks"] = "luarocks install luasec";
["Source"] = "https://github.com/brunoos/luasec";
}, "SSL/TLS support will not be available");