Skip to content
Snippets Groups Projects
Commit 32e1f331 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

daemon/trust_anchors: fixed root key fetch

parent 84976b1d
Branches
Tags
No related merge requests found
......@@ -52,7 +52,8 @@ if not ffi_ok then
if not io.open(path, 'r') then
local rr, err = bootstrap()
if not rr then print(err) return false end
io.open(path, 'w'):write(rr..'\n')
local keyfile = assert(io.open(path, 'w'))
keyfile:write(rr..'\n')
end
for line in io.lines(path) do
trustanchor(line)
......@@ -255,7 +256,6 @@ local trust_anchors = {
-- Bootstrap if requested and keyfile doesn't exist
if not io.open(path, 'r') then
local rr, msg = bootstrap()
print(msg)
if not rr then
error('you MUST obtain the root TA manually, see: '..
'http://knot-resolver.readthedocs.org/en/latest/daemon.html#enabling-dnssec')
......
......@@ -175,7 +175,9 @@ local rrparser = {
file = function (path)
local zs = zs_scanner_t()
local ok, err = zs:open(path)
if not ok then error(err) end
if not ok then
return ok, err
end
local results = {}
while zs:parse() do
table.insert(results, zs:current_rr())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment