git-cvsserver: take care of empty passwords
A message that is not in the archive (sent off-list or not yet received): 3594077658746039911@unknownmsgid
PATCH 3/5 git-cvsserver: take care of empty passwords
Do not try to descramble them.
---
git-cvsserver.perl | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
git-cvsserver.perl +0 -0
@@ -241,11 +241,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.0.4
Quoted 1 line · Áshin László
Do not try to descramble them.
This commit message isn't very revealing. What does this do exactly? Is the behavior with empty passwords changed now? Does git-cvsserver no longer support empty passwords? Is the on-disk format in the authdb just different? (I.e. "" instead of "A" or something). Or something else?
descramble() dies if it is called with empty string as an argument. This patch only fixes this.
The test case written to check empty passwords only checks the case when the user is not in the authdb, so the old code doesn't even call descramble().
Quoted 9 lines · Ævar Arnfjörð Bjarmason
Quoted 1 line · Áshin László
Do not try to descramble them.
This commit message isn't very revealing. What does this do exactly? Is the behavior with empty passwords changed now? Does git-cvsserver no longer support empty passwords? Is the on-disk format in the authdb just different? (I.e. "" instead of "A" or something). Or something else?