{"thread":{"id":"24262","subject":"[PATCH] git-cvsserver: pserver-auth-script","startedAt":"2010-07-02T07:54:06Z","lastAt":"2010-07-03T10:49:17Z","messageCount":8,"participants":["László ÁSHIN","Ævar Arnfjörð Bjarmason","Jakub Narebski","Áshin László"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"144670","messageId":"20100702095406.7af15d20@ashinlaszlo.pta.neti.hu","threadId":"24262","inReplyTo":null,"subject":"[PATCH] git-cvsserver: pserver-auth-script","fromName":"László ÁSHIN","fromEmail":"laszlo.ashin@neti.hu","sentAt":"2010-07-02T07:54:06Z","receivedAt":"2010-07-02T07:54:06Z","isPatch":true,"sender":{"key":"laszlo.ashin@neti.hu","avatar":null},"body":"Hi,\n\nThe following patch makes git-cvsserver capable of authenticating users through an external executable script using pserver method.\nThe script can be specified in the gitcvs section of the config file:\n[gitcvs]\n\tenabled = 1\n\tauthscript = /some/where/script.sh\n\nThe script, itself will get username and password on its standard input, so it can look like something like this:\n\n#!/bin/sh\nread username\nread password\n\nwbinfo -a \"$username%$password\"\n\n--\nOnly a return value of zero means a successful authentication.\n\nPlease comment and keep me on cc.\n\n-- \nRegards,\nLászló Áshin\n\ndiff -ruN a/git-cvsserver b/git-cvsserver\n--- a/git-cvsserver\t2010-07-01 15:31:18.000000000 +0200\n+++ b/git-cvsserver\t2010-07-01 15:35:41.000000000 +0200\n@@ -200,35 +200,54 @@\n         # Fall through to LOVE\n     } else {\n         # Trying to authenticate a user\n-        if (not exists $cfg->{gitcvs}->{authdb}) {\n-            print \"E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\\n\";\n-            print \"I HATE YOU\\n\";\n-            exit 1;\n-        }\n-\n-        my $authdb = $cfg->{gitcvs}->{authdb};\n-\n-        unless (-e $authdb) {\n-            print \"E The authentication database specified in [gitcvs.authdb] does not exist\\n\";\n-            print \"I HATE YOU\\n\";\n-            exit 1;\n-        }\n-\n-        my $auth_ok;\n-        open my $passwd, \"<\", $authdb or die $!;\n-        while (<$passwd>) {\n-            if (m{^\\Q$user\\E:(.*)}) {\n-                if (crypt($user, descramble($password)) eq $1) {\n-                    $auth_ok = 1;\n-                }\n-            };\n-        }\n-        close $passwd;\n+        if (exists $cfg->{gitcvs}->{authscript}) {\n+            my $authscript = $cfg->{gitcvs}->{authscript};\n+            unless (-x $authscript) {\n+                print \"E The authentication script specified in [gitcvs.authscript] cannot be executed\\n\";\n+                print \"I HATE YOU\\n\";\n+                exit 1;\n+            }\n+\n+            open SCRIPTIN, '|' . $authscript or die $!;\n+            print SCRIPTIN $user . \"\\n\";\n+            print SCRIPTIN descramble($password) . \"\\n\";\n+            close SCRIPTIN;\n+            if ($? != 0) {\n+                print \"E External script authentication failed.\\n\";\n+                print \"I HATE YOU\\n\";\n+                exit 1;\n+            }\n+        } else {\n+            if (not exists $cfg->{gitcvs}->{authdb}) {\n+                print \"E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\\n\";\n+                print \"I HATE YOU\\n\";\n+                exit 1;\n+            }\n+\n+            my $authdb = $cfg->{gitcvs}->{authdb};\n+\n+            unless (-e $authdb) {\n+                print \"E The authentication database specified in [gitcvs.authdb] does not exist\\n\";\n+                print \"I HATE YOU\\n\";\n+                exit 1;\n+            }\n+\n+            my $auth_ok;\n+            open my $passwd, \"<\", $authdb or die $!;\n+            while (<$passwd>) {\n+                if (m{^\\Q$user\\E:(.*)}) {\n+                    if (crypt($user, descramble($password)) eq $1) {\n+                        $auth_ok = 1;\n+                    }\n+                };\n+            }\n+            close $passwd;\n \n-        unless ($auth_ok) {\n-            print \"I HATE YOU\\n\";\n-            exit 1;\n-        }\n+            unless ($auth_ok) {\n+                print \"I HATE YOU\\n\";\n+                exit 1;\n+            }\n+\t}\n \n         # Fall through to LOVE\n     }\n"},{"id":"144679","messageId":"AANLkTil29nTVJS_dqsdyoH0BmRE8-U7HqNeeghDkbuEq@mail.gmail.com","threadId":"24262","inReplyTo":"20100702095406.7af15d20@ashinlaszlo.pta.neti.hu","subject":"Re: [PATCH] git-cvsserver: pserver-auth-script","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-02T14:33:48Z","receivedAt":"2010-07-02T14:33:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Jul 2, 2010 at 07:54, László ÁSHIN <laszlo.ashin@neti.hu> wrote:\n> Hi,\n>\n> The following patch makes git-cvsserver capable of authenticating users through an external executable script using pserver method.\n> The script can be specified in the gitcvs section of the config file:\n> [gitcvs]\n>        enabled = 1\n>        authscript = /some/where/script.sh\n>\n> The script, itself will get username and password on its standard input, so it can look like something like this:\n>\n> #!/bin/sh\n> read username\n> read password\n>\n> wbinfo -a \"$username%$password\"\n>\n> --\n> Only a return value of zero means a successful authentication.\n>\n> Please comment and keep me on cc.\n>\n> --\n> Regards,\n> László Áshin\n>\n> diff -ruN a/git-cvsserver b/git-cvsserver\n> --- a/git-cvsserver     2010-07-01 15:31:18.000000000 +0200\n> +++ b/git-cvsserver     2010-07-01 15:35:41.000000000 +0200\n> @@ -200,35 +200,54 @@\n>         # Fall through to LOVE\n>     } else {\n>         # Trying to authenticate a user\n> -        if (not exists $cfg->{gitcvs}->{authdb}) {\n> -            print \"E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\\n\";\n> -            print \"I HATE YOU\\n\";\n> -            exit 1;\n> -        }\n> -\n> -        my $authdb = $cfg->{gitcvs}->{authdb};\n> -\n> -        unless (-e $authdb) {\n> -            print \"E The authentication database specified in [gitcvs.authdb] does not exist\\n\";\n> -            print \"I HATE YOU\\n\";\n> -            exit 1;\n> -        }\n> -\n> -        my $auth_ok;\n> -        open my $passwd, \"<\", $authdb or die $!;\n> -        while (<$passwd>) {\n> -            if (m{^\\Q$user\\E:(.*)}) {\n> -                if (crypt($user, descramble($password)) eq $1) {\n> -                    $auth_ok = 1;\n> -                }\n> -            };\n> -        }\n> -        close $passwd;\n> +        if (exists $cfg->{gitcvs}->{authscript}) {\n> +            my $authscript = $cfg->{gitcvs}->{authscript};\n> +            unless (-x $authscript) {\n> +                print \"E The authentication script specified in [gitcvs.authscript] cannot be executed\\n\";\n> +                print \"I HATE YOU\\n\";\n> +                exit 1;\n> +            }\n> +\n> +            open SCRIPTIN, '|' . $authscript or die $!;\n> +            print SCRIPTIN $user . \"\\n\";\n> +            print SCRIPTIN descramble($password) . \"\\n\";\n> +            close SCRIPTIN;\n> +            if ($? != 0) {\n> +                print \"E External script authentication failed.\\n\";\n> +                print \"I HATE YOU\\n\";\n> +                exit 1;\n> +            }\n> +        } else {\n> +            if (not exists $cfg->{gitcvs}->{authdb}) {\n> +                print \"E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\\n\";\n> +                print \"I HATE YOU\\n\";\n> +                exit 1;\n> +            }\n> +\n> +            my $authdb = $cfg->{gitcvs}->{authdb};\n> +\n> +            unless (-e $authdb) {\n> +                print \"E The authentication database specified in [gitcvs.authdb] does not exist\\n\";\n> +                print \"I HATE YOU\\n\";\n> +                exit 1;\n> +            }\n> +\n> +            my $auth_ok;\n> +            open my $passwd, \"<\", $authdb or die $!;\n> +            while (<$passwd>) {\n> +                if (m{^\\Q$user\\E:(.*)}) {\n> +                    if (crypt($user, descramble($password)) eq $1) {\n> +                        $auth_ok = 1;\n> +                    }\n> +                };\n> +            }\n> +            close $passwd;\n>\n> -        unless ($auth_ok) {\n> -            print \"I HATE YOU\\n\";\n> -            exit 1;\n> -        }\n> +            unless ($auth_ok) {\n> +                print \"I HATE YOU\\n\";\n> +                exit 1;\n> +            }\n> +       }\n>\n>         # Fall through to LOVE\n>     }\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"144680","messageId":"AANLkTinGZsCLF8CFKgQJaB63Jh9anGfQK4ZSHFPl4R4N@mail.gmail.com","threadId":"24262","inReplyTo":"20100702095406.7af15d20@ashinlaszlo.pta.neti.hu","subject":"Re: [PATCH] git-cvsserver: pserver-auth-script","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-02T14:39:40Z","receivedAt":"2010-07-02T14:39:40Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Jul 2, 2010 at 07:54, László ÁSHIN <laszlo.ashin@neti.hu> wrote:\n\nDisregard the last E-Mail. I bumped into the wrong button on my\nkeyboard.\n\n> The following patch makes git-cvsserver capable of authenticating users through an external executable script using pserver method.\n> The script can be specified in the gitcvs section of the config file:\n> [gitcvs]\n>        enabled = 1\n>        authscript = /some/where/script.sh\n>\n> The script, itself will get username and password on its standard input, so it can look like something like this:\n>\n> #!/bin/sh\n> read username\n> read password\n>\n> wbinfo -a \"$username%$password\"\n>\n> --\n> Only a return value of zero means a successful authentication.\n>\n> Please comment and keep me on cc.\n\nGood to see someone use the pserver auth code I added, even though I'm\nnot doing so.\n\nThe idea looks good, please send another patch that adds documentation\nto git-cvsserver.txt too.\n\n> diff -ruN a/git-cvsserver b/git-cvsserver\n> --- a/git-cvsserver     2010-07-01 15:31:18.000000000 +0200\n> +++ b/git-cvsserver     2010-07-01 15:35:41.000000000 +0200\n\nWhy isn't this a patch against git-cvsserver.perl? Presumably you made\nit without using the Git tools. It doesn't apply like this.\n\n> @@ -200,35 +200,54 @@\n>         # Fall through to LOVE\n>     } else {\n>         # Trying to authenticate a user\n> -        if (not exists $cfg->{gitcvs}->{authdb}) {\n> -            print \"E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\\n\";\n> -            print \"I HATE YOU\\n\";\n> -            exit 1;\n> -        }\n> -\n> -        my $authdb = $cfg->{gitcvs}->{authdb};\n> -\n> -        unless (-e $authdb) {\n> -            print \"E The authentication database specified in [gitcvs.authdb] does not exist\\n\";\n> -            print \"I HATE YOU\\n\";\n> -            exit 1;\n> -        }\n> -\n> -        my $auth_ok;\n> -        open my $passwd, \"<\", $authdb or die $!;\n> -        while (<$passwd>) {\n> -            if (m{^\\Q$user\\E:(.*)}) {\n> -                if (crypt($user, descramble($password)) eq $1) {\n> -                    $auth_ok = 1;\n> -                }\n> -            };\n> -        }\n> -        close $passwd;\n> +        if (exists $cfg->{gitcvs}->{authscript}) {\n> +            my $authscript = $cfg->{gitcvs}->{authscript};\n> +            unless (-x $authscript) {\n> +                print \"E The authentication script specified in [gitcvs.authscript] cannot be executed\\n\";\n> +                print \"I HATE YOU\\n\";\n> +                exit 1;\n> +            }\n> +\n> +            open SCRIPTIN, '|' . $authscript or die $!;\n> +            print SCRIPTIN $user . \"\\n\";\n> +            print SCRIPTIN descramble($password) . \"\\n\";\n> +            close SCRIPTIN;\n\nNit: Nice use of three-arg open, but you should use lexical\nfilehandles instead. I.e.:\n\n    open my $script, '|' . $authscript or die $!;\n    ...\n\n> +            if ($? != 0) {\n> +                print \"E External script authentication failed.\\n\";\n> +                print \"I HATE YOU\\n\";\n> +                exit 1;\n> +            }\n> +        } else {\n> +            if (not exists $cfg->{gitcvs}->{authdb}) {\n> +                print \"E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\\n\";\n> +                print \"I HATE YOU\\n\";\n> +                exit 1;\n> +            }\n> +\n> +            my $authdb = $cfg->{gitcvs}->{authdb};\n> +\n> +            unless (-e $authdb) {\n> +                print \"E The authentication database specified in [gitcvs.authdb] does not exist\\n\";\n> +                print \"I HATE YOU\\n\";\n> +                exit 1;\n> +            }\n> +\n> +            my $auth_ok;\n> +            open my $passwd, \"<\", $authdb or die $!;\n> +            while (<$passwd>) {\n> +                if (m{^\\Q$user\\E:(.*)}) {\n> +                    if (crypt($user, descramble($password)) eq $1) {\n> +                        $auth_ok = 1;\n> +                    }\n> +                };\n> +            }\n> +            close $passwd;\n>\n> -        unless ($auth_ok) {\n> -            print \"I HATE YOU\\n\";\n> -            exit 1;\n> -        }\n> +            unless ($auth_ok) {\n> +                print \"I HATE YOU\\n\";\n> +                exit 1;\n> +            }\n> +       }\n>\n>         # Fall through to LOVE\n>     }\n\nOtherwise this looks good. Submit something that's against the *.perl\n(and uses git format-patch / git send-email .. ) & has docs and I'll\nack it.\n"},{"id":"144690","messageId":"AANLkTin_Pd2_uJciKDzW8wLhCSFtvOOzdlwJ8eFmWc7q@mail.gmail.com","threadId":"24262","inReplyTo":"AANLkTinGZsCLF8CFKgQJaB63Jh9anGfQK4ZSHFPl4R4N@mail.gmail.com","subject":"Re: [PATCH] git-cvsserver: pserver-auth-script","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-02T15:04:14Z","receivedAt":"2010-07-02T15:04:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Jul 2, 2010 at 14:39, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> Otherwise this looks good. Submit something that's against the *.perl\n> (and uses git format-patch / git send-email .. ) & has docs and I'll\n> ack it.\n\nOh, and it also needs tests. See the existing authdb tests in\nt9400-git-cvsserver-server.sh.\n"},{"id":"144722","messageId":"m31vbloa6m.fsf@localhost.localdomain","threadId":"24262","inReplyTo":"AANLkTinGZsCLF8CFKgQJaB63Jh9anGfQK4ZSHFPl4R4N@mail.gmail.com","subject":"Re: [PATCH] git-cvsserver: pserver-auth-script","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-07-02T21:31:48Z","receivedAt":"2010-07-02T21:31:48Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n> On Fri, Jul 2, 2010 at 07:54, László ÁSHIN <laszlo.ashin@neti.hu> wrote:\n> \n> > +\n> > +            open SCRIPTIN, '|' . $authscript or die $!;\n> > +            print SCRIPTIN $user . \"\\n\";\n> > +            print SCRIPTIN descramble($password) . \"\\n\";\n> > +            close SCRIPTIN;\n> \n> Nit: Nice use of three-arg open, but you should use lexical\n> filehandles instead. I.e.:\n> \n>     open my $script, '|' . $authscript or die $!;\n>     ...\n\nThis is two-argument open, not three-argument magic open.  There is\nstring concatenation operator '.' there, not a comma ',' delimiting\narguments.\n\nIt should be\n\n   open my $script_fd, '|-', $authscript\n   \tor die \"Couldn't open authentication script '$authscript': $!\";\n \n> > +        } else {\n> > +            if (not exists $cfg->{gitcvs}->{authdb}) {\n\nWhy not elsif?\n\n> > +                print \"E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\\n\";\n\nOverly long line.  Perhaps it would be better to split it into\nconcatenated parts.\n\n\n> > +            my $auth_ok;\n> > +            open my $passwd, \"<\", $authdb or die $!;\n\nAnd here you use three-argument form of (ordinary) open.\n\n> > +            while (<$passwd>) {\n> > +                if (m{^\\Q$user\\E:(.*)}) {\n> > +                    if (crypt($user, descramble($password)) eq $1) {\n\nWhy nested if, and not short-circuit &&?\n\n    +                if (/^\\Q$user\\E:(.*)/ &&\n    +                    crypt($user, descramble($password)) eq $1) {\n    \n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"144723","messageId":"AANLkTimts_MlrWGKaiu3frk7vOnK9B70RE7It2Wml3on@mail.gmail.com","threadId":"24262","inReplyTo":"m31vbloa6m.fsf@localhost.localdomain","subject":"Re: [PATCH] git-cvsserver: pserver-auth-script","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-02T21:34:11Z","receivedAt":"2010-07-02T21:34:11Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Jul 2, 2010 at 21:31, Jakub Narebski <jnareb@gmail.com> wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>> On Fri, Jul 2, 2010 at 07:54, László ÁSHIN <laszlo.ashin@neti.hu> wrote:\n>>\n>> > +\n>> > +            open SCRIPTIN, '|' . $authscript or die $!;\n>> > +            print SCRIPTIN $user . \"\\n\";\n>> > +            print SCRIPTIN descramble($password) . \"\\n\";\n>> > +            close SCRIPTIN;\n>>\n>> Nit: Nice use of three-arg open, but you should use lexical\n>> filehandles instead. I.e.:\n>>\n>>     open my $script, '|' . $authscript or die $!;\n>>     ...\n>\n> This is two-argument open, not three-argument magic open.  There is\n> string concatenation operator '.' there, not a comma ',' delimiting\n> arguments.\n\nWell spotted, I misread that.\n\n> It should be\n>\n>   open my $script_fd, '|-', $authscript\n>        or die \"Couldn't open authentication script '$authscript': $!\";\n>\n>> > +        } else {\n>> > +            if (not exists $cfg->{gitcvs}->{authdb}) {\n>\n> Why not elsif?\n>\n>> > +                print \"E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\\n\";\n>\n> Overly long line.  Perhaps it would be better to split it into\n> concatenated parts.\n>\n>\n>> > +            my $auth_ok;\n>> > +            open my $passwd, \"<\", $authdb or die $!;\n>\n> And here you use three-argument form of (ordinary) open.\n\nThis and the code below were already part of the code. But the patch\nwould be better if it didn't move so much code around so that this\nwould be obvious.\n\n>> > +            while (<$passwd>) {\n>> > +                if (m{^\\Q$user\\E:(.*)}) {\n>> > +                    if (crypt($user, descramble($password)) eq $1) {\n>\n> Why nested if, and not short-circuit &&?\n>\n>    +                if (/^\\Q$user\\E:(.*)/ &&\n>    +                    crypt($user, descramble($password)) eq $1) {\n>\n> --\n> Jakub Narebski\n> Poland\n> ShadeHawk on #git\n>\n"},{"id":"144739","messageId":"AANLkTinLgbrd-tOLntZt-FZkGVtTHXU2lteB-t7NAjSm@mail.gmail.com","threadId":"24262","inReplyTo":"AANLkTimts_MlrWGKaiu3frk7vOnK9B70RE7It2Wml3on@mail.gmail.com","subject":"Re: [PATCH] git-cvsserver: pserver-auth-script","fromName":"Áshin László","fromEmail":"ashinlaszlo@gmail.com","sentAt":"2010-07-03T09:28:40Z","receivedAt":"2010-07-03T09:28:40Z","isPatch":true,"sender":{"key":"ashinlaszlo@gmail.com","avatar":null},"body":"Hi,\n\nOn Fri, Jul 2, 2010 at 23:34, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> On Fri, Jul 2, 2010 at 21:31, Jakub Narebski <jnareb@gmail.com> wrote:\n>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>>> On Fri, Jul 2, 2010 at 07:54, László ÁSHIN <laszlo.ashin@neti.hu> wrote:\n>>>\n>>> > +\n>>> > +            open SCRIPTIN, '|' . $authscript or die $!;\n>>> > +            print SCRIPTIN $user . \"\\n\";\n>>> > +            print SCRIPTIN descramble($password) . \"\\n\";\n>>> > +            close SCRIPTIN;\n>>>\n>>> Nit: Nice use of three-arg open, but you should use lexical\n>>> filehandles instead. I.e.:\n>>>\n>>>     open my $script, '|' . $authscript or die $!;\n>>>     ...\n>>\n>> This is two-argument open, not three-argument magic open.  There is\n>> string concatenation operator '.' there, not a comma ',' delimiting\n>> arguments.\n>\n> Well spotted, I misread that.\n>\n>> It should be\n>>\n>>   open my $script_fd, '|-', $authscript\n>>        or die \"Couldn't open authentication script '$authscript': $!\";\n>>\n\nIt will be fixed, I will resend the patch.\n\n\n>>> > +        } else {\n>>> > +            if (not exists $cfg->{gitcvs}->{authdb}) {\n>>\n>> Why not elsif?\n\nBecause the else branch continues below. But good point, it can be\ndone that way too. Will be fixed.\n\n\n>>\n>>> > +                print \"E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\\n\";\n>>\n>> Overly long line.  Perhaps it would be better to split it into\n>> concatenated parts.\n>>\n\nOK. Next patch will be fixed from this point of view as well.\n\n\n>>\n>>> > +            my $auth_ok;\n>>> > +            open my $passwd, \"<\", $authdb or die $!;\n>>\n>> And here you use three-argument form of (ordinary) open.\n>\n> This and the code below were already part of the code. But the patch\n> would be better if it didn't move so much code around so that this\n> would be obvious.\n>\n\nI wanted to keep the old functionality (authdb), so I moved all of its\ncode to this else branch. That move meant I had to increase\nindentation level. But as far as I see now I could have solved it\nsomehow else to keep the indentation level. I will fix this too.\n\n\n>>> > +            while (<$passwd>) {\n>>> > +                if (m{^\\Q$user\\E:(.*)}) {\n>>> > +                    if (crypt($user, descramble($password)) eq $1) {\n>>\n>> Why nested if, and not short-circuit &&?\n>>\n>>    +                if (/^\\Q$user\\E:(.*)/ &&\n>>    +                    crypt($user, descramble($password)) eq $1) {\n>>\n\nGood point, but it is not my code.\n\nSo, I will resend this patch - the corrected one without the mistakes\nI taken in the first version of it.\nShould I make one patch for each of the code, doc, and test case, or\ncan they all go into one patch?\n\nRegards,\nLászló ÁSHIN\n"},{"id":"144741","messageId":"AANLkTilRfqg62NcvuLjCmNhJRlt8GFXFPAhG_M4fEa56@mail.gmail.com","threadId":"24262","inReplyTo":"AANLkTinLgbrd-tOLntZt-FZkGVtTHXU2lteB-t7NAjSm@mail.gmail.com","subject":"Re: [PATCH] git-cvsserver: pserver-auth-script","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-03T10:49:17Z","receivedAt":"2010-07-03T10:49:17Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Jul 3, 2010 at 09:28, Áshin László <ashinlaszlo@gmail.com> wrote:\n> So, I will resend this patch - the corrected one without the mistakes\n> I taken in the first version of it.\n\nGood.\n\n> Should I make one patch for each of the code, doc, and test case, or\n> can they all go into one patch?\n\nThey should all be part of the same patch.\n"}]}