On 07/17/2013 10:22 PM, Amos Jeffries wrote:
>> 2) Does not allow inside double quoted strings an escaped $ or %
>> character if the parameter does not support macros.
> What about users who want to place config files in a directory path with
> spaces AND use per-worker ${process_number} macro on the filenames ?
AFAIK, the ${process_number} macro is a pre-processor macro and Squid
pre-processor currently does not know about quoted strings. It will
substitute that macro in virtually any context.
IMO that blind expansion is conceptually wrong, but fixing that may not
be possible without revamping the entire lower-level parsing code so
that the preprocessor does tokenization itself (and, hence, detects
things like quoted strings).
However, the proposed patch does not make things worse in the context of
double quoted strings discussed in the item (2) above: Since all
squid.conf directives support ${process_number} macro (essentially), the
presence and expansion of that macro in double quoted strings fits the
overall quoted strings syntax.
We would have to deal with the lower level parsing revamp when/if we add
support for single-quoted strings that ought to prevent any macro
expansion, including expansion of the ${process_number} macros.
> The initial specifications included no macro expansion inside single
> quotes (The ${process_name} and ${process_number} and any other new
> macro will be added should not expand inside single quotes). This is
> requires many changes in configuration file pre-processing code, so it
> is not implemented.
Can we prohibit bare single-quoted strings then? This way we will not
have to deal with backward compatibility problems when/if we properly
introduce them later. If somebody needs a single quote after this patch,
it can be escaped or included inside a quoted string, of course. Or is
prohibiting single quoted strings too difficult as well?
This is just a question. Do not let it stop you from committing your
changes to trunk if you and others are happy with them.
Cheers,
Alex.
Received on Thu Jul 18 2013 - 04:47:22 MDT
This archive was generated by hypermail 2.2.0 : Fri Jul 19 2013 - 12:00:47 MDT