httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/modules/dav/fs repos.c
Date Thu, 24 Jan 2002 15:23:58 GMT
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.
  
  Revision  Changes    Path
  1.59      +11 -3     httpd-2.0/modules/dav/fs/repos.c
  
  Index: repos.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/dav/fs/repos.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- 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)) {
  +    /* If given resource is root, then there is no parent.
  +     * Unless we can retrieve the filepath root, this is
  +     * intendend to fail.  If we split the root and
  +     * no path info remains, then we also fail.
  +     */
  +    testpath = ctx->pathname;
  +    rv = apr_filepath_root(&testroot, &testpath, ctx->pool);
  +    if ((rv != APR_SUCCESS && rv != APR_ERELATIVE) 
  +        || !testpath || !*testpath) {
           *result_parent = NULL;
           return NULL;
       }
  
  
  

Mime
View raw message