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

[PATCH 4/5] git-cvsserver: break the loop after successful hit

From
ÁLÁshin László <ashinlaszlo@gmail.com>
Date
Jul 6, 2010, 17:38 UTC
Message-ID
<AANLkTik0pMkYDHZD9jgzn3OaGUdyeiFwAv7o3OTUmEvO@mail.gmail.com>
In-Reply-To
<-1324832183078898154@unknownmsgid>
No need to check for more lines of the authentication database after found a
matching one.
---
 git-cvsserver.perl |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index e842d77..cd461ac 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -248,11 +248,10 @@ if ($state->{method} eq 'pserver') {
        my $auth_ok;
        open my $passwd, "<", $authdb or die $!;
        while (<$passwd>) {
-            if (m{^\Q$user\E:(.*)}) {
-                if (crypt($user, $password) eq $1) {
-                    $auth_ok = 1;
-                }
-            };
+            if (m{^\Q$user\E:(.*)} && crypt($user, $password) eq $1) {
+                $auth_ok = 1;
+                last;
+            }
        }
        close $passwd;

--
1.7.0.4
Next: Junio C Hamano
Message 1 of 2 in “git-cvsserver: break the loop after successful hit”
  1. 4/5 git-cvsserver: break the loop after successful hitÁshin László, Jul 6, 2010
  2. Junio C HamanoJul 7, 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.