You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Doug MacEachern <do...@covalent.net> on 2001/08/24 02:55:16 UTC

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;



Re: current cvs cannot serve static files

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Jeff Trawick" <tr...@attglobal.net>
Sent: Thursday, August 23, 2001 8:40 PM


> "William A. Rowe, Jr." <wr...@rowe-clan.net> writes:
> 
> > 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
> 
> what's good for the goose is good for the gander ;)

Agreed :)  Also, better to catch them today than in 2.0.55.

Bill


Re: current cvs cannot serve static files

Posted by Jeff Trawick <tr...@attglobal.net>.
"William A. Rowe, Jr." <wr...@rowe-clan.net> writes:

> 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

what's good for the goose is good for the gander ;)

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Re: current cvs cannot serve static files

Posted by Cliff Woolley <cl...@yahoo.com>.
On Thu, 23 Aug 2001, William A. Rowe, Jr. wrote:

> 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.

Your patch didn't help on my end... I just committed it before I saw your
note here.  Sorry, hope it doesn't get in your way.  I'll revert if you
want.

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Re: current cvs cannot serve static files

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
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" <do...@covalent.net>
To: <de...@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;
> 
> 
>