]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon: add ability to load modules with _ in name
authorPetr Špaček <petr.spacek@nic.cz>
Wed, 1 Nov 2017 16:52:12 +0000 (17:52 +0100)
committerPetr Špaček <petr.spacek@nic.cz>
Wed, 1 Nov 2017 17:26:28 +0000 (18:26 +0100)
daemon/lua/sandbox.lua

index 63dbbb76d188004e4c85ce1621a0a0c1a2374645..5d57c22ef2b6c99bfaf983220270eebffc31f621 100644 (file)
@@ -113,7 +113,7 @@ setmetatable(modules, {
                if type(k) == 'number' then k = v v = nil end
                if not rawget(_G, k) then
                        modules.load(k)
-                       k = string.match(k, '%w+')
+                       k = string.match(k, '[%w_]+')
                        local mod = _G[k]
                        local config = mod and rawget(mod, 'config')
                        if mod ~= nil and config ~= nil then