This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: CGIHTTPServer cannot manage cgi in sub directories
Type: Stage:
Components: Library (Lib) Versions: Python 2.2
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: facundobatista, rhettinger, titus, vincent_delft
Priority: normal Keywords:

Created on 2003-07-28 09:00 by vincent_delft, last changed 2022-04-10 16:10 by admin. This issue is now closed.

Messages (4)
msg17384 - (view) Author: vincent delft (vincent_delft) Date: 2003-07-28 09:00
With Python 2.2.2, CGIHTTPServer 1.32 on Linux Gentoo 
 
If I have a cgi script in cgi-bin it works wery well. 
If i copy the same script (with all same privileges) in cgi-bin/test 
(a subdirectory) I got the following message : 
"Error response 
Error code 403.  
Message: CGI script is not a plain file ('/cgi-bin/test').  
Error code explanation: 403 = Request forbidden -- authorization 
will not help. " 
 
 
If I remove the "rest.find('/')" code functionality by forcing the 
result to -1 it works well (cfr here after) 
 
Can you explain the goal of such coding ? 
 
 
 
 
        i = rest.find('/') 
+      i=-1 
        if i >= 0: 
            script, rest = rest[:i], rest[i:] 
        else: 
            script, rest = rest, '' 
        scriptname = dir + '/' + script 
        scriptfile = self.translate_path(scriptname) 
 
 
 
msg17385 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-08-17 17:06
Logged In: YES 
user_id=80475

Eric, this was your change (2/9/2001).  Will you take it from 
here?
msg17386 - (view) Author: Titus Brown (titus) Date: 2004-12-19 06:19
Logged In: YES 
user_id=23486

same as bug 737202, which has an attached patch.
msg17387 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2005-01-15 18:43
Logged In: YES 
user_id=752496

Duplicate of #737202, as the other has the patch, please go
on with it.
History
Date User Action Args
2022-04-10 16:10:16adminsetgithub: 38946
2003-07-28 09:00:43vincent_delftcreate