aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s/mod_s2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-09-07 17:44:57 +0200
committerKim Alvefur <zash@zash.se>2019-09-07 17:44:57 +0200
commit5c27fe4b793490d6ec80cdbdcc5063ae3b660766 (patch)
tree13bad75ec6f3424f26c6b5fd47d44078fbccb05d /plugins/mod_s2s/mod_s2s.lua
parent6f213da0a0d3c6c292f2ba6baebf1238ef4ea13d (diff)
downloadprosody-5c27fe4b793490d6ec80cdbdcc5063ae3b660766.tar.gz
prosody-5c27fe4b793490d6ec80cdbdcc5063ae3b660766.zip
mod_s2s: Handle authentication of s2sin and s2sout the same way
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua12
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 6c4d92ae..d8e631b9 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -249,15 +249,13 @@ function make_authenticated(event)
session.type = "s2sout";
elseif session.type == "s2sin_unauthed" then
session.type = "s2sin";
- if host then
- if not session.hosts[host] then session.hosts[host] = {}; end
- session.hosts[host].authed = true;
- end
- elseif session.type == "s2sin" and host then
+ elseif session.type ~= "s2sin" and session.type ~= "s2sout" then
+ return false;
+ end
+
+ if session.incoming and host then
if not session.hosts[host] then session.hosts[host] = {}; end
session.hosts[host].authed = true;
- else
- return false;
end
session.log("debug", "connection %s->%s is now authenticated for %s", session.from_host, session.to_host, host);