From: martin f krafft <hidden> Date: 2016-06-15 22:44:30
Hi all,
please have a look at http://git.madduck.net/v/code/libfactory++.git
or http://git.madduck.net/v/code/libfactory%2b%2b.git.
I narrowed this down to the first line of CGI.pm's path_info sub:
my ($self,$info) = self_or_default(@_);
but then my perl-foo wouldn't take me further.
gitweb works fine if I turn off pathinfo, but when it's turned on,
it cannot deal with two ++ in the name of projects.
The bug seems to be in CGI.pm, and I now wonder what to do about it.
Please keep the bug address [off-list ref] in Cc.
--
martin | http://madduck.net/ | http://two.sentenc.es/
"the association on this web site and in peter chappell
publications, articles and books, made between remedy and diseases
is used for clarity, but is not the functional reality and does not
imply these resonances treat any disease. they merely vitalise and
inform the self healing system."
-- peter chappell
spamtraps: madduck.bogus@madduck.net
From: Frank Lichtenheld <hidden> Date: 2016-06-15 22:44:30
On Sun, Apr 20, 2008 at 04:46:54PM +0200, martin f krafft wrote:
The bug seems to be in CGI.pm, and I now wonder what to do about it.
CGI->path_info in etch's version is broken, you need either use a newer
CGI.pm or $ENV{PATH_INFO} directly.
Gruesse,
--
Frank Lichtenheld [off-list ref]
www: http://www.djpig.de/
From: martin f. krafft <hidden> Date: 2016-06-15 22:44:30
The project name, when used in a regular expression, needs to be quoted
properly, so that stuff like '++' in the project name does not cause
Perl to barf.
Related info: http://bugs.debian.org/476076
This is a bug in Perl's CGI.pm, but fixing that exposed a similar bug in
gitweb.perl
Signed-off-by: martin f. krafft <redacted>
---
gitweb/gitweb.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@@ -511,7 +511,7 @@ sub evaluate_path_info {}# do not change any parameters if an action is given using the query stringreturnif$action;-$path_info=~s,^$project/*,,;+$path_info=~s,^\Q$project\E/*,,;my($refname,$pathname)=split(/:/,$path_info,2);if(defined$pathname){# we got "project.git/branch:filename" or "project.git/branch:dir/"
From: martin f. krafft <hidden> Date: 2016-06-15 22:44:30
If a project name contains special URL characters like +, gitweb's links
break in subtle ways. The solution is to pass the project name through
esc_url() and using the return value.
Signed-off-by: martin f. krafft <redacted>
---
gitweb/gitweb.perl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
@@ -633,7 +633,7 @@ sub href(%) {my($use_pathinfo)=gitweb_check_feature('pathinfo');if($use_pathinfo){# use PATH_INFO for project name-$href.="/$params{'project'}"ifdefined$params{'project'};+$href.="/".esc_url($params{'project'})ifdefined$params{'project'};delete$params{'project'};# Summary just uses the project path URL