<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/connect.c, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-10-16T21:32:55Z</updated>
<entry>
<title>Merge branch 'tk/typofix-connect-unknown-proto-error' into maint</title>
<updated>2015-10-16T21:32:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-16T21:32:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ab74762cdb32d17fcb811e8721b706ed5c0570b'/>
<id>urn:sha1:9ab74762cdb32d17fcb811e8721b706ed5c0570b</id>
<content type='text'>
* tk/typofix-connect-unknown-proto-error:
  connect: fix typo in result string of prot_name()
</content>
</entry>
<entry>
<title>Merge branch 'jk/connect-clear-env' into maint</title>
<updated>2015-10-16T21:32:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-16T21:32:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a3bbfe5d006f0f4deb59f92b3079ccf67764ea34'/>
<id>urn:sha1:a3bbfe5d006f0f4deb59f92b3079ccf67764ea34</id>
<content type='text'>
The ssh transport, just like any other transport over the network,
did not clear GIT_* environment variables, but it is possible to
use SendEnv and AcceptEnv to leak them to the remote invocation of
Git, which is not a good idea at all.  Explicitly clear them just
like we do for the local transport.

* jk/connect-clear-env:
  git_connect: clarify conn-&gt;use_shell flag
  git_connect: clear GIT_* environment for ssh
</content>
</entry>
<entry>
<title>Sync with 2.3.10</title>
<updated>2015-09-28T22:28:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-28T22:28:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6343e2f6f271cf344ea8e7384342502faecaf37c'/>
<id>urn:sha1:6343e2f6f271cf344ea8e7384342502faecaf37c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>connect: fix typo in result string of prot_name()</title>
<updated>2015-09-25T17:01:07Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2015-09-24T12:44:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=83e6bda3fa564fe6b1946712a17efce1d10ed2c0'/>
<id>urn:sha1:83e6bda3fa564fe6b1946712a17efce1d10ed2c0</id>
<content type='text'>
Replace 'unkown' with 'unknown'.

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>transport: add a protocol-whitelist environment variable</title>
<updated>2015-09-23T18:35:48Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-16T17:12:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a5adaced2e13c135d5d9cc65be9eb95aa3bacedf'/>
<id>urn:sha1:a5adaced2e13c135d5d9cc65be9eb95aa3bacedf</id>
<content type='text'>
If we are cloning an untrusted remote repository into a
sandbox, we may also want to fetch remote submodules in
order to get the complete view as intended by the other
side. However, that opens us up to attacks where a malicious
user gets us to clone something they would not otherwise
have access to (this is not necessarily a problem by itself,
but we may then act on the cloned contents in a way that
exposes them to the attacker).

Ideally such a setup would sandbox git entirely away from
high-value items, but this is not always practical or easy
to set up (e.g., OS network controls may block multiple
protocols, and we would want to enable some but not others).

We can help this case by providing a way to restrict
particular protocols. We use a whitelist in the environment.
This is more annoying to set up than a blacklist, but
defaults to safety if the set of protocols git supports
grows). If no whitelist is specified, we continue to default
to allowing all protocols (this is an "unsafe" default, but
since the minority of users will want this sandboxing
effect, it is the only sensible one).

A note on the tests: ideally these would all be in a single
test file, but the git-daemon and httpd test infrastructure
is an all-or-nothing proposition rather than a test-by-test
prerequisite. By putting them all together, we would be
unable to test the file-local code on machines without
apache.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git_connect: clarify conn-&gt;use_shell flag</title>
<updated>2015-09-08T22:33:21Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-08T08:33:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a48b409f9ccd4e1957286ba064fd3a25a9ea2b56'/>
<id>urn:sha1:a48b409f9ccd4e1957286ba064fd3a25a9ea2b56</id>
<content type='text'>
When executing user-specified programs, we generally always
want to use a shell, for flexibility and consistency. One
big exception is executing $GIT_SSH, which for historical
reasons must not use a shell.

Once upon a time the logic in git_connect looked like:

  if (protocol == PROTO_SSH) {
	  ... setup ssh ...
  } else {
	  ... setup local connection ...
	  conn-&gt;use_shell = 1;
  }

But over time the PROTO_SSH block has grown, and the "local"
block has shrunk so that it contains only conn-&gt;use_shell;
it's easy to miss at the end of the large block.  Moreover,
PROTO_SSH now also sometimes sets use_shell, when the new
GIT_SSH_COMMAND is used.

Let's just set conn-&gt;use_shell when we're setting up the "conn"
struct, and unset it (with a comment) in the historical GIT_SSH
case.  This will make the flow easier to follow.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git_connect: clear GIT_* environment for ssh</title>
<updated>2015-09-04T22:50:33Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-04T22:40:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aab40438511dd2e4505c0850478e79773aa6721c'/>
<id>urn:sha1:aab40438511dd2e4505c0850478e79773aa6721c</id>
<content type='text'>
When we "switch" to another local repository to run the server
side of a fetch or push, we must clear the variables in
local_repo_env so that our local $GIT_DIR, etc, do not
pollute the upload-pack or receive-pack that is executing in
the "remote" repository.

We have never done so for ssh connections. For the most
part, nobody has noticed because ssh will not pass unknown
environment variables by default. However, it is not out of
the question for a user to configure ssh to pass along GIT_*
variables using SendEnv/AcceptEnv.

We can demonstrate the problem by using "git -c" on a local
command and seeing its impact on a remote repository.  This
config ends up in $GIT_CONFIG_PARAMETERS. In the local case,
the config has no impact, but in the ssh transport, it does
(our test script has a fake ssh that passes through all
environment variables; this isn't normal, but does simulate
one possible setup).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bc/connect-plink' into maint</title>
<updated>2015-06-05T19:00:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-05T19:00:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d8bb4685c4d1e7187f93436fc26ad468a0cf941'/>
<id>urn:sha1:2d8bb4685c4d1e7187f93436fc26ad468a0cf941</id>
<content type='text'>
The connection initiation code for "ssh" transport tried to absorb
differences between the stock "ssh" and Putty-supplied "plink" and
its derivatives, but the logic to tell that we are using "plink"
variants were too loose and falsely triggered when "plink" appeared
anywhere in the path (e.g. "/home/me/bin/uplink/ssh").

* bc/connect-plink:
  connect: improve check for plink to reduce false positives
  t5601: fix quotation error leading to skipped tests
  connect: simplify SSH connection code path
</content>
</entry>
<entry>
<title>Merge branch 'bc/connect-plink'</title>
<updated>2015-05-19T20:17:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-05-19T20:17:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a4f891329527826e6f1c80be2b77cfbfee06190'/>
<id>urn:sha1:7a4f891329527826e6f1c80be2b77cfbfee06190</id>
<content type='text'>
The connection initiation code for "ssh" transport tried to absorb
differences between the stock "ssh" and Putty-supplied "plink" and
its derivatives, but the logic to tell that we are using "plink"
variants were too loose and falsely triggered when "plink" appeared
anywhere in the path (e.g. "/home/me/bin/uplink/ssh").

* bc/connect-plink:
  connect: improve check for plink to reduce false positives
  t5601: fix quotation error leading to skipped tests
  connect: simplify SSH connection code path
</content>
</entry>
<entry>
<title>connect: improve check for plink to reduce false positives</title>
<updated>2015-04-28T22:23:12Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2015-04-26T20:30:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=baaf233755f71c057d28b9e8692e24d4fca7d22f'/>
<id>urn:sha1:baaf233755f71c057d28b9e8692e24d4fca7d22f</id>
<content type='text'>
The git_connect function has code to handle plink and tortoiseplink
specially, as they require different command line arguments from
OpenSSH (-P instead of -p for ports; tortoiseplink additionally requires
-batch).  However, the match was done by checking for "plink" anywhere
in the string, which led to a GIT_SSH value containing "uplink" being
treated as an invocation of putty's plink.

Improve the check by looking for "plink" or "tortoiseplink" (or those
names suffixed with ".exe") only in the final component of the path.
This has the downside that a program such as "plink-0.63" would no
longer be recognized, but the increased robustness is likely worth it.
Add tests to cover these cases to avoid regressions.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Acked-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
