mod_imagemap: Fix a cross-site scripting issue. Reported by JPCERT.
[Joe Orton]
+ *) mod_disk_cache: Delete temporary files if they cannot be renamed to their
+ final name. [Davi Arnaut <davi haxent.com.br>]
+
*) http_protocol: Escape request method in 405 error reporting.
This has no security impact since the browser cannot be tricked
into sending arbitrary method strings. [Jeff Trawick]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_disk_cache: Delete temporary files if they cannot be renamed to their
- final name.
- Trunk version of patch:
- http://svn.apache.org/viewcvs.cgi?rev=409942&view=rev
- http://svn.apache.org/viewcvs.cgi?rev=607245&view=rev
- http://svn.apache.org/viewcvs.cgi?rev=607440&view=rev
- Backport version for 2.2.x of patch:
- Trunk version of patch works
- +1: rpluem, niq, wrowe
- niq: Provisional +1, but the error logging should be at a consistent
- level (maybe WARNING?)
- rpluem: Set it to ERROR in all cases as IMHO this should not happen.
- If this level is too high we can reduce it later.
- wrowe: disagree with rpluem - it's incredibly disruptive to admins
- to have their logs filled with noise - warning would be ok,
- provided there's no more than one entry per failed request.
- If their request would die outright, only then is rpluem right.
- rpluem: Level now set to WARNING.
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
*/
rv = apr_file_rename(dobj->tempfile, dobj->datafile, r->pool);
if (rv != APR_SUCCESS) {
- /* XXX log */
+ ap_log_error(APLOG_MARK, APLOG_WARNING, rv, r->server,
+ "disk_cache: rename tempfile to datafile failed:"
+ " %s -> %s", dobj->tempfile, dobj->datafile);
+ apr_file_remove(dobj->tempfile, r->pool);
}
dobj->tfd = NULL;
rv = safe_file_rename(conf, dobj->tempfile, dobj->hdrsfile,
r->pool);
if (rv != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, r->server,
+ ap_log_error(APLOG_MARK, APLOG_WARNING, rv, r->server,
"disk_cache: rename tempfile to varyfile failed: %s -> %s",
dobj->tempfile, dobj->hdrsfile);
+ apr_file_remove(dobj->tempfile, r->pool);
return rv;
}
rv = safe_file_rename(conf, dobj->tempfile, dobj->hdrsfile, r->pool);
if (rv != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
+ ap_log_error(APLOG_MARK, APLOG_WARNING, rv, r->server,
"disk_cache: rename tempfile to hdrsfile failed: %s -> %s",
dobj->tempfile, dobj->hdrsfile);
+ apr_file_remove(dobj->tempfile, r->pool);
return rv;
}