www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Munro <mu...@iss.ca>
Subject mod_alias/3485: substring_conf() does not parse a quoted string correctly
Date Thu, 03 Dec 1998 15:09:44 GMT

>Number:         3485
>Category:       mod_alias
>Synopsis:       substring_conf() does not parse a quoted string correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Thu Dec  3 07:10:00 PST 1998
>Originator:     munro@iss.ca
>Release:        1.3.2 Win32
Win32 MS DevStudio 6.0
substring_conf() will parse "e:\develo~1\Apache\cgi-bin\" out as e:\develo~1\Apache\cgi-bin".
Note that the last '\' is replaced with a quote.  This results in the error
script not found or unable to stat: e:/development/apache/cgi-bin"cgictest.EXE.
Put quotes around the path for ScriptAlias.  
For example, ScriptAlias /cgi-bin/ "e:\develo~1\Apache\cgi-bin\"

Now try to run the cgi.
substring_conf() in ../main/util.c (called from ap_getword_conf()) seems
to be the culprit.  When parsing the string "e:\develo~1\Apache\cgi-bin\" 
(quotes are part of the string), it replaces the last '\' with '"'. 
At quick glance,  with only this case in mind,  the following change should 
do the trick:

if (start[i] == '\\' && (start[i + 1] == '\\'
    || (quote && start[i + 1] == quote)))
<<	    *resp++ = start[++i];
[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]

>>          *resp++ = start[i++];

View raw message