<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/credential.c, branch v2.37.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.37.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.37.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-03-04T21:24:18Z</updated>
<entry>
<title>urlmatch.c: add and use a *_release() function</title>
<updated>2022-03-04T21:24:18Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-03-04T18:32:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a41e8e74674d53a46616b01f2c18e43c7f2f30a8'/>
<id>urn:sha1:a41e8e74674d53a46616b01f2c18e43c7f2f30a8</id>
<content type='text'>
Plug a memory leak in credential_apply_config() by adding and using a
new urlmatch_config_release() function. This just does a
string_list_clear() on the "vars" member.

This finished up work on normalizing the init/free pattern in this
API, started in 73ee449bbf2 (urlmatch.[ch]: add and use
URLMATCH_CONFIG_INIT, 2021-10-01).

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>urlmatch.[ch]: add and use URLMATCH_CONFIG_INIT</title>
<updated>2021-10-01T21:22:51Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-10-01T10:27:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=73ee449bbf2918e29d26361e57f35a24f224e3be'/>
<id>urn:sha1:73ee449bbf2918e29d26361e57f35a24f224e3be</id>
<content type='text'>
Change the initialization pattern of "struct urlmatch_config" to use
an *_INIT macro and designated initializers. Right now there's no
other "struct" member of "struct urlmatch_config" which would require
its own *_INIT, but it's good practice not to assume that. Let's also
change this to a designated initializer while we're at it.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>credential: fix leak in credential_apply_config()</title>
<updated>2021-08-25T18:41:30Z</updated>
<author>
<name>Mike Hommey</name>
<email>mh@glandium.org</email>
</author>
<published>2021-08-20T08:44:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5146c2f148e903db2d906dae372803d9c8c3bbcf'/>
<id>urn:sha1:5146c2f148e903db2d906dae372803d9c8c3bbcf</id>
<content type='text'>
Signed-off-by: Mike Hommey &lt;mh@glandium.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>*.c *_init(): define in terms of corresponding *_INIT macro</title>
<updated>2021-07-01T19:32:22Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-07-01T10:51:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5726a6b4012cd41701927a6637b9f2070e7760ee'/>
<id>urn:sha1:5726a6b4012cd41701927a6637b9f2070e7760ee</id>
<content type='text'>
Change the common patter in the codebase of duplicating the
initialization logic between an *_INIT macro and a
corresponding *_init() function to use the macro as the canonical
source of truth.

Now we no longer need to keep the function up-to-date with the macro
version. This implements a suggestion by Jeff King who found that
under -O2 [1] modern compilers will init new version in place without
the extra copy[1]. The performance of a single *_init() won't matter
in most cases, but even if it does we're going to be producing
efficient machine code to perform these operations.

1. https://lore.kernel.org/git/YNyrDxUO1PlGJvCn@coredump.intra.peff.net/

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>credential: treat CR/LF as line endings in the credential protocol</title>
<updated>2020-10-03T17:41:03Z</updated>
<author>
<name>Nikita Leonov</name>
<email>nykyta.leonov@gmail.com</email>
</author>
<published>2020-10-03T13:29:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=356c473295097f4aeaacc1a2dcd70271b7080788'/>
<id>urn:sha1:356c473295097f4aeaacc1a2dcd70271b7080788</id>
<content type='text'>
This fix makes using Git credentials more friendly to Windows users: it
allows a credential helper to communicate using CR/LF line endings ("DOS
line endings" commonly found on Windows) instead of LF-only line endings
("Unix line endings").

Note that this changes the behavior a bit: if a credential helper
produces, say, a password with a trailing Carriage Return character,
that will now be culled even when the rest of the lines end only in Line
Feed characters, indicating that the Carriage Return was not meant to be
part of the line ending.

In practice, it seems _very_ unlikely that something like this happens.
Passwords usually need to consist of non-control characters, URLs need
to have special characters URL-encoded, and user names, well, are names.

However, it _does_ help on Windows, where CR/LF line endings are common:
as unrecognized commands are simply ignored by the credential machinery,
even a command like `quit\r` (which is clearly intended to abort) would
simply be ignored (silently) by Git.

So let's change the credential machinery to accept both CR/LF and LF
line endings.

While we do this for the credential helper protocol, we do _not_ adjust
`git credential-cache--daemon` (which won't work on Windows, anyway,
because it requires Unix sockets) nor `git credential-store` (which
writes the file `~/.git-credentials` which we consider an implementation
detail that should be opaque to the user, read: we do expect users _not_
to edit this file manually).

Signed-off-by: Nikita Leonov &lt;nykyta.leonov@gmail.com&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run_command: teach API users to use embedded 'args' more</title>
<updated>2020-08-26T22:32:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-08-26T22:25:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afbdba391eaf3c473eff8f12437ff510935b520f'/>
<id>urn:sha1:afbdba391eaf3c473eff8f12437ff510935b520f</id>
<content type='text'>
The child_process structure has an embedded strvec for formulating
the command line argument list these days, but code that predates
the wide use of it prepared a separate char *argv[] array and
manually set the child_process.argv pointer point at it.

Teach these old-style code to lose the separate argv[] array.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/partial-urlmatch'</title>
<updated>2020-05-05T21:54:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-05-05T21:54:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=568324f31ba6cec13532e420117d312db65ddd80'/>
<id>urn:sha1:568324f31ba6cec13532e420117d312db65ddd80</id>
<content type='text'>
The same as js/partial-urlmatch-2.17, built on more recent codebase
to avoid unnecessary merge conflicts.

* js/partial-urlmatch:
  credential: handle `credential.&lt;partial-URL&gt;.&lt;key&gt;` again
  credential: optionally allow partial URLs in credential_from_url_gently()
</content>
</entry>
<entry>
<title>Merge branch 'js/partial-urlmatch-2.17'</title>
<updated>2020-05-05T21:54:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-05-05T21:54:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=da05cacd8a4e7c3d6d8c84aa2c1d45684717ac95'/>
<id>urn:sha1:da05cacd8a4e7c3d6d8c84aa2c1d45684717ac95</id>
<content type='text'>
Recent updates broke parsing of "credential.&lt;url&gt;.&lt;key&gt;" where
&lt;url&gt; is not a full URL (e.g. [credential "https://"] helper = ...)
stopped working, which has been corrected.

* js/partial-urlmatch-2.17:
  credential: handle `credential.&lt;partial-URL&gt;.&lt;key&gt;` again
  credential: optionally allow partial URLs in credential_from_url_gently()
  credential: fix grammar
</content>
</entry>
<entry>
<title>Merge branch 'bc/wildcard-credential'</title>
<updated>2020-05-05T21:54:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-05-05T21:54:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd65fc3960a972ab2f03b94d08f0e421d9ee22bb'/>
<id>urn:sha1:fd65fc3960a972ab2f03b94d08f0e421d9ee22bb</id>
<content type='text'>
Update the parser used for credential.&lt;URL&gt;.&lt;variable&gt;
configuration, to handle &lt;URL&gt;s with '/' in them correctly.

* bc/wildcard-credential:
  credential: fix matching URLs with multiple levels in path
</content>
</entry>
<entry>
<title>credential: handle `credential.&lt;partial-URL&gt;.&lt;key&gt;` again</title>
<updated>2020-04-29T15:37:36Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-04-24T11:49:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a121b0d226dd0017318be0d18120aeb766f1235'/>
<id>urn:sha1:9a121b0d226dd0017318be0d18120aeb766f1235</id>
<content type='text'>
In the patches for CVE-2020-11008, the ability to specify credential
settings in the config for partial URLs got lost. For example, it used
to be possible to specify a credential helper for a specific protocol:

	[credential "https://"]
		helper = my-https-helper

Likewise, it used to be possible to configure settings for a specific
host, e.g.:

	[credential "dev.azure.com"]
		useHTTPPath = true

Let's reinstate this behavior.

While at it, increase the test coverage to document and verify the
behavior with a couple other categories of partial URLs.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Reviewed-by: Carlo Marcelo Arenas Belón &lt;carenas@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
