[asterisk-bugs] [Asterisk 0017472]: parser mangles #include

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Jun 13 12:40:38 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17472 
====================================================================== 
Reported By:                seandarcy
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17472
Category:                   Core/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.6.2.8 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-06-05 10:10 CDT
Last Modified:              2010-06-13 12:40 CDT
====================================================================== 
Summary:                    parser mangles #include
Description: 
With an #include in extensions.conf:

[general]
static=yes
writeprotect=no

#include "exts/extensions-for-fax"

[globals]
TRUNK=DAHDI/g0
TRUNKMSD=1
.............

to a file that exists:

ls -l exts/extensions-for-fax
-rw-r--r--. 1 root root 6157 Nov 13  2009 exts/extensions-for-fax

the parser mangles the #include:

 == Parsing '/etc/asterisk/extensions.conf':   == Found
[Jun  5 10:41:42] ERROR[26393]: config.c:1098 process_text_line: The file
'exts/etensions--for-fax' was listed as a #include but it does not exist.

====================================================================== 

---------------------------------------------------------------------- 
 (0123328) nivan (reporter) - 2010-06-13 12:40
 https://issues.asterisk.org/view.php?id=17472#c123328 
---------------------------------------------------------------------- 
When reverting to the previous code to strip out the quotes everything
works. Maybe the 'strcpy(c, c + 1)' does not play nice with gcc 4.4.3? Here
is the diff for main/config.c:


1055d1054
< 		/*
1056a1056
> 			/* Dequote */
1059c1059
< 					strcpy(c, c + 1); 
---
> 					strcpy(c, c + 1); /* SAFE */
1062c1062
< 					strcpy(c, c + 1);
---
> 					strcpy(c, c + 1); /* SAFE */
1066a1067
> 			/* C-style include */
1073,1087d1073
< 		*/
< 
< 		/* revert back to old method of stripping quotes */
<                 while ((*c == '<') || (*c == '>') || (*c == '\"')) c++;
<                 /* Get rid of leading mess */
<                 cur = c;
<                 cur2 = cur;
<                 while (!ast_strlen_zero(cur)) {
<                         c = cur + strlen(cur) - 1;
<                         if ((*c == '>') || (*c == '<') || (*c == '\"'))
<                                 *c = '\0';
<                         else
<                                 break;
<                 }
< 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-06-13 12:40 nivan          Note Added: 0123328                          
======================================================================




More information about the asterisk-bugs mailing list