<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git, branch v2.5.6</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=v2.5.6</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=v2.5.6'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2017-05-05T03:50:38Z</updated>
<entry>
<title>Git 2.5.6</title>
<updated>2017-05-05T03:50:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-05-05T03:49:00Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=ac33201285cce4b392c3cedfaf7f098fdb1dde87'/>
<id>urn:sha1:ac33201285cce4b392c3cedfaf7f098fdb1dde87</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'maint-2.4' into maint-2.5</title>
<updated>2017-05-05T03:46:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-05-05T03:46:53Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=531788af951cbaf5356363f66c54594b555bdde3'/>
<id>urn:sha1:531788af951cbaf5356363f66c54594b555bdde3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Git 2.4.12</title>
<updated>2017-05-05T03:43:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-05-05T03:25:09Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=4000b4020911512eea10667dd5c97a0b4890e098'/>
<id>urn:sha1:4000b4020911512eea10667dd5c97a0b4890e098</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/shell-no-repository-that-begins-with-dash' into maint-2.4</title>
<updated>2017-05-05T03:17:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-05-05T03:17:55Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=5a4ffdf5873bc15af39a59eef4766cc4240ed586'/>
<id>urn:sha1:5a4ffdf5873bc15af39a59eef4766cc4240ed586</id>
<content type='text'>
* jk/shell-no-repository-that-begins-with-dash:
  shell: disallow repo names beginning with dash
</content>
</entry>
<entry>
<title>shell: disallow repo names beginning with dash</title>
<updated>2017-05-05T03:07:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-04-29T12:36:44Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=3ec804490a265f4c418a321428c12f3f18b7eff5'/>
<id>urn:sha1:3ec804490a265f4c418a321428c12f3f18b7eff5</id>
<content type='text'>
When a remote server uses git-shell, the client side will
connect to it like:

  ssh server "git-upload-pack 'foo.git'"

and we literally exec ("git-upload-pack", "foo.git"). In
early versions of upload-pack and receive-pack, we took a
repository argument and nothing else. But over time they
learned to accept dashed options. If the user passes a
repository name that starts with a dash, the results are
confusing at best (we complain of a bogus option instead of
a non-existent repository) and malicious at worst (the user
can start an interactive pager via "--help").

We could pass "--" to the sub-process to make sure the
user's argument is interpreted as a branch name. I.e.:

  git-upload-pack -- -foo.git

But adding "--" automatically would make us inconsistent
with a normal shell (i.e., when git-shell is not in use),
where "-foo.git" would still be an error. For that case, the
client would have to specify the "--", but they can't do so
reliably, as existing versions of git-shell do not allow
more than a single argument.

The simplest thing is to simply disallow "-" at the start of
the repo name argument. This hasn't worked either with or
without git-shell since version 1.0.0, and nobody has
complained.

Note that this patch just applies to do_generic_cmd(), which
runs upload-pack, receive-pack, and upload-archive. There
are two other types of commands that git-shell runs:

  - do_cvs_cmd(), but this already restricts the argument to
    be the literal string "server"

  - admin-provided commands in the git-shell-commands
    directory. We'll pass along arbitrary arguments there,
    so these commands could have similar problems. But these
    commands might actually understand dashed arguments, so
    we cannot just block them here. It's up to the writer of
    the commands to make sure they are safe. With great
    power comes great responsibility.

Reported-by: Timo Schmid &lt;tschmid@ernw.de&gt;
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 2.5.5</title>
<updated>2016-03-17T18:24:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-17T17:28:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=e568e563ade00bbb0937162f405fc160f253e224'/>
<id>urn:sha1:e568e563ade00bbb0937162f405fc160f253e224</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'maint-2.4' into maint-2.5</title>
<updated>2016-03-17T18:24:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-17T18:24:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c638f3e4d585008f630d7dd8bb902f44217455b3'/>
<id>urn:sha1:c638f3e4d585008f630d7dd8bb902f44217455b3</id>
<content type='text'>
* maint-2.4:
  Git 2.4.11
  list-objects: pass full pathname to callbacks
  list-objects: drop name_path entirely
  list-objects: convert name_path to a strbuf
  show_object_with_name: simplify by using path_name()
  http-push: stop using name_path
  tree-diff: catch integer overflow in combine_diff_path allocation
  add helpers for detecting size_t overflow
</content>
</entry>
<entry>
<title>Git 2.4.11</title>
<updated>2016-03-17T18:23:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-17T17:00:44Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=765428699a5381f113d19974720bc91b5bfeaf1d'/>
<id>urn:sha1:765428699a5381f113d19974720bc91b5bfeaf1d</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/path-name-safety-2.4' into maint-2.4</title>
<updated>2016-03-17T18:22:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-17T16:55:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=32c6dca8c428672c11a2a0ddf3cb2f7476caff86'/>
<id>urn:sha1:32c6dca8c428672c11a2a0ddf3cb2f7476caff86</id>
<content type='text'>
Bugfix patches were backported from the 'master' front to plug heap
corruption holes, to catch integer overflow in the computation of
pathname lengths, and to get rid of the name_path API.  Both of
these would have resulted in writing over an under-allocated buffer
when formulating pathnames while tree traversal.

* jk/path-name-safety-2.4:
  list-objects: pass full pathname to callbacks
  list-objects: drop name_path entirely
  list-objects: convert name_path to a strbuf
  show_object_with_name: simplify by using path_name()
  http-push: stop using name_path
  tree-diff: catch integer overflow in combine_diff_path allocation
  add helpers for detecting size_t overflow
</content>
</entry>
<entry>
<title>list-objects: pass full pathname to callbacks</title>
<updated>2016-03-16T17:41:04Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-11T22:28:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2824e1841b99393d2469c495253d547c643bd8f1'/>
<id>urn:sha1:2824e1841b99393d2469c495253d547c643bd8f1</id>
<content type='text'>
When we find a blob at "a/b/c", we currently pass this to
our show_object_fn callbacks as two components: "a/b/" and
"c". Callbacks which want the full value then call
path_name(), which concatenates the two. But this is an
inefficient interface; the path is a strbuf, and we could
simply append "c" to it temporarily, then roll back the
length, without creating a new copy.

So we could improve this by teaching the callsites of
path_name() this trick (and there are only 3). But we can
also notice that no callback actually cares about the
broken-down representation, and simply pass each callback
the full path "a/b/c" as a string. The callback code becomes
even simpler, then, as we do not have to worry about freeing
an allocated buffer, nor rolling back our modification to
the strbuf.

This is theoretically less efficient, as some callbacks
would not bother to format the final path component. But in
practice this is not measurable. Since we use the same
strbuf over and over, our work to grow it is amortized, and
we really only pay to memcpy a few bytes.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
