{"thread":{"id":"2501","subject":"[PATCH] git-daemon: --inetd implies --syslog","startedAt":"2005-11-14T16:41:01Z","lastAt":"2005-11-14T23:59:23Z","messageCount":5,"participants":["Andreas Ericsson","Junio C Hamano","H. Peter Anvin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11807","messageId":"20051114164101.58A495BF92@nox.op5.se","threadId":"2501","inReplyTo":null,"subject":"[PATCH] git-daemon: --inetd implies --syslog","fromName":"Andreas Ericsson","fromEmail":"exon@op5.se","sentAt":"2005-11-14T16:41:01Z","receivedAt":"2005-11-14T16:41:01Z","isPatch":true,"sender":{"key":"exon@op5.se","avatar":"https://gravatar.com/avatar/b948c4f759e868f8e721e545e37afe2cf89cfa8e2ee8b70a432f0d76aee39891?d=mp&s=160"},"body":"\nOtherwise nothing is logged anywhere, which is a Bad Thing.\n\nSigned-off-by: Andreas Ericsson <ae@op5.se>\n\n---\n\n Documentation/git-daemon.txt |    2 +-\n daemon.c                     |    6 +++---\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\napplies-to: 963d67921d6f65c08d51a8c93811f03274c34703\n9fac415ad7ec34c21b20b3c349872304869505df\ndiff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt\nindex 67c5f22..3783858 100644\n--- a/Documentation/git-daemon.txt\n+++ b/Documentation/git-daemon.txt\n@@ -35,7 +35,7 @@ OPTIONS\n \tdo not have the 'git-daemon-export-ok' file.\n \n --inetd::\n-\tHave the server run as an inetd service.\n+\tHave the server run as an inetd service. Implies --syslog.\n \n --port::\n \tListen on an alternative port.\ndiff --git a/daemon.c b/daemon.c\nindex c3f8641..50a3396 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -627,9 +627,9 @@ int main(int argc, char **argv)\n \t}\n \n \tif (inetd_mode) {\n-\t\tfclose(stderr); //FIXME: workaround\n+\t\tlog_syslog = 1;\n \t\treturn execute();\n-\t} else {\n-\t\treturn serve(port);\n \t}\n+\n+\treturn serve(port);\n }\n---\n0.99.9.GIT\n"},{"id":"11837","messageId":"7vlkzrx84p.fsf@assigned-by-dhcp.cox.net","threadId":"2501","inReplyTo":"20051114164101.58A495BF92@nox.op5.se","subject":"Re: [PATCH] git-daemon: --inetd implies --syslog","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-14T20:54:46Z","receivedAt":"2005-11-14T20:54:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"exon@op5.se (Andreas Ericsson) writes:\n\n> Otherwise nothing is logged anywhere, which is a Bad Thing.\n>\n> Signed-off-by: Andreas Ericsson <ae@op5.se>\n\nThanks; I am OK with what you are trying to do with this change,\nexcept that:\n\n - I suspect closing stderr is still needed (the \"workaround\"\n   was about inetd connection sending output to both fd 1 and 2\n   to the client, which would corrupt the protocol conversation\n   when exec'ed program writes anything to its standard error\n   stream).\n\n - I would have preferred the removal of needless else as a\n   separate cleanup patch (this is minor).\n\nPeter, I am CC'ing this to you because I do not know how you run\nthe daemon on kernel.org machines -- I suspect you use --syslog\nalready and am hoping you are OK with this change.\n"},{"id":"11841","messageId":"4379006E.8020607@op5.se","threadId":"2501","inReplyTo":"7vlkzrx84p.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-daemon: --inetd implies --syslog","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-11-14T21:23:58Z","receivedAt":"2005-11-14T21:23:58Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> exon@op5.se (Andreas Ericsson) writes:\n> \n> \n>>Otherwise nothing is logged anywhere, which is a Bad Thing.\n>>\n>>Signed-off-by: Andreas Ericsson <ae@op5.se>\n> \n> \n> Thanks; I am OK with what you are trying to do with this change,\n> except that:\n> \n>  - I suspect closing stderr is still needed (the \"workaround\"\n>    was about inetd connection sending output to both fd 1 and 2\n>    to the client, which would corrupt the protocol conversation\n>    when exec'ed program writes anything to its standard error\n>    stream).\n> \n\nThat shouldn't be a problem because;\n1) handle() dupes the connected socket to stdin and stdout, but not stderr.\n\n2) A program sending output to stderr() fails (well, *should* be either \nfailing or silent), so it's most likely not sane to continue doing \nthings anyway. This assumes that no client prints anything to stderr \nthat can be interpreted as \"real\" protocol data, ofcourse.\n\n>  - I would have preferred the removal of needless else as a\n>    separate cleanup patch (this is minor).\n> \n\nSorry. I think I missed that part when I glanced at the diff output.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"11844","messageId":"7vfypyx50s.fsf@assigned-by-dhcp.cox.net","threadId":"2501","inReplyTo":"4379006E.8020607@op5.se","subject":"Re: [PATCH] git-daemon: --inetd implies --syslog","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-14T22:01:55Z","receivedAt":"2005-11-14T22:01:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Ericsson <ae@op5.se> writes:\n\n> That shouldn't be a problem because;\n> 1) handle() dupes the connected socket to stdin and stdout, but not stderr.\n\nI am afraid that\n\n$ git whatchanged -s -S'FIXME' daemon.c\n\ntells me otherwise.  Whatever we do in handle() is too late to matter.\n\ndiff-tree 7c3693f1f240e17772c864fad35bc16226038fc8 (from 6a2e50f9dfdca7ac572bbe30dd0efdf19ca250f6)\nAuthor: lars.doelle@on-line.de <lars.doelle@on-line.de>\nDate:   Thu Sep 8 03:50:01 2005 +0200\n\n    [PATCH] git-daemon --inetd\n    \n    git-daemon using inetd. does not work properly. inetd routes stderr onto the\n    network line just like stdout, which was apparently not expected to be so.\n    \n    As the result of this, the stream is closed by the receiver, because some\n    \"Packing %d objects\\n\" originating from pack_objects is first reported over\n    the line instead of the expected pack_header, and so the SIGNATURE test\n    fails.  Here is a workaround.\n    \n    Signed-off-by: Junio C Hamano <junkio@cox.net>\n"},{"id":"11860","messageId":"437924DB.1060602@zytor.com","threadId":"2501","inReplyTo":"7vlkzrx84p.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-daemon: --inetd implies --syslog","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-11-14T23:59:23Z","receivedAt":"2005-11-14T23:59:23Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Junio C Hamano wrote:\n> \n> Thanks; I am OK with what you are trying to do with this change,\n> except that:\n> \n>  - I suspect closing stderr is still needed (the \"workaround\"\n>    was about inetd connection sending output to both fd 1 and 2\n>    to the client, which would corrupt the protocol conversation\n>    when exec'ed program writes anything to its standard error\n>    stream).\n> \n>  - I would have preferred the removal of needless else as a\n>    separate cleanup patch (this is minor).\n> \n> Peter, I am CC'ing this to you because I do not know how you run\n> the daemon on kernel.org machines -- I suspect you use --syslog\n> already and am hoping you are OK with this change.\n\nYeah, I use --inetd --syslog.\n\n\t-hpa\n"}]}