<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib, branch v2.41.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.41.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.41.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-05-15T20:59:06Z</updated>
<entry>
<title>Merge branch 'sg/retire-unused-cocci'</title>
<updated>2023-05-15T20:59:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-15T20:59:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef06676c3646271e505c255372b667568faf88f8'/>
<id>urn:sha1:ef06676c3646271e505c255372b667568faf88f8</id>
<content type='text'>
Retire a rather expensive-to-run Coccinelle check patch.

* sg/retire-unused-cocci:
  cocci: remove 'unused.cocci'
</content>
</entry>
<entry>
<title>Merge branch 'js/subtree-fully-spelt-quiet-and-debug-options'</title>
<updated>2023-05-15T20:59:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-15T20:59:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=db13ea835b056afa13ab96c9f96dce011ecc328a'/>
<id>urn:sha1:db13ea835b056afa13ab96c9f96dce011ecc328a</id>
<content type='text'>
"git subtree" (in contrib/) update.

* js/subtree-fully-spelt-quiet-and-debug-options:
  subtree: support long global flags
</content>
</entry>
<entry>
<title>Merge branch 'mh/credential-password-expiry-wincred'</title>
<updated>2023-05-11T19:16:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-11T19:16:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5bc069e383539824fd3a0d897100d44bbe1f8a24'/>
<id>urn:sha1:5bc069e383539824fd3a0d897100d44bbe1f8a24</id>
<content type='text'>
Teach the recently invented "password expiry time" trait to the
wincred credential helper.

* mh/credential-password-expiry-wincred:
  credential/wincred: store password_expiry_utc
</content>
</entry>
<entry>
<title>Merge branch 'mh/use-wincred-from-system'</title>
<updated>2023-05-11T19:16:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-11T19:16:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb29fb86f3de9e7fd713209bfa490ef8c8ab70ca'/>
<id>urn:sha1:cb29fb86f3de9e7fd713209bfa490ef8c8ab70ca</id>
<content type='text'>
Code clean-up.

* mh/use-wincred-from-system:
  credential/wincred: include wincred.h
</content>
</entry>
<entry>
<title>Merge branch 'tb/credential-long-lines'</title>
<updated>2023-05-10T17:23:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-10T17:23:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fbbf60a9bc4d7139efa70a0246cec2b3f2cc63fb'/>
<id>urn:sha1:fbbf60a9bc4d7139efa70a0246cec2b3f2cc63fb</id>
<content type='text'>
The implementation of credential helpers used fgets() over fixed
size buffers to read protocol messages, causing the remainder of
the folded long line to trigger unexpected behaviour, which has
been corrected.

* tb/credential-long-lines:
  contrib/credential: embiggen fixed-size buffer in wincred
  contrib/credential: avoid fixed-size buffer in libsecret
  contrib/credential: .gitignore libsecret build artifacts
  contrib/credential: remove 'gnome-keyring' credential helper
  contrib/credential: avoid fixed-size buffer in osxkeychain
  t/lib-credential.sh: ensure credential helpers handle long headers
  credential.c: store "wwwauth[]" values in `credential_read()`
</content>
</entry>
<entry>
<title>subtree: support long global flags</title>
<updated>2023-05-08T14:58:27Z</updated>
<author>
<name>Josh Soref</name>
<email>jsoref@gmail.com</email>
</author>
<published>2023-05-07T03:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b4de9239bfbc402738a5755d75a8b90a25c5cfdf'/>
<id>urn:sha1:b4de9239bfbc402738a5755d75a8b90a25c5cfdf</id>
<content type='text'>
The documentation at e75d1da38a claimed support, but it was never present

Signed-off-by: Josh Soref &lt;jsoref@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ek/completion-use-read-r-to-read-literally'</title>
<updated>2023-05-02T17:13:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-02T17:13:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4ca12e10e6fbda68adcb32e78497dc261e94734d'/>
<id>urn:sha1:4ca12e10e6fbda68adcb32e78497dc261e94734d</id>
<content type='text'>
The completion script used to use bare "read" without the "-r"
option to read the contents of various state files, which risked
getting confused with backslashes in them.  This has been
corrected.

* ek/completion-use-read-r-to-read-literally:
  completion: suppress unwanted unescaping of `read`
</content>
</entry>
<entry>
<title>contrib/credential: embiggen fixed-size buffer in wincred</title>
<updated>2023-05-01T16:27:02Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2023-05-01T15:54:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0a3a972c163b2c5ed81a8e2c12fbf0c53eeb210c'/>
<id>urn:sha1:0a3a972c163b2c5ed81a8e2c12fbf0c53eeb210c</id>
<content type='text'>
As in previous commits, harden the wincred credential helper against the
aforementioned protocol injection attack.

Unlike the approached used for osxkeychain and libsecret, where a
fixed-size buffer was replaced with `getline()`, we must take a
different approach here. There is no `getline()` equivalent in Windows,
and the function is not available to us with ordinary compiler settings.

Instead, allocate a larger (still fixed-size) buffer in which to process
each line. The value of 100 KiB is chosen to match the maximum-length
header that curl will allow, CURL_MAX_HTTP_HEADER.

To ensure that we are reading complete lines at a time, and that we
aren't susceptible to a similar injection attack (albeit with more
padding), ensure that each read terminates at a newline (i.e., that no
line is more than 100 KiB long).

Note that it isn't sufficient to turn the old loop into something like:

    while (len &amp;&amp; strchr("\r\n", buf[len - 1])) {
      buf[--len] = 0;
      ends_in_newline = 1;
    }

because if an attacker sends something like:

    [aaaaa.....]\r
    host=example.com\r\n

the credential helper would fill its buffer after reading up through the
first '\r', call fgets() again, and then see "host=example.com\r\n" on
its line.

Note that the original code was written in a way that would trim an
arbitrary number of "\r" and "\n" from the end of the string. We should
get only a single "\n" (since the point of `fgets()` is to return the
buffer to us when it sees one), and likewise would not expect to see
more than one associated "\r". The new code trims a single "\r\n", which
matches the original intent.

[1]: https://curl.se/libcurl/c/CURLOPT_HEADERFUNCTION.html

Tested-by: Matthew John Cheetham &lt;mjcheetham@outlook.com&gt;
Helped-by: Matthew John Cheetham &lt;mjcheetham@outlook.com&gt;
Co-authored-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>contrib/credential: avoid fixed-size buffer in libsecret</title>
<updated>2023-05-01T16:27:02Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2023-05-01T15:54:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64f1e658e935bea6c9afdc4fa8be1d3ad6740355'/>
<id>urn:sha1:64f1e658e935bea6c9afdc4fa8be1d3ad6740355</id>
<content type='text'>
The libsecret credential helper reads the newline-delimited
protocol stream one line at a time by repeatedly calling fgets() into a
fixed-size buffer, and is thus affected by the vulnerability described
in the previous commit.

To mitigate this attack, avoid using a fixed-size buffer, and instead
rely on getline() to allocate a buffer as large as necessary to fit the
entire content of the line, preventing any protocol injection.

In most parts of Git we don't assume that every platform has getline().
But libsecret is primarily used on Linux, where we do already assume it
(using a knob in config.mak.uname). POSIX also added getline() in 2008,
so we'd expect other recent Unix-like operating systems to have it
(e.g., FreeBSD also does).

Note that the buffer was already allocated on the heap in this case, but
we'll swap `g_free()` for `free()`, since it will now be allocated by
the system `getline()`, rather than glib's `g_malloc()`.

Tested-by: Jeff King &lt;peff@peff.net&gt;
Co-authored-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>contrib/credential: .gitignore libsecret build artifacts</title>
<updated>2023-05-01T16:27:02Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2023-05-01T15:54:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de2fb99006575d55f878f9a4d02726cb598c361d'/>
<id>urn:sha1:de2fb99006575d55f878f9a4d02726cb598c361d</id>
<content type='text'>
The libsecret credential helper does not mark its build artifact as
ignored, so running "make" results in a dirty working tree.

Mark the "git-credential-libsecret" binary as ignored to avoid the above.

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