Re: [PATCH] Ask for "git program" when asking for "git-program" over SSH connection
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Jun 25, 2008, 03:45 UTC
- Message-ID
- <20080625034538.GW11793@spearce.org>
- In-Reply-To
- <7vprq66vqd.fsf_-_@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> The daemon expects to see the dashed form and we cannot change older > servers. But when invoking programs on the remote end over SSH, the > command line the client side build is under client's control.
...
Show 12 quoted lines
> diff --git a/connect.c b/connect.c
> index e92af29..fd1da26 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -589,6 +589,10 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
> conn = xcalloc(1, sizeof(*conn));
>
> strbuf_init(&cmd, MAX_CMD_LEN);
> + if (protocol != PROTO_GIT && !strncmp(prog, "git-", 4)) {
> + strbuf_addstr(&cmd, "git ");
> + prog += 4;
> + }Nack on that implementation.
I think this is a problem for systems based on say gitosis, or some pattern like it. Day-job doesn't use gitosis, but has switched to a Perl based forced ssh tool that smells a lot like gitosis. Gitosis is popular.
github probably uses something similar. But nobody knows (or probably cares) since they don't release their source.
gitosis is likely looking for "$git-upload-pack '(.*)'$" to be in the $SSH_ORIGINAL_COMMAND environment variable, if you send "git upload-pack 'path.git'" I think its going to reject.
What's really bad about your patch is you cannot work around it as a user by setting --upload-pack on the command line, or in the config, because down at the very deepest level you are switching the "git-" to "git " and ignoring what the user has supplied you.
Sorry, but I think this change needs to go higher up, to the default values that --upload-pack and remote.$name.uploadpack override, so the user can at least work around it when we break her ability to use github, gitosis, or anything like it.
-- Shawn.