From d431f7e1ec80f4ecef0935aeaff6044e76185da2 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 26 Aug 2014 12:02:41 +0200 Subject: mod_posix: Make sure that 'pidfile' is a string --- plugins/mod_posix.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua index 28fd7f38..b289fa44 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("pidfile"); + pidfile = module:get_option_string("pidfile"); if pidfile then local err; local mode = stat(pidfile) and "r+" or "w+"; -- cgit v1.2.3 From 67e5d2e47ee1d32bb069407a118cf203a009fee9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 26 Aug 2014 12:19:27 +0200 Subject: mod_compression: Handle compression setup errors by logging a warning about it (fixes #408) --- plugins/mod_compression.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua index 531ea8ea..1ec4c85a 100644 --- a/plugins/mod_compression.lua +++ b/plugins/mod_compression.lua @@ -147,6 +147,12 @@ module:hook("stanza/http://jabber.org/protocol/compress:compressed", function(ev end end); +module:hook("stanza/http://jabber.org/protocol/compress:failure", function(event) + local err = event.stanza:get_child(); + (event.origin.log or module._log)("warn", "Compression setup failed (%s)", err and err.name or "unknown reason"); + return true; +end); + module:hook("stanza/http://jabber.org/protocol/compress:compress", function(event) local session, stanza = event.origin, event.stanza; -- cgit v1.2.3 From 306092e0a7259b9cc37bf618e130cb7c91f5301e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 26 Aug 2014 21:50:08 +0200 Subject: mod_s2s: Mark stream as opened earlier for outgoing connections, fixes double stream headers on policy failures --- plugins/mod_s2s/mod_s2s.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index aa517bbd..d4864a38 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -362,7 +362,9 @@ function stream_callbacks.streamopened(session, attr) log("debug", "Sending stream features: %s", tostring(features)); send(features); end + session.notopen = nil; elseif session.direction == "outgoing" then + session.notopen = nil; -- If we are just using the connection for verifying dialback keys, we won't try and auth it if not attr.id then error("stream response did not give us a streamid!!!"); end session.streamid = attr.id; @@ -396,7 +398,6 @@ function stream_callbacks.streamopened(session, attr) end end end - session.notopen = nil; end function stream_callbacks.streamclosed(session) -- cgit v1.2.3 From ef0bac2fe0bde60b990bb952a73f9bd9b526f7eb Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 27 Aug 2014 13:20:08 +0200 Subject: mod_s2s: Reset stream ID when resetting stream [compliance] --- plugins/mod_s2s/mod_s2s.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index d4864a38..c288d858 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -528,6 +528,7 @@ local function initialize_session(session) function session.reset_stream() session.notopen = true; + session.streamid = nil; session.stream:reset(); end -- cgit v1.2.3 From 933bb5a86967c12a1623ab6d669e6fdb6ab93f91 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 23 Aug 2014 09:29:17 +0100 Subject: mod_c2s, mod_s2s: Log received invalid stream headers --- plugins/mod_c2s.lua | 2 +- plugins/mod_s2s/mod_s2s.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 5feb1f2c..b6895f4b 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -91,7 +91,7 @@ end function stream_callbacks.error(session, error, data) if error == "no-stream" then - session.log("debug", "Invalid opening stream header"); + session.log("debug", "Invalid opening stream header (%s)", (data:gsub("^([^\1]+)\1", "{%1}"))); session:close("invalid-namespace"); elseif error == "parse-error" then (session.log or log)("debug", "Client XML parse error: %s", tostring(data)); diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index c288d858..44334428 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -407,6 +407,7 @@ end function stream_callbacks.error(session, error, data) if error == "no-stream" then + session.log("debug", "Invalid opening stream header (%s)", (data:gsub("^([^\1]+)\1", "{%1}"))); session:close("invalid-namespace"); elseif error == "parse-error" then session.log("debug", "Server-to-server XML parse error: %s", tostring(error)); -- cgit v1.2.3 From 27c737e5ff7b8a4834c3cd45cff1937a22b4185c Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 28 Aug 2014 09:17:07 +0100 Subject: mod_privacy: Fix to correctly sort privacy list rules by order (thanks Flow) --- plugins/mod_privacy.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_privacy.lua b/plugins/mod_privacy.lua index 31ace9f9..49c9427f 100644 --- a/plugins/mod_privacy.lua +++ b/plugins/mod_privacy.lua @@ -157,7 +157,7 @@ function createOrReplaceList (privacy_lists, origin, stanza, name, entries) list.items[#list.items + 1] = tmp; end - table.sort(list, function(a, b) return a.order < b.order; end); + table.sort(list.items, function(a, b) return a.order < b.order; end); origin.send(st.reply(stanza)); if bare_sessions[bare_jid] ~= nil then -- cgit v1.2.3