httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject http_core.c: improper handling of virtual host paths? (fwd)
Date Fri, 03 Jan 1997 15:27:59 GMT

Not acked.

Alexei, is this what you wanted fixed ?


----- Forwarded message from Miguel A.L. Paraz -----

From: "Miguel A.L. Paraz" <map@iphil.net>
Message-Id: <199701031250.UAA19571@marikit.iphil.net>
Subject: http_core.c:  improper handling of virtual host paths?
To: apache-bugs@apache.org
Date: Fri, 3 Jan 1997 12:50:56 +0000 ()
X-Mailer: ELM [version 2.4 PL25 PGP2]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi,

It looks like URIs which are a substring of the ServerPath in a virtualhost
are unnecessarily truncated.  For example, my ServerPath is /something,
and my URI is something.html.  I believe this patch to core_translate()
fixes it by checking if the leading text of the URI is indeed a path
by checking for '/'.  This is 1.2b3, apologies if it's fixed in b4 which
I've only seen now.

*** http_core.c.old	Fri Jan  3 12:42:46 1997
--- http_core.c	Fri Jan  3 12:39:20 1997
***************
*** 1214,1227 ****
  {
      void *sconf = r->server->module_config;
      core_server_config *conf = get_module_config (sconf, &core_module);
!   
      if (r->proxyreq) return NOT_IMPLEMENTED;
      if ((r->uri[0] != '/') && strcmp(r->uri, "*")) return BAD_REQUEST;
      
!     if (r->server->path &&
! 	!strncmp(r->uri, r->server->path, r->server->pathlen))
!       r->filename = pstrcat (r->pool, conf->document_root,
! 			     (r->uri + r->server->pathlen), NULL);
      else
        r->filename = pstrcat (r->pool, conf->document_root, r->uri, NULL);
  
--- 1214,1234 ----
  {
      void *sconf = r->server->module_config;
      core_server_config *conf = get_module_config (sconf, &core_module);
! 
      if (r->proxyreq) return NOT_IMPLEMENTED;
      if ((r->uri[0] != '/') && strcmp(r->uri, "*")) return BAD_REQUEST;
      
!     if (r->server->path)
!     {
! 	char *t = strstr(r->uri, r->server->path);
! 	if (t && (*(t+r->server->pathlen) == '/'))
! 	{
! 	    r->filename = pstrcat (r->pool, conf->document_root,
! 				   (r->uri + r->server->pathlen), NULL);
! 	}
! 	else
! 	  r->filename = pstrcat (r->pool, conf->document_root, r->uri, NULL);
!     }
      else
        r->filename = pstrcat (r->pool, conf->document_root, r->uri, NULL);
  

Thanks,

-- 
miguel a.l. paraz  <map@iphil.net> | iphil communications, makati city, ph
pgp key id: 0x43F0D011             | <http://www.iphil.net>











----- End of forwarded message from Miguel A.L. Paraz -----

-- 
Rob Hartill.       Internet Movie Database Ltd.    http://www.imdb.com/  

Mime
View raw message