<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/daemon.c, branch v2.3.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.7</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-03-14T05:56:01Z</updated>
<entry>
<title>Merge branch 'rs/daemon-interpolate' into maint</title>
<updated>2015-03-14T05:56:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-14T05:56:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1469d9906833a8bd7d07a70ba8250c823716f20a'/>
<id>urn:sha1:1469d9906833a8bd7d07a70ba8250c823716f20a</id>
<content type='text'>
"git daemon" looked up the hostname even when "%CH" and "%IP"
interpolations are not requested, which was unnecessary.

* rs/daemon-interpolate:
  daemon: use callback to build interpolated path
  daemon: look up client-supplied hostname lazily
</content>
</entry>
<entry>
<title>Merge branch 'jk/daemon-interpolate' into maint</title>
<updated>2015-03-14T05:55:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-14T05:55:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c722ba4814f34d02faed305e4cc6498c783543a9'/>
<id>urn:sha1:c722ba4814f34d02faed305e4cc6498c783543a9</id>
<content type='text'>
The "interpolated-path" option of "git daemon" inserted any string
client declared on the "host=" capability request without checking.
Sanitize and limit %H and %CH to a saner and a valid DNS name.

* jk/daemon-interpolate:
  daemon: sanitize incoming virtual hostname
  t5570: test git-daemon's --interpolated-path option
  git_connect: let user override virtual-host we send to daemon
</content>
</entry>
<entry>
<title>daemon: use callback to build interpolated path</title>
<updated>2015-02-17T21:40:49Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2015-02-15T18:33:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dc8edc8f7d503b96dc4ceb275f7f6ca7637be5a9'/>
<id>urn:sha1:dc8edc8f7d503b96dc4ceb275f7f6ca7637be5a9</id>
<content type='text'>
Provide a callback function for strbuf_expand() instead of using the
helper strbuf_expand_dict_cb().  While the resulting code is longer, it
only looks up the canonical hostname and IP address if at least one of
the placeholders %CH and %IP are used with --interpolated-path.

Use a struct for passing the directory to the callback function instead
of passing it directly to avoid having to cast away its const qualifier.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>daemon: look up client-supplied hostname lazily</title>
<updated>2015-02-17T21:40:36Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2015-02-15T18:31:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=edef953e482ce212b7d68bbe0f59e34b5552db3e'/>
<id>urn:sha1:edef953e482ce212b7d68bbe0f59e34b5552db3e</id>
<content type='text'>
Look up canonical hostname and IP address using getaddrinfo(3) or
gethostbyname(3) only if --interpolated-path or --access-hook were
specified.

Do that by introducing getter functions for canon_hostname and
ip_address and using them for all read accesses.  These wrappers call
the new helper lookup_hostname(), which sets the variables only at its
first call.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>daemon: sanitize incoming virtual hostname</title>
<updated>2015-02-17T21:15:30Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-02-17T19:09:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b48537305229d1a4f25633f71941ee52d2582017'/>
<id>urn:sha1:b48537305229d1a4f25633f71941ee52d2582017</id>
<content type='text'>
We use the daemon_avoid_alias function to make sure that the
pathname the user gives us is sane. However, after applying
that check, we might then interpolate the path using a
string given by the server admin, but which may contain more
untrusted data from the client. We should be sure to
sanitize this data, as well.

We cannot use daemon_avoid_alias here, as it is more strict
than we need in requiring a leading '/'. At the same time,
we can be much more strict here. We are interpreting a
hostname, which should not contain slashes or excessive runs
of dots, as those things are not allowed in DNS names.

Note that in addition to cleansing the hostname field, we
must check the "canonical hostname" (%CH) as well as the
port (%P), which we take as a raw string.  For the canonical
hostname, this comes from an actual DNS lookup on the
accessed IP, which makes it a much less likely vector for
problems. But it does not hurt to sanitize it in the same
way. Unfortunately we cannot test this case easily, as it
would involve a custom hostname lookup.

We do not need to check %IP, as it comes straight from
inet_ntop, so must have a sane form.

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 'rs/daemon-fixes' into maint</title>
<updated>2014-10-29T17:35:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-29T17:35:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a8f01f87d03bef31d3b7f43c4c46398ec76a8e91'/>
<id>urn:sha1:a8f01f87d03bef31d3b7f43c4c46398ec76a8e91</id>
<content type='text'>
* rs/daemon-fixes:
  daemon: remove write-only variable maxfd
  daemon: fix error message after bind()
  daemon: handle gethostbyname() error
</content>
</entry>
<entry>
<title>Merge branch 'rs/daemon-fixes'</title>
<updated>2014-10-14T17:49:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-14T17:49:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dc11fc2de8d92b9e7935ad070941e86f4e33000b'/>
<id>urn:sha1:dc11fc2de8d92b9e7935ad070941e86f4e33000b</id>
<content type='text'>
"git daemon" (with NO_IPV6 build configuration) used to incorrectly
use the hostname even when gethostbyname() reported that the given
hostname is not found.

* rs/daemon-fixes:
  daemon: remove write-only variable maxfd
  daemon: fix error message after bind()
  daemon: handle gethostbyname() error
</content>
</entry>
<entry>
<title>daemon: remove write-only variable maxfd</title>
<updated>2014-10-01T20:34:56Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-10-01T10:21:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=107efbeb2409ac3fb01560a42067c8cc506aa249'/>
<id>urn:sha1:107efbeb2409ac3fb01560a42067c8cc506aa249</id>
<content type='text'>
It became unused when 6573faff (NO_IPV6 support for git daemon) replaced
select() with poll().

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>daemon: fix error message after bind()</title>
<updated>2014-10-01T20:34:54Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-10-01T10:18:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9d1b9aa9e10da398f430bc619b361d83bee6df7d'/>
<id>urn:sha1:9d1b9aa9e10da398f430bc619b361d83bee6df7d</id>
<content type='text'>
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>daemon: handle gethostbyname() error</title>
<updated>2014-10-01T20:34:53Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-10-01T10:16:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eb6c403500dd0b0d78b7b00d7ed0bf6b5daccc4e'/>
<id>urn:sha1:eb6c403500dd0b0d78b7b00d7ed0bf6b5daccc4e</id>
<content type='text'>
If the user-supplied hostname can't be found then we should not use it.
We already avoid doing that in the non-NO_IPV6 case by checking if the
return value of getaddrinfo() is zero (success).  Do the same in the
NO_IPV6 case and make sure the return value of gethostbyname() isn't
NULL before dereferencing this pointer.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
