Diff

plugins/mod_admin_shell.lua @ 12228:f60f9cd9d26c

mod_admin_shell: Use exact match instead of Lua patterns in c2s,s2s:show It is unexpected that 'example.com' matches 'exampleicom.org' and this use of Lua patterns is undocumented and unlikely to be widely known or used.
author Kim Alvefur <zash@zash.se>
date Sun, 30 Jan 2022 11:10:51 +0100
parent 12226:7db81c9cbbbf
child 12229:30ea791ce817
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua	Sat Jan 29 16:11:38 2022 +0100
+++ b/plugins/mod_admin_shell.lua	Sun Jan 30 11:10:51 2022 +0100
@@ -903,7 +903,7 @@
 
 	local function match(session)
 		local jid = get_jid(session)
-		return (not match_jid) or jid:match(match_jid)
+		return (not match_jid) or jid == match_jid;
 	end
 
 	local group_by_host = true;
@@ -986,7 +986,7 @@
 
 	local function match(session)
 		local host, remote = get_s2s_hosts(session);
-		return not match_jid or (host or ""):match(match_jid) or (remote or ""):match(match_jid);
+		return not match_jid or host == match_jid or remote == match_jid;
 	end
 
 	local group_by_host = true;