{"thread":{"id":"8132","subject":"[PATCH] cvsserver: Don't send mixed messages to clients","startedAt":"2007-05-13T17:49:05Z","lastAt":"2007-05-20T01:10:48Z","messageCount":5,"participants":["Frank Lichtenheld","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"42029","messageId":"1179078545517-git-send-email-frank@lichtenheld.de","threadId":"8132","inReplyTo":null,"subject":"[PATCH] cvsserver: Don't send mixed messages to clients","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-05-13T17:49:05Z","receivedAt":"2007-05-13T17:49:05Z","isPatch":true,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"After we send I HATE YOU we should probably exit and not happily\ncontinue with I LOVE YOU and further communication.\n\nMost clients will probably just exit and ignore everything we\nsend after the I HATE YOU and it is not a security problem\neither because we don't really care about the user name anyway.\n\nBut it is still the right thing to do.\n\nSigned-off-by: Frank Lichtenheld <frank@lichtenheld.de>\n---\n git-cvsserver.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex a07c725..fcfb99d 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -105,6 +105,7 @@ if (@ARGV && $ARGV[0] eq 'pserver') {\n     unless ($line eq 'anonymous') {\n        print \"E Only anonymous user allowed via pserver\\n\";\n        print \"I HATE YOU\\n\";\n+       exit 1;\n     }\n     $line = <STDIN>; chomp $line;    # validate the password?\n     $line = <STDIN>; chomp $line;\n-- \n1.5.1.4\n"},{"id":"42167","messageId":"7vmz07m6wy.fsf@assigned-by-dhcp.cox.net","threadId":"8132","inReplyTo":"20070514131528.GC5272@planck.djpig.de","subject":"Re: [PATCH] cvsserver: Don't send mixed messages to clients","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-14T21:28:29Z","receivedAt":"2007-05-14T21:28:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frank Lichtenheld <frank@lichtenheld.de> writes:\n\n> After looking through all the uses of\n> \tdie \"something\"\n> and\n> \tprint \"E something\";\n> \texit;\n> and\n> \tprint \"error 1 something\";\n> \texit;\n>\n> in the current code I fail to see a real pattern there, is there any?\n> If yes, we should maybe document it in a comment somewhere...\n>\n> For the record, cvs (server side) does the following in this particular situation:\n> \tbuf_output0 (buf_to_net, \"I HATE YOU\\n\");\n>         buf_flush (buf_to_net, true);\n>\n>         /* Don't worry about server_cleanup, server_active isn't set\n>            yet.  */\n>         exit (EXIT_FAILURE);\n\nOk, I stand corrected.  If there is a pattern to emulate, that\nshould be found in the real cvs server.\n"},{"id":"42663","messageId":"20070520004543.GF4085@planck.djpig.de","threadId":"8132","inReplyTo":"7vmz07m6wy.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] cvsserver: Don't send mixed messages to clients","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-05-20T00:45:43Z","receivedAt":"2007-05-20T00:45:43Z","isPatch":true,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"On Mon, May 14, 2007 at 02:28:29PM -0700, Junio C Hamano wrote:\n> Frank Lichtenheld <frank@lichtenheld.de> writes:\n> > For the record, cvs (server side) does the following in this particular situation:\n> > \tbuf_output0 (buf_to_net, \"I HATE YOU\\n\");\n> >         buf_flush (buf_to_net, true);\n> >\n> >         /* Don't worry about server_cleanup, server_active isn't set\n> >            yet.  */\n> >         exit (EXIT_FAILURE);\n> \n> Ok, I stand corrected.  If there is a pattern to emulate, that\n> should be found in the real cvs server.\n\nWill you correct the patch then back to my version? master still has\nyour version of it AFAICT.\n\nGruesse,\n-- \nFrank Lichtenheld <frank@lichtenheld.de>\nwww: http://www.djpig.de/\n"},{"id":"42664","messageId":"7v646otizs.fsf@assigned-by-dhcp.cox.net","threadId":"8132","inReplyTo":"20070520004543.GF4085@planck.djpig.de","subject":"Re: [PATCH] cvsserver: Don't send mixed messages to clients","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-20T00:51:35Z","receivedAt":"2007-05-20T00:51:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frank Lichtenheld <frank@lichtenheld.de> writes:\n\n> On Mon, May 14, 2007 at 02:28:29PM -0700, Junio C Hamano wrote:\n>> Frank Lichtenheld <frank@lichtenheld.de> writes:\n>> > For the record, cvs (server side) does the following in this particular situation:\n>> > \tbuf_output0 (buf_to_net, \"I HATE YOU\\n\");\n>> >         buf_flush (buf_to_net, true);\n>> >\n>> >         /* Don't worry about server_cleanup, server_active isn't set\n>> >            yet.  */\n>> >         exit (EXIT_FAILURE);\n>> \n>> Ok, I stand corrected.  If there is a pattern to emulate, that\n>> should be found in the real cvs server.\n>\n> Will you correct the patch then back to my version? master still has\n> your version of it AFAICT.\n\nWill do, but then we would also have to vet all the error exit\npaths to match what the real cvsserver does, wouldn't we?\n\nWe've survived without that so far, so while I'll apply the\nabove change before 1.5.2, I think we do not have to have the\nrelease wait for fixes to the other error exit paths.\n"},{"id":"42665","messageId":"20070520011048.GG4085@planck.djpig.de","threadId":"8132","inReplyTo":"7v646otizs.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] cvsserver: Don't send mixed messages to clients","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-05-20T01:10:48Z","receivedAt":"2007-05-20T01:10:48Z","isPatch":true,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"On Sat, May 19, 2007 at 05:51:35PM -0700, Junio C Hamano wrote:\n> Frank Lichtenheld <frank@lichtenheld.de> writes:\n> \n> > On Mon, May 14, 2007 at 02:28:29PM -0700, Junio C Hamano wrote:\n> >> Frank Lichtenheld <frank@lichtenheld.de> writes:\n> >> > For the record, cvs (server side) does the following in this particular situation:\n> >> > \tbuf_output0 (buf_to_net, \"I HATE YOU\\n\");\n> >> >         buf_flush (buf_to_net, true);\n> >> >\n> >> >         /* Don't worry about server_cleanup, server_active isn't set\n> >> >            yet.  */\n> >> >         exit (EXIT_FAILURE);\n> >> \n> >> Ok, I stand corrected.  If there is a pattern to emulate, that\n> >> should be found in the real cvs server.\n> >\n> > Will you correct the patch then back to my version? master still has\n> > your version of it AFAICT.\n> \n> Will do, but then we would also have to vet all the error exit\n> paths to match what the real cvsserver does, wouldn't we?\n\nSure. But it is nothing utterly important. It just so happens\nthat I already have a test for this one case and would like to\nsee it fixed before submitting the test patches again.\n\n> We've survived without that so far, so while I'll apply the\n> above change before 1.5.2, I think we do not have to have the\n> release wait for fixes to the other error exit paths.\n\nAgreed.\n\nGruesse,\n-- \nFrank Lichtenheld <frank@lichtenheld.de>\nwww: http://www.djpig.de/\n"}]}