threads / patch / 24282

patch, 4 partsgit-cvsserver: do not try to descramble empty password

Subject: [PATCH 3/4] git-cvsserver: do not try to descramble empty password

## tl;dr

One message between Jul 3, 2010 and Jul 3, 2010. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Áshin László· Jul 3, 2010, 21:23 UTC · lore
 git-cvsserver.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Show changes to git-cvsserver.perl +5 −2
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 46e5fdb..01c5b21 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -235,11 +235,15 @@ if ($state->{method} eq 'pserver') {
            exit 1;
        }

+        if (length($password) > 0) {
+            $password = descramble($password);
+        }
+
        my $auth_ok;
        open my $passwd, "<", $authdb or die $!;
        while (<$passwd>) {
            if (m{^\Q$user\E:(.*)}) {
-                if (crypt($user, descramble($password)) eq $1) {
+                if (crypt($user, $password) eq $1) {
                    $auth_ok = 1;
                }
            };
--
1.7.2.rc1.dirty

← back to recent threads