You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ben Laurie <be...@algroup.co.uk> on 1999/10/25 18:59:23 UTC

Bug?

Am I losing it? If I do something like this:

<Location /abcd>
	SetHandler some-handler
	Action some-handler /cgi/somescript
</Location>

and the file corresponding to /abcd (i.e. <DocumentRoot>/abcd) does not
exist, I get a 404 Not Found.

However, if the handler I set is an _internal_ one, say server-status,
then it works!

Surely this is a bug? (In case it isn't obvious, I think they should
both work).

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi

Re: Bug?

Posted by Ben Laurie <be...@algroup.co.uk>.
Manoj Kasichainula wrote:
> 
> On Mon, Oct 25, 1999 at 05:59:23PM +0100, Ben Laurie wrote:
> > Am I losing it? If I do something like this:
> >
> > <Location /abcd>
> >       SetHandler some-handler
> >       Action some-handler /cgi/somescript
> > </Location>
> >
> > and the file corresponding to /abcd (i.e. <DocumentRoot>/abcd) does not
> > exist, I get a 404 Not Found.
> >
> > However, if the handler I set is an _internal_ one, say server-status,
> > then it works!
> 
> A snippet of code from mod_actions.c:
> 
>     /* Second, check for actions (which override the method scripts) */
>     if ((t = ap_table_get(conf->action_types,
>                        action ? action : ap_default_type(r)))) {
>         script = t;
>         if (r->finfo.st_mode == 0) {
>             ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
>                         "File does not exist: %s", r->filename);
>             return NOT_FOUND;
>         }
>     }
> 
> It appears that we're getting the name of the script, intending to
> check for the presence of the script, but checking for the requested
> file instead (or at least the part before path info). This looks like
> a bug to me.

Yep, me too.

> Does this check even need to be present?

You mean once it is fixed?

> I guess we save an internal
> redirect to a nonexistent CGI, but this is most definitely not a case
> to be optimized for.

My guess it is a bit of overzealous cut-n-paste. I'd agree that it
doesn't need to be optimised. Of course, there could be some more subtle
reason for it, but whatever, it would appear to be wrong as it stands.

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi

Re: Bug?

Posted by Manoj Kasichainula <ma...@io.com>.
On Mon, Oct 25, 1999 at 05:59:23PM +0100, Ben Laurie wrote:
> Am I losing it? If I do something like this:
> 
> <Location /abcd>
> 	SetHandler some-handler
> 	Action some-handler /cgi/somescript
> </Location>
> 
> and the file corresponding to /abcd (i.e. <DocumentRoot>/abcd) does not
> exist, I get a 404 Not Found.
> 
> However, if the handler I set is an _internal_ one, say server-status,
> then it works!

A snippet of code from mod_actions.c:

    /* Second, check for actions (which override the method scripts) */
    if ((t = ap_table_get(conf->action_types,
                       action ? action : ap_default_type(r)))) {
        script = t;
        if (r->finfo.st_mode == 0) {
            ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
                        "File does not exist: %s", r->filename);
            return NOT_FOUND;
        }
    }

It appears that we're getting the name of the script, intending to
check for the presence of the script, but checking for the requested
file instead (or at least the part before path info). This looks like
a bug to me.

Does this check even need to be present? I guess we save an internal
redirect to a nonexistent CGI, but this is most definitely not a case
to be optimized for.

-- 
Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/
"I mean how can a punk be cyber?" - Bruce Sterling