Hello community, here is the log from the commit of package prosody for openSUSE:Factory checked in at 2020-09-12 00:11:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/prosody (Old) and /work/SRC/openSUSE:Factory/.prosody.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "prosody" Sat Sep 12 00:11:05 2020 rev:20 rq:833724 version:0.11.6 Changes: -------- --- /work/SRC/openSUSE:Factory/prosody/prosody.changes 2020-03-26 23:33:24.394777909 +0100 +++ /work/SRC/openSUSE:Factory/.prosody.new.4249/prosody.changes 2020-09-12 00:11:41.493167003 +0200 @@ -1,0 +2,43 @@ +Fri Sep 11 08:48:41 UTC 2020 - Michael Vetter <[email protected]> + +- Update to 0.11.6: + Fixes and improvements: + * mod_storage_internal: Fix error in time limited queries on items without ‘when’ field, fixes #1557 + * mod_carbons: Fix handling of incoming MUC PMs #1540 + * mod_csi_simple: Consider XEP-0353: Jingle Message Initiation important + * mod_http_files: Avoid using inode in etag, fixes #1498: Fail to download file on FreeBSD + * mod_admin_telnet: Create a DNS resolver per console session (fixes #1492: Telnet console DNS commands reduced usefulness) + * core.certmanager: Move EECDH ciphers before EDH in default cipherstring (fixes #1513) + * mod_s2s: Escape invalid XML in loggin (same way as mod_c2s) (fixes #1574: Invalid XML input on s2s connection is logged unescaped) + * mod_muc: Allow control over the server-admins-are-room-owners feature (see #1174) + * mod_muc_mam: Remove spoofed archive IDs before archiving (fixes #1552: MUC MAM may strip its own archive id) + * mod_muc_mam: Fix stanza id filter event name, fixes #1546: mod_muc_mam does not strip spoofed stanza ids + * mod_muc_mam: Fix missing advertising of XEP-0359, fixes #1547: mod_muc_mam does not advertise stanza-id + Minor changes: + * net.http API: Add request:cancel() method + * net.http API: Fix traceback on invalid URL passed to request() + * MUC: Persist affiliation_data in new MUC format + * mod_websocket: Fire event on session creation (thanks Aaron van Meerten) + * MUC: Always include ‘affiliation’/‘role’ attributes, defaulting to ‘none’ if nil + * mod_tls: Log when certificates are (re)loaded + * mod_vcard4: Report correct error condition (fixes #1521: mod_vcard4 reports wrong error) + * net.http: Re-expose destroy_request() function (fixes unintentional API breakage) + * net.http.server: Strip port from Host header in IPv6 friendly way (fix #1302) + * util.prosodyctl: Tell prosody do daemonize via command line flag (fixes #1514) + * SASL: Apply saslprep where necessary, fixes #1560: Login fails if password contains special chars + * net.http.server: Fix reporting of missing Host header + * util.datamanager API: Fix iterating over “users” (thanks marc0s) + * net.resolvers.basic: Default conn_type to ‘tcp’ consistently if unspecified (thanks marc0s) + * mod_storage_sql: Fix check for deletion limits (fixes #1494) + * mod_admin_telnet: Handle unavailable cipher info (fixes #1510: mod_admin_telnet backtrace) + * Log warning when using prosodyctl start/stop/restart + * core.certmanager: Look for privkey.pem to go with fullchain.pem (fixes #1526) + * mod_storage_sql: Add index covering sort_id to improve performance (fixes #1505) + * mod_mam,mod_muc_mam: Allow other work to be performed during archive cleanup (fixes #1504) + * mod_muc_mam: Don’t strip MUC tags, fix #1567: MUC tags stripped by mod_muc_mam + * mod_pubsub, mod_pep: Ensure correct number of children of (fixes #1496) + * mod_register_ibr: Add FORM_TYPE as required by XEP-0077 (fixes #1511) + * mod_muc_mam: Fix traceback saving message from non-occupant (fixes #1497) + * util.startup: Remove duplicated initialization of logging (fix #1527: startup: Logging initialized twice) + +------------------------------------------------------------------- Old: ---- prosody-0.11.5.tar.gz prosody-0.11.5.tar.gz.asc New: ---- prosody-0.11.6.tar.gz prosody-0.11.6.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ prosody.spec ++++++ --- /var/tmp/diff_new_pack.7AxEZu/_old 2020-09-12 00:11:43.389168816 +0200 +++ /var/tmp/diff_new_pack.7AxEZu/_new 2020-09-12 00:11:43.389168816 +0200 @@ -18,7 +18,7 @@ %define _piddir /run Name: prosody -Version: 0.11.5 +Version: 0.11.6 Release: 0 Summary: Communications server for Jabber/XMPP License: MIT ++++++ prosody-0.11.5.tar.gz -> prosody-0.11.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/.hg_archival.txt new/prosody-0.11.6/.hg_archival.txt --- old/prosody-0.11.5/.hg_archival.txt 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/.hg_archival.txt 2020-08-01 12:58:37.000000000 +0200 @@ -1,4 +1,4 @@ repo: 3e3171b59028ee70122cfec6ecf98f518f946b59 -node: dbd60f47316492bc367802914dc8fa47f4b3edac +node: bacca65ce107b8549ce5f9079e81e5771eed2021 branch: 0.11 -tag: 0.11.5 +tag: 0.11.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/core/certmanager.lua new/prosody-0.11.6/core/certmanager.lua --- old/prosody-0.11.5/core/certmanager.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/core/certmanager.lua 2020-08-01 12:58:37.000000000 +0200 @@ -73,13 +73,15 @@ local key_path = certs .. key_try[i]:format(name); if stat(crt_path, "mode") == "file" then - if key_path:sub(-4) == ".crt" then - key_path = key_path:sub(1, -4) .. "key"; - if stat(key_path, "mode") == "file" then - log("debug", "Selecting certificate %s with key %s for %s", crt_path, key_path, name); - return { certificate = crt_path, key = key_path }; + if crt_path == key_path then + if key_path:sub(-4) == ".crt" then + key_path = key_path:sub(1, -4) .. "key"; + elseif key_path:sub(-13) == "fullchain.pem" then + key_path = key_path:sub(1, -14) .. "privkey.pem"; end - elseif stat(key_path, "mode") == "file" then + end + + if stat(key_path, "mode") == "file" then log("debug", "Selecting certificate %s with key %s for %s", crt_path, key_path, name); return { certificate = crt_path, key = key_path }; end @@ -123,8 +125,8 @@ "P-521", }; ciphers = { -- Enabled ciphers in order of preference: - "HIGH+kEDH", -- Ephemeral Diffie-Hellman key exchange, if a 'dhparam' file is set "HIGH+kEECDH", -- Ephemeral Elliptic curve Diffie-Hellman key exchange + "HIGH+kEDH", -- Ephemeral Diffie-Hellman key exchange, if a 'dhparam' file is set "HIGH", -- Other "High strength" ciphers -- Disabled cipher suites: "!PSK", -- Pre-Shared Key - not used for XMPP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/net/http/server.lua new/prosody-0.11.6/net/http/server.lua --- old/prosody-0.11.5/net/http/server.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/net/http/server.lua 2020-08-01 12:58:37.000000000 +0200 @@ -207,7 +207,8 @@ }; conn._http_open_response = response; - local host = (request.headers.host or ""):match("[^:]+"); + local host = request.headers.host; + if host then host = host:gsub(":%d+$",""); end -- Some sanity checking local err_code, err; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/net/http.lua new/prosody-0.11.6/net/http.lua --- old/prosody-0.11.5/net/http.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/net/http.lua 2020-08-01 12:58:37.000000000 +0200 @@ -56,6 +56,16 @@ end end +local function cancel_request(request, reason) + if request.callback then + request.callback(reason or "cancelled", 0, request); + request.callback = nil; + end + if request.conn then + destroy_request(request); + end +end + local function request_reader(request, data, err) if not request.parser then local function error_cb(reason) @@ -105,6 +115,7 @@ end req.reader = request_reader; req.state = "status"; + req.cancel = cancel_request; requests[req.conn] = req; @@ -183,14 +194,15 @@ local function request(self, u, ex, callback) local req = url.parse(u); - req.url = u; - req.http = self; if not (req and req.host) then callback("invalid-url", 0, req); return nil, "invalid-url"; end + req.url = u; + req.http = self; + if not req.path then req.path = "/"; end @@ -301,4 +313,5 @@ urldecode = util_http.urldecode; formencode = util_http.formencode; formdecode = util_http.formdecode; + destroy_request = destroy_request; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/net/resolvers/basic.lua new/prosody-0.11.6/net/resolvers/basic.lua --- old/prosody-0.11.5/net/resolvers/basic.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/net/resolvers/basic.lua 2020-08-01 12:58:37.000000000 +0200 @@ -58,6 +58,7 @@ local function new(hostname, port, conn_type, extra) local ascii_host = idna_to_ascii(hostname); local targets = nil; + conn_type = conn_type or "tcp"; local is_ip = inet_pton(hostname); if not is_ip and hostname:sub(1,1) == '[' then @@ -75,7 +76,7 @@ return setmetatable({ hostname = ascii_host; port = port; - conn_type = conn_type or "tcp"; + conn_type = conn_type; extra = extra; targets = targets; }, resolver_mt); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/net/server_epoll.lua new/prosody-0.11.6/net/server_epoll.lua --- old/prosody-0.11.5/net/server_epoll.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/net/server_epoll.lua 2020-08-01 12:58:37.000000000 +0200 @@ -102,7 +102,7 @@ if peek > now then next_delay = peek - now; break; - end + end local _, timer, id = timers:pop(); local ok, ret = pcall(timer[2], now); @@ -110,10 +110,10 @@ local next_time = now+ret; timer[1] = next_time; timers:insert(timer, next_time); - end + end peek = timers:peek(); - end + end if peek == nil then return next_delay; end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_admin_telnet.lua new/prosody-0.11.6/plugins/mod_admin_telnet.lua --- old/prosody-0.11.5/plugins/mod_admin_telnet.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_admin_telnet.lua 2020-08-01 12:58:37.000000000 +0200 @@ -528,11 +528,14 @@ common_info(session, line); if session.secure then local sock = session.conn and session.conn.socket and session.conn:socket(); - if sock and sock.info then - local info = sock:info(); - line[#line+1] = ("(%s with %s)"):format(info.protocol, info.cipher); - else - line[#line+1] = "(cipher info unavailable)"; + if sock then + local info = sock.info and sock:info(); + if info then + line[#line+1] = ("(%s with %s)"):format(info.protocol, info.cipher); + else + -- TLS session might not be ready yet + line[#line+1] = "(cipher info unavailable)"; + end end else line[#line+1] = "(insecure)"; @@ -1074,36 +1077,49 @@ def_env.dns = {}; local adns = require"net.adns"; -local dns = require"net.dns"; + +local function get_resolver(session) + local resolver = session.dns_resolver; + if not resolver then + resolver = adns.resolver(); + session.dns_resolver = resolver; + end + return resolver; +end function def_env.dns:lookup(name, typ, class) + local resolver = get_resolver(self.session); local ret = "Query sent"; local print = self.session.print; local function handler(...) ret = "Got response"; print(...); end - adns.lookup(handler, name, typ, class); + resolver:lookup(handler, name, typ, class); return true, ret; end function def_env.dns:addnameserver(...) - dns._resolver:addnameserver(...) + local resolver = get_resolver(self.session); + resolver._resolver:addnameserver(...) return true end function def_env.dns:setnameserver(...) - dns._resolver:setnameserver(...) + local resolver = get_resolver(self.session); + resolver._resolver:setnameserver(...) return true end function def_env.dns:purge() - dns.purge() + local resolver = get_resolver(self.session); + resolver._resolver:purge() return true end function def_env.dns:cache() - return true, "Cache:\n"..tostring(dns.cache()) + local resolver = get_resolver(self.session); + return true, "Cache:\n"..tostring(resolver._resolver.cache) end def_env.http = {}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_auth_insecure.lua new/prosody-0.11.6/plugins/mod_auth_insecure.lua --- old/prosody-0.11.5/plugins/mod_auth_insecure.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_auth_insecure.lua 2020-08-01 12:58:37.000000000 +0200 @@ -9,6 +9,7 @@ local datamanager = require "util.datamanager"; local new_sasl = require "util.sasl".new; +local saslprep = require "util.encodings".stringprep.saslprep; local host = module.host; local provider = { name = "insecure" }; @@ -21,6 +22,10 @@ function provider.set_password(username, password) local account = datamanager.load(username, host, "accounts"); + password = saslprep(password); + if not password then + return nil, "Password fails SASLprep."; + end if account then account.password = password; return datamanager.store(username, host, "accounts", account); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_auth_internal_hashed.lua new/prosody-0.11.6/plugins/mod_auth_internal_hashed.lua --- old/prosody-0.11.5/plugins/mod_auth_internal_hashed.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_auth_internal_hashed.lua 2020-08-01 12:58:37.000000000 +0200 @@ -15,6 +15,7 @@ local new_sasl = require "util.sasl".new; local hex = require"util.hex"; local to_hex, from_hex = hex.to, hex.from; +local saslprep = require "util.encodings".stringprep.saslprep; local log = module._log; local host = module.host; @@ -32,9 +33,13 @@ function provider.test_password(username, password) log("debug", "test password for user '%s'", username); local credentials = accounts:get(username) or {}; + password = saslprep(password); + if not password then + return nil, "Password fails SASLprep."; + end if credentials.password ~= nil and string.len(credentials.password) ~= 0 then - if credentials.password ~= password then + if saslprep(credentials.password) ~= password then return nil, "Auth failed. Provided password is incorrect."; end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_auth_internal_plain.lua new/prosody-0.11.6/plugins/mod_auth_internal_plain.lua --- old/prosody-0.11.5/plugins/mod_auth_internal_plain.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_auth_internal_plain.lua 2020-08-01 12:58:37.000000000 +0200 @@ -8,6 +8,7 @@ local usermanager = require "core.usermanager"; local new_sasl = require "util.sasl".new; +local saslprep = require "util.encodings".stringprep.saslprep; local log = module._log; local host = module.host; @@ -20,8 +21,12 @@ function provider.test_password(username, password) log("debug", "test password for user '%s'", username); local credentials = accounts:get(username) or {}; + password = saslprep(password); + if not password then + return nil, "Password fails SASLprep."; + end - if password == credentials.password then + if password == saslprep(credentials.password) then return true; else return nil, "Auth failed. Invalid username or password."; @@ -35,6 +40,10 @@ function provider.set_password(username, password) log("debug", "set_password for username '%s'", username); + password = saslprep(password); + if not password then + return nil, "Password fails SASLprep."; + end local account = accounts:get(username); if account then account.password = password; @@ -57,6 +66,10 @@ end function provider.create_user(username, password) + password = saslprep(password); + if not password then + return nil, "Password fails SASLprep."; + end return accounts:set(username, {password = password}); end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_carbons.lua new/prosody-0.11.6/plugins/mod_carbons.lua --- old/prosody-0.11.5/plugins/mod_carbons.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_carbons.lua 2020-08-01 12:58:37.000000000 +0200 @@ -69,7 +69,7 @@ elseif stanza:get_child("no-copy", "urn:xmpp:hints") then module:log("debug", "Message has no-copy hint, ignoring"); return - elseif not c2s and bare_jid == orig_from and stanza:get_child("x", "http://jabber.org/protocol/muc#user") then + elseif not c2s and bare_jid ~= orig_to and stanza:get_child("x", "http://jabber.org/protocol/muc#user") then module:log("debug", "MUC PM, ignoring"); return end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_csi_simple.lua new/prosody-0.11.6/plugins/mod_csi_simple.lua --- old/prosody-0.11.5/plugins/mod_csi_simple.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_csi_simple.lua 2020-08-01 12:58:37.000000000 +0200 @@ -79,6 +79,9 @@ if stanza:get_child("encryption", "urn:xmpp:eme:0") then return true; end + if stanza:get_child(nil, "urn:xmpp:jingle-message:0") then + return true; + end return false; end return true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_http_files.lua new/prosody-0.11.6/plugins/mod_http_files.lua --- old/prosody-0.11.5/plugins/mod_http_files.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_http_files.lua 2020-08-01 12:58:37.000000000 +0200 @@ -112,7 +112,7 @@ local last_modified = os_date('!%a, %d %b %Y %H:%M:%S GMT', attr.modification); response_headers.last_modified = last_modified; - local etag = ('"%02x-%x-%x-%x"'):format(attr.dev or 0, attr.ino or 0, attr.size or 0, attr.modification or 0); + local etag = ('"%x-%x-%x"'):format(attr.change or 0, attr.size or 0, attr.modification or 0); response_headers.etag = etag; local if_none_match = request_headers.if_none_match diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_mam/mod_mam.lua new/prosody-0.11.6/plugins/mod_mam/mod_mam.lua --- old/prosody-0.11.5/plugins/mod_mam/mod_mam.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_mam/mod_mam.lua 2020-08-01 12:58:37.000000000 +0200 @@ -362,7 +362,8 @@ end end - cleanup_runner = require "util.async".runner(function () + local async = require "util.async"; + cleanup_runner = async.runner(function () local users = {}; local cut_off = datestamp(os.time() - cleanup_after); for date in cleanup_storage:users() do @@ -391,6 +392,9 @@ cleanup_map:set(cut_off, user, true); module:log("error", "Could not delete messages for user '%s': %s", user, err); end + local wait, done = async.waiter(); + module:add_timer(0.01, done); + wait(); end module:log("info", "Deleted %d expired messages for %d users", sum, num_users); end); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_muc_mam.lua new/prosody-0.11.6/plugins/mod_muc_mam.lua --- old/prosody-0.11.5/plugins/mod_muc_mam.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_muc_mam.lua 2020-08-01 12:58:37.000000000 +0200 @@ -309,7 +309,7 @@ return true; end, 1); -module:hook("muc-broadcast-messages", function (event) +module:hook("muc-broadcast-message", function (event) local room, stanza = event.room, event.stanza; -- Filter out <stanza-id> that claim to be from us @@ -318,13 +318,10 @@ and jid_prep(tag.attr.by) == room.jid then return nil; end - if tag.name == "x" and tag.attr.xmlns == xmlns_muc_user then - return nil; - end return tag; end); -end, 0); +end, 1); -- Handle messages local function save_to_history(self, stanza) @@ -335,11 +332,14 @@ if stanza.name == "message" and self:get_whois() == "anyone" then stored_stanza = st.clone(stanza); stored_stanza.attr.to = nil; - local actor = jid_bare(self._occupants[stanza.attr.from].jid); - local affiliation = self:get_affiliation(actor) or "none"; - local role = self:get_role(actor) or self:get_default_role(affiliation); - stored_stanza:add_direct_child(st.stanza("x", { xmlns = xmlns_muc_user }) - :tag("item", { affiliation = affiliation; role = role; jid = actor })); + local occupant = self._occupants[stanza.attr.from]; + if occupant then + local actor = jid_bare(occupant.jid); + local affiliation = self:get_affiliation(actor) or "none"; + local role = self:get_role(actor) or self:get_default_role(affiliation); + stored_stanza:add_direct_child(st.stanza("x", { xmlns = xmlns_muc_user }) + :tag("item", { affiliation = affiliation; role = role; jid = actor })); + end end -- Policy check @@ -392,6 +392,7 @@ module:hook("muc-disco#info", function(event) event.reply:tag("feature", {var=xmlns_mam}):up(); + event.reply:tag("feature", {var=xmlns_st_id}):up(); end); -- Cleanup @@ -434,7 +435,8 @@ end end - cleanup_runner = require "util.async".runner(function () + local async = require "util.async"; + cleanup_runner = async.runner(function () local rooms = {}; local cut_off = datestamp(os.time() - cleanup_after); for date in cleanup_storage:users() do @@ -463,6 +465,9 @@ cleanup_map:set(cut_off, room, true); module:log("error", "Could not delete messages for room '%s': %s", room, err); end + local wait, done = async.waiter(); + module:add_timer(0.01, done); + wait(); end module:log("info", "Deleted %d expired messages for %d rooms", sum, num_rooms); end); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_pep.lua new/prosody-0.11.6/plugins/mod_pep.lua --- old/prosody-0.11.5/plugins/mod_pep.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_pep.lua 2020-08-01 12:58:37.000000000 +0200 @@ -51,7 +51,7 @@ end function is_item_stanza(item) - return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item"; + return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item" and #item.tags == 1; end function check_node_config(node, actor, new_config) -- luacheck: ignore 212/node 212/actor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_pubsub/mod_pubsub.lua new/prosody-0.11.6/plugins/mod_pubsub/mod_pubsub.lua --- old/prosody-0.11.5/plugins/mod_pubsub/mod_pubsub.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_pubsub/mod_pubsub.lua 2020-08-01 12:58:37.000000000 +0200 @@ -112,7 +112,7 @@ end function is_item_stanza(item) - return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item"; + return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item" and #item.tags == 1; end module:hook("pubsub-summary/http://www.w3.org/2005/Atom", function (event) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_register_ibr.lua new/prosody-0.11.6/plugins/mod_register_ibr.lua --- old/prosody-0.11.5/plugins/mod_register_ibr.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_register_ibr.lua 2020-08-01 12:58:37.000000000 +0200 @@ -25,6 +25,7 @@ local account_details = module:open_store("account_details"); local field_map = { + FORM_TYPE = { name = "FORM_TYPE", type = "hidden", value = "jabber:iq:register" }; username = { name = "username", type = "text-single", label = "Username", required = true }; password = { name = "password", type = "text-private", label = "Password", required = true }; nick = { name = "nick", type = "text-single", label = "Nickname" }; @@ -50,6 +51,7 @@ title = title; instructions = instructions; + field_map.FORM_TYPE; field_map.username; field_map.password; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_s2s/mod_s2s.lua new/prosody-0.11.6/plugins/mod_s2s/mod_s2s.lua --- old/prosody-0.11.5/plugins/mod_s2s/mod_s2s.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_s2s/mod_s2s.lua 2020-08-01 12:58:37.000000000 +0200 @@ -595,8 +595,7 @@ if data then local ok, err = stream:feed(data); if ok then return; end - log("warn", "Received invalid XML: %s", data); - log("warn", "Problem was: %s", err); + log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); session:close("not-well-formed"); end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_storage_internal.lua new/prosody-0.11.6/plugins/mod_storage_internal.lua --- old/prosody-0.11.5/plugins/mod_storage_internal.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_storage_internal.lua 2020-08-01 12:58:37.000000000 +0200 @@ -104,12 +104,14 @@ end if query.start then items:filter(function (item) - return item.when >= query.start; + local when = item.when or datetime.parse(item.attr.stamp); + return when >= query.start; end); end if query["end"] then items:filter(function (item) - return item.when <= query["end"]; + local when = item.when or datetime.parse(item.attr.stamp); + return when <= query["end"]; end); end count = #items; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_storage_sql.lua new/prosody-0.11.6/plugins/mod_storage_sql.lua --- old/prosody-0.11.5/plugins/mod_storage_sql.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_storage_sql.lua 2020-08-01 12:58:37.000000000 +0200 @@ -500,6 +500,7 @@ Index { name="prosodyarchive_index", unique = engine.params.driver ~= "MySQL", "host", "user", "store", "key" }; Index { name="prosodyarchive_with_when", "host", "user", "store", "with", "when" }; Index { name="prosodyarchive_when", "host", "user", "store", "when" }; + Index { name="prosodyarchive_sort", "host", "user", "store", "sort_id" }; }; engine:transaction(function() ProsodyArchiveTable:create(engine); @@ -622,11 +623,11 @@ module:log("error", "Old database format detected. Please run: prosodyctl mod_%s upgrade", module.name); return false, "database upgrade needed"; end - if engine.params.driver == "SQLite3" then - for row in engine:select("PRAGMA compile_options") do - if row[1] == "ENABLE_UPDATE_DELETE_LIMIT" then - engine._have_delete_limit = true; - end + end + if engine.params.driver == "SQLite3" then + for row in engine:select("PRAGMA compile_options") do + if row[1] == "ENABLE_UPDATE_DELETE_LIMIT" then + engine._have_delete_limit = true; end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_tls.lua new/prosody-0.11.6/plugins/mod_tls.lua --- old/prosody-0.11.5/plugins/mod_tls.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_tls.lua 2020-08-01 12:58:37.000000000 +0200 @@ -36,7 +36,7 @@ local ssl_ctx_c2s, ssl_ctx_s2sout, ssl_ctx_s2sin; local ssl_cfg_c2s, ssl_cfg_s2sout, ssl_cfg_s2sin; -function module.load() +function module.load(reload) local NULL, err = {}; local modhost = module.host; local parent = modhost:match("%.(.*)$"); @@ -63,6 +63,12 @@ module:log("debug", "Creating context for s2sin"); ssl_ctx_s2sin, err, ssl_cfg_s2sin = create_context(host.host, "server", host_s2s, host_ssl, global_s2s); -- for incoming server connections if not ssl_ctx_s2sin then module:log("error", "Error creating contexts for s2sin: %s", err); end + + if reload then + module:log("info", "Certificates reloaded"); + else + module:log("info", "Certificates loaded"); + end end module:hook_global("config-reloaded", module.load); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_vcard4.lua new/prosody-0.11.6/plugins/mod_vcard4.lua --- old/prosody-0.11.5/plugins/mod_vcard4.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_vcard4.lua 2020-08-01 12:58:37.000000000 +0200 @@ -14,9 +14,9 @@ local ok, id, item = pep_service:get_last_item("urn:xmpp:vcard4", stanza.attr.from); if ok and item then origin.send(st.reply(stanza):add_child(item.tags[1])); - elseif item == "item-not-found" or not id then + elseif id == "item-not-found" or not id then origin.send(st.error_reply(stanza, "cancel", "item-not-found")); - elseif item == "forbidden" then + elseif id == "forbidden" then origin.send(st.error_reply(stanza, "auth", "forbidden")); else origin.send(st.error_reply(stanza, "modify", "undefined-condition")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/mod_websocket.lua new/prosody-0.11.6/plugins/mod_websocket.lua --- old/prosody-0.11.5/plugins/mod_websocket.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/mod_websocket.lua 2020-08-01 12:58:37.000000000 +0200 @@ -305,6 +305,8 @@ response.headers.sec_webSocket_accept = base64(sha1(request.headers.sec_websocket_key .. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")); response.headers.sec_webSocket_protocol = "xmpp"; + module:fire_event("websocket-session", { session = session, request = request }); + session.log("debug", "Sending WebSocket handshake"); return ""; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/muc/mod_muc.lua new/prosody-0.11.6/plugins/muc/mod_muc.lua --- old/prosody-0.11.5/plugins/muc/mod_muc.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/muc/mod_muc.lua 2020-08-01 12:58:37.000000000 +0200 @@ -104,7 +104,8 @@ return um_is_admin(jid, module.host); end -do -- Monkey patch to make server admins room owners +if module:get_option_boolean("component_admins_as_room_owners", true) then + -- Monkey patch to make server admins room owners local _get_affiliation = room_mt.get_affiliation; function room_mt:get_affiliation(jid) if is_admin(jid) then return "owner"; end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/plugins/muc/muc.lib.lua new/prosody-0.11.6/plugins/muc/muc.lib.lua --- old/prosody-0.11.5/plugins/muc/muc.lib.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/plugins/muc/muc.lib.lua 2020-08-01 12:58:37.000000000 +0200 @@ -143,7 +143,7 @@ -- actor is the attribute table local function add_item(x, affiliation, role, jid, nick, actor_nick, actor_jid, reason) - x:tag("item", {affiliation = affiliation; role = role; jid = jid; nick = nick;}) + x:tag("item", {affiliation = affiliation or "none"; role = role; jid = jid; nick = nick;}) if actor_nick or actor_jid then x:tag("actor", {nick = actor_nick; jid = actor_jid;}):up() end @@ -1449,6 +1449,7 @@ frozen = { _jid = self.jid; _data = self._data; + _affiliation_data = self._affiliation_data; }; for user, affiliation in pairs(self._affiliations) do frozen[user] = affiliation; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/prosody.release new/prosody-0.11.6/prosody.release --- old/prosody-0.11.5/prosody.release 2020-01-19 17:10:27.000000000 +0100 +++ new/prosody-0.11.6/prosody.release 2020-09-09 11:24:29.000000000 +0200 @@ -1 +1 @@ -0.11.5 +0.11.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/prosodyctl new/prosody-0.11.6/prosodyctl --- old/prosody-0.11.5/prosodyctl 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/prosodyctl 2020-08-01 12:58:37.000000000 +0200 @@ -69,6 +69,7 @@ local prosodyctl = require "util.prosodyctl" local socket = require "socket" local dependencies = require "util.dependencies"; +local lfs = dependencies.softreq "lfs"; ----------------------- @@ -198,11 +199,26 @@ return 1; end +local function service_command_warning(service_command) + if prosody.installed and configmanager.get("*", "prosodyctl_service_warnings") ~= false then + show_warning("WARNING: Use of prosodyctl start/stop/restart/reload is not recommended"); + show_warning(" if Prosody is managed by an init system - use that directly instead."); + lfs = lfs or require + if lfs.attributes("/etc/systemd") then + show_warning(" e.g. systemctl %s prosody", service_command); + elseif lfs.attributes("/etc/init.d/prosody") then + show_warning(" e.g. /etc/init.d/prosody %s", service_command); + end + show_warning(""); + end +end + function commands.start(arg) if arg[1] == "--help" then show_usage([[start]], [[Start Prosody]]); return 1; end + service_command_warning("start"); local ok, ret = prosodyctl.isrunning(); if not ok then show_message(error_messages[ret]); @@ -293,6 +309,8 @@ return 1; end + service_command_warning("stop"); + if not prosodyctl.isrunning() then show_message("Prosody is not running"); return 1; @@ -328,6 +346,8 @@ return 1; end + service_command_warning("restart"); + commands.stop(arg); return commands.start(arg); end @@ -421,6 +441,8 @@ return 1; end + service_command_warning("reload"); + if not prosodyctl.isrunning() then show_message("Prosody is not running"); return 1; @@ -492,7 +514,6 @@ end local openssl; -local lfs; local cert_commands = {}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/spec/scansion/muc_register.scs new/prosody-0.11.6/spec/scansion/muc_register.scs --- old/prosody-0.11.5/spec/scansion/muc_register.scs 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/spec/scansion/muc_register.scs 2020-08-01 12:58:37.000000000 +0200 @@ -198,7 +198,7 @@ Romeo receives: <message from='[email protected]'> <x xmlns='http://jabber.org/protocol/muc#user' scansion:strict='true'> - <item jid="${Juliet's JID}" /> + <item jid="${Juliet's JID}" affiliation='none' /> </x> </message> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/util/datamanager.lua new/prosody-0.11.6/util/datamanager.lua --- old/prosody-0.11.5/util/datamanager.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/util/datamanager.lua 2020-08-01 12:58:37.000000000 +0200 @@ -320,7 +320,7 @@ local function users(host, store, typ) -- luacheck: ignore 431/store typ = type_map[typ or "keyval"]; - local store_dir = format("%s/%s/%s", data_path, encode(host), store); + local store_dir = format("%s/%s/%s", data_path, encode(host), store_encode(store)); local mode, err = lfs.attributes(store_dir, "mode"); if not mode then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/util/prosodyctl.lua new/prosody-0.11.6/util/prosodyctl.lua --- old/prosody-0.11.5/util/prosodyctl.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/util/prosodyctl.lua 2020-08-01 12:58:37.000000000 +0200 @@ -238,9 +238,9 @@ return false, "already-running"; end if not source_dir then - os.execute("./prosody"); + os.execute("./prosody -D"); else - os.execute(source_dir.."/../../bin/prosody"); + os.execute(source_dir.."/../../bin/prosody -D"); end return true; end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/util/sasl/plain.lua new/prosody-0.11.6/util/sasl/plain.lua --- old/prosody-0.11.5/util/sasl/plain.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/util/sasl/plain.lua 2020-08-01 12:58:37.000000000 +0200 @@ -70,7 +70,7 @@ if self.profile.plain then local correct_password; correct_password, state = self.profile.plain(self, authentication, self.realm); - correct = (correct_password == password); + correct = (saslprep(correct_password) == password); elseif self.profile.plain_test then correct, state = self.profile.plain_test(self, authentication, password, self.realm); end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/util/sasl/scram.lua new/prosody-0.11.6/util/sasl/scram.lua --- old/prosody-0.11.5/util/sasl/scram.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/util/sasl/scram.lua 2020-08-01 12:58:37.000000000 +0200 @@ -106,6 +106,10 @@ if iteration_count < 4096 then log("warn", "Iteration count < 4096 which is the suggested minimum according to RFC 5802.") end + password = saslprep(password); + if not password then + return false, "password fails SASLprep"; + end local salted_password = Hi(password, salt, iteration_count); local stored_key = sha1(hmac_sha1(salted_password, "Client Key")) local server_key = hmac_sha1(salted_password, "Server Key"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.5/util/startup.lua new/prosody-0.11.6/util/startup.lua --- old/prosody-0.11.5/util/startup.lua 2020-01-19 16:50:32.000000000 +0100 +++ new/prosody-0.11.6/util/startup.lua 2020-08-01 12:58:37.000000000 +0200 @@ -597,7 +597,6 @@ startup.sandbox_require(); startup.set_function_metatable(); startup.check_dependencies(); - startup.init_logging(); startup.load_libraries(); startup.setup_plugindir(); startup.setup_datadir();
