From 6328ec2cbe55929b53c729bbf32b35908759f7e9 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Tue, 25 Sep 2012 05:07:05 +0530 Subject: [PATCH] dont auto-vivify empty entries in %repos... before this, trying to access a wild repo would create an empty hash in %repos. This is pretty harmless, but at some later point, memberships() would try to use that in a pattern, attempting to match the real repo being access-checked. Which is still fine if your repo doesn't look like "libstdc++" AND you're using some recent perl. However, for perl 5.8.8, and if the repo has a ++ in it, perl barfs. Here's a test program to check your perl: #!/usr/bin/perl $base="foo/u1/libstdc++"; $i="foo/u1/libstdc++"; if ( $base =~ /^$i$/ ) { print 1; } else { print 2; } On 5.14.2 I get "2". On 5.8.8 I get: Nested quantifiers in regex; marked by <-- HERE in m/^foo/u1/libstdc++ <-- HERE $/ at ./aa.pl line 6. --- src/lib/Gitolite/Conf/Load.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Gitolite/Conf/Load.pm b/src/lib/Gitolite/Conf/Load.pm index b6991f8..dcc559c 100644 --- a/src/lib/Gitolite/Conf/Load.pm +++ b/src/lib/Gitolite/Conf/Load.pm @@ -255,7 +255,7 @@ sub load_1 { for my $r (@repos) { for my $u (@users) { - push @rules, @{ $repos{$r}{$u} } if exists $repos{$r}{$u}; + push @rules, @{ $repos{$r}{$u} } if exists $repos{$r} and exists $repos{$r}{$u}; } }