]> git.ipfire.org Git - thirdparty/bind9.git/commit
Do not ignore resolv.conf syntax errors
authorMichał Kępień <michal@isc.org>
Mon, 26 Feb 2018 09:52:58 +0000 (10:52 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 6 Mar 2018 07:27:45 +0000 (08:27 +0100)
commit1f400b68a8e6b7a1111151b512eaee2c49bae2ad
treef62829c85aceba1d9160a535442e0a0ba50173ef
parent5c0327e8ffe9a76a7727283048d8165a6e7796b7
Do not ignore resolv.conf syntax errors

irs_resconf_load() stores the value returned by add_search() into ret
without consulting its current value first.  This causes any previous
errors raised while parsing resolv.conf to be ignored as long as any
"domain" or "search" statement is present in the file.

Prevent this by returning early in case an error is detected while
parsing resolv.conf.  Ensure that "searchlist" and "magic" members of
the created irs_resconf_t structure are always initialized before
isc_resconf_destroy() is called.
lib/irs/resconf.c
lib/irs/tests/resconf_test.c
lib/irs/tests/testdata/options-bad-ndots.conf [new file with mode: 0644]
lib/irs/tests/testdata/options-empty.conf [new file with mode: 0644]