aboutsummaryrefslogtreecommitdiff
path: root/git-cvsserver.perl
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2010-05-15 02:46:01 +0000
committerJunio C Hamano <gitster@pobox.com>2010-05-19 21:02:59 -0700
commit3052525effbf4b9ab0cc4a66fe32f0f7261b7323 (patch)
tree1bd68b2a11e4a87b42751de4837c86e7a43319da /git-cvsserver.perl
parentc057bad3701682a208b72473b746de6bb5d89792 (diff)
downloadgit-3052525effbf4b9ab0cc4a66fe32f0f7261b7323.tar.gz
git-3052525effbf4b9ab0cc4a66fe32f0f7261b7323.tar.xz
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>
Diffstat (limited to 'git-cvsserver.perl')
-rwxr-xr-xgit-cvsserver.perl23
1 files changed, 13 insertions, 10 deletions
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(<PASSWD>) {
- 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;
}