]> git.ipfire.org Git - thirdparty/bind9.git/commit
cfg_parse_ functions internally handle the parser
authorColin Vidal <colin@isc.org>
Wed, 22 Oct 2025 09:49:09 +0000 (11:49 +0200)
committerEvan Hunt <each@isc.org>
Thu, 23 Oct 2025 20:01:08 +0000 (13:01 -0700)
commitd03f6e6fd47ff083f9b3bfa17306d7de00b517d2
treeb806b71a039235bea82a5f0d3eb5e0368c8f3ac9
parent0191ba5540e5bdfeddc275755bf72c26722d38ec
cfg_parse_ functions internally handle the parser

Instead of (1) allocating a parser, (2) parsing a file/buffer then (3)
freeing the parser, the parser is now internally created/destroyed from
within the `cfg_parse_*` functions. This simplifies a lot the use cases,
especially around the error cases where the parser needs to be freed in
a cleanup goto.

The only trick was the parser callback mechanism, which would previously
have been set up between steps 1 and 2.  Since it's never been used for
any purpose other than the "directory" option, the chdir call has now
been moved inside the parser and the generic callback mechanism has been
removed, replacing CFG_CLAUSEFLAG_CALLBACK with CFG_CLAUSEFLAG_CHDIR.
25 files changed:
bin/check/named-checkconf.c
bin/delv/delv.c
bin/dig/dighost.c
bin/dnssec/dnssec-keygen.c
bin/dnssec/dnssec-ksr.c
bin/named/config.c
bin/named/controlconf.c
bin/named/include/named/config.h
bin/named/server.c
bin/nsupdate/nsupdate.c
bin/plugins/filter-a.c
bin/plugins/filter-aaaa.c
bin/plugins/synthrecord.c
bin/rndc/rndc.c
bin/tests/system/checkconf/tests.sh
bin/tests/system/hooks/driver/test-syncplugin.c
doc/misc/cfg_test.c
lib/isccfg/include/isccfg/cfg.h
lib/isccfg/include/isccfg/grammar.h
lib/isccfg/namedconf.c
lib/isccfg/parser.c
tests/isccfg/duration_test.c
tests/isccfg/grammar_test.c
tests/isccfg/meson.build
tests/isccfg/parser_test.c