From new-httpd-owner-new-httpd-archive=hyperreal.org@apache.org Fri Oct 02 17:06:20 1998 Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 13584 invoked by uid 6000); 2 Oct 1998 17:06:19 -0000 Received: (qmail 13571 invoked from network); 2 Oct 1998 17:06:16 -0000 Received: from redfish.go2net.com (207.178.55.5) by taz.hyperreal.org with SMTP; 2 Oct 1998 17:06:16 -0000 Received: from marcs by redfish.go2net.com with smtp (Exim 1.82 #2) id 0zP8dN-0002TL-00; Fri, 2 Oct 1998 10:04:49 -0700 Date: Fri, 2 Oct 1998 10:04:49 -0700 (PDT) From: Marc Slemko X-Sender: marcs@redfish To: new-httpd@apache.org Subject: Re: Win32: Why strlwr os_canonical_filename? In-Reply-To: <3615062C.19DCBE71@algroup.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Status: O On Fri, 2 Oct 1998, Ben Laurie wrote: > Marc Slemko wrote: > > > > On Wed, 30 Sep 1998, Ken Parzygnat wrote: > > > > > I have a question regarding the following code > > > segment from sub_canonical_filename: > > > > > > if (h == INVALID_HANDLE_VALUE) { > > > ap_assert(strlen(szCanon) + strlen(szFilePart) + nSlashes < nCanon); > > > for (n = 0; n < nSlashes; ++n) { > > > strcat(szCanon, "/"); > > > } > > > strcat(szCanon, szFilePart); > > > return FALSE; > > > } > > > else { > > > ap_assert(strlen(szCanon)+strlen(d.cFileName) < nCanon); > > > strlwr(d.cFileName); > > > strcat(szCanon, d.cFileName); > > > return TRUE; > > > } > > > > > > Why is strlwr being called in the else leg? Can we remove > > > this call? > > > > Because we need some way to be able to try to compare filenames, for > > numerous purposes such as access control. > > > > Because, due to the greatness of Win32, there are around 9543 different > > names for any file, and differing case is one of those ways, we have to > > lowercase things. > > > > This should, however, only be done on the actual filename part, nothing > > else. I seem to remember this being fixed three or four times. > > It is only being done on the actual filename part. Except that PATH_TRANSLATED is a filename but it isn't a filename. See PR#mumble, which likely prompted this question.