@matheusbsbs / matheus-bagliano / commits / 3052525eff
Fork 0

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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed May 15, 2010 at 02:46 UTC 3052525effbf4b9ab0cc4a66fe32f0f7261b7323
1 file changed +13 -10
git-cvsserver.perl
+13 -10
@@ -194,16 +194,19 @@ if ($state->{method} eq 'pserver') {
194 print "I HATE YOU\n";
195 exit 1;
196 }
197 - my $auth_ok;
198 - open PASSWD, "<$cfg->{gitcvs}->{authdb}" or die $!;
199 - while(<PASSWD>) {
200 - if (m{^\Q$user\E:(.*)}) {
201 - if (crypt($user, $1) eq $1) {
202 - $auth_ok = 1;
203 - }
204 - };
205 - }
206 - unless ($auth_ok) {
197 +
198 + my $auth_ok;
199 + open my $passwd, "<", $cfg->{gitcvs}->{authdb} or die $!;
200 + while (<$passwd>) {
201 + if (m{^\Q$user\E:(.*)}) {
202 + if (crypt($user, $1) eq $1) {
203 + $auth_ok = 1;
204 + }
205 + };
206 + }
207 + close $passwd;
208 +
209 + unless ($auth_ok) {
210 print "I HATE YOU\n";
211 exit 1;
212 }