Limit recursion in ap_expr evaluation to avoid unbounded stack usage
* evaluate chains of ||, &&, and string concatenation non-recursively
* limit other types of recursion to 20 levels
* avoid some string copies if concatenating more than 2 strings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1204730 13f79535-47bb-0310-9956-ffa450edef68
- add possibility to have expressions that evaluate to a string and not to
a boolean value
- modify ap_expr_parse_cmd() interface to support this and make it more
convenient to use in general
- rename AP_EXPR_FLAGS_* to AP_EXPR_FLAG_* for consistency
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1142164 13f79535-47bb-0310-9956-ffa450edef68
* a restricted mode that does not allow to bypass request access restrictions
* new variables DOCUMENT_URI (alias for REQUEST_URI), LAST_MODIFIED
* -A as an alias for -U
* an additional data entry in ap_expr_eval_ctx_t for use by the consumer
* an extensible ap_expr_exec_ctx() API that allows to use that data entry
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1128564 13f79535-47bb-0310-9956-ffa450edef68
- allow lookup function to pre-parse string constant arguments
(used for subnet masks so far)
- various bug fixes for binary operators
- do strdup() for error messages created on the stack to avoid corruption
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1039900 13f79535-47bb-0310-9956-ffa450edef68
- minor bump for ap_expr_exec_re() introduced in r1037504
- actually commit the changes to allow using backreferences in SetEnvIfExpr
- automatically add the correct entries to the Vary-header if the result of
an expression evaluation depends on a request header
(can be turned off by setting the AP_EXPR_FLAGS_DONT_VARY flag)
- set AP_EXPR_FLAGS_DONT_VARY in mod_log_config's conditional logging
- fix various off-by-one errors in req_table_func
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037540 13f79535-47bb-0310-9956-ffa450edef68
- implement regex backreferences and make them available for setting
envvars in SetEnvIfExpr
- implement nested function calls in %-syntax: %{func1:%{func2:arg}}
- actually implement evaluation of concatenation operator (oops...)
- Fix <If ... > treating an internal error as success
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037504 13f79535-47bb-0310-9956-ffa450edef68
the new parser. Rework ap_expr's public interface and provide hooks for modules
to add variables and functions.
The Netware and Windows build files still need to be adjusted
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032073 13f79535-47bb-0310-9956-ffa450edef68
a list of tokens. Couldn't resist after sf's comment on r1002363!
This means expressions like
<If %{REQUEST_METHOD} IN GET,HEAD,OPTIONS,...>
will work as a drop-in substitute for <Limit>
Also fix off-by-one bug in variable evaluation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002415 13f79535-47bb-0310-9956-ffa450edef68
arbitrary expressions in Require lines.
The main issue I wanted to fix was that the env provider only allows to
check for the existance of an envvar but not the contents.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002363 13f79535-47bb-0310-9956-ffa450edef68