<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/setup.c, branch v2.35.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.35.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.35.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-03-23T23:31:42Z</updated>
<entry>
<title>Sync with 2.34.2</title>
<updated>2022-03-23T23:31:42Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-03-17T09:57:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1f480d5127b746c2345701b86f7e15ecbd3377a3'/>
<id>urn:sha1:1f480d5127b746c2345701b86f7e15ecbd3377a3</id>
<content type='text'>
* maint-2.34:
  Git 2.34.2
  Git 2.33.2
  Git 2.32.1
  Git 2.31.2
  GIT-VERSION-GEN: bump to v2.33.1
  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>Sync with 2.32.1</title>
<updated>2022-03-23T23:31:32Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-03-17T09:57:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=303b876f76c2caccc9a289c4f14a2b2d3850684e'/>
<id>urn:sha1:303b876f76c2caccc9a289c4f14a2b2d3850684e</id>
<content type='text'>
* maint-2.32:
  Git 2.32.1
  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>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>setup: introduce startup_info-&gt;original_cwd</title>
<updated>2021-12-09T21:33:12Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-12-09T05:08:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e6f8861bd43636b27651150e6a3caa0a937fb418'/>
<id>urn:sha1:e6f8861bd43636b27651150e6a3caa0a937fb418</id>
<content type='text'>
Removing the current working directory causes all subsequent git
commands run from that directory to get confused and fail with a message
about being unable to read the current working directory:

    $ git status
    fatal: Unable to read current working directory: No such file or directory

Non-git commands likely have similar warnings or even errors, e.g.

    $ bash -c 'echo hello'
    shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    hello

This confuses end users, particularly since the command they get the
error from is not the one that caused the problem; the problem came from
the side-effect of some previous command.

We would like to avoid removing the current working directory of our
parent process; towards this end, introduce a new variable,
startup_info-&gt;original_cwd, that tracks the current working directory
that we inherited from our parent process.  For convenience of later
comparisons, we prefer that this new variable store a path relative to
the toplevel working directory (thus much like 'prefix'), except without
the trailing slash.

Subsequent commits will make use of this new variable.

Acked-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Acked-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: use xopen and xdup in sanitize_stdfds</title>
<updated>2021-09-10T00:40:02Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-09-09T21:45:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9a65b6c0a9171a3ff636e59a3e435eda8f50e5b'/>
<id>urn:sha1:d9a65b6c0a9171a3ff636e59a3e435eda8f50e5b</id>
<content type='text'>
Replace the catch-all error message with specific ones for opening and
duplicating by calling the wrappers xopen and xdup.  The code becomes
easier to follow when error handling is reduced to two letters.

Remove the unnecessary mode parameter while at it -- we expect /dev/null
to already exist.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jt/partial-clone-submodule-1'</title>
<updated>2021-07-17T00:42:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-07-17T00:42:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8721e2eaedd0290ef399f638912a49b36402e715'/>
<id>urn:sha1:8721e2eaedd0290ef399f638912a49b36402e715</id>
<content type='text'>
Prepare the internals for lazily fetching objects in submodules
from their promisor remotes.

* jt/partial-clone-submodule-1:
  promisor-remote: teach lazy-fetch in any repo
  run-command: refactor subprocess env preparation
  submodule: refrain from filtering GIT_CONFIG_COUNT
  promisor-remote: support per-repository config
  repository: move global r_f_p_c to repo struct
</content>
</entry>
<entry>
<title>repository: move global r_f_p_c to repo struct</title>
<updated>2021-06-28T16:57:41Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2021-06-17T17:13:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ebaf3bcf1aecdc31062ede80fca3a7c98202d8bb'/>
<id>urn:sha1:ebaf3bcf1aecdc31062ede80fca3a7c98202d8bb</id>
<content type='text'>
Move repository_format_partial_clone, which is currently a global
variable, into struct repository. (Full support for per-repository
partial clone config will be done in a subsequent commit - this is split
into its own commit because of the extent of the changes needed.)

The new repo-specific variable cannot be set in
check_repository_format_gently() (as is currently), because that
function does not know which repo it is operating on (or even whether
the value is important); therefore this responsibility is delegated to
the outermost caller that knows. Of all the outermost callers that know
(found by looking at all functions that call clear_repository_format()),
I looked at those that either read from the main Git directory or write
into a struct repository. These callers have been modified accordingly
(write to the_repository in the former case and write to the given
struct repository in the latter case).

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: split "extensions found" messages into singular and plural</title>
<updated>2021-05-20T04:36:58Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2021-05-18T06:19:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8013d7d9ee7674774f6dbdbaeab11ce173bee016'/>
<id>urn:sha1:8013d7d9ee7674774f6dbdbaeab11ce173bee016</id>
<content type='text'>
It's easier to translate this way.

Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&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>
</feed>
