httpd-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: current cvs cannot serve static files
Date Fri, 24 Aug 2001 01:26:10 GMT
The reason you observed this was the fact that &dir is passed to apr_filepath_root
_because_ we want that dir pointer moved forward.  The patch I applied to set
aside the caller's *dir value has fixed this part.

That isn't all, but I'm still coding.  Please (everyone) don't slap patches
willy nilly on this, I'm uncovering a ton of loose ends in our existing code
(prior to the patch set today).  If you apply a patch (like Jeff did) make it 
small, so I can undo it and see what it's covering up :)  I'm in mod_dir right
now, little wonder we have so many 'autoindex' exploits :(

Bill

----- Original Message ----- 
From: "Doug MacEachern" <dougm@covalent.net>
To: <dev@httpd.apache.org>
Sent: Thursday, August 23, 2001 7:55 PM
Subject: current cvs cannot serve static files


> current cvs default_handler is failing for pages that exist.  problem is
> due to ap_os_is_path_absolute() return false (in directory_walk), when the
> path is in fact absolute, so get_path_info() never happens, leaving 
> r->finfo.filetype == 0.  am i the only one seeing this?  patch below
> fixes here.
> 
> --- server/util.c       2001/08/23 19:08:19     1.109
> +++ server/util.c       2001/08/24 00:42:00
> @@ -258,8 +258,15 @@
>  AP_DECLARE(int) ap_os_is_path_absolute(apr_pool_t *p, const char *dir) 
>  {
>      const char *newpath;
> -    if (apr_filepath_root(&newpath, &dir, 0, p) != APR_SUCCESS
> -            || strncmp(newpath, dir, strlen(newpath)) != 0) {
> +    apr_status_t rv = apr_filepath_root(&newpath, &dir, 0, p);
> +
> +    if (rv == APR_EABSOLUTE) {
> +        return 1;
> +    }
> +
> +    if (rv != APR_SUCCESS ||
> +        strncmp(newpath, dir, strlen(newpath)) != 0)
> +    {
>          return 0;
>      }
>      return 1;
> 
> 
> 


Mime
View raw message