git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] git-cvsserver: fix error for invalid password formats

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 19, 2010, 16:06 UTC
Message-ID
<1276963618-14662-3-git-send-email-avarab@gmail.com>
In-Reply-To
<1276963618-14662-1-git-send-email-avarab@gmail.com>

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
Previous: Ævar Arnfjörð Bjarmason
Message 3 of 3 in “git-cvsserver: Minor fixes for oopsies”
  1. 0/2 git-cvsserver: Minor fixes for oopsiesÆvar Arnfjörð Bjarmason, Jun 19, 2010
  2. 1/2 git-cvsserver: typo in a comment: bas -> hasÆvar Arnfjörð Bjarmason, Jun 19, 2010
  3. 2/2 git-cvsserver: fix error for invalid password formatsÆvar Arnfjörð Bjarmason, Jun 19, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.