You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@worldgate.com> on 1998/06/19 19:08:12 UTC

Re: cvs commit: apache-1.3/src/modules/standard mod_autoindex.c

Surely we have a better way to do this than adding an ifdef and doing a
case insensitive compare on win32 only.

Don't we have canonicalization routines that can be used for this?

On 19 Jun 1998 coar@hyperreal.org wrote:

> coar        98/06/19 06:31:31
> 
>   Modified:    src      CHANGES
>                src/modules/standard mod_autoindex.c
>   Log:
>   	IndexIgnore was looking for an exact match of the filename against
>   	the pattern, even though on Win32 README.html, Readme.html, and
>   	readme.html are all the same file.
>   
>   PR:		2455
>   
>   Revision  Changes    Path
>   1.926     +3 -0      apache-1.3/src/CHANGES
>   
>   Index: CHANGES
>   ===================================================================
>   RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
>   retrieving revision 1.925
>   retrieving revision 1.926
>   diff -u -r1.925 -r1.926
>   --- CHANGES	1998/06/17 13:33:59	1.925
>   +++ CHANGES	1998/06/19 13:31:28	1.926
>   @@ -1,5 +1,8 @@
>    Changes with Apache 1.3.1
>    
>   +  *) IndexIgnore should be case-blind on Win32 (and any other case-aware
>   +     but case-insensitive platforms).  [Ken Coar] PR#2455
>   +
>      *) Enable DSO support for OpenBSD in general, not only for 2.x, because it
>         also works for OpenBSD 1.x. [Ralf S. Engelschall]
>    
>   
>   
>   
>   1.83      +10 -0     apache-1.3/src/modules/standard/mod_autoindex.c
>   
>   Index: mod_autoindex.c
>   ===================================================================
>   RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v
>   retrieving revision 1.82
>   retrieving revision 1.83
>   diff -u -r1.82 -r1.83
>   --- mod_autoindex.c	1998/06/16 03:40:13	1.82
>   +++ mod_autoindex.c	1998/06/19 13:31:30	1.83
>   @@ -534,10 +534,20 @@
>    	    ap++;
>    	}
>    
>   +#ifndef WIN32
>    	if (!ap_strcmp_match(path, p->apply_path)
>    	    && !ap_strcmp_match(tt, ap)) {
>    	    return 1;
>    	}
>   +#else  /* !WIN32 */
>   +	/*
>   +	 * On Win32, the match must be case-blind.
>   +	 */
>   +	if (!ap_strcasecmp_match(path, p->apply_path)
>   +	    && !ap_strcasecmp_match(tt, ap)) {
>   +	    return 1;
>   +	}
>   +#endif /* !WIN32 */
>        }
>        return 0;
>    }
>   
>   
>   
> 


Re: cvs commit: apache-1.3/src/modules/standard mod_autoindex.c

Posted by Ben Laurie <be...@algroup.co.uk>.
Rodent of Unusual Size wrote:
> 
> Ben Laurie wrote:
> >
> > People are supposed to write the config file for the canonical form of
> > the name. So, we don't have to cater for them doing funny stuff in the
> > config file, we only have to cater for funny filenames.
> >
> > Hence, using the canonical filename should cure the problem. I'd
> > guess.
> 
> Erm.. would you please re-state that some other way?  That made
> my head hurt for some reason..

What I'm saying is that you (the user) should write config directives
such that they match the canonical form of the filename, rather than the
code rewriting the directives.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686| Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org/
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author     http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache/

WE'RE RECRUITING! http://www.aldigital.co.uk/recruit/

Re: cvs commit: apache-1.3/src/modules/standard mod_autoindex.c

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Ben Laurie wrote:
> 
> People are supposed to write the config file for the canonical form of
> the name. So, we don't have to cater for them doing funny stuff in the
> config file, we only have to cater for funny filenames.
> 
> Hence, using the canonical filename should cure the problem. I'd
> guess.

Erm.. would you please re-state that some other way?  That made
my head hurt for some reason..

#ken	P-)}

Ken Coar                    <http://Web.Golux.Com/coar/>
Apache Group member         <http://www.apache.org/>
"Apache Server for Dummies" <http://Web.Golux.Com/coar/ASFD/>

Re: cvs commit: apache-1.3/src/modules/standard mod_autoindex.c

Posted by Ben Laurie <be...@algroup.co.uk>.
Alexei Kosut wrote:
> 
> On Sat, 20 Jun 1998, Ben Laurie wrote:
> 
> > People are supposed to write the config file for the canonical form of
> > the name. So, we don't have to cater for them doing funny stuff in the
> > config file, we only have to cater for funny filenames.
> 
> I guess... OTOH, a bunch of the directives do convert the config file
> input into canonical format. So it's kind of iffy. However, if the user
> does use canonical format (lowercase) for all their directives, there
> shouldn't be any problems.This is not, IIRC, properly documented.
> 
> It should be.

Well, lowercased, forwardslashed and bedrivelettered is the real deal.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686| Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org/
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author     http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache/

WE'RE RECRUITING! http://www.aldigital.co.uk/recruit/

Re: cvs commit: apache-1.3/src/modules/standard mod_autoindex.c

Posted by Alexei Kosut <ak...@leland.Stanford.EDU>.
On Sat, 20 Jun 1998, Ben Laurie wrote:

> People are supposed to write the config file for the canonical form of
> the name. So, we don't have to cater for them doing funny stuff in the
> config file, we only have to cater for funny filenames.

I guess... OTOH, a bunch of the directives do convert the config file
input into canonical format. So it's kind of iffy. However, if the user
does use canonical format (lowercase) for all their directives, there
shouldn't be any problems.This is not, IIRC, properly documented.

It should be.

-- Alexei Kosut <ak...@stanford.edu> <http://www.stanford.edu/~akosut/>
   Stanford University, Class of 2001 * Apache <http://www.apache.org> *



Re: cvs commit: apache-1.3/src/modules/standard mod_autoindex.c

Posted by Ben Laurie <be...@algroup.co.uk>.
Rodent of Unusual Size wrote:
> 
> Marc Slemko wrote:
> >
> > Surely we have a better way to do this than adding an ifdef and
> > doing a case insensitive compare on win32 only.
> >
> > Don't we have canonicalization routines that can be used for this?
> 
> Possibly; I didn't think to check the <Files> stuff.  The thing here
> is the pattern issue.  As far as that goes, I'm not entirely
> certain that the <Files> stuff will correctly interpret A.html
> and a.html as being identical on Win32 (which they are).  Hmm.
> I'll look into this a bit more.

People are supposed to write the config file for the canonical form of
the name. So, we don't have to cater for them doing funny stuff in the
config file, we only have to cater for funny filenames.

Hence, using the canonical filename should cure the problem. I'd guess.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686| Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org/
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author     http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache/

WE'RE RECRUITING! http://www.aldigital.co.uk/recruit/

Re: cvs commit: apache-1.3/src/modules/standard mod_autoindex.c

Posted by Marc Slemko <ma...@worldgate.com>.
On Fri, 19 Jun 1998, Rodent of Unusual Size wrote:

> Marc Slemko wrote:
> > 
> > Surely we have a better way to do this than adding an ifdef and
> > doing a case insensitive compare on win32 only.
> > 
> > Don't we have canonicalization routines that can be used for this?
> 
> Possibly; I didn't think to check the <Files> stuff.  The thing here
> is the pattern issue.  As far as that goes, I'm not entirely
> certain that the <Files> stuff will correctly interpret A.html
> and a.html as being identical on Win32 (which they are).  Hmm.
> I'll look into this a bit more.

No, the trick isn't to treat a.html and A.html as the same the trick is to
canonicalize both into the same format.  This is already done for
requested files to avoid having to give routines that shouldn't care
bunches of changes that will only deal with case sensitivity, and not
other possible (eg. c:/foo and /foo can be the same) differences.

See util_win32.c.


Re: cvs commit: apache-1.3/src/modules/standard mod_autoindex.c

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Marc Slemko wrote:
> 
> Surely we have a better way to do this than adding an ifdef and
> doing a case insensitive compare on win32 only.
> 
> Don't we have canonicalization routines that can be used for this?

Possibly; I didn't think to check the <Files> stuff.  The thing here
is the pattern issue.  As far as that goes, I'm not entirely
certain that the <Files> stuff will correctly interpret A.html
and a.html as being identical on Win32 (which they are).  Hmm.
I'll look into this a bit more.

#ken	P-)}

Ken Coar                    <http://Web.Golux.Com/coar/>
Apache Group member         <http://www.apache.org/>
"Apache Server for Dummies" <http://Web.Golux.Com/coar/ASFD/>