httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: httpd-2.0/modules/dav/fs repos.c
Date Thu, 24 Jan 2002 23:00:22 GMT
On Thu, Jan 24, 2002 at 03:23:58PM -0000, wrowe@apache.org wrote:
> wrowe       02/01/24 07:23:58
> 
>   Modified:    modules/dav/fs repos.c
>   Log:
>     Cause dav_fs_get_parent_resource to fail if the file path is entirely
>     invalid or incomplete, or if it is root [determined by the platform's
>     apr implemention].  Identified by Greg Stein.

Well, it was also intended to mean "root URI path". There is no parent for
http://example.com/. Similarly, there is no parent for
http://example.com/foo/bar/ when that Location maps to C:/

(yes, the latter case has a parent, but mod_dav_fs and Apache aren't quite
 sophisticated enough to figure it out)

>...
>   --- repos.c	23 Jan 2002 20:55:10 -0000	1.58
>   +++ repos.c	24 Jan 2002 15:23:58 -0000	1.59
>   @@ -735,10 +735,18 @@
>        dav_resource *parent_resource;
>        apr_status_t rv;
>        char *dirpath;
>   +    char *testroot;
>   +    char *testpath;
>    
>   -    /* If given resource is root, then there is no parent */
>   -    if (strcmp(resource->uri, "/") == 0 ||
>   -        ap_os_is_path_absolute(ctx->pool, ctx->pathname)) {

That first strcmp() is needed for the URI part of the test.

I'll fix it.

Thanks for the patches, Bill!

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message