Commit Graph

25 Commits

Author SHA1 Message Date
7a3526ce36 fix comment (r1476530 in trunk)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1517383 13f79535-47bb-0310-9956-ffa450edef68
2013-08-25 21:15:41 +00:00
0f0c027ee8 include/: Various doxy markup tweaks.
Backport of r1211364 from trunk.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1238409 13f79535-47bb-0310-9956-ffa450edef68
2012-01-31 11:58:02 +00:00
94a5c2e9bc Merge r1204087, 1204090:
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
2011-11-21 22:24:12 +00:00
46d4791a5d Add string valued expressions to ap_expr, do some API cleanup
- 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
2011-07-02 07:45:00 +00:00
a8c135f27e Add some features to ap_expr for use by mod_include:
* 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
2011-05-28 07:01:47 +00:00
d412770d65 Wrap at 80
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086341 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 19:02:37 +00:00
23f8375f8b doxygen improvements
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1044680 13f79535-47bb-0310-9956-ffa450edef68
2010-12-11 17:18:35 +00:00
ce6e4de41a Fix some doxygen warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1043710 13f79535-47bb-0310-9956-ffa450edef68
2010-12-08 21:59:46 +00:00
b93e49391b Rename ap_expr's typedef names:
ap_expr            ->  ap_expr_t
ap_expr_parse_ctx  ->  ap_expr_parse_ctx_t
ap_expr_eval_ctx   ->  ap_expr_eval_ctx_t
ap_expr_lookup_fn  ->  ap_expr_lookup_fn_t
ap_expr_node_op    ->  ap_expr_node_op_e


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1042146 13f79535-47bb-0310-9956-ffa450edef68
2010-12-04 11:22:30 +00:00
e27a3c21e3 - add -ipmatch, -str(c)match, -fnmatch, -R operators to ap_expr
- 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
2010-11-28 16:35:14 +00:00
c409988d42 Fix another Windows build issue: Add a wrapper around ap_run_expr_lookup with
the correct calling convention.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1039528 13f79535-47bb-0310-9956-ffa450edef68
2010-11-26 19:32:13 +00:00
b6649687a3 More ap_expr updates:
- 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
2010-11-21 19:51:41 +00:00
6ef1911acc ap_expr related fixes/enhancements:
- 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
2010-11-21 17:22:26 +00:00
35cdba6976 Replace ap_expr with a parser derived from mod_ssl's parser. Make mod_ssl use
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
2010-11-06 14:31:16 +00:00
6ed93282a7 Add "IN" operator to expression parser, to evaluate membership of
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
2010-09-28 23:26:44 +00:00
a10a4e4f2f This is just too easy to not do it: Add an 'expr' authz provider that allows
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
2010-09-28 21:33:44 +00:00
9cd5afd692 Fix mod_include potential segfault checking backref from unmatched regexp
http://markmail.org/message/jlc7t5edsjujbe37
Patch by rpluem, lars, niq


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@795445 13f79535-47bb-0310-9956-ffa450edef68
2009-07-18 23:12:58 +00:00
cb4a8ab247 Declare the callback function NONSTD
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664173 13f79535-47bb-0310-9956-ffa450edef68
2008-06-06 22:40:15 +00:00
500c9cb211 Remove ap_expr_clone from the API (same day it was added:-)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@643175 13f79535-47bb-0310-9956-ffa450edef68
2008-03-31 22:10:36 +00:00
41df671a88 Flesh out ap_expr with:
* Re-usable parse trees
 * Canonical string parser function (candidate)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@642971 13f79535-47bb-0310-9956-ffa450edef68
2008-03-31 12:16:58 +00:00
4ac9672dde * Add some doxygen stub / stuff
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@642631 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 22:33:51 +00:00
a792c6a396 * Prevent multiple "execution" of ap_expr.h contents when included multiple
times and allow it to be included by C++ files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@642630 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 22:29:39 +00:00
dd2aa04626 * For AP_MAX_REG_MATCH we need to ensure that httpd.h is there, otherwise we
fail to compile exports.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@642629 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 22:25:07 +00:00
6df04a66fa Thou shalt not let tabs creep in.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@642596 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 19:56:55 +00:00
8f6e6a9726 Introduce ap_expr expression parser API
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@642558 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 17:13:28 +00:00