mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
Fix the remaining APR_FINFO_NORM occurances. Again, followup is needed
to actually test any field outside the scope of APR_FINFO_MIN. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87935 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -978,7 +978,7 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
|
|||||||
ap_parse_uri(rnew, rnew->uri); /* fill in parsed_uri values */
|
ap_parse_uri(rnew, rnew->uri); /* fill in parsed_uri values */
|
||||||
|
|
||||||
if (((rv = apr_stat(&rnew->finfo, rnew->filename,
|
if (((rv = apr_stat(&rnew->finfo, rnew->filename,
|
||||||
APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS)
|
APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS)
|
||||||
&& (rv != APR_INCOMPLETE)) {
|
&& (rv != APR_INCOMPLETE)) {
|
||||||
rnew->finfo.filetype = 0;
|
rnew->finfo.filetype = 0;
|
||||||
}
|
}
|
||||||
|
@@ -491,7 +491,7 @@ static const char *cmd_rewritemap(cmd_parms *cmd, void *dconf, const char *a1,
|
|||||||
newmap->fpout = NULL;
|
newmap->fpout = NULL;
|
||||||
|
|
||||||
if (newmap->checkfile && (sconf->state == ENGINE_ENABLED)
|
if (newmap->checkfile && (sconf->state == ENGINE_ENABLED)
|
||||||
&& (apr_stat(&st, newmap->checkfile, APR_FINFO_NORM,
|
&& (apr_stat(&st, newmap->checkfile, APR_FINFO_MIN,
|
||||||
cmd->pool) != APR_SUCCESS)) {
|
cmd->pool) != APR_SUCCESS)) {
|
||||||
return apr_pstrcat(cmd->pool,
|
return apr_pstrcat(cmd->pool,
|
||||||
"RewriteMap: map file or program not found:",
|
"RewriteMap: map file or program not found:",
|
||||||
@@ -2114,14 +2114,14 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p,
|
|||||||
|
|
||||||
rc = 0;
|
rc = 0;
|
||||||
if (strcmp(p->pattern, "-f") == 0) {
|
if (strcmp(p->pattern, "-f") == 0) {
|
||||||
if (apr_stat(&sb, input, APR_FINFO_NORM, r->pool) == APR_SUCCESS) {
|
if (apr_stat(&sb, input, APR_FINFO_MIN, r->pool) == APR_SUCCESS) {
|
||||||
if (sb.filetype == APR_REG) {
|
if (sb.filetype == APR_REG) {
|
||||||
rc = 1;
|
rc = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(p->pattern, "-s") == 0) {
|
else if (strcmp(p->pattern, "-s") == 0) {
|
||||||
if (apr_stat(&sb, input, APR_FINFO_NORM, r->pool) == APR_SUCCESS) {
|
if (apr_stat(&sb, input, APR_FINFO_MIN, r->pool) == APR_SUCCESS) {
|
||||||
if ((sb.filetype == APR_REG) && sb.size > 0) {
|
if ((sb.filetype == APR_REG) && sb.size > 0) {
|
||||||
rc = 1;
|
rc = 1;
|
||||||
}
|
}
|
||||||
@@ -2129,7 +2129,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p,
|
|||||||
}
|
}
|
||||||
else if (strcmp(p->pattern, "-l") == 0) {
|
else if (strcmp(p->pattern, "-l") == 0) {
|
||||||
#if !defined(OS2)
|
#if !defined(OS2)
|
||||||
if (apr_lstat(&sb, input, APR_FINFO_NORM, r->pool) == APR_SUCCESS) {
|
if (apr_lstat(&sb, input, APR_FINFO_MIN, r->pool) == APR_SUCCESS) {
|
||||||
if (sb.filetype == APR_LNK) {
|
if (sb.filetype == APR_LNK) {
|
||||||
rc = 1;
|
rc = 1;
|
||||||
}
|
}
|
||||||
@@ -2137,7 +2137,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (strcmp(p->pattern, "-d") == 0) {
|
else if (strcmp(p->pattern, "-d") == 0) {
|
||||||
if (apr_stat(&sb, input, APR_FINFO_NORM, r->pool) == APR_SUCCESS) {
|
if (apr_stat(&sb, input, APR_FINFO_MIN, r->pool) == APR_SUCCESS) {
|
||||||
if (sb.filetype == APR_DIR) {
|
if (sb.filetype == APR_DIR) {
|
||||||
rc = 1;
|
rc = 1;
|
||||||
}
|
}
|
||||||
@@ -2174,7 +2174,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p,
|
|||||||
/* file exists for any result up to 2xx, no redirects */
|
/* file exists for any result up to 2xx, no redirects */
|
||||||
if (rsub->status < 300 &&
|
if (rsub->status < 300 &&
|
||||||
/* double-check that file exists since default result is 200 */
|
/* double-check that file exists since default result is 200 */
|
||||||
apr_stat(&sb, rsub->filename, APR_FINFO_NORM,
|
apr_stat(&sb, rsub->filename, APR_FINFO_MIN,
|
||||||
r->pool) == APR_SUCCESS) {
|
r->pool) == APR_SUCCESS) {
|
||||||
rc = 1;
|
rc = 1;
|
||||||
}
|
}
|
||||||
@@ -2658,7 +2658,7 @@ static char *lookup_map(request_rec *r, char *name, char *key)
|
|||||||
if (strcmp(s->name, name) == 0) {
|
if (strcmp(s->name, name) == 0) {
|
||||||
if (s->type == MAPTYPE_TXT) {
|
if (s->type == MAPTYPE_TXT) {
|
||||||
if ((rv = apr_stat(&st, s->checkfile,
|
if ((rv = apr_stat(&st, s->checkfile,
|
||||||
APR_FINFO_NORM, r->pool)) != APR_SUCCESS) {
|
APR_FINFO_MIN, r->pool)) != APR_SUCCESS) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
|
||||||
"mod_rewrite: can't access text RewriteMap "
|
"mod_rewrite: can't access text RewriteMap "
|
||||||
"file %s", s->checkfile);
|
"file %s", s->checkfile);
|
||||||
@@ -2696,7 +2696,7 @@ static char *lookup_map(request_rec *r, char *name, char *key)
|
|||||||
else if (s->type == MAPTYPE_DBM) {
|
else if (s->type == MAPTYPE_DBM) {
|
||||||
#ifndef NO_DBM_REWRITEMAP
|
#ifndef NO_DBM_REWRITEMAP
|
||||||
if ((rv = apr_stat(&st, s->checkfile,
|
if ((rv = apr_stat(&st, s->checkfile,
|
||||||
APR_FINFO_NORM, r->pool)) != APR_SUCCESS) {
|
APR_FINFO_MIN, r->pool)) != APR_SUCCESS) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
|
||||||
"mod_rewrite: can't access DBM RewriteMap "
|
"mod_rewrite: can't access DBM RewriteMap "
|
||||||
"file %s", s->checkfile);
|
"file %s", s->checkfile);
|
||||||
@@ -2759,7 +2759,7 @@ static char *lookup_map(request_rec *r, char *name, char *key)
|
|||||||
}
|
}
|
||||||
else if (s->type == MAPTYPE_RND) {
|
else if (s->type == MAPTYPE_RND) {
|
||||||
if ((rv = apr_stat(&st, s->checkfile,
|
if ((rv = apr_stat(&st, s->checkfile,
|
||||||
APR_FINFO_NORM, r->pool)) != APR_SUCCESS) {
|
APR_FINFO_MIN, r->pool)) != APR_SUCCESS) {
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
|
||||||
"mod_rewrite: can't access text RewriteMap "
|
"mod_rewrite: can't access text RewriteMap "
|
||||||
"file %s", s->checkfile);
|
"file %s", s->checkfile);
|
||||||
@@ -4005,7 +4005,7 @@ static int prefix_stat(const char *path, apr_finfo_t *sb)
|
|||||||
if ((cp = strchr(curpath+1, '/')) != NULL) {
|
if ((cp = strchr(curpath+1, '/')) != NULL) {
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
}
|
}
|
||||||
if (apr_stat(sb, curpath, APR_FINFO_NORM, NULL) == APR_SUCCESS) {
|
if (apr_stat(sb, curpath, APR_FINFO_MIN, NULL) == APR_SUCCESS) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -340,7 +340,7 @@ static int translate_userdir(request_rec *r)
|
|||||||
* used, for example, to run a CGI script for the user.
|
* used, for example, to run a CGI script for the user.
|
||||||
*/
|
*/
|
||||||
if (filename && (!*userdirs
|
if (filename && (!*userdirs
|
||||||
|| ((rv = apr_stat(&statbuf, filename, APR_FINFO_NORM,
|
|| ((rv = apr_stat(&statbuf, filename, APR_FINFO_MIN,
|
||||||
r->pool)) == APR_SUCCESS
|
r->pool)) == APR_SUCCESS
|
||||||
|| rv == APR_INCOMPLETE))) {
|
|| rv == APR_INCOMPLETE))) {
|
||||||
r->filename = apr_pstrcat(r->pool, filename, dname, NULL);
|
r->filename = apr_pstrcat(r->pool, filename, dname, NULL);
|
||||||
|
@@ -1271,7 +1271,7 @@ int ap_proxy_cache_send(request_rec *r, ap_cache_el *c)
|
|||||||
len = 2;
|
len = 2;
|
||||||
apr_send(fp, CRLF, &len);
|
apr_send(fp, CRLF, &len);
|
||||||
/* send data */
|
/* send data */
|
||||||
apr_getfileinfo(&finfo, APR_FINFO_NORM, cachefp);
|
apr_getfileinfo(&finfo, APR_FINFO_MIN, cachefp);
|
||||||
if(!r->header_only && ap_send_fd(cachefp, r, offset, finfo.size, &len))
|
if(!r->header_only && ap_send_fd(cachefp, r, offset, finfo.size, &len))
|
||||||
return HTTP_INTERNAL_SERVER_ERROR;
|
return HTTP_INTERNAL_SERVER_ERROR;
|
||||||
return OK;
|
return OK;
|
||||||
|
Reference in New Issue
Block a user