Hello community, here is the log from the commit of package prosody for openSUSE:Factory checked in at 2020-01-20 22:52:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/prosody (Old) and /work/SRC/openSUSE:Factory/.prosody.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "prosody" Mon Jan 20 22:52:49 2020 rev:18 rq:765696 version:0.11.4 Changes: -------- --- /work/SRC/openSUSE:Factory/prosody/prosody.changes 2019-10-07 14:14:10.918878957 +0200 +++ /work/SRC/openSUSE:Factory/.prosody.new.26092/prosody.changes 2020-01-20 22:53:08.979290541 +0100 @@ -1,0 +2,30 @@ +Mon Jan 20 08:15:32 UTC 2020 - Michael Vetter <[email protected]> + +- Update to 0.11.4: + Fixes and improvements: + * core.rostermanager: Improve performance by caching rosters of offline #1233 + * mod_pep: Handling subscriptions more efficiently #1372 + Minor changes: + * util.interpolation: Support unescaped variables with more modifiers #1452 + * MUC: Mark source of historic messages correctly #1416 + * mod_auth_internal_hashed: Pass on errors #1477 + * mod_mam, mod_muc_mam: Improve logging of failures #1478, #1480, #1481 + * mod_muc, mod_muc_mam: Reschedule message expiry in case of failure + * mod_mam: Add flag to session when it performs a MAM query + * prosodyctl check: Warn about conflict between mod_pep and mod_pep_simple + * prosodyctl check: Warn about conflict between mod_vcard and mod_vcard_legacy #1469 + * core.modulemanager: Disable mod_vcard if mod_vcard_legacy is enabled to prevent conflict #1469 + * MUC: Strip tags with MUC-related namespaces from private messages #1427 + * MUC: Don’t advertise registration feature on host #1451 + * mod_vcard_legacy: Fix handling of empty photo elements #1432 + * mod_vcard_legacy: Advertise lack of avatar correctly #1431 + * prosodyctl: Handle if the setting proxy65_address has the wrong type + * prosodyctl: Print a blank line to improve spacing and readability + * MUC: Fix role loss in Nickname change #1466 + * util.pposix: Fix reporting of memory usage in 2-4GB range #1445 + * util.startup: Fix a regression concerning directory paths #1430 + * mod_websocket: Don’t mask WebSocket pong answers #1484 + * net.resolvers: Apply IDNA conversion to ascii for DNS lookups (affects only HTTP queries) #1426 + * net.resolvers.basic: Fix resolution of IPv6 literals (in brackets) #1459 + +------------------------------------------------------------------- Old: ---- prosody-0.11.3.tar.gz prosody-0.11.3.tar.gz.asc New: ---- prosody-0.11.4.tar.gz prosody-0.11.4.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ prosody.spec ++++++ --- /var/tmp/diff_new_pack.m3zvRe/_old 2020-01-20 22:53:10.051290954 +0100 +++ /var/tmp/diff_new_pack.m3zvRe/_new 2020-01-20 22:53:10.079290965 +0100 @@ -1,7 +1,7 @@ # # spec file for package prosody # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,13 +12,13 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define _piddir /run Name: prosody -Version: 0.11.3 +Version: 0.11.4 Release: 0 Summary: Communications server for Jabber/XMPP License: MIT ++++++ prosody-0.11.3.tar.gz -> prosody-0.11.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/.hg_archival.txt new/prosody-0.11.4/.hg_archival.txt --- old/prosody-0.11.3/.hg_archival.txt 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/.hg_archival.txt 2020-01-02 10:49:37.000000000 +0100 @@ -1,4 +1,4 @@ repo: 3e3171b59028ee70122cfec6ecf98f518f946b59 -node: dd7e924c74ef27b7f92eb872d2db50aaa229b234 +node: 10d6d0d91f4ec47a6eb446792fee1d4b79a914d7 branch: 0.11 -tag: 0.11.3 +tag: 0.11.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/core/modulemanager.lua new/prosody-0.11.4/core/modulemanager.lua --- old/prosody-0.11.3/core/modulemanager.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/core/modulemanager.lua 2020-01-02 10:49:37.000000000 +0100 @@ -63,6 +63,11 @@ modules:add("admin_telnet"); end + if modules:contains("vcard") and modules:contains("vcard_legacy") then + log("error", "The mod_vcard_legacy plugin replaces mod_vcard but both are enabled. Please update your config."); + modules:remove("vcard"); + end + return modules, component; end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/core/rostermanager.lua new/prosody-0.11.4/core/rostermanager.lua --- old/prosody-0.11.3/core/rostermanager.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/core/rostermanager.lua 2020-01-02 10:49:37.000000000 +0100 @@ -12,6 +12,7 @@ local log = require "util.logger".init("rostermanager"); local new_id = require "util.id".short; +local new_cache = require "util.cache".new; local pairs = pairs; local tostring = tostring; @@ -111,6 +112,23 @@ else -- Attempt to load roster for non-loaded user log("debug", "load_roster: loading for offline user: %s", jid); end + local roster_cache = hosts[host] and hosts[host].roster_cache; + if not roster_cache then + if hosts[host] then + roster_cache = new_cache(1024); + hosts[host].roster_cache = roster_cache; + end + else + roster = roster_cache:get(jid); + if roster then + log("debug", "load_roster: cache hit"); + roster_cache:set(jid, roster); + if user then user.roster = roster; end + return roster; + else + log("debug", "load_roster: cache miss, loading from storage"); + end + end local roster_store = storagemanager.open(host, "roster", "keyval"); local data, err = roster_store:get(username); roster = data or {}; @@ -134,6 +152,10 @@ if not err then hosts[host].events.fire_event("roster-load", { username = username, host = host, roster = roster }); end + if roster_cache and not user then + log("debug", "load_roster: caching loaded roster"); + roster_cache:set(jid, roster); + end return roster, err; end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/net/resolvers/basic.lua new/prosody-0.11.4/net/resolvers/basic.lua --- old/prosody-0.11.3/net/resolvers/basic.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/net/resolvers/basic.lua 2020-01-02 10:49:37.000000000 +0100 @@ -1,5 +1,7 @@ local adns = require "net.adns"; local inet_pton = require "util.net".pton; +local inet_ntop = require "util.net".ntop; +local idna_to_ascii = require "util.encodings".idna.to_ascii; local methods = {}; local resolver_mt = { __index = methods }; @@ -17,6 +19,12 @@ return; end + if not self.hostname then + -- FIXME report IDNA error + cb(nil); + return; + end + local targets = {}; local n = 2; local function ready() @@ -26,16 +34,6 @@ self:next(cb); end - local is_ip = inet_pton(self.hostname); - if is_ip then - if #is_ip == 16 then - cb(self.conn_type.."6", self.hostname, self.port, self.extra); - elseif #is_ip == 4 then - cb(self.conn_type.."4", self.hostname, self.port, self.extra); - end - return; - end - -- Resolve DNS to target list local dns_resolver = adns.resolver(); dns_resolver:lookup(function (answer) @@ -58,11 +56,28 @@ end local function new(hostname, port, conn_type, extra) + local ascii_host = idna_to_ascii(hostname); + local targets = nil; + + local is_ip = inet_pton(hostname); + if not is_ip and hostname:sub(1,1) == '[' then + is_ip = inet_pton(hostname:sub(2,-2)); + end + if is_ip then + hostname = inet_ntop(is_ip); + if #is_ip == 16 then + targets = { { conn_type.."6", hostname, port, extra } }; + elseif #is_ip == 4 then + targets = { { conn_type.."4", hostname, port, extra } }; + end + end + return setmetatable({ - hostname = hostname; + hostname = ascii_host; port = port; conn_type = conn_type or "tcp"; extra = extra; + targets = targets; }, resolver_mt); end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/net/resolvers/service.lua new/prosody-0.11.4/net/resolvers/service.lua --- old/prosody-0.11.3/net/resolvers/service.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/net/resolvers/service.lua 2020-01-02 10:49:37.000000000 +0100 @@ -1,5 +1,6 @@ local adns = require "net.adns"; local basic = require "net.resolvers.basic"; +local idna_to_ascii = require "util.encodings".idna.to_ascii; local methods = {}; local resolver_mt = { __index = methods }; @@ -24,6 +25,12 @@ return; end + if not self.hostname then + -- FIXME report IDNA error + cb(nil); + return; + end + local targets = {}; local function ready() self.targets = targets; @@ -58,7 +65,7 @@ local function new(hostname, service, conn_type, extra) return setmetatable({ - hostname = hostname; + hostname = idna_to_ascii(hostname); service = service; conn_type = conn_type or "tcp"; extra = extra; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/plugins/mod_auth_internal_hashed.lua new/prosody-0.11.4/plugins/mod_auth_internal_hashed.lua --- old/prosody-0.11.3/plugins/mod_auth_internal_hashed.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/plugins/mod_auth_internal_hashed.lua 2020-01-02 10:49:37.000000000 +0100 @@ -68,6 +68,9 @@ account.salt = generate_uuid(); account.iteration_count = max(account.iteration_count or 0, default_iteration_count); local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, account.salt, account.iteration_count); + if not valid then + return valid, stored_key; + end local stored_key_hex = to_hex(stored_key); local server_key_hex = to_hex(server_key); @@ -99,6 +102,9 @@ end local salt = generate_uuid(); local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, salt, default_iteration_count); + if not valid then + return valid, stored_key; + end local stored_key_hex = to_hex(stored_key); local server_key_hex = to_hex(server_key); return accounts:set(username, { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/plugins/mod_mam/mod_mam.lua new/prosody-0.11.4/plugins/mod_mam/mod_mam.lua --- old/prosody-0.11.3/plugins/mod_mam/mod_mam.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/plugins/mod_mam/mod_mam.lua 2020-01-02 10:49:37.000000000 +0100 @@ -90,6 +90,8 @@ local query = stanza.tags[1]; local qid = query.attr.queryid; + origin.mam_requested = true; + get_prefs(origin.username, true); -- Search query parameters @@ -295,7 +297,7 @@ log("debug", "Archiving stanza: %s", stanza:top_tag()); -- And stash it - local ok = archive:append(store_user, nil, clone_for_storage, time_now(), with); + local ok, err = archive:append(store_user, nil, clone_for_storage, time_now(), with); if ok then local clone_for_other_handlers = st.clone(stanza); local id = ok; @@ -303,6 +305,8 @@ event.stanza = clone_for_other_handlers; schedule_cleanup(store_user); module:fire_event("archive-message-added", { origin = origin, stanza = clone_for_storage, for_user = store_user, id = id }); + else + log("error", "Could not archive stanza: %s", err); end else log("debug", "Not archiving stanza: %s (prefs)", stanza:top_tag()); @@ -383,6 +387,9 @@ if ok then num_users = num_users + 1; sum = sum + (tonumber(ok) or 0); + else + cleanup_map:set(cut_off, user, true); + module:log("error", "Could not delete messages for user '%s': %s", user, err); end end module:log("info", "Deleted %d expired messages for %d users", sum, num_users); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/plugins/mod_muc_mam.lua new/prosody-0.11.4/plugins/mod_muc_mam.lua --- old/prosody-0.11.3/plugins/mod_muc_mam.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/plugins/mod_muc_mam.lua 2020-01-02 10:49:37.000000000 +0100 @@ -352,11 +352,13 @@ end -- And stash it - local id = archive:append(room_node, nil, stored_stanza, time_now(), with); + local id, err = archive:append(room_node, nil, stored_stanza, time_now(), with); if id then schedule_cleanup(room_node); stanza:add_direct_child(st.stanza("stanza-id", { xmlns = xmlns_st_id, by = self.jid, id = id })); + else + module:log("error", "Could not archive stanza: %s", err); end end @@ -457,6 +459,9 @@ if ok then num_rooms = num_rooms + 1; sum = sum + (tonumber(ok) or 0); + else + cleanup_map:set(cut_off, room, true); + module:log("error", "Could not delete messages for room '%s': %s", room, err); end end module:log("info", "Deleted %d expired messages for %d rooms", sum, num_rooms); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/plugins/mod_pep.lua new/prosody-0.11.4/plugins/mod_pep.lua --- old/prosody-0.11.3/plugins/mod_pep.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/plugins/mod_pep.lua 2020-01-02 10:49:37.000000000 +0100 @@ -90,21 +90,6 @@ return data, err; end function store:set(node, data) - if data then - -- Save the data without subscriptions - local subscribers = {}; - for jid, sub in pairs(data.subscribers) do - if type(sub) ~= "table" or not sub.presence then - subscribers[jid] = sub; - end - end - data = { - name = data.name; - config = data.config; - affiliations = data.affiliations; - subscribers = subscribers; - }; - end return node_config:set(username, node, data); end function store:users() @@ -160,18 +145,23 @@ return simple_broadcast; end -local function on_node_creation(event) - local service = event.service; - local node = event.node; - local username = service.config.pep_username; - - local service_recipients = recipients[username]; - if not service_recipients then return; end - - for recipient, nodes in pairs(service_recipients) do - if nodes:contains(node) then - service:add_subscription(node, recipient, recipient, { presence = true }); +local function get_subscriber_filter(username) + return function (jids, node) + local broadcast_to = {}; + for jid, opts in pairs(jids) do + broadcast_to[jid] = opts; end + + local service_recipients = recipients[username]; + if service_recipients then + local service = services[username]; + for recipient, nodes in pairs(service_recipients) do + if nodes:contains(node) and service:may(node, recipient, "subscribe") then + broadcast_to[recipient] = true; + end + end + end + return broadcast_to; end end @@ -196,6 +186,7 @@ nodestore = nodestore(username); itemstore = simple_itemstore(username); broadcaster = get_broadcaster(username); + subscriber_filter = get_subscriber_filter(username); itemcheck = is_item_stanza; get_affiliation = function (jid) if jid_bare(jid) == user_bare then @@ -233,11 +224,6 @@ return service; end -module:hook("item-added/pep-service", function (event) - local service = event.item.service; - module:hook_object_event(service.events, "node-created", on_node_creation); -end); - function handle_pubsub_iq(event) local origin, stanza = event.origin, event.stanza; local service_name = origin.username; @@ -303,12 +289,9 @@ end local service = get_pep_service(service_name); - for node in current - nodes do - service:remove_subscription(node, recipient, recipient); - end for node in nodes - current do - if service:add_subscription(node, recipient, recipient, { presence = true }) then + if service:may(node, recipient, "subscribe") then resend_last_item(recipient, node, service); end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/plugins/mod_vcard_legacy.lua new/prosody-0.11.4/plugins/mod_vcard_legacy.lua --- old/prosody-0.11.3/plugins/mod_vcard_legacy.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/plugins/mod_vcard_legacy.lua 2020-01-02 10:49:37.000000000 +0100 @@ -300,13 +300,19 @@ if stanza.attr.type then return end local pep_service = mod_pep.get_pep_service(username); - stanza:remove_children("x", "vcard-temp:x:update"); - local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }); + local x_update = stanza:get_child("x", "vcard-temp:x:update"); + if not x_update then + x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }):tag("photo"); + stanza:add_direct_child(x_update); + elseif x_update:get_child("photo") then + return; -- XEP implies that these should be left alone + else + x_update:tag("photo"); + end local ok, avatar_hash = pep_service:get_last_item("urn:xmpp:avatar:metadata", true); if ok and avatar_hash then - x_update:text_tag("photo", avatar_hash); + x_update:text(avatar_hash); end - stanza:add_direct_child(x_update); end module:hook("pre-presence/full", inject_xep153, 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/plugins/mod_websocket.lua new/prosody-0.11.4/plugins/mod_websocket.lua --- old/prosody-0.11.3/plugins/mod_websocket.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/plugins/mod_websocket.lua 2020-01-02 10:49:37.000000000 +0100 @@ -236,6 +236,7 @@ return; elseif opcode == 0x9 then -- Ping frame frame.opcode = 0xA; + frame.MASK = false; -- Clients send masked frames, servers don't, see #1484 conn:write(build_frame(frame)); return ""; elseif opcode == 0xA then -- Pong frame, MAY be sent unsolicited, eg as keepalive diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/plugins/muc/muc.lib.lua new/prosody-0.11.4/plugins/muc/muc.lib.lua --- old/prosody-0.11.3/plugins/muc/muc.lib.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/plugins/muc/muc.lib.lua 2020-01-02 10:49:37.000000000 +0100 @@ -524,6 +524,9 @@ log("debug", "no occupant found for %s; creating new occupant object for %s", dest_jid, real_jid); is_first_dest_session = true; dest_occupant = self:new_occupant(bare_jid, dest_jid); + if orig_occupant then + dest_occupant.role = orig_occupant.role; + end else is_first_dest_session = false; end @@ -779,6 +782,7 @@ return true; end log("debug", "%s sent private message stanza to %s (%s)", from, to, o_data.jid); + stanza = muc_util.filter_muc_x(st.clone(stanza)); stanza:tag("x", { xmlns = "http://jabber.org/protocol/muc#user" }):up(); stanza.attr.from = current_nick; self:route_to_occupant(o_data, stanza) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/plugins/muc/register.lib.lua new/prosody-0.11.4/plugins/muc/register.lib.lua --- old/prosody-0.11.3/plugins/muc/register.lib.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/plugins/muc/register.lib.lua 2020-01-02 10:49:37.000000000 +0100 @@ -48,8 +48,6 @@ event.room._reserved_nicks = nil; end); -module:add_feature("jabber:iq:register"); - module:hook("muc-disco#info", function (event) event.reply:tag("feature", { var = "jabber:iq:register" }):up(); end); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/prosody.release new/prosody-0.11.4/prosody.release --- old/prosody-0.11.3/prosody.release 2019-09-05 17:21:47.000000000 +0200 +++ new/prosody-0.11.4/prosody.release 2020-01-06 18:35:05.000000000 +0100 @@ -1 +1 @@ -0.11.3 +0.11.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/prosodyctl new/prosody-0.11.4/prosodyctl --- old/prosody-0.11.3/prosodyctl 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/prosodyctl 2020-01-02 10:49:37.000000000 +0100 @@ -933,6 +933,16 @@ print(" For more information see https://prosody.im/doc/storage"); end end + if all_modules:contains("vcard") and all_modules:contains("vcard_legacy") then + print(""); + print(" Both mod_vcard_legacy and mod_vcard are enabled but they conflict"); + print(" with each other. Remove one."); + end + if all_modules:contains("pep") and all_modules:contains("pep_simple") then + print(""); + print(" Both mod_pep_simple and mod_pep are enabled but they conflict"); + print(" with each other. Remove one."); + end for host, host_config in pairs(config) do --luacheck: ignore 213/host if type(rawget(host_config, "storage")) == "string" and rawget(host_config, "default_storage") then print(""); @@ -1103,17 +1113,21 @@ if modules:contains("proxy65") then local proxy65_target = configmanager.get(host, "proxy65_address") or host; - local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA"); - local prob = {}; - if not A then - table.insert(prob, "A"); - end - if v6_supported and not AAAA then - table.insert(prob, "AAAA"); - end - if #prob > 0 then - print(" File transfer proxy "..proxy65_target.." has no "..table.concat(prob, "/") - .." record. Create one or set 'proxy65_address' to the correct host/IP."); + if type(proxy65_target) == "string" then + local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA"); + local prob = {}; + if not A then + table.insert(prob, "A"); + end + if v6_supported and not AAAA then + table.insert(prob, "AAAA"); + end + if #prob > 0 then + print(" File transfer proxy "..proxy65_target.." has no "..table.concat(prob, "/") + .." record. Create one or set 'proxy65_address' to the correct host/IP."); + end + else + print(" proxy65_address for "..host.." should be set to a string, unable to perform DNS check"); end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/util/interpolation.lua new/prosody-0.11.4/util/interpolation.lua --- old/prosody-0.11.3/util/interpolation.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/util/interpolation.lua 2020-01-02 10:49:37.000000000 +0100 @@ -32,7 +32,7 @@ -- assert(type(values) == "table", "bad argument #2 to 'render' (table expected)"); return (s_gsub(template, pat, function (block) block = s_sub(block, 2, -2); - local name, opt, e = s_match(block, "^([%a_][%w_.]*)(%p?)()"); + local name, raw, opt, e = s_match(block, "^([%a_][%w_.]*)(!?)(%p?)()"); if not name then return end local value = values[name]; if not value and name:find(".", 2, true) then @@ -45,7 +45,7 @@ if funcs then while value ~= nil and opt == '|' do local f; - f, opt, e = s_match(block, "^([%a_][%w_.]*)(%p?)()", e); + f, raw, opt, e = s_match(block, "^([%a_][%w_.]*)(!?)(%p?)()", e); f = funcs[f]; if f then value = f(value); end end @@ -70,7 +70,7 @@ if type(value) ~= "string" then value = tostring(value); end - if opt ~= '!' then + if raw ~= '!' then return escape(value); end return value; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/util/pubsub.lua new/prosody-0.11.4/util/pubsub.lua --- old/prosody-0.11.3/util/pubsub.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/util/pubsub.lua 2020-01-02 10:49:37.000000000 +0100 @@ -6,6 +6,7 @@ local default_config = { itemstore = function (config, _) return cache.new(config["max_items"]) end; broadcaster = function () end; + subscriber_filter = function (subs) return subs end; itemcheck = function () return true; end; get_affiliation = function () end; normalize_jid = function (jid) return jid; end; @@ -499,7 +500,7 @@ end self.events.fire_event("node-deleted", { service = self, node = node, actor = actor }); - self.config.broadcaster("delete", node, node_obj.subscribers, nil, actor, node_obj, self); + self:broadcast("delete", node, node_obj.subscribers, nil, actor, node_obj); return true; end @@ -562,10 +563,15 @@ local event_data = { service = self, node = node, actor = actor, id = id, item = item }; self.events.fire_event("item-published/"..node, event_data); self.events.fire_event("item-published", event_data); - self.config.broadcaster("items", node, node_obj.subscribers, item, actor, node_obj, self); + self:broadcast("items", node, node_obj.subscribers, item, actor, node_obj); return true; end +function service:broadcast(event, node, subscribers, item, actor, node_obj) + subscribers = self.config.subscriber_filter(subscribers, node, event); + return self.config.broadcaster(event, node, subscribers, item, actor, node_obj, self); +end + function service:retract(node, actor, id, retract) --> ok, err -- Access checking if not self:may(node, actor, "retract") then @@ -582,7 +588,7 @@ end self.events.fire_event("item-retracted", { service = self, node = node, actor = actor, id = id }); if retract then - self.config.broadcaster("retract", node, node_obj.subscribers, retract, actor, node_obj, self); + self:broadcast("retract", node, node_obj.subscribers, retract, actor, node_obj); end return true end @@ -604,7 +610,7 @@ end self.events.fire_event("node-purged", { service = self, node = node, actor = actor }); if notify then - self.config.broadcaster("purge", node, node_obj.subscribers, nil, actor, node_obj, self); + self:broadcast("purge", node, node_obj.subscribers, nil, actor, node_obj); end return true end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/util/startup.lua new/prosody-0.11.4/util/startup.lua --- old/prosody-0.11.3/util/startup.lua 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/util/startup.lua 2020-01-02 10:49:37.000000000 +0100 @@ -33,7 +33,8 @@ if file then file:close(); prosody.config_file = filename; - CFG_CONFIGDIR = filename:match("^(.*)[\\/][^\\/]*$"); -- luacheck: ignore 111 + prosody.paths.config = filename:match("^(.*)[\\/][^\\/]*$"); + CFG_CONFIGDIR = prosody.paths.config; -- luacheck: ignore 111 break; end end @@ -230,8 +231,14 @@ function startup.chdir() if prosody.installed then + local lfs = require "lfs"; + -- Ensure paths are absolute, not relative to the working directory which we're about to change + local cwd = lfs.currentdir(); + prosody.paths.source = config.resolve_relative_path(cwd, prosody.paths.source); + prosody.paths.config = config.resolve_relative_path(cwd, prosody.paths.config); + prosody.paths.data = config.resolve_relative_path(cwd, prosody.paths.data); -- Change working directory to data path. - require "lfs".chdir(prosody.paths.data); + lfs.chdir(prosody.paths.data); end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/prosody-0.11.3/util-src/pposix.c new/prosody-0.11.4/util-src/pposix.c --- old/prosody-0.11.3/util-src/pposix.c 2019-08-31 16:08:45.000000000 +0200 +++ new/prosody-0.11.4/util-src/pposix.c 2020-01-02 10:49:37.000000000 +0100 @@ -721,20 +721,20 @@ struct mallinfo info = mallinfo(); lua_createtable(L, 0, 5); /* This is the total size of memory allocated with sbrk by malloc, in bytes. */ - lua_pushinteger(L, info.arena); + lua_pushinteger(L, (unsigned)info.arena); lua_setfield(L, -2, "allocated"); /* This is the total size of memory allocated with mmap, in bytes. */ - lua_pushinteger(L, info.hblkhd); + lua_pushinteger(L, (unsigned)info.hblkhd); lua_setfield(L, -2, "allocated_mmap"); /* This is the total size of memory occupied by chunks handed out by malloc. */ - lua_pushinteger(L, info.uordblks); + lua_pushinteger(L, (unsigned)info.uordblks); lua_setfield(L, -2, "used"); /* This is the total size of memory occupied by free (not in use) chunks. */ - lua_pushinteger(L, info.fordblks); + lua_pushinteger(L, (unsigned)info.fordblks); lua_setfield(L, -2, "unused"); /* This is the size of the top-most releasable chunk that normally borders the end of the heap (i.e., the high end of the virtual address space's data segment). */ - lua_pushinteger(L, info.keepcost); + lua_pushinteger(L, (unsigned)info.keepcost); lua_setfield(L, -2, "returnable"); return 1; }
