[PATCH] Minimal support for paths with spaces
Gordon Henriksen
gordon at iclub.com
Thu Feb 5 12:07:04 PST 2004
The attached patch allows me to use cvsweb.cgi to browse folders and
view/download files from my CVS repository which contain spaces in their
filenames.
Contrary to the comment in the source, cvs co -p with a space seems to
work just fine: cvsweb.cgi simply wasn't unescaping $ENV{PATH_INFO}, and
was as a result telling cvs to access "some+path" or "some%20path"
instead of the correct "some path".
I carped the y/// and s///e that the program uses to unescape
QUERY_STRING and applied them to $pathinfo.
I haven't noticed any ill effects whatsoever from this patch, but this
is a brand new installation of the CGI (where a prohibition against
spaces would be quite the deal-killer).
I haven't explored all the cases where ${PATH_INFO} or derivative
variables (e.g., $fullname) might be reincorporated into a URL without
having been properly re-escaped. e.g., since $pathinfo and $fullpath are
now unescaped, filenames with ?'s might now pose a problem if the
program tries $r->redirect("$path/$fullpath"). Someone should do that.
--
Gordon Henriksen
IT Manager
ICLUBcentral Inc.
gordon at iclub.com
P.S. - I'm not subscribed to freebsd-cvsweb at FreeBSD.org, so mail me
privately if you expect any messages to reach me.
More information about the freebsd-cvsweb
mailing list