apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: svn commit: r422157 - /apr/apr/trunk/file_io/win32/filepath.c
Date Mon, 17 Jul 2006 19:24:06 GMT
Colm MacCarthaigh wrote:
> On Mon, Jul 17, 2006 at 01:11:24PM -0500, William A. Rowe, Jr. wrote:
>> cd c:\progra~1\Apache~1
>>
>> so apr_filepath_get returns "c:\progra~1\Apache~1"
>>
>> and the TRUENAME resolves to "c:\Program Files\Apache Software Foundation".
>>
>> Do we really want to spend the cycles in filepath_get to normalize this 
>> case?
> 
> The dangerous thing I'm thinking of is when people think they can use
> strncmp as a cheap form of "is this filename a child of parent-dir".
> Although thinking about it harder, it's probably safer for that to fail.

Yup.  Although the canonical form says "C:\Program Files\Apache", there are
good reasons for the user to want the shorthand path "c:\progra~1\apache"
since it doesn't suffer from whitespace-in-pathname issues.


Mime
View raw message