mirror of
https://github.com/apache/httpd.git
synced 2025-08-05 16:55:50 +03:00
Definately need a canonical name, so comparison succeeds at run time.
PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86375 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
8
modules/cache/mod_file_cache.c
vendored
8
modules/cache/mod_file_cache.c
vendored
@@ -273,8 +273,10 @@ static const char *mmapfile(cmd_parms *cmd, void *dummy, const char *filename)
|
|||||||
a_file *new_file;
|
a_file *new_file;
|
||||||
a_file tmp;
|
a_file tmp;
|
||||||
apr_file_t *fd = NULL;
|
apr_file_t *fd = NULL;
|
||||||
|
char *fspec;
|
||||||
|
|
||||||
if (apr_stat(&tmp.finfo, filename, cmd->temp_pool) != APR_SUCCESS) {
|
fspec = ap_os_case_canonical_filename(cmd->pool, filename);
|
||||||
|
if (apr_stat(&tmp.finfo, fspec, cmd->temp_pool) != APR_SUCCESS) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
|
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
|
||||||
"mod_file_cache: unable to stat(%s), skipping", filename);
|
"mod_file_cache: unable to stat(%s), skipping", filename);
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -284,7 +286,7 @@ static const char *mmapfile(cmd_parms *cmd, void *dummy, const char *filename)
|
|||||||
"mod_file_cache: %s isn't a regular file, skipping", filename);
|
"mod_file_cache: %s isn't a regular file, skipping", filename);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (apr_open(&fd, filename, APR_READ, APR_OS_DEFAULT, cmd->temp_pool)
|
if (apr_open(&fd, fspec, APR_READ, APR_OS_DEFAULT, cmd->temp_pool)
|
||||||
!= APR_SUCCESS) {
|
!= APR_SUCCESS) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
|
ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
|
||||||
"mod_file_cache: unable to open(%s, O_RDONLY), skipping", filename);
|
"mod_file_cache: unable to open(%s, O_RDONLY), skipping", filename);
|
||||||
@@ -299,7 +301,7 @@ static const char *mmapfile(cmd_parms *cmd, void *dummy, const char *filename)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
apr_close(fd);
|
apr_close(fd);
|
||||||
tmp.filename = apr_pstrdup(cmd->pool, filename);
|
tmp.filename = fspec;
|
||||||
sconf = ap_get_module_config(cmd->server->module_config, &file_cache_module);
|
sconf = ap_get_module_config(cmd->server->module_config, &file_cache_module);
|
||||||
new_file = apr_push_array(sconf->files);
|
new_file = apr_push_array(sconf->files);
|
||||||
*new_file = tmp;
|
*new_file = tmp;
|
||||||
|
Reference in New Issue
Block a user