You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Robert S. Thau" <rs...@ai.mit.edu> on 1995/07/08 18:13:30 UTC

Re: one more...

BTW, on Cliff's UserDir bug, it seems cleaner to let the directory
module itself generate the redirect as usual, by not tacking on
spurious PATH_INFO (which was the underlying problem).  Granted, it
only makes a difference if /~user/public_html is something other than
a directory, which is a pretty rare case, but sometime someone is
going to write a custom directory handler, and wonder why it wasn't
being called in this case.  Anyway, this fixes the problem here:

*** mod_userdir.c~      Sun Jun 25 19:01:10 1995
--- mod_userdir.c       Sat Jul  8 12:01:22 1995
***************
*** 108,115 ****
          if(!(pw=getpwnam(w)))
              return NOT_FOUND;
  
!       r->filename =
!         pstrcat (r->pool, pw->pw_dir, "/", userdir, "/", dname, NULL);
  
        return OK;
      }
--- 108,122 ----
          if(!(pw=getpwnam(w)))
              return NOT_FOUND;
  
!       /* The 'dname' funny business involves backing it up to capture
!        * the '/' delimiting the "/~user" part from the rest of the URL,
!        * in case there was one (the case where there wasn't being just
!        * "GET /~user HTTP/1.0", for which we don't want to tack on a
!        * '/' onto the filename).
!        */
! 
!       if (dname[-1] == '/') --dname;
!       r->filename = pstrcat (r->pool, pw->pw_dir, "/", userdir, dname, NULL);
  
        return OK;
      }


Any objections?

rst