changeset 2415:07d7036040ee

mod_firewall: Insert semicolons after some statements to prevent ambiguous syntax in output (fixes #797)
author Kim Alvefur <zash@zash.se>
date Tue, 13 Dec 2016 16:57:16 +0100
parents 97b4229982f5
children ade918cd9ca7
files mod_firewall/actions.lib.lua mod_firewall/mod_firewall.lua
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/actions.lib.lua	Sun Dec 04 10:19:07 2016 +0100
+++ b/mod_firewall/actions.lib.lua	Tue Dec 13 16:57:16 2016 +0100
@@ -114,7 +114,7 @@
 local function route_modify(make_new, to, drop)
 	local reroute, deps = "session.send(newstanza)", { "st" };
 	if to then
-		reroute = ("newstanza.attr.to = %q; core_post_stanza(session, newstanza)"):format(to);
+		reroute = ("newstanza.attr.to = %q; core_post_stanza(session, newstanza);"):format(to);
 		deps[#deps+1] = "core_post_stanza";
 	end
 	return ([[local newstanza = st.%s; %s;%s]])
@@ -158,7 +158,7 @@
 function action_handlers.LOG(string)
 	local level = string:match("^%[(%a+)%]") or "info";
 	string = string:gsub("^%[%a+%] ?", "");
-	return meta(("(session.log or log)(%q, %q)"):format(level, string));
+	return meta(("(session.log or log)(%q, %q);"):format(level, string));
 end
 
 function action_handlers.RULEDEP(dep)
--- a/mod_firewall/mod_firewall.lua	Sun Dec 04 10:19:07 2016 +0100
+++ b/mod_firewall/mod_firewall.lua	Tue Dec 13 16:57:16 2016 +0100
@@ -93,7 +93,7 @@
 	to = { local_code = [[local to = stanza.attr.to or jid_bare(session.full_jid);]]; depends = { "jid_bare" } };
 	from = { local_code = [[local from = stanza.attr.from;]] };
 	type = { local_code = [[local type = stanza.attr.type;]] };
-	name = { local_code = [[local name = stanza.name]] };
+	name = { local_code = [[local name = stanza.name;]] };
 	split_to = { -- The stanza's split to address
 		depends = { "jid_split", "to" };
 		local_code = [[local to_node, to_host, to_resource = jid_split(to);]];