httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: translate_userdir()
Date Tue, 19 Mar 1996 00:39:11 GMT
On Mon, 18 Mar 1996, Ben Laurie wrote:

> But, in essence, what is happening is the _last_ UserDir translation is used
> _regardless of whether it makes any sense to the userdir module_, in the hope
> that a handler will understand the resulting filename and be able to resolve it
> (in particular the CGI handler). At least, that's what I think is happening.

Exactly. The alternative, btw, is to follow the lead set by mod_dir.c and 
do a sub_req_lookup_file() for each one, but I felt this wasn't the best 
of solutions, really.

> This behaviour is undocumented, but perhaps desirable. So, to make everyone
> happy it should be documented, at least in the source, to prevent further
> misunderstanding.

Okay. The patch you committed does this, and I'm happy about it.

> I'm not sure how reliable the behaviour is - does it depend on module ordering,
> for example?

Nope. (this is why it's very nice that Apache has fourteen different
phases that modules can hook into)

> Is it OK for a module to set a filename without knowing whether is is going to
> work?

Yep. In fact, all the modules do it, pretty much. Files that don't exist 
are supposdely caught in the handler phase. Do a grep on NOT_FOUND and 
look where it exists. As far as I can see, the reasons a filename 
translation function should not (I'll even go so far as to say never) 
send a NOT_FOUND are as follows:

1) There may be a .htaccess in that path somewhere that sets something 
that might change the request/response, like a custom error message.

2) Building on reason 1, if that directory is auth-protected in some way, 
returning NOT_FOUND would tell the client that the file doesn't exist, 
and might give them information you don't want them to have - the auth 
handler should send them an AUTH_REQUIRED instead.

3) The filename is available to log modules and other error-detection 

There are probably other reasons as well.

> Would it perhaps be better to have an entirely seperate ExecUserDir directive?

No. I think it's better the way it is.

--// Alexei Kosut // <> // Lefler on IRC --//
-----------------// <> -------// 
"To get the full effect of Pat Buchanan's speeches, they should be
read in the original German." //--------------------------------------

View raw message