httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <bri...@kheldar.apana.org.au>
Subject Re: [patch] 1.3.15 ap_os_is_path_absolute
Date Thu, 02 Nov 2000 02:38:38 GMT
On Wed, 1 Nov 2000 15:00:13 -0600, William A. Rowe, Jr. wrote:

>From: "William A. Rowe, Jr." <wrowe@rowe-clan.net>
>Sent: Wednesday, November 01, 2000 2:13 PM
>
>> Users are frequently reporting that their module/handler/alias
>> absolute paths are being concatinated onto the server root.
>> This is because 1.3.14 now refuses to believe in backslashes
>> under win32, and it's up to the front end to deal with them.
>> 
>> Solution 3: My own - simply change both the ap_set_file_slot and 
>> ap_server_root_relative functions pass the file arg through the
>> ap_canonicalize_filename function before testing that it is/isn't
>> absolute.  I'm +1, since it's a smaller, tighter patch.  It also
>> helps third party authors and prevents them from thinking about this
>> issue entirely.
>
>Here's the patch... Brian, do you want to drop it in as-is and just
>check out the behavior on OS2?

Err, no. I'd much rather you used a more appropriate function, say:

void ap_fix_slashes(char *szFile)
{
/* Switch backslashes to forward */
    char *pos;

    for (pos=szFile; *pos; pos++)
        if (*pos == '\\')
            *pos = '/';
}


Why are you so keen to use ap_os_canonical_filename() when you're not
actually after a canonical file name?

As for OS/2's ap_os_canonical_filename() being the only one to return
absolute paths, I'd argue (again) that it's the only one that actually
works.

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Mime
View raw message