Patch against 2.0.x of below.
---------- Forwarded message ----------
From: Eric Covener <[EMAIL PROTECTED]>
Date: Wed, 9 Feb 2005 09:36:09 -0500
Subject: [PATCH] remove formatting from ap_log_error calls
To: [email protected]
ap_log_error escapes escape sequences such as newline and tab so that
they appear as the two-character strings "\t" or "\n" in error_log
(unless httpd was built with -DAP_UNSAFE_ERROR_LOG_UNESCAPED) as
fallout from CAN-2003-0020
Some callers throughout the code still send '\n' within the string
argument sent to ap_log_error, trivial patch attached removes the
formatting from these calls.
--
Eric Covener
[EMAIL PROTECTED]
Index: server/mpm/winnt/mpm_winnt.c
===================================================================
--- server/mpm/winnt/mpm_winnt.c (revision 152672)
+++ server/mpm/winnt/mpm_winnt.c (working copy)
@@ -668,7 +668,7 @@
if ((rv = apr_procattr_io_set(attr, APR_FULL_BLOCK,
APR_NO_PIPE, APR_NO_PIPE)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,
- "Parent: Unable to create child stdin pipe.\n");
+ "Parent: Unable to create child stdin pipe.");
apr_pool_destroy(ptemp);
return -1;
}
@@ -679,7 +679,7 @@
|| ((rv = apr_procattr_child_out_set(attr, child_out, NULL))
!= APR_SUCCESS)) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,
- "Parent: Unable to connect child stdout to NUL.\n");
+ "Parent: Unable to connect child stdout to NUL.");
apr_pool_destroy(ptemp);
return -1;
}
@@ -697,7 +697,7 @@
if ((rv = apr_procattr_child_err_set(attr, child_err, NULL))
!= APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,
- "Parent: Unable to connect child stderr.\n");
+ "Parent: Unable to connect child stderr.");
apr_pool_destroy(ptemp);
return -1;
}
Index: modules/proxy/proxy_util.c
===================================================================
--- modules/proxy/proxy_util.c (revision 152672)
+++ modules/proxy/proxy_util.c (working copy)
@@ -707,7 +707,7 @@
if (bits != 32) /* no warning for fully qualified IP address */
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
- "Warning: NetMask not supplied with IP-Addr; guessing: %s/%ld\n",
+ "Warning: NetMask not supplied with IP-Addr; guessing: %s/%ld",
inet_ntoa(This->addr), bits);
}
@@ -715,11 +715,11 @@
if (*addr == '\0' && (This->addr.s_addr & ~This->mask.s_addr) != 0) {
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
- "Warning: NetMask and IP-Addr disagree in %s/%ld\n",
+ "Warning: NetMask and IP-Addr disagree in %s/%ld",
inet_ntoa(This->addr), bits);
This->addr.s_addr &= This->mask.s_addr;
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
- " Set to %s/%ld\n",
+ " Set to %s/%ld",
inet_ntoa(This->addr), bits);
}
Index: modules/ssl/ssl_engine_kernel.c
===================================================================
--- modules/ssl/ssl_engine_kernel.c (revision 152672)
+++ modules/ssl/ssl_engine_kernel.c (working copy)
@@ -553,7 +553,7 @@
if (renegotiate && !renegotiate_quick && (r->method_number == M_POST)) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
"SSL Re-negotiation in conjunction "
- "with POST method not supported!\n"
+ "with POST method not supported! "
"hint: try SSLOptions +OptRenegotiate");
return HTTP_METHOD_NOT_ALLOWED;
@@ -1794,7 +1794,7 @@
else if (where & SSL_CB_ALERT) {
char *str = (where & SSL_CB_READ) ? "read" : "write";
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
- "%s: Alert: %s:%s:%s\n",
+ "%s: Alert: %s:%s:%s",
SSL_LIBRARY_NAME, str,
SSL_alert_type_string_long(rc),
SSL_alert_desc_string_long(rc));