From: Bill Stoddard Date: Thu, 2 Sep 2004 22:06:22 +0000 (+0000) Subject: ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED the stderr to errorlog stuff X-Git-Tag: 2.0.51~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3ef65c808091b7f52cd559a5ba10d4048931f7a;p=thirdparty%2Fapache%2Fhttpd.git ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED the stderr to errorlog stuff for those who don't want to escape (as in server/log.c) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@104940 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 65c4292ebcd..17ba6e34289 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2004/09/02 20:09:28 $] +Last modified at [$Date: 2004/09/02 22:06:22 $] Release: @@ -98,13 +98,6 @@ PATCHES TO BACKPORT FROM 2.1 native chars here and it will be converted later? (I'm not sure) (2) I'd put out (null) only if val is NULL, not if it's empty. - *) Escape errfn strings before sending them to the log file (and - analogus patch to mod_cgid) - http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/generators/mod_cgi.c?r1=1.167&r2=1.168 - +1: stoddard, trawick, jorton - nd: I'd like to add 1.169 - trawick: 1.169 is fine with me - *) Add -l option to rotatelogs to let it use local time rather than UTC. PR 24417. [Ken Coar, Uli Zappe ] support/rotatelogs.c: r1.33, r1.34, r1.35 diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index 5ba5cad259a..1e5a3c7fbfe 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -348,11 +348,19 @@ static void cgi_child_errfn(apr_pool_t *pool, apr_status_t err, char errbuf[200]; apr_file_open_stderr(&stderr_log, pool); + /* Escape the logged string because it may be something that + * came in over the network. + */ apr_file_printf(stderr_log, "(%d)%s: %s\n", err, apr_strerror(err, errbuf, sizeof(errbuf)), - description); +#ifdef AP_UNSAFE_ERROR_LOG_UNESCAPED + description +#else + ap_escape_logitem(pool, description) +#endif + ); } static apr_status_t run_cgi_child(apr_file_t **script_out, diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 8d6ec7f4c82..bcb7a5b5d0d 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -559,7 +559,13 @@ static void cgid_child_errfn(apr_pool_t *pool, apr_status_t err, * have r->headers_in and possibly other storage referenced by * ap_log_rerror() */ - ap_log_error(APLOG_MARK, APLOG_ERR, err, r->server, "%s", description); + ap_log_error(APLOG_MARK, APLOG_ERR, err, r->server, "%s", +#ifdef AP_UNSAFE_ERROR_LOG_UNESCAPED + description +#else + ap_escape_logitem(pool, description) +#endif + ); } static int cgid_server(void *data)