]> 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)
committerAllan Nathanson <42244061+Allan-N@users.noreply.github.com>
Tue, 23 Sep 2025 19:48:22 +0000 (19:48 +0000)
commit8340954c42c0ae50e39e0b4232e9d01cb3326afa
tree19350f7944df2eaa447996ec2235242da1ac92d8
parent201a55324d4e54538d0c0dd9ad75de9f68ef1948
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