[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
Wed Aug 29 15:19:53 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-29-2007 15:19 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-29-07 15:19  
---------------------------------------------------------------------- 
OK, I've uploaded the diffs.patch, which applies to trunk.

I will momentarily commit these changes to trunk, and see what the
reaction is.

If this fix is borked, or not what y'all are looking for, it can be
reverted. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-29-07 15:19  murf           Note Added: 0069656                          
======================================================================




More information about the asterisk-bugs mailing list