]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED the stderr to errorlog stuff
authorBill Stoddard <stoddard@apache.org>
Thu, 2 Sep 2004 22:06:22 +0000 (22:06 +0000)
committerBill Stoddard <stoddard@apache.org>
Thu, 2 Sep 2004 22:06:22 +0000 (22:06 +0000)
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

STATUS
modules/generators/mod_cgi.c
modules/generators/mod_cgid.c

diff --git a/STATUS b/STATUS
index 65c4292ebcd3b88e1f17732228e8aeb27e76a5c6..17ba6e34289f1da532325f4cb524c47fd3636ce6 100644 (file)
--- 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 <uli ritual.org>]
          support/rotatelogs.c: r1.33, r1.34, r1.35
index 5ba5cad259a7b36399d681b8e3eca841456163c9..1e5a3c7fbfe14e1c228f3d0d75c936e084ab5957 100644 (file)
@@ -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,
index 8d6ec7f4c82fba82fce828b5f8c47d951e86c3e6..bcb7a5b5d0d0b1f70a09641d2d5ad531d5614888 100644 (file)
@@ -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)