[Home]

Summary:ASTERISK-04375: [Patch] check_expr -- a small program to check for possible probs in extensions.conf
Reporter:Steve Murphy (murf)Labels:
Date Opened:2005-06-08 10:18:00Date Closed:2008-01-15 15:37:50.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) check_expr.c
Description:I have written a small program to check the extensions.conf file for
operators not surrounded by spaces, such as a regex operator in an unquoted string. Such were implicitly grouped with the old syntax, now they are seen by the parser as an operator.

This is the first problem that confused a user enough to write the mailing list. To help users in general, I think it might be wise to add this to the CVS somewhere, so if a user is confused, we can direct him to this tool, to compile and use it to find possible problems.

It is meant to be run only once, when a user upgrades from older versions of flex to flex-2.5.31 or higher. At this point, the new spaces-dont-matter-as-much parser is in affect, and legacy situations should be reviewed.

Just because check_expr flags a possible problem doesn't necc. mean that there is a real problem, but the operator in question should be checked to see it the new parsing rules might cause a problem.

I will issue new versions of this file as more experience is gained with possible user problems.


****** ADDITIONAL INFORMATION ******

The program requires one arg, the path to the extensions.conf you want to check.

Compile with:   gcc -g -o check_expr check_expr.c

It generates a log file, expr2_log

It might be cool to run the check during the make, if the flex version is >= 2.5.31, and the logfile doesn't exist.  It should only run once that way, and the users will see the results to stdout. But this may be more a headache than it's worth... up to you.
Comments:By: Donny Kavanagh (donnyk) 2005-06-08 10:22:59

I think the best scenario would be to add a feature to Asterisk similar to apache, which is to tell it to parse its config files to see if they come up clean or not.

By: Steve Murphy (murf) 2005-06-08 10:47:40

Sure, that would be really cool, but this is not that feature. It is purely meant to read "legacy", or extensions.conf files run & tested with flex < 2.5.31 (which means no flex scanner at all), flagging possible compatibility probs with the new flex scanner in place.

And, once a user codes and tests exprs in the new regime, such new exprs might be flagged also, needlessly.

These exprs would probably pass syntax check in both regimes. They just don't behave the same, is the issue. A code review of the extensions.conf would most likely find these, but sometimes you miss things. The program will hopefully help.

By: Kevin P. Fleming (kpfleming) 2005-06-09 16:49:30

Added to the 'utils' directory in CVS HEAD (with a minor fix to make it work when no expressions are found). Thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:37:50.000-0600

Repository: asterisk
Revision: 5886

A   trunk/utils/check_expr.c

------------------------------------------------------------------------
r5886 | kpfleming | 2008-01-15 15:37:50 -0600 (Tue, 15 Jan 2008) | 2 lines

add tool to check extensions.conf files for problems with new expression parser (bug ASTERISK-4375)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=5886