Mailing List Archive

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
Re: one more... [ In reply to ]
On Sat, 08 Jul 1995 12:13:30 EDT, rst@ai.mit.edu (Robert S. Thau) wrote:

} 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:

} Any objections?

None, yours is better. I guess I should not be hacking at 3am :)

Cliff