<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/setup.c, branch v2.32.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.32.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.32.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-04-13T22:21:26Z</updated>
<entry>
<title>Git 2.32.2</title>
<updated>2022-04-13T22:21:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-13T22:21:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=15304344342b7c888f732d28f908890d874bcb0c'/>
<id>urn:sha1:15304344342b7c888f732d28f908890d874bcb0c</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: opt-out of check with safe.directory=*</title>
<updated>2022-04-13T19:42:51Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2022-04-13T15:32:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f85c4a30b072a26d74af8bbf63cc8f6a5dfc1b8'/>
<id>urn:sha1:0f85c4a30b072a26d74af8bbf63cc8f6a5dfc1b8</id>
<content type='text'>
With the addition of the safe.directory in 8959555ce
(setup_git_directory(): add an owner check for the top-level directory,
2022-03-02) released in v2.35.2, we are receiving feedback from a
variety of users about the feature.

Some users have a very large list of shared repositories and find it
cumbersome to add this config for every one of them.

In a more difficult case, certain workflows involve running Git commands
within containers. The container boundary prevents any global or system
config from communicating `safe.directory` values from the host into the
container. Further, the container almost always runs as a different user
than the owner of the directory in the host.

To simplify the reactions necessary for these users, extend the
definition of the safe.directory config value to include a possible '*'
value. This value implies that all directories are safe, providing a
single setting to opt-out of this protection.

Note that an empty assignment of safe.directory clears all previous
values, and this is already the case with the "if (!value || !*value)"
condition.

Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: fix safe.directory key not being checked</title>
<updated>2022-04-13T19:42:51Z</updated>
<author>
<name>Matheus Valadares</name>
<email>me@m28.io</email>
</author>
<published>2022-04-13T15:32:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bb50ec3cc300eeff3aba7a2bea145aabdb477d31'/>
<id>urn:sha1:bb50ec3cc300eeff3aba7a2bea145aabdb477d31</id>
<content type='text'>
It seems that nothing is ever checking to make sure the safe directories
in the configs actually have the key safe.directory, so some unrelated
config that has a value with a certain directory would also make it a
safe directory.

Signed-off-by: Matheus Valadares &lt;me@m28.io&gt;
Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t0033: add tests for safe.directory</title>
<updated>2022-04-13T19:42:49Z</updated>
<author>
<name>Derrick Stolee</name>
<email>derrickstolee@github.com</email>
</author>
<published>2022-04-13T15:32:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e47363e5a8bdf5144059d664c45c0975243ef05b'/>
<id>urn:sha1:e47363e5a8bdf5144059d664c45c0975243ef05b</id>
<content type='text'>
It is difficult to change the ownership on a directory in our test
suite, so insert a new GIT_TEST_ASSUME_DIFFERENT_OWNER environment
variable to trick Git into thinking we are in a differently-owned
directory. This allows us to test that the config is parsed correctly.

Signed-off-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Sync with 2.31.2</title>
<updated>2022-03-23T23:31:28Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-03-17T09:57:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=201b0c7af6cad52cf6f0cfc46bd48201a23f6224'/>
<id>urn:sha1:201b0c7af6cad52cf6f0cfc46bd48201a23f6224</id>
<content type='text'>
* maint-2.31:
  Git 2.31.2
  Git 2.30.3
  setup_git_directory(): add an owner check for the top-level directory
  Add a function to determine whether a path is owned by the current user
</content>
</entry>
<entry>
<title>setup_git_directory(): add an owner check for the top-level directory</title>
<updated>2022-03-21T12:16:26Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-03-02T11:23:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8959555cee7ec045958f9b6dd62e541affb7e7d9'/>
<id>urn:sha1:8959555cee7ec045958f9b6dd62e541affb7e7d9</id>
<content type='text'>
It poses a security risk to search for a git directory outside of the
directories owned by the current user.

For example, it is common e.g. in computer pools of educational
institutes to have a "scratch" space: a mounted disk with plenty of
space that is regularly swiped where any authenticated user can create
a directory to do their work. Merely navigating to such a space with a
Git-enabled `PS1` when there is a maliciously-crafted `/scratch/.git/`
can lead to a compromised account.

The same holds true in multi-user setups running Windows, as `C:\` is
writable to every authenticated user by default.

To plug this vulnerability, we stop Git from accepting top-level
directories owned by someone other than the current user. We avoid
looking at the ownership of each and every directories between the
current and the top-level one (if there are any between) to avoid
introducing a performance bottleneck.

This new default behavior is obviously incompatible with the concept of
shared repositories, where we expect the top-level directory to be owned
by only one of its legitimate users. To re-enable that use case, we add
support for adding exceptions from the new default behavior via the
config setting `safe.directory`.

The `safe.directory` config setting is only respected in the system and
global configs, not from repository configs or via the command-line, and
can have multiple values to allow for multiple shared repositories.

We are particularly careful to provide a helpful message to any user
trying to use a shared repository.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
</content>
</entry>
<entry>
<title>macOS: precompose startup_info-&gt;prefix</title>
<updated>2021-04-06T00:30:36Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2021-04-04T17:14:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c7d0e61016bfa1c6aec04b0d7daec2e64cfccf3e'/>
<id>urn:sha1:c7d0e61016bfa1c6aec04b0d7daec2e64cfccf3e</id>
<content type='text'>
The "prefix" was precomposed for macOS in commit 5c327502 (MacOS:
precompose_argv_prefix(), 2021-02-03).

However, this commit forgot to update "startup_info-&gt;prefix" after
precomposing.

Move the (possible) precomposition towards the end of
setup_git_directory_gently(), so that precompose_string_if_needed()
can use git_config_get_bool("core.precomposeunicode") correctly.

Keep prefix, startup_info-&gt;prefix and GIT_PREFIX_ENVIRONMENT all in sync.

And as a result, the prefix no longer needs to be precomposed in git.c

Reported-by: Dmitry Torilov &lt;d.torilov@gmail.com&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bc/sha-256-part-3'</title>
<updated>2020-08-12T01:04:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-08-12T01:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0ad9574ddf5bb14d9ed6808112485ce0da99fea'/>
<id>urn:sha1:e0ad9574ddf5bb14d9ed6808112485ce0da99fea</id>
<content type='text'>
The final leg of SHA-256 transition.

* bc/sha-256-part-3: (39 commits)
  t: remove test_oid_init in tests
  docs: add documentation for extensions.objectFormat
  ci: run tests with SHA-256
  t: make SHA1 prerequisite depend on default hash
  t: allow testing different hash algorithms via environment
  t: add test_oid option to select hash algorithm
  repository: enable SHA-256 support by default
  setup: add support for reading extensions.objectformat
  bundle: add new version for use with SHA-256
  builtin/verify-pack: implement an --object-format option
  http-fetch: set up git directory before parsing pack hashes
  t0410: mark test with SHA1 prerequisite
  t5308: make test work with SHA-256
  t9700: make hash size independent
  t9500: ensure that algorithm info is preserved in config
  t9350: make hash size independent
  t9301: make hash size independent
  t9300: use $ZERO_OID instead of hard-coded object ID
  t9300: abstract away SHA-1-specific constants
  t8011: make hash size independent
  ...
</content>
</entry>
<entry>
<title>Merge branch 'jk/reject-newer-extensions-in-v0' into master</title>
<updated>2020-07-30T20:20:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-07-30T20:20:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c28a2d0c12cbd897adf48c52b4d6275a4b84bb78'/>
<id>urn:sha1:c28a2d0c12cbd897adf48c52b4d6275a4b84bb78</id>
<content type='text'>
With the base fix to 2.27 regresion, any new extensions in a v0
repository would still be silently honored, which is not quite
right.  Instead, complain and die loudly.

* jk/reject-newer-extensions-in-v0:
  verify_repository_format(): complain about new extensions in v0 repo
</content>
</entry>
<entry>
<title>setup: add support for reading extensions.objectformat</title>
<updated>2020-07-30T16:16:49Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2020-07-29T23:14:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b5b46d7973763cffde59425d53286faab4e4e712'/>
<id>urn:sha1:b5b46d7973763cffde59425d53286faab4e4e712</id>
<content type='text'>
The transition plan specifies extensions.objectFormat as the indication
that we're using a given hash in a certain repo.  Read this as one of
the extensions we support.  If the user has specified an invalid value,
fail.

Ensure that we reject the extension if the repository format version is
0.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Reviewed-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
