]> git.ipfire.org Git - thirdparty/asterisk.git/commit
config.c: fix saving of deep/wide template configurations
authorAllan Nathanson <42244061+Allan-N@users.noreply.github.com>
Wed, 10 Sep 2025 20:35:27 +0000 (16:35 -0400)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 23 Sep 2025 19:48:25 +0000 (19:48 +0000)
commit7bd30279def05d82540d49808395d7b03f0deb13
tree16e5ca2aa8dd0ed7280522e3bc372f1dbd367885
parent32c41efa0442b6e60f8f405548ecf934b7704f4e
config.c: fix saving of deep/wide template configurations

Follow-on to #244 and #960 regarding how the ast_config_XXX APIs
handle template inheritance.

ast_config_text_file_save2() incorrectly suppressed variables if they
matched any ancestor template.  This broke deep chains (dropping values
based on distant parents) and wide inheritance (ignoring last-wins order
across multiple parents).

The function now inspects the full template hierarchy to find the nearest
effective parent (last occurrence wins).  Earlier inherited duplicates are
collapsed, explicit overrides are kept unless they exactly match the parent,
and PreserveEffectiveContext avoids writing redundant lines.

Resolves: #1451
main/config.c