On Mon, 18 Apr 2022 08:43:24 +0300 Michael Tokarev <m...@tls.msk.ru> wrote:
..
Maybe we can always update this (very small) file as a part of the
daemon startup procedure.

It looks like I completely misunderstood this file purpose.
Am I right this is just the initial key and unbound updates
this key automatically by its own?

auto-trust-anchor-file: <filename>
 File with trust anchor for one zone, which is tracked with RFC5011 probes.

Okay, it smells like it is, and it definitely it should not
be copied from /usr/share/dns/root.key..

I'll re-do my changes there (which I already comitted).

But now I've a question: how the initial problem happened?

The script (/usr/lib/unbound/package-helper) use install(1)
to update the file and to chown it (this also smells unsafe
from the security PoV). And install unlinks the destination
file first, creates destination file, writes contents to
it, and closes it.  It looks like we should not use install(1)
here, or maybe install it to .tmp and mv it atomically, -
and from _there_, the problem will just go away.

/mjt

Reply via email to