From: Ævar Arnfjörð Bjarmason Date: Sat, 15 May 2010 02:46:01 +0000 (+0000) Subject: git-cvsserver: indent & clean up authdb code X-Git-Tag: v1.7.2-rc0~67^2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3052525effbf4b9ab0cc4a66fe32f0f7261b7323;p=git.git git-cvsserver: indent & clean up authdb code - Indent the last commit to fit with the rest of the code. - Use lexical filehandles instead of global globs - Close the filehandle after the password database has been read. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 8b97fb80c..ed1d5b9d6 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -194,16 +194,19 @@ if ($state->{method} eq 'pserver') { print "I HATE YOU\n"; exit 1; } - my $auth_ok; - open PASSWD, "<$cfg->{gitcvs}->{authdb}" or die $!; - while() { - if (m{^\Q$user\E:(.*)}) { - if (crypt($user, $1) eq $1) { - $auth_ok = 1; - } - }; - } - unless ($auth_ok) { + + my $auth_ok; + open my $passwd, "<", $cfg->{gitcvs}->{authdb} or die $!; + while (<$passwd>) { + if (m{^\Q$user\E:(.*)}) { + if (crypt($user, $1) eq $1) { + $auth_ok = 1; + } + }; + } + close $passwd; + + unless ($auth_ok) { print "I HATE YOU\n"; exit 1; }