<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-compat-util.h, branch v2.36.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.36.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.36.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-06-23T10:36:12Z</updated>
<entry>
<title>Sync with 2.35.4</title>
<updated>2022-06-23T10:36:12Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-23T10:36:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8f8eea8c3aba154ce1f9eaab4fa06c73b60550dc'/>
<id>urn:sha1:8f8eea8c3aba154ce1f9eaab4fa06c73b60550dc</id>
<content type='text'>
* maint-2.35:
  Git 2.35.4
  Git 2.34.4
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
</content>
</entry>
<entry>
<title>Sync with 2.34.4</title>
<updated>2022-06-23T10:36:03Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-23T10:36:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aef3d5948c5b00a0409e117da7e720f574040505'/>
<id>urn:sha1:aef3d5948c5b00a0409e117da7e720f574040505</id>
<content type='text'>
* maint-2.34:
  Git 2.34.4
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
</content>
</entry>
<entry>
<title>Sync with 2.33.4</title>
<updated>2022-06-23T10:35:47Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-23T10:35:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=378eaded1aec073a815b8687e67a2e2eadd3228c'/>
<id>urn:sha1:378eaded1aec073a815b8687e67a2e2eadd3228c</id>
<content type='text'>
* maint-2.33:
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
</content>
</entry>
<entry>
<title>Sync with 2.32.3</title>
<updated>2022-06-23T10:35:38Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-23T10:35:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eebfde3f213e2990727a64da0d7d04ad961a28b0'/>
<id>urn:sha1:eebfde3f213e2990727a64da0d7d04ad961a28b0</id>
<content type='text'>
* maint-2.32:
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
</content>
</entry>
<entry>
<title>Sync with 2.31.4</title>
<updated>2022-06-23T10:35:30Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-23T10:35:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc0c773028685cdbae35c6c71f3fd3b87ab70985'/>
<id>urn:sha1:fc0c773028685cdbae35c6c71f3fd3b87ab70985</id>
<content type='text'>
* maint-2.31:
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
</content>
</entry>
<entry>
<title>Sync with 2.30.5</title>
<updated>2022-06-23T10:35:23Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-06-23T10:35:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2f8809f9a1838eb607f14097dcd63071f2eb00fe'/>
<id>urn:sha1:2f8809f9a1838eb607f14097dcd63071f2eb00fe</id>
<content type='text'>
* maint-2.30:
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo
</content>
</entry>
<entry>
<title>git-compat-util: allow root to access both SUDO_UID and root owned</title>
<updated>2022-06-17T21:03:08Z</updated>
<author>
<name>Carlo Marcelo Arenas Belón</name>
<email>carenas@gmail.com</email>
</author>
<published>2022-06-17T20:23:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6b11e3d52e919cce91011f4f9025e6f4b61375f2'/>
<id>urn:sha1:6b11e3d52e919cce91011f4f9025e6f4b61375f2</id>
<content type='text'>
Previous changes introduced a regression which will prevent root for
accessing repositories owned by thyself if using sudo because SUDO_UID
takes precedence.

Loosen that restriction by allowing root to access repositories owned
by both uid by default and without having to add a safe.directory
exception.

A previous workaround that was documented in the tests is no longer
needed so it has been removed together with its specially crafted
prerequisite.

Helped-by: Johanness Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Carlo Marcelo Arenas Belón &lt;carenas@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-compat-util: avoid failing dir ownership checks if running privileged</title>
<updated>2022-05-13T01:12:23Z</updated>
<author>
<name>Carlo Marcelo Arenas Belón</name>
<email>carenas@gmail.com</email>
</author>
<published>2022-05-13T01:00:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ae9abbb63eea74441e3e8b153dc6ec1f94c373b4'/>
<id>urn:sha1:ae9abbb63eea74441e3e8b153dc6ec1f94c373b4</id>
<content type='text'>
bdc77d1d685 (Add a function to determine whether a path is owned by the
current user, 2022-03-02) checks for the effective uid of the running
process using geteuid() but didn't account for cases where that user was
root (because git was invoked through sudo or a compatible tool) and the
original uid that repository trusted for its config was no longer known,
therefore failing the following otherwise safe call:

  guy@renard ~/Software/uncrustify $ sudo git describe --always --dirty
  [sudo] password for guy:
  fatal: unsafe repository ('/home/guy/Software/uncrustify' is owned by someone else)

Attempt to detect those cases by using the environment variables that
those tools create to keep track of the original user id, and do the
ownership check using that instead.

This assumes the environment the user is running on after going
privileged can't be tampered with, and also adds code to restrict that
the new behavior only applies if running as root, therefore keeping the
most common case, which runs unprivileged, from changing, but because of
that, it will miss cases where sudo (or an equivalent) was used to change
to another unprivileged user or where the equivalent tool used to raise
privileges didn't track the original id in a sudo compatible way.

Because of compatibility with sudo, the code assumes that uid_t is an
unsigned integer type (which is not required by the standard) but is used
that way in their codebase to generate SUDO_UID.  In systems where uid_t
is signed, sudo might be also patched to NOT be unsigned and that might
be able to trigger an edge case and a bug (as described in the code), but
it is considered unlikely to happen and even if it does, the code would
just mostly fail safely, so there was no attempt either to detect it or
prevent it by the code, which is something that might change in the future,
based on expected user feedback.

Reported-by: Guy Maurel &lt;guy.j@maurel.de&gt;
Helped-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Helped-by: Randall Becker &lt;rsbecker@nexbridge.com&gt;
Helped-by: Phillip Wood &lt;phillip.wood123@gmail.com&gt;
Suggested-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Carlo Marcelo Arenas Belón &lt;carenas@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v2.35.2'</title>
<updated>2022-04-11T23:44:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-11T23:44:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f1b50ec6f85883c483b344442c69cd3d88b38380'/>
<id>urn:sha1:f1b50ec6f85883c483b344442c69cd3d88b38380</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge branch 'bc/csprng-mktemps'</title>
<updated>2022-04-06T22:21:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-06T22:21:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=95acb13a550cbc07a5ef38ffceb5678fac61acff'/>
<id>urn:sha1:95acb13a550cbc07a5ef38ffceb5678fac61acff</id>
<content type='text'>
Build fix.

* bc/csprng-mktemps:
  git-compat-util: really support openssl as a source of entropy
</content>
</entry>
</feed>
