Write /etc/resolv.conf in a more atomic manner.
authorflorian <florian@openbsd.org>
Fri, 2 Sep 2022 09:39:55 +0000 (09:39 +0000)
committerflorian <florian@openbsd.org>
Fri, 2 Sep 2022 09:39:55 +0000 (09:39 +0000)
commit3a57ef91005472e5b4735b56dd19a3b4688ef250
treee80d97861bb8de079a7401caabd39f7ccf4275c5
parent2547ab58da20f1cad368fd53e440f9114df03ee5
Write /etc/resolv.conf in a more atomic manner.

There were few reports were /etc/resolv.conf would lose user-managed
lines, possibly caused by a system crash.

While here add a call to fsync(2) which might also help.

input otto
input & OK deraadt, kn
sbin/resolvd/resolvd.c