Re: [PATCH] transport: do not allow to push over git:// protocol
From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:52:10
Subsystem:
documentation, the rest · Maintainers:
Jonathan Corbet, Linus Torvalds
On Mon, Oct 03, 2011 at 02:01:59PM +0300, Ilari Liusvaara wrote:
quoted hunk ↗ jump to hunk
On Mon, Oct 03, 2011 at 03:42:51AM -0400, Jeff King wrote:quoted
On Sat, Oct 01, 2011 at 11:26:55AM +1000, Nguyen Thai Ngoc Duy wrote: The real problem here seems to be that instead of communicating "no, we don't support that", git-daemon just hangs up. It would be a much nicer fix if we could change that. I'm not sure it's possible, though. There's not much room in the beginning of the room to make that communication in a way that's backwards compatible.Oh, sure it is possible (except for remote snapshot): $ /usr/bin/git fetch git://localhost/foobar fatal: remote error: R access for foobar DENIED to anonymous $ /usr/bin/git push git://localhost/foobar fatal: remote error: W access for foobar DENIED to anonymous $ /usr/bin/git archive --remote=git://localhost/foobar HEAD fatal: git archive: protocol error $ /usr/bin/git --version git version 1.7.6.3 Supported for fetch and push since 1.6.1-rc1 (And 1.6.1 was over 2.5 years ago). Oh, and even before that, but with slightly more ugly error message. Oh, and adding interpretation of ERR packets to git archive is easy (and I even happen to have git:// server that can send those to test against): $ git archive --remote=git://localhost/foobar HEAD fatal: remote error: R access for foobar DENIED to anonymous (I also tested that remote snapshotting of repository that should be readable succeeds, it does).--- >8 ----From ce3a402e4fa72cf603f92801d6f021ff89d3ac35 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara <redacted> Date: Mon, 3 Oct 2011 13:55:37 +0300 Subject: [PATCH] Support ERR in remote archive like in fetch/push Make ERR as first packet of remote snapshot reply work like it does in fetch/push. Lets servers decline remote snapshot with message the same way as declining fetch/push with a message. Signed-off-by: Ilari Liusvaara <redacted>
Yeah, maybe with this patch also? -- 8< -- Subject: [PATCH] pack-protocol: document "ERR" line Since a807328 (connect.c: add a way for git-daemon to pass an error back to client), git client recognizes "ERR" line and prints a friendly message to user if an error happens at server side. Document this. Signed-off-by: Nguyễn Thái Ngọc Duy <redacted> --- Documentation/technical/pack-protocol.txt | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Documentation/technical/pack-protocol.txt b/Documentation/technical/pack-protocol.txt
index a7004c6..546980c 100644
--- a/Documentation/technical/pack-protocol.txt
+++ b/Documentation/technical/pack-protocol.txt@@ -60,6 +60,13 @@ process on the server side over the Git protocol is this: "0039git-upload-pack /schacon/gitbook.git\0host=example.com\0" | nc -v example.com 9418 +If the server refuses the request for some reasons, it could abort +gracefully with an error message. + +---- + error-line = PKT-LINE("ERR" SP explanation-text) +---- + SSH Transport -------------
--
-- 8< --