# HG changeset patch # User Sebastien Decugis # Date 1362237686 -3600 # Node ID 69d55a534aff7f6a9d818477c0409ad7a777b8a4 # Parent e5a09fab5ef3f3a45db27aba4f02421f0a158456 Improve configuration parser of acl_wl extension, to avoid errors sent on stdout/stderr diff -r e5a09fab5ef3 -r 69d55a534aff extensions/acl_wl/aw_conf.l --- a/extensions/acl_wl/aw_conf.l Sat Mar 02 14:03:04 2013 +0100 +++ b/extensions/acl_wl/aw_conf.l Sat Mar 02 16:21:26 2013 +0100 @@ -92,4 +92,11 @@ return FQDN; } + /* No match */ +<*>[[:alnum:]]+ | /* This rule is only useful to print a complete token in error messages */ +<*>. { + TRACE_DEBUG_ERROR("Unrecognized text on line %d col %d: '%s'.\n", yylloc->first_line, yylloc->first_column, yytext); + return LEX_ERROR; + } + %% diff -r e5a09fab5ef3 -r 69d55a534aff extensions/acl_wl/aw_conf.y --- a/extensions/acl_wl/aw_conf.y Sat Mar 02 14:03:04 2013 +0100 +++ b/extensions/acl_wl/aw_conf.y Sat Mar 02 16:21:26 2013 +0100 @@ -126,5 +126,10 @@ { fqdn_added++; } + | conffile LEX_ERROR + { + yyerror(&yylloc, conffile, "An error occurred while parsing the configuration file"); + return EINVAL; + } ;