mod_firewall: Fix to find scripts when installed with plugin installer
authorKim Alvefur <zash@zash.se>
Sun, 11 Feb 2024 12:50:53 +0100
changeset 5838 866a49f5aa61
parent 5837 58df53eefa28
child 5839 9f41d2d33e3e
mod_firewall: Fix to find scripts when installed with plugin installer Extra resources are stored in a different path by luarocks, not alongside the code as this code assumed. Thanks eTaurus
mod_firewall/mod_firewall.lua
--- a/mod_firewall/mod_firewall.lua	Wed Feb 07 11:57:30 2024 +0000
+++ b/mod_firewall/mod_firewall.lua	Sun Feb 11 12:50:53 2024 +0100
@@ -612,7 +612,7 @@
 local function resolve_script_path(script_path)
 	local relative_to = prosody.paths.config;
 	if script_path:match("^module:") then
-		relative_to = module.path:sub(1, -#("/mod_"..module.name..".lua"));
+		relative_to = module:get_directory();
 		script_path = script_path:match("^module:(.+)$");
 	end
 	return resolve_relative_path(relative_to, script_path);