Changeset

4921:9a01c6bc435e

mod_proxy65: Fix ACL
author Kim Alvefur <zash@zash.se>
date Tue, 29 May 2012 17:20:02 +0200
parents 4920:e27adbf4e743
children 4922:d1fdc545f8b2
files plugins/mod_proxy65.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_proxy65.lua	Mon May 28 15:59:10 2012 +0000
+++ b/plugins/mod_proxy65.lua	Tue May 29 17:20:02 2012 +0200
@@ -124,9 +124,11 @@
 		-- check ACL
 		while proxy_acl and #proxy_acl > 0 do -- using 'while' instead of 'if' so we can break out of it
 			local jid = stanza.attr.from;
+			local allow;
 			for _, acl in ipairs(proxy_acl) do
-				if jid_compare(jid, acl) then break; end
+				if jid_compare(jid, acl) then allow = true; break; end
 			end
+			if allow then break; end
 			module:log("warn", "Denying use of proxy for %s", tostring(stanza.attr.from));
 			origin.send(st.error_reply(stanza, "auth", "forbidden"));
 			return true;