git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] git-cvsserver: Minor fixes for oopsies
@ 2010-06-19 16:06 Ævar Arnfjörð Bjarmason
  2010-06-19 16:06 ` [PATCH 1/2] git-cvsserver: typo in a comment: bas -> has Ævar Arnfjörð Bjarmason
  2010-06-19 16:06 ` [PATCH 2/2] git-cvsserver: fix error for invalid password formats Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-06-19 16:06 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

The original git-cvsserver pserver support had some oops code. There
was a typo in a comment, and the error for invalid password formats
wasn't correct.

As an aside, since the original implementation I've released the code
on CPAN as the Crypt::CVS. That version also has a scramble() function
and exhaustive tests.

It would make a good experimental case for adding dual-life modules to
Git due to its smallness and the inclusion of tests.

Ævar Arnfjörð Bjarmason (2):
  git-cvsserver: typo in a comment: bas -> has
  git-cvsserver: fix error for invalid password formats

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] git-cvsserver: typo in a comment: bas -> has
  2010-06-19 16:06 [PATCH 0/2] git-cvsserver: Minor fixes for oopsies Ævar Arnfjörð Bjarmason
@ 2010-06-19 16:06 ` Ævar Arnfjörð Bjarmason
  2010-06-19 16:06 ` [PATCH 2/2] git-cvsserver: fix error for invalid password formats Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-06-19 16:06 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-cvsserver.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 3833bee..6de7921 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -2656,7 +2656,7 @@ sub descramble
     );
     my ($str) = @_;
 
-    # This should never happen, the same password format (A) bas been
+    # This should never happen, the same password format (A) has been
     # used by CVS since the beginning of time
     die "invalid password format $1" unless substr($str, 0, 1) eq 'A';
 
-- 
1.7.1.251.g92a7

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] git-cvsserver: fix error for invalid password formats
  2010-06-19 16:06 [PATCH 0/2] git-cvsserver: Minor fixes for oopsies Ævar Arnfjörð Bjarmason
  2010-06-19 16:06 ` [PATCH 1/2] git-cvsserver: typo in a comment: bas -> has Ævar Arnfjörð Bjarmason
@ 2010-06-19 16:06 ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-06-19 16:06 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Change the error message to report the erroneous password
character. $1 was never set in the previos version, it was a leftover
from older code that used a regex for the test.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-cvsserver.perl |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 6de7921..0f45c39 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -2658,7 +2658,10 @@ sub descramble
 
     # This should never happen, the same password format (A) has been
     # used by CVS since the beginning of time
-    die "invalid password format $1" unless substr($str, 0, 1) eq 'A';
+    {
+        my $fmt = substr($str, 0, 1);
+        die "invalid password format `$fmt'" unless $fmt eq 'A';
+    }
 
     my @str = unpack "C*", substr($str, 1);
     my $ret = join '', map { chr $SHIFTS[$_] } @str;
-- 
1.7.1.251.g92a7

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-19 16:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-19 16:06 [PATCH 0/2] git-cvsserver: Minor fixes for oopsies Ævar Arnfjörð Bjarmason
2010-06-19 16:06 ` [PATCH 1/2] git-cvsserver: typo in a comment: bas -> has Ævar Arnfjörð Bjarmason
2010-06-19 16:06 ` [PATCH 2/2] git-cvsserver: fix error for invalid password formats Ævar Arnfjörð Bjarmason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).