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

1 messages from 2010-07-03 to 2010-07-03. Participants: Áshin László.
Thread: https://gitlist.dev/t/24282

## Áshin László, 2010-07-03 21:23

Subject: [PATCH 3/4] git-cvsserver: do not try to descramble empty password
Message-ID: <AANLkTikUyBMOASPSQeyMLa_Vhp0QdP__c0kIsCMarY8L@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikUyBMOASPSQeyMLa_Vhp0QdP__c0kIsCMarY8L%40mail.gmail.com
In-Reply-To: <-1644121413921817001@unknownmsgid>

```
 git-cvsserver.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

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

```
