Commit 7d363023 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1585609 from trunk:

Allow Require expr to work when the expression is quoted.

For example as appears in our documentation:
Require expr "%{TIME_HOUR} -ge 9 && %{TIME_HOUR} -le 17"

PR: 56235

Submitted by: breser
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1678236 13f79535-47bb-0310-9956-ffa450edef68
parent a4501d34
Loading
Loading
Loading
Loading
+0 −5
Changes for STATUS: 0 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -105,11 +105,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) mod_authz_core: Allow "Require expr" to work when the expression is quoted,
     as in an example in the doc.  PR 56235
     trunk patch: http://svn.apache.org/r1585609
     2.4.x patch: trunk works (modulo CHANGES)
     +1: druggeri, breser, ylavic


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
+10 −0
Changes for modules/aaa/mod_authz_core.c: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1069,6 +1069,16 @@ static const char *expr_parse_config(cmd_parms *cmd, const char *require_line,
    const char *expr_err = NULL;
    struct require_expr_info *info = apr_pcalloc(cmd->pool, sizeof(*info));

    /* if the expression happens to be surrounded by quotes, skip them */
    if (require_line[0] == '"') {
        apr_size_t len = strlen(require_line);

        if (require_line[len-1] == '"')
            require_line = apr_pstrndup(cmd->temp_pool,
                                        require_line + 1,
                                        len - 2);
    }

    apr_pool_userdata_setn(info, REQUIRE_EXPR_NOTE, apr_pool_cleanup_null,
                          cmd->temp_pool);
    info->expr = ap_expr_parse_cmd(cmd, require_line, 0, &expr_err,