[asterisk-bugs] [Asterisk 0008684]: [patch] Fix bad handling of #include directives from manager GetConfig/UpdateConfig

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Aug 27 09:25:22 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=8684 
====================================================================== 
Reported By:                ssokol
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   8684
Category:                   Core/Configuration
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.0 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        Yes 
Request Review:              
====================================================================== 
Date Submitted:             12-28-2006 10:28 CST
Last Modified:              08-27-2007 09:25 CDT
====================================================================== 
Summary:                    [patch] Fix bad handling of #include directives from
manager GetConfig/UpdateConfig
Description: 
Currently the configuration parser used to process GetConfig/UpdateConfig
manager commands follows the standard rules for reading configuration
files: it reads until it hits a directive (#include or #exec).  When it
hits a directive, it loads the included or executed file, then continues
with the original.  Unfortunately, it does not retain any knowledge of the
directive (i.e. it has no idea that a portion of the config data was added
due to a #include).

This makes no difference when the config file is being read for the sake
of the actual running configuration, but it presents a problem for the
GetConfig and UpdateConfig manager commands.  When the UpdateConfig command
goes to save the altered version of the configuration, it has no idea that
a portion of the config data was actually inserted from another file.  Thus
all of the data gets written back to the original file and the #include
command disappears.

The attached patches avoid this issue by forcing the configuration parser
to ignore any #include directives.  The load command simply treats them as
comments so that they are retained and written back out during the save
step.
====================================================================== 

---------------------------------------------------------------------- 
 murf - 08-27-07 09:25  
---------------------------------------------------------------------- 
I personally think we could upgrade the config reader to remember #include
directives, and we can mark each entry as to its origin.

We can then regenerate the entire include tree when we write the config
files.

This issue is kinda old; is it worth my time to make these enhancements? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-27-07 09:25  murf           Note Added: 0069478                          
======================================================================




More information about the asterisk-bugs mailing list