From: Jan Hudec <bulb@ucw.cz>
To: David Miller <davem@davemloft.net>
Cc: gitster@pobox.com, peterz@infradead.org, git@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [ANNOUNCE] GIT 1.6.0-rc2
Date: Mon, 15 Sep 2008 19:12:40 +0200 [thread overview]
Message-ID: <20080915171240.GB4787@efreet.light.src> (raw)
In-Reply-To: <20080913.013330.29519747.davem@davemloft.net>
On Sat, Sep 13, 2008 at 01:33:30 -0700, David Miller wrote:
> As a followup this turned out to be the classic "PATH when doing GIT over
> SSH" problem.
>
> I have to say this is very unfun to debug, and even less fun to "fix"
> even once you know this is the problem. And what's more I know this is
> the second time I've had to spend a night debugging this very problem.
>
> I ended up having to make a ~/.ssh/environment file and then restart my
> SSH server with "PermitUserEnvironment yes" added to sshd_config.
>
> But I can't believe this is what I have to do just to pull from a machine
> where I have GIT only installed in my home directory. What if I were just
> a normal user and couldn't change the SSHD config? What hoops would I
> need to jump through to get my PATH setup correctly? :)
>
> It doesn't even work to put ~/bin into the PATH listed in the system wide
> /etc/environment, because that does not do tilde expansion, SSHD just takes
> it as-is.
>
> Wouldn't it make sense to put the bindir into PATH when we try to do
> execv_git_cmd()? The code has already put the gitexecdir into the
> PATH at this point.
I don't think it gets to execv_git_cmd(). Git on local side will run
ssh <host> git upload-pack
and it's ssh that can't find git in ~/bin (or maybe it's still using the
dashed form for backward compatibility; the argument stands either way).
There are two possible solutions (besides the .ssh/environment one):
1. Without hacking git: Use a separate key pair for git access and configure
that key on the server with 'command="/home/you/bin/git-shell"' option in
.ssh/authorized_keys. Git shell should run the command from exec-dir
properly.
2. Hack git to support some variable to set the remote command for ssh
protocol.
--
Jan 'Bulb' Hudec <bulb@ucw.cz>
next prev parent reply other threads:[~2008-09-15 18:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-07 0:31 [ANNOUNCE] GIT 1.6.0-rc2 Junio C Hamano
2008-08-07 8:58 ` Peter Zijlstra
2008-08-07 10:00 ` Junio C Hamano
2008-08-07 10:18 ` Peter Zijlstra
2008-08-07 12:26 ` David Miller
2008-09-13 8:33 ` David Miller
2008-09-15 17:12 ` Jan Hudec [this message]
2008-09-15 18:25 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080915171240.GB4787@efreet.light.src \
--to=bulb@ucw.cz \
--cc=davem@davemloft.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.