aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-07-04 02:33:15 +0200
committerKim Alvefur <zash@zash.se>2021-07-04 02:33:15 +0200
commit6f60a98b166796f0be7515ec8636027972e34f92 (patch)
treef3e4e323f357a7427d6c4eba917c004ff23e97b9 /util
parent37395dfb23cf6d82561a8709df673e571cd18f56 (diff)
downloadprosody-6f60a98b166796f0be7515ec8636027972e34f92.tar.gz
prosody-6f60a98b166796f0be7515ec8636027972e34f92.zip
util.prosodyctl.check: Normalize away trailing dot in some messages too
Diffstat (limited to 'util')
-rw-r--r--util/prosodyctl/check.lua21
1 files changed, 13 insertions, 8 deletions
diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua
index 1ed3c37c..1795b01d 100644
--- a/util/prosodyctl/check.lua
+++ b/util/prosodyctl/check.lua
@@ -365,6 +365,10 @@ local function check(arg)
local v6_supported = not not socket.tcp6;
+ local function trim_dns_name(n)
+ return (n:gsub("%.$", ""));
+ end
+
for jid, host_options in enabled_hosts() do
local all_targets_ok, some_targets_ok = true, false;
local node, host = jid_split(jid);
@@ -388,9 +392,10 @@ local function check(arg)
print(" 'xmpp-client' service disabled by pointing to '.'"); -- FIXME Explain better what this is
break;
end
- target_hosts:add(record.srv.target);
+ local target = trim_dns_name(record.srv.target);
+ target_hosts:add(target);
if not c2s_ports:contains(record.srv.port) then
- print(" SRV target "..record.srv.target.." contains unknown client port: "..record.srv.port);
+ print(" SRV target "..target.." contains unknown client port: "..record.srv.port);
end
end
else
@@ -410,9 +415,10 @@ local function check(arg)
print(" 'xmpps-client' service disabled by pointing to '.'"); -- FIXME Explain better what this is
break;
end
- target_hosts:add(record.srv.target);
+ local target = trim_dns_name(record.srv.target);
+ target_hosts:add(target);
if not c2s_tls_ports:contains(record.srv.port) then
- print(" SRV target "..record.srv.target.." contains unknown Direct TLS client port: "..record.srv.port);
+ print(" SRV target "..target.." contains unknown Direct TLS client port: "..record.srv.port);
end
end
else
@@ -428,9 +434,10 @@ local function check(arg)
print(" 'xmpp-server' service disabled by pointing to '.'"); -- FIXME Explain better what this is
break;
end
- target_hosts:add(record.srv.target);
+ local target = trim_dns_name(record.srv.target);
+ target_hosts:add(target);
if not s2s_ports:contains(record.srv.port) then
- print(" SRV target "..record.srv.target.." contains unknown server port: "..record.srv.port);
+ print(" SRV target "..target.." contains unknown server port: "..record.srv.port);
end
end
else
@@ -446,8 +453,6 @@ local function check(arg)
target_hosts:add(host);
end
- target_hosts = target_hosts / function(target) return target:gsub("%.$", ""); end
-
if target_hosts:contains("localhost") then
print(" Target 'localhost' cannot be accessed from other servers");
target_hosts:remove("localhost");