Changeset

13869:f44f2a8a8c37 13.0

mod_admin_shell: Fix matching logic in s2s:close (Thanks Menel) It was matching 'from' on the wrong field and the boolean logic was wrong.
author Kim Alvefur <zash@zash.se>
date Mon, 28 Apr 2025 19:41:19 +0200
parents 13868:14b52f217f7a
children 13870:8078eebf5601
files plugins/mod_admin_shell.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua	Fri Apr 25 17:05:13 2025 +0200
+++ b/plugins/mod_admin_shell.lua	Mon Apr 28 19:41:19 2025 +0200
@@ -1587,7 +1587,7 @@
 
 	for _, session in pairs(s2s_sessions) do
 		local id = session.id or (session.type .. tostring(session):match("[a-f0-9]+$"));
-		if (match_id and match_id == id) or ((from and match_wildcard(from, session.to_host)) or (to and match_wildcard(to, session.to_host))) then
+		if (match_id and match_id == id) or ((from and match_wildcard(from, session.from_host)) and (to and match_wildcard(to, session.to_host))) then
 			print(("Closing connection from %s to %s [%s]"):format(session.from_host, session.to_host, id));
 			(session.close or s2smanager.destroy_session)(session, build_reason(text, condition));
 			count = count + 1;