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)
-- 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')
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())