You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1997/01/03 16:27:59 UTC

http_core.c: improper handling of virtual host paths? (fwd)

Not acked.

Alexei, is this what you wanted fixed ?


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

From: "Miguel A.L. Paraz" <ma...@iphil.net>
Message-Id: <19...@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  <ma...@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/  

Re: http_core.c: improper handling of virtual host paths? (fwd)

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Fri, 3 Jan 1997, "Miguel A.L. Paraz" wrote:

> 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.

We are aware of this problem. It is not fixed in 1.2b4, but it has
been fixed for the next release (1.2b5).

Thanks for using Apache!

-- 
________________________________________________________________________
Alexei Kosut <ak...@nueva.pvt.k12.ca.us>      The Apache HTTP Server
URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/