www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John W. Hanks" <jha...@vsicorp.com>
Subject Re: mod_cgi/2918: Multiple leading slashes in SCRIPT_NAME, REQUEST_URI
Date Sat, 29 Aug 1998 02:40:00 GMT
The following reply was made to PR mod_cgi/2918; it has been noted by GNATS.

From: "John W. Hanks" <jhanks@vsicorp.com>
To: Marc Slemko <marcs@znep.com>
Cc: apbugs@hyperreal.org
Subject: Re: mod_cgi/2918: Multiple leading slashes in SCRIPT_NAME, REQUEST_URI
Date: Fri, 28 Aug 1998 22:41:22 -0400 (EDT)

 On Fri, 28 Aug 1998, Marc Slemko wrote:
 
 > On 28 Aug 1998, John Hanks wrote:
 > 
 > > When executing a CGI from another CGI (one that created a form) the SCRIPT_NAME

 > > and REQUEST_URI variables appear to have an extra proceeding slash, 
 > > see example below. It also appears in the SCRIPT_FILENAME.
 > 
 > Erm... what do you mean "executing a CGI from another CGI"?  
 > 
 > How exactly are you doing this?  
 >
 I moving some working programs from NCSA/1.4.2 under Linux to Apache
 1.3.1 on a Digtal Unix station.  One of the programs is used to update
 some data fields stored on the server.  
 
 To simplify things (at least for me!), I use the same program to create
 the script and then parse it the next time around (if they left anything
 out, it can just redisplay the form with the data they did put in asking
 for what they left out).  When running in 'test mode', it does a
 system("printenv > /tmp/maint.env") so I can make sure the environment
 variables are what I'm expecting (that's where the piece I sent came
 from). 
 
 The first 'call' is just a link to the URL with '/form' in PATH_INFO.  I
 check to see if it is a GET or POST then, if a GET, check the PATH_INFO
 to make sure it is a form request.
 
 (Well, isn't that funny.  I was actually accessing the pages as I wrote
 this and checking the environment dump and it seems that it must do it the
 first time as well.  I thought it was okay the first time and messed up
 the second, but it is now doing it the first time as well.  Maybe I was
 looking at the wrong window last night.)
 
 Anyway, the first time it creates the form and the second time it parses
 it.  During the parse, it checks to make sure that the document is a form
 from itself (to try to eliminate junk forms) by comparing HTTP_REFERER to
 "http://"+SERVER_NAME+SCRIPT_NAME+"/form" (I see I can now use REQUEST_URI
 for the last two).
 
 Anyways, as I showed in the text sent, it looks like SCRIPT_NAME has an
 extra leading '/', which also appears in REQUEST_URI (presumably gotten by
 catting SCRIPT_NAME+PATH_INFO) and in SCRIPT_FILENAME (by catting
 DOCUMENT_ROOT+SCRIPT_NAME).
 
 I'm sorry I posted the problem incorrectly.  I must have been tired last
 night.
 
 If you need any more information, please let me know.
 
 John
 

Mime
View raw message