From 827921fe1dd706350a42434071fb5e43520fc58e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 28 Apr 2013 16:22:01 +0200 Subject: prosodyctl: Put keys and certificates in ./certs when in a source checkout --- prosodyctl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/prosodyctl b/prosodyctl index 24d28157..30a10b9a 100755 --- a/prosodyctl +++ b/prosodyctl @@ -654,7 +654,7 @@ end function cert_commands.config(arg) if #arg >= 1 and arg[1] ~= "--help" then - local conf_filename = (CFG_DATADIR or ".") .. "/" .. arg[1] .. ".cnf"; + local conf_filename = (CFG_DATADIR or "./certs") .. "/" .. arg[1] .. ".cnf"; if ask_overwrite(conf_filename) then return nil, conf_filename; end @@ -687,7 +687,7 @@ end function cert_commands.key(arg) if #arg >= 1 and arg[1] ~= "--help" then - local key_filename = (CFG_DATADIR or ".") .. "/" .. arg[1] .. ".key"; + local key_filename = (CFG_DATADIR or "./certs") .. "/" .. arg[1] .. ".key"; if ask_overwrite(key_filename) then return nil, key_filename; end @@ -709,7 +709,7 @@ end function cert_commands.request(arg) if #arg >= 1 and arg[1] ~= "--help" then - local req_filename = (CFG_DATADIR or ".") .. "/" .. arg[1] .. ".req"; + local req_filename = (CFG_DATADIR or "./certs") .. "/" .. arg[1] .. ".req"; if ask_overwrite(req_filename) then return nil, req_filename; end @@ -727,7 +727,7 @@ end function cert_commands.generate(arg) if #arg >= 1 and arg[1] ~= "--help" then - local cert_filename = (CFG_DATADIR or ".") .. "/" .. arg[1] .. ".crt"; + local cert_filename = (CFG_DATADIR or "./certs") .. "/" .. arg[1] .. ".crt"; if ask_overwrite(cert_filename) then return nil, cert_filename; end -- cgit v1.2.3 From c596e86388de98d061508b5659f7ad1652654ca0 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 29 Apr 2013 00:33:39 +0100 Subject: mod_s2s: Ensure that to/from on stream headers are always correct, fixes #338 --- plugins/mod_s2s/mod_s2s.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index a935239e..30ebb706 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -348,7 +348,7 @@ function stream_callbacks.streamopened(session, attr) end end - session:open_stream() + session:open_stream(session.to_host, session.from_host) if session.version >= 1.0 then local features = st.stanza("stream:features"); @@ -448,7 +448,11 @@ local function session_close(session, reason, remote_reason) local log = session.log or log; if session.conn then if session.notopen then - session:open_stream() + if session.direction == "incoming" then + session:open_stream(session.to_host, session.from_host); + else + session:open_stream(session.from_host, session.to_host); + end end if reason then -- nil == no err, initiated by us, false == initiated by remote if type(reason) == "string" then -- assume stream error @@ -496,8 +500,6 @@ local function session_close(session, reason, remote_reason) end function session_open_stream(session, from, to) - local from = from or session.from_host; - local to = to or session.to_host; local attr = { ["xmlns:stream"] = 'http://etherx.jabber.org/streams', xmlns = 'jabber:server', @@ -506,8 +508,7 @@ function session_open_stream(session, from, to) id = session.streamid, from = from, to = to, } - local local_host = session.direction == "outgoing" and from or to; - if not local_host or (hosts[local_host] and hosts[local_host].modules.dialback) then + if not from or (hosts[from] and hosts[from].modules.dialback) then attr["xmlns:db"] = 'jabber:server:dialback'; end -- cgit v1.2.3 From 073282787b0f983a57863ad2304c7daf7d3a9066 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 29 Apr 2013 10:43:44 +0100 Subject: mod_saslauth, mod_compression: Fix some cases where open_stream() was not being passed to/from (see df3c78221f26 and issue #338) --- plugins/mod_compression.lua | 2 +- plugins/mod_saslauth.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua index 44bc05fe..92856099 100644 --- a/plugins/mod_compression.lua +++ b/plugins/mod_compression.lua @@ -141,7 +141,7 @@ module:hook("stanza/http://jabber.org/protocol/compress:compressed", function(ev -- setup decompression for session.data setup_decompression(session, inflate_stream); session:reset_stream(); - session:open_stream(); + session:open_stream(session.from_host, session.to_host); session.compressed = true; return true; end diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index b75b1844..201cc477 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -87,7 +87,7 @@ module:hook_stanza(xmlns_sasl, "success", function (session, stanza) module:log("debug", "SASL EXTERNAL with %s succeeded", session.to_host); session.external_auth = "succeeded" session:reset_stream(); - session:open_stream(); + session:open_stream(session.from_host, session.to_host); module:fire_event("s2s-authenticated", { session = session, host = session.to_host }); return true; -- cgit v1.2.3