aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
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");