]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
trust_anchors: do not accept add_file() for managed TA without ta_update module
authorPetr Špaček <petr.spacek@nic.cz>
Fri, 22 Mar 2019 13:45:56 +0000 (14:45 +0100)
committerPetr Špaček <petr.spacek@nic.cz>
Thu, 4 Apr 2019 12:18:59 +0000 (14:18 +0200)
Previous version would add the TA and then print error message, which is
not expected.

daemon/lua/trust_anchors.lua.in
tests/integration/deckard

index cc1e8b3c92e7ad30cee2cd08cc6e916f3eb1cefd..d17b20df765ebbbac24ced7ff54b57b407ae8169 100644 (file)
@@ -318,6 +318,10 @@ end
 local function add_file(path, unmanaged)
        local managed = not unmanaged
        if managed then
+               if not ta_update then
+                       panic('[ ta ] automatic update for TA ' .. owner_str .. ' requested, '
+                               .. 'but required module ta_update is not loaded')
+               end
                if not io.open(path .. '.lock', 'w') then
                        error("[ ta ] ERROR: write access needed to keyfile dir '"..path.."'")
                end
@@ -370,10 +374,6 @@ local function add_file(path, unmanaged)
        -- TODO: if failed and for root, try to rebootstrap?
 
        if managed then
-               if not ta_update then
-                       panic('[ ta ] automatic update for TA ' .. owner_str .. ' requested, '
-                               .. 'but required plugin ta_update is not loaded')
-               end
                ta_update.start(owner)
        end
 end
index f601f2f7557344a6c8bc436a01f325213d1f23dd..839af3909d5af7835822f72dd2e3238fb6229edb 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f601f2f7557344a6c8bc436a01f325213d1f23dd
+Subproject commit 839af3909d5af7835822f72dd2e3238fb6229edb