Skip to content

Commit

Permalink
(MODPYTHON-63) Fixes to code previously set down for handling <Direct…
Browse files Browse the repository at this point in the history
…ory ~>

and <DirectoryMatch> as it wasn't decoding configuration correctly and in
case of <DirectoryMatch> could cause Apache to crash.
  • Loading branch information
grahamd committed Aug 5, 2006
1 parent a79e832 commit ffa9273
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/python/mod_python/__init__.py
Expand Up @@ -20,5 +20,5 @@
__all__ = ["apache", "cgihandler", "psp",
"publisher", "util", "python22"]

version = "3.3.0-dev-20060803"
version = "3.3.0-dev-20060805"

4 changes: 2 additions & 2 deletions src/include/mpversion.h
@@ -1,5 +1,5 @@
#define MPV_MAJOR 3
#define MPV_MINOR 3
#define MPV_PATCH 0
#define MPV_BUILD 20060803
#define MPV_STRING "3.3.0-dev-20060803"
#define MPV_BUILD 20060805
#define MPV_STRING "3.3.0-dev-20060805"
9 changes: 4 additions & 5 deletions src/mod_python.c
Expand Up @@ -963,27 +963,26 @@ static void determine_context(apr_pool_t *p, const cmd_parms* cmd,

directory = ap_getword_conf(p, &arg);

if (!strcmp(cmd->path, "~")) {
regex = ap_pregcomp(p, directory, AP_REG_EXTENDED|USE_ICASE);
if (!strcmp(directory, "~")) {
directory = ap_getword_conf(p, &arg);
regex = ap_pregcomp(p, cmd->path, AP_REG_EXTENDED|USE_ICASE);
} else if (ap_is_matchexp(directory)) {
d_is_fnmatch = 1;
}
} else if ((context = find_parent(directive, "<DirectoryMatch"))) {
regex = ap_pregcomp(p, directory, AP_REG_EXTENDED|USE_ICASE);

arg = context->args;
endp = ap_strrchr_c(arg, '>');
arg = apr_pstrndup(p, arg, endp - arg);

directory = ap_getword_conf(p, &arg);
regex = ap_pregcomp(p, directory, AP_REG_EXTENDED|USE_ICASE);
}
else if (cmd->config_file != NULL) {
/* cmd->config_file is NULL when in main Apache
* configuration file as the file is completely
* read in before the directive is processed as
* EXEC_ON_READ is not set in req_override field
* of command_struct table entry. Thus now then
* of command_struct table entry. Thus know then
* we are being used in a .htaccess file. */

directory = ap_make_dirstr_parent(p, directive->filename);
Expand Down

0 comments on commit ffa9273

Please sign in to comment.