[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#201327: marked as done (libapache-mod-lisp: does case-sensitive compare of response headers)



Your message dated Wed, 17 May 2006 11:27:03 +0200
with message-id <20060517092703.GA79418@jail.schiach.de>
and subject line closing
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libapache-mod-lisp
Version: 2.32-1
Severity: normal
Tags: upstream, patch

When reading response headers sent by the lisp process, mod_lisp.c
compares these headers to several known strings, but it uses a
case-sensitive comparison.  HTTP headers are case-insensitive, so a
case-sensitive comparison is inappropriate.

Furthermore, this makes it more difficult to use symbols as header
names in the lisp process, since symbols typically print in a
canonical case.

I've attached an untested patch that should fix the problem.

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux nuwen 2.4.21 #1 Sat Jun 14 00:03:54 EDT 2003 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages libapache-mod-lisp depends on:
ii  libc6                         2.3.1-17   GNU C Library: Shared libraries an
ii  libdb4.1                      4.1.25-4   Berkeley v4.1 Database Libraries [
ii  libexpat1                     1.95.6-4   XML parsing C library - runtime li

-- no debconf information
--- mod_lisp.c.~1~	2003-07-11 13:58:11.000000000 -0400
+++ mod_lisp.c	2003-07-14 23:39:14.000000000 -0400
@@ -664,7 +664,7 @@
 	{
 	  if (!elts[i].key) continue;
 	  ret = SendLispHeaderLine(BuffSocket, 
-				   !strcmp(elts[i].key, "end")?"end-header":elts[i].key, 
+				   !strcasecmp(elts[i].key, "end")?"end-header":elts[i].key, 
 				   elts[i].val);
 	  if (ret!=0)
 	    {
@@ -726,7 +726,7 @@
 	Header[l-1] = 0;
 
       ap_kill_timeout(r);
-      if (!strcmp(Header, "end"))
+      if (!strcasecmp(Header, "end"))
 	break;
       
       if (ap_bgets(Value, MAX_STRING_LEN, (BUFF *) BuffSocket) <= 0)
@@ -736,45 +736,45 @@
       if (l > 0)
 	Value[l-1] = 0;
 
-      if (!strcmp(Header, "Content-Type"))
+      if (!strcasecmp(Header, "Content-Type"))
 	{
 	  char *tmp = ap_pstrdup(r->pool, Value);
 	  ap_content_type_tolower(tmp);
 	  r->content_type = tmp;
 	}
-      else if (!strcmp(Header, "Status"))
+      else if (!strcasecmp(Header, "Status"))
 	{
 	  r->status = atoi(Value);
 	  r->status_line = ap_pstrdup(r->pool, Value);
 	}
-      else if (!strcmp(Header, "Location"))
+      else if (!strcasecmp(Header, "Location"))
 	{
 	  ap_table_set(r->headers_out, Header, Value);
 	}
-      else if (!strcmp(Header, "Content-Length"))
+      else if (!strcasecmp(Header, "Content-Length"))
 	{
 	  ap_table_set(r->headers_out, Header, Value);
 	  ContentLength = atoi(Value);
 	}
-     else if (!strcmp(Header, "Last-Modified"))
+     else if (!strcasecmp(Header, "Last-Modified"))
 	{
 	  time_t mtime = ap_parseHTTPdate(Value);
 	  ap_update_mtime(r, mtime);
 	  ap_set_last_modified(r);
 	}
-     else if (!strcmp(Header, "Keep-Socket"))
+     else if (!strcasecmp(Header, "Keep-Socket"))
 	{
 	  KeepSocket = atoi(Value);
 	}
-      else if (!strcmp(Header, "Log-Error"))
+      else if (!strcasecmp(Header, "Log-Error"))
 	{
 	  ap_log_error("mod_lisp", 0, APLOG_ERR, r->server, Value);
 	}
-      else if (!strcmp(Header, "Log"))
+      else if (!strcasecmp(Header, "Log"))
 	{
 	  ap_log_error("mod_lisp", 0, APLOG_ERR, r->server, Value);
 	}
-      else if (!strcmp(Header, "Note"))
+      else if (!strcasecmp(Header, "Note"))
 	{
 	  char *pv = strchr(Value, ' ');
 	  if (pv != NULL)
@@ -783,7 +783,7 @@
 	      ap_table_setn(r->notes, ap_pstrdup(r->pool, Value), ap_pstrdup(r->pool, pv));
 	    }
 	}
-      else if (!strcmp(Header, "Set-Cookie"))
+      else if (!strcasecmp(Header, "Set-Cookie"))
 	{
 	  ap_table_add(r->headers_out, Header, Value);
 	}

--- End Message ---
--- Begin Message ---
hi,

those NMU changes have been intergrated/accepted in numerous QA Uploads,
therefore closing those 2 Year old Bugreports. 

bye,
    - michael

--- End Message ---

Reply to: