]> 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 08:25:23 +0000 (09:25 +0100)
commitca7cd80dd524fab357ac21f3bc4f2bcc7ca9a018
tree3192c08b8d5e0d6be4f33d529463a1b1d6622fbe
parent6bb0246ea3da41abc4e4ca72dcd255af747dcfb0
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.

(cherry picked from commit 1f400b68a8e6b7a1111151b512eaee2c49bae2ad)
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]