<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/daemon.c, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-10-17T01:51:29Z</updated>
<entry>
<title>daemon: recognize hidden request arguments</title>
<updated>2017-10-17T01:51:29Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-10-16T17:55:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dfe422d04db56e7306a78fcf5b8e93b6b7f60e34'/>
<id>urn:sha1:dfe422d04db56e7306a78fcf5b8e93b6b7f60e34</id>
<content type='text'>
A normal request to git-daemon is structured as
"command path/to/repo\0host=..\0" and due to a bug introduced in
49ba83fb6 (Add virtualization support to git-daemon, 2006-09-19) we
aren't able to place any extra arguments (separated by NULs) besides the
host otherwise the parsing of those arguments would enter an infinite
loop.  This bug was fixed in 73bb33a94 (daemon: Strictly parse the
"extra arg" part of the command, 2009-06-04) but a check was put in
place to disallow extra arguments so that new clients wouldn't trigger
this bug in older servers.

In order to get around this limitation teach git-daemon to recognize
additional request arguments hidden behind a second NUL byte.  Requests
can then be structured like:
"command path/to/repo\0host=..\0\0version=1\0key=value\0".  git-daemon
can then parse out the extra arguments and set 'GIT_PROTOCOL'
accordingly.

By placing these extra arguments behind a second NUL byte we can skirt
around both the infinite loop bug in 49ba83fb6 (Add virtualization
support to git-daemon, 2006-09-19) as well as the explicit disallowing
of extra arguments introduced in 73bb33a94 (daemon: Strictly parse the
"extra arg" part of the command, 2009-06-04) because both of these
versions of git-daemon check for a single NUL byte after the host
argument before terminating the argument parsing.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>config: don't include config.h by default</title>
<updated>2017-06-15T19:56:22Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-06-14T18:07:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2141fc1d20e659810245ec6ca1c143c60e033ec'/>
<id>urn:sha1:b2141fc1d20e659810245ec6ca1c143c60e033ec</id>
<content type='text'>
Stop including config.h by default in cache.h.  Instead only include
config.h in those files which require use of the config system.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dt/xgethostname-nul-termination'</title>
<updated>2017-04-24T05:07:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-24T05:07:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5938454cbc585e0f4bdd9f1cc87c6886a3c1bff3'/>
<id>urn:sha1:5938454cbc585e0f4bdd9f1cc87c6886a3c1bff3</id>
<content type='text'>
gethostname(2) may not NUL terminate the buffer if hostname does
not fit; unfortunately there is no easy way to see if our buffer
was too small, but at least this will make sure we will not end up
using garbage past the end of the buffer.

* dt/xgethostname-nul-termination:
  xgethostname: handle long hostnames
  use HOST_NAME_MAX to size buffers for gethostname(2)
</content>
</entry>
<entry>
<title>use HOST_NAME_MAX to size buffers for gethostname(2)</title>
<updated>2017-04-19T02:57:41Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-04-18T21:57:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=da25bdb7766c01665500cf7c7b75e76ea1f28b49'/>
<id>urn:sha1:da25bdb7766c01665500cf7c7b75e76ea1f28b49</id>
<content type='text'>
POSIX limits the length of host names to HOST_NAME_MAX.  Export the
fallback definition from daemon.c and use this constant to make all
buffers used with gethostname(2) big enough for any possible result
and a terminating NUL.

Inspired-by: David Turner &lt;dturner@twosigma.com&gt;
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: David Turner &lt;dturner@twosigma.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>daemon: use an argv_array to exec children</title>
<updated>2017-03-30T21:59:50Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-03-28T19:48:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6a97da396470cb85e289a4810326fd7f50062b96'/>
<id>urn:sha1:6a97da396470cb85e289a4810326fd7f50062b96</id>
<content type='text'>
Our struct child_process already has its own argv_array.
Let's use that to avoid having to format options into
separate buffers.

Note that we'll need to declare the child process outside of
the run_service_command() helper to do this. But that opens
up a further simplification, which is that the helper can
append to our argument list, saving each caller from
specifying "." manually.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/daemon-path-ok-check-truncation' into maint</title>
<updated>2016-11-29T21:27:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-11-29T21:27:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aa22ef8a80997771d8a1f3e329139637e1ee63ec'/>
<id>urn:sha1:aa22ef8a80997771d8a1f3e329139637e1ee63ec</id>
<content type='text'>
"git daemon" used fixed-length buffers to turn URL to the
repository the client asked for into the server side directory
path, using snprintf() to avoid overflowing these buffers, but
allowed possibly truncated paths to the directory.  This has been
tightened to reject such a request that causes overlong path to be
required to serve.

* jk/daemon-path-ok-check-truncation:
  daemon: detect and reject too-long paths
</content>
</entry>
<entry>
<title>Merge branch 'ls/filter-process'</title>
<updated>2016-10-31T20:15:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-31T20:15:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dbaa6bdce22914843e956e36d41d328547514342'/>
<id>urn:sha1:dbaa6bdce22914843e956e36d41d328547514342</id>
<content type='text'>
The smudge/clean filter API expect an external process is spawned
to filter the contents for each path that has a filter defined.  A
new type of "process" filter API has been added to allow the first
request to run the filter for a path to spawn a single process, and
all filtering need is served by this single process for multiple
paths, reducing the process creation overhead.

* ls/filter-process:
  contrib/long-running-filter: add long running filter example
  convert: add filter.&lt;driver&gt;.process option
  convert: prepare filter.&lt;driver&gt;.process option
  convert: make apply_filter() adhere to standard Git error handling
  pkt-line: add functions to read/write flush terminated packet streams
  pkt-line: add packet_write_gently()
  pkt-line: add packet_flush_gently()
  pkt-line: add packet_write_fmt_gently()
  pkt-line: extract set_packet_header()
  pkt-line: rename packet_write() to packet_write_fmt()
  run-command: add clean_on_exit_handler
  run-command: move check_pipe() from write_or_die to run_command
  convert: modernize tests
  convert: quote filter names in error messages
</content>
</entry>
<entry>
<title>Merge branch 'jk/daemon-path-ok-check-truncation'</title>
<updated>2016-10-27T21:58:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-27T21:58:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ee87d47b364cdaf78badefb3f7044b8074ed1550'/>
<id>urn:sha1:ee87d47b364cdaf78badefb3f7044b8074ed1550</id>
<content type='text'>
"git daemon" used fixed-length buffers to turn URL to the
repository the client asked for into the server side directory
path, using snprintf() to avoid overflowing these buffers, but
allowed possibly truncated paths to the directory.  This has been
tightened to reject such a request that causes overlong path to be
required to serve.

* jk/daemon-path-ok-check-truncation:
  daemon: detect and reject too-long paths
</content>
</entry>
<entry>
<title>daemon: detect and reject too-long paths</title>
<updated>2016-10-24T16:59:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-22T04:59:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6bdb0083be3b42aab5dfa6bf18b447623704f7f5'/>
<id>urn:sha1:6bdb0083be3b42aab5dfa6bf18b447623704f7f5</id>
<content type='text'>
When we are checking the path via path_ok(), we use some
fixed PATH_MAX buffers. We write into them via snprintf(),
so there's no possibility of overflow, but it does mean we
may silently truncate the path, leading to potentially
confusing errors when the partial path does not exist.

We're better off to reject the path explicitly.

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>pkt-line: rename packet_write() to packet_write_fmt()</title>
<updated>2016-10-17T18:36:50Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2016-10-16T23:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=81c634e94f2fef0cec295f7554080c82bd6aeeb7'/>
<id>urn:sha1:81c634e94f2fef0cec295f7554080c82bd6aeeb7</id>
<content type='text'>
packet_write() should be called packet_write_fmt() because it is a
printf-like function that takes a format string as first parameter.

packet_write_fmt() should be used for text strings only. Arbitrary
binary data should use a new packet_write() function that is introduced
in a subsequent patch.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
