Mailing List Archive

Bug in Apache 0.8.11 scriptalias (fwd)
Hmm, looks like we have a moving target on this ScriptAlias stuff,

Forwarded message:
> From alethea@ukc.ac.uk Fri Aug 25 06:55:08 1995
> To: apache-bugs@apache.org
> Subject: Bug in Apache 0.8.11 scriptalias
> X-Address: Alethea, Computing Lab., The University, Canterbury, CT2 7NF, UK
> X-URL: http://alethea.ukc.ac.uk/
> Date: Fri, 25 Aug 1995 14:48:02 +0100
> Message-ID: <14219.809358482@nuntius.ukc.ac.uk>
> From: Alethea <alethea@ukc.ac.uk>
>
>
> With the movement of the ScriptAlias command from mod_cgi.c to
> mod_alias.c, a bug has been introduced. Previously, ScriptAlias would
> handle /xxx/ and /xxx differently. Now, it behaves in the same way as
> Alias, i.e. it strips off any trailing slashes before proceeding.
>
> In our current config, we have the following:
>
> ScriptAlias /wp/ /usr/l/alethea/export/cgi/wp/nonpublic/
> ScriptAlias /wp /usr/l/alethea/export/cgi/wp/public/view
>
> which enables us to have a CGI program called /wp, and various CGI
> programs inside /wp (such as /wp/edit). With the new modifications to
> ScriptAlias handling, this will not work.
>
>
>
> Hope this is useful,
> -------
> Royston Shufflebotham (http://alethea.ukc.ac.uk/wp?94rws)
> on behalf of the Alethea Group
>
>
> P.S. Could you tell me what email address I should use to pass on
> information about new modules to you? In particular, I have a SunOS
> dynamic-loading module working (I sent an earlier version of it to you
> in a previous patch), which now handles module-unloading/reloading
> during server re-config. This requires a small patch to http_config.c,
> and I expect that mod_dld.c could be modified to work in a similar
> fashion.
>
Re: Bug in Apache 0.8.11 scriptalias (fwd) [ In reply to ]
Date: Fri, 25 Aug 95 17:02 BST
From: drtr@ast.cam.ac.uk (David Robinson)

Sigh.

Here's the message I sent earlier on this subject.

Hmm... I seem to remember that that original message had an
alternative patch attached, which I offered at one point to look over
for 0.8.9 if you would simply resend it (which you declined to do) ---
and you didn't resend it this time either. Unfortunately, I can't do
much with a patch I don't have.

Could you prepare an updated version for consideration (i.e., the
vote) in 0.8.12?

rst
Re: Bug in Apache 0.8.11 scriptalias (fwd) [ In reply to ]
Forwarded message:
> From alethea@ukc.ac.uk Fri Aug 25 06:55:08 1995
> To: apache-bugs@apache.org
> Subject: Bug in Apache 0.8.11 scriptalias
> X-Address: Alethea, Computing Lab., The University, Canterbury, CT2 7NF, UK
> X-URL: http://alethea.ukc.ac.uk/
> Date: Fri, 25 Aug 1995 14:48:02 +0100
> Message-ID: <14219.809358482@nuntius.ukc.ac.uk>
> From: Alethea <alethea@ukc.ac.uk>
>
>
> With the movement of the ScriptAlias command from mod_cgi.c to
> mod_alias.c, a bug has been introduced. Previously, ScriptAlias would
> handle /xxx/ and /xxx differently. Now, it behaves in the same way as
> Alias, i.e. it strips off any trailing slashes before proceeding.
>
> In our current config, we have the following:
>
> ScriptAlias /wp/ /usr/l/alethea/export/cgi/wp/nonpublic/
> ScriptAlias /wp /usr/l/alethea/export/cgi/wp/public/view
>
> which enables us to have a CGI program called /wp, and various CGI
> programs inside /wp (such as /wp/edit). With the new modifications to
> ScriptAlias handling, this will not work.

Sigh.

Here's the message I sent earlier on this subject.

>Date: Mon, 7 Aug 95 16:03 BST
>From: drtr@ast.cam.ac.uk (David Robinson)
>Subject: Re: Maybe I'm being silly but...
>
>Rst wrote:
>>... it sure looks to me like the "Alias /foo/ /bar/" bug can be cured
>>by just stripping trailing slashes off both args (being moderately careful
>>to canonicalize "///" to "/" and not the empty string). Yes?
>
>No.
>
>and also
>>I'm not sure I can even duplicate the problem as reported (the worst I
>>can get a configuration with "Alias /foo/ /bar/" to do on 0.8.7 is not
>>to properly redirect requests for /foo), but doing the strip-slash
>>business I described in my earlier note today cures the symptoms I do
>>observe.
>
>The actual problem was:
>Alias /foo /bar/
>where /bar/index.html (or whatever) exists,
>
>then URL:/foo returns /index.html, instead of /bar/index.html
>
>The fix in 0.8.8 unfortuately introduces more incompatibilities than it fixes;
>munging the paths to mask the true bug is not the best solution.
>
>The bug is actually due to using the wrong test for when to redirect
>a directory index. It currently tests for a missing PATH_INFO of "/", whereas
>it should really test for the URL not ending in "/".
>
>With a request of /foo, PATH_INFO is set to "/" (maybe this is wrong too),
>so mod_dir.c does not redirect the request to /foo/. However, the point
>of the test and redirect is to ensure that relative links in index.html
>'work'; this depends on whether the URL ends in a '/' or not. So testing
>the URL would be the 'correct' test anyway. A patch for 0.8.7 is supplied.
>
>The fix in 0.8.8 makes it incompatible with the old NCSA behaviour;
>specifically Alias /wom/ /bar/ would not match URL:/wom whereas it did
>not previously.
>
>Of course, the answer to the posters question should have been that
>he should use
>Alias /foo /bar
>in preference.

I probably mean to say `The fix in 0.8.8 makes it incompatible with the
old NCSA behaviour; specifically Alias /wom/ /bar/ would match URL:/wom
whereas it did not previously', which is precisely the bug being reported.

David.
Re: Bug in Apache 0.8.11 scriptalias (fwd) [ In reply to ]
From: rst@ai.mit.edu (Robert S. Thau)
Date: Fri, 25 Aug 95 16:57:19 EDT
> Date: Fri, 25 Aug 95 17:02 BST
> From: drtr@ast.cam.ac.uk (David Robinson)
>
> Sigh.
>
> Here's the message I sent earlier on this subject.
>
>Hmm... I seem to remember that that original message had an
>alternative patch attached, which I offered at one point to look over
>for 0.8.9 if you would simply resend it (which you declined to do) ---

I never received that request (at least, I'm sure I never explicitly refused
to resend the patch).

>and you didn't resend it this time either. Unfortunately, I can't do
>much with a patch I don't have.
>
>Could you prepare an updated version for consideration (i.e., the
>vote) in 0.8.12?

The patch I sent originally follows. Do you have a patch to undo the
changes you made to 0.8.8?

David. (253 messages to go on new-httpd)


------------------------ Begin file dir.patch ------------------------------
*** mod_dir.c~ Tue Aug 1 01:46:52 1995
--- mod_dir.c Mon Aug 7 15:34:51 1995
***************
*** 762,768 ****

if (r->method_number != M_GET) return NOT_IMPLEMENTED;

! if (!r->path_info || *r->path_info != '/') {
char* ifile = pstrcat (r->pool, r->uri, "/", NULL);
table_set (r->headers_out, "Location",
construct_url(r->pool, ifile, r->server));
--- 762,768 ----

if (r->method_number != M_GET) return NOT_IMPLEMENTED;

! if (r->uri[0] == '\0' || r->uri[strlen(r->uri)-1] != '/') {
char* ifile = pstrcat (r->pool, r->uri, "/", NULL);
table_set (r->headers_out, "Location",
construct_url(r->pool, ifile, r->server));
------------------------ Begin file dir.patch ------------------------------
Re: Bug in Apache 0.8.11 scriptalias (fwd) [ In reply to ]
From: rst@ai.mit.edu (Robert S. Thau)
Date: Fri, 25 Aug 95 16:57:19 EDT
> Date: Fri, 25 Aug 95 17:02 BST
> From: drtr@ast.cam.ac.uk (David Robinson)
>
> Sigh.
>
> Here's the message I sent earlier on this subject.
>
>Hmm... I seem to remember that that original message had an
>alternative patch attached, which I offered at one point to look over
>for 0.8.9 if you would simply resend it (which you declined to do) ---

I never received that request (at least, I'm sure I never explicitly refused
to resend the patch).

>and you didn't resend it this time either. Unfortunately, I can't do
>much with a patch I don't have.
>
>Could you prepare an updated version for consideration (i.e., the
>vote) in 0.8.12?

The patch I sent originally follows. Do you have a patch to undo the
changes you made to 0.8.8?

David. (253 messages to go on new-httpd)


------------------------ Begin file dir.patch ------------------------------
*** mod_dir.c~ Tue Aug 1 01:46:52 1995
--- mod_dir.c Mon Aug 7 15:34:51 1995
***************
*** 762,768 ****

if (r->method_number != M_GET) return NOT_IMPLEMENTED;

! if (!r->path_info || *r->path_info != '/') {
char* ifile = pstrcat (r->pool, r->uri, "/", NULL);
table_set (r->headers_out, "Location",
construct_url(r->pool, ifile, r->server));
--- 762,768 ----

if (r->method_number != M_GET) return NOT_IMPLEMENTED;

! if (r->uri[0] == '\0' || r->uri[strlen(r->uri)-1] != '/') {
char* ifile = pstrcat (r->pool, r->uri, "/", NULL);
table_set (r->headers_out, "Location",
construct_url(r->pool, ifile, r->server));
------------------------ Begin file dir.patch ------------------------------