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

[PATCH 2/5] simplify control flow in cvs pserver auth

From
ÁLÁshin László <ashinlaszlo@gmail.com>
Date
Jul 6, 2010, 17:35 UTC
Message-ID
<AANLkTil27QbVl_Li1P2C53SUBZYYtwrWXYdOeZN5FVHl@mail.gmail.com>
In-Reply-To
<2703392615631579763@unknownmsgid>
---
 git-cvsserver.perl |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index c89d999..10dcc65 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -231,18 +231,12 @@ if ($state->{method} eq 'pserver') {
        }

        # Fall through to LOVE
-    } else {
-        # Trying to authenticate a user
-        if (not exists $cfg->{gitcvs}->{authdb}) {
-            print "E the repo config file needs a [gitcvs] section
with an 'authdb' parameter set to the filename of the authentication
database\n";
-            print "I HATE YOU\n";
-            exit 1;
-        }
-
+    } elsif (exists $cfg->{gitcvs}->{authdb}) {
        my $authdb = $cfg->{gitcvs}->{authdb};

        unless (-e $authdb) {
-            print "E The authentication database specified in
[gitcvs.authdb] does not exist\n";
+            print "E The authentication database specified in " .
+                "[gitcvs.authdb] does not exist\n";
            print "I HATE YOU\n";
            exit 1;
        }
@@ -264,6 +258,10 @@ if ($state->{method} eq 'pserver') {
        }

        # Fall through to LOVE
+    } else {
+        print "E Unable to find a usable authentication method\n";
+        print "I HATE YOU\n";
+        exit 1;
    }

    # For checking whether the user is anonymous on commit
--
1.7.0.4
Message 1 of 1 in “simplify control flow in cvs pserver auth”
  1. 2/5 simplify control flow in cvs pserver authÁshin László, Jul 6, 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.