From 9695bad2e8fd25277aac814170de2a20849a234a Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 12 Jul 2013 07:01:10 -0700 Subject: [PATCH] projlist.cgi: switch to using new filedb_grep function --- cgi/projlist.cgi | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/cgi/projlist.cgi b/cgi/projlist.cgi index 002f432..dcab25a 100755 --- a/cgi/projlist.cgi +++ b/cgi/projlist.cgi @@ -48,23 +48,19 @@ if (!valid_email($name) && $name !~ /^[0-9a-f]{32}$/) { $name = md5_hex($name) if $name !~ /^[0-9a-f]{32}$/; my $displayname; - -open F, '<', "$Girocco::Config::chroot/etc/gitweb.list" - or die "not found project list, that's really weird!"; - -my @projects = (); -while () { - chomp; - my ($proj, $owner) = split / /; - $owner = CGI::Util::unescape($owner); - if (md5_hex($owner) eq $name) { - $proj = CGI::Util::unescape($proj); - $proj =~ s/[.]git$//; - push @projects, $proj; - $displayname = $owner unless $displayname; +my @projects = filedb_grep(jailed_file('/etc/gitweb.list'), + sub { + chomp; + my ($proj, $owner) = split / /; + $owner = CGI::Util::unescape($owner); + if (md5_hex($owner) eq $name) { + $proj = CGI::Util::unescape($proj); + $proj =~ s/[.]git$//; + $displayname = $owner unless $displayname; + $proj; + } } -} -close F; +); @projects or die "not found owner's projects, that's really weird!"; $displayname =~ s,@,,; -- 2.11.4.GIT