<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin, branch v2.33.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.33.6</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.33.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-10-06T21:42:02Z</updated>
<entry>
<title>Sync with 2.32.4</title>
<updated>2022-10-06T21:42:02Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-10-06T21:42:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3957f3c84e89c68e8bf3f7cb172ba6837af70506'/>
<id>urn:sha1:3957f3c84e89c68e8bf3f7cb172ba6837af70506</id>
<content type='text'>
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>Sync with 2.31.5</title>
<updated>2022-10-06T21:40:44Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-10-06T21:40:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9cbd2827c5a19d935054cdb162e53e5703be09f4'/>
<id>urn:sha1:9cbd2827c5a19d935054cdb162e53e5703be09f4</id>
<content type='text'>
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>Sync with 2.30.6</title>
<updated>2022-10-06T21:39:15Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-10-06T21:39:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=122512967e6184b1888a63ea2b6ed9ada3046b28'/>
<id>urn:sha1:122512967e6184b1888a63ea2b6ed9ada3046b28</id>
<content type='text'>
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>builtin/clone.c: disallow `--local` clones with symlinks</title>
<updated>2022-10-01T04:23:38Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-07-28T21:35:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6f054f9fb3a501c35b55c65e547a244f14c38d56'/>
<id>urn:sha1:6f054f9fb3a501c35b55c65e547a244f14c38d56</id>
<content type='text'>
When cloning a repository with `--local`, Git relies on either making a
hardlink or copy to every file in the "objects" directory of the source
repository. This is done through the callpath `cmd_clone()` -&gt;
`clone_local()` -&gt; `copy_or_link_directory()`.

The way this optimization works is by enumerating every file and
directory recursively in the source repository's `$GIT_DIR/objects`
directory, and then either making a copy or hardlink of each file. The
only exception to this rule is when copying the "alternates" file, in
which case paths are rewritten to be absolute before writing a new
"alternates" file in the destination repo.

One quirk of this implementation is that it dereferences symlinks when
cloning. This behavior was most recently modified in 36596fd2df (clone:
better handle symlinked files at .git/objects/, 2019-07-10), which
attempted to support `--local` clones of repositories with symlinks in
their objects directory in a platform-independent way.

Unfortunately, this behavior of dereferencing symlinks (that is,
creating a hardlink or copy of the source's link target in the
destination repository) can be used as a component in attacking a
victim by inadvertently exposing the contents of file stored outside of
the repository.

Take, for example, a repository that stores a Dockerfile and is used to
build Docker images. When building an image, Docker copies the directory
contents into the VM, and then instructs the VM to execute the
Dockerfile at the root of the copied directory. This protects against
directory traversal attacks by copying symbolic links as-is without
dereferencing them.

That is, if a user has a symlink pointing at their private key material
(where the symlink is present in the same directory as the Dockerfile,
but the key itself is present outside of that directory), the key is
unreadable to a Docker image, since the link will appear broken from the
container's point of view.

This behavior enables an attack whereby a victim is convinced to clone a
repository containing an embedded submodule (with a URL like
"file:///proc/self/cwd/path/to/submodule") which has a symlink pointing
at a path containing sensitive information on the victim's machine. If a
user is tricked into doing this, the contents at the destination of
those symbolic links are exposed to the Docker image at runtime.

One approach to preventing this behavior is to recreate symlinks in the
destination repository. But this is problematic, since symlinking the
objects directory are not well-supported. (One potential problem is that
when sharing, e.g. a "pack" directory via symlinks, different writers
performing garbage collection may consider different sets of objects to
be reachable, enabling a situation whereby garbage collecting one
repository may remove reachable objects in another repository).

Instead, prohibit the local clone optimization when any symlinks are
present in the `$GIT_DIR/objects` directory of the source repository.
Users may clone the repository again by prepending the "file://" scheme
to their clone URL, or by adding the `--no-local` option to their `git
clone` invocation.

The directory iterator used by `copy_or_link_directory()` must no longer
dereference symlinks (i.e., it *must* call `lstat()` instead of `stat()`
in order to discover whether or not there are symlinks present). This has
no bearing on the overall behavior, since we will immediately `die()` on
encounter a symlink.

Note that t5604.33 suggests that we do support local clones with
symbolic links in the source repository's objects directory, but this
was likely unintentional, or at least did not take into consideration
the problem with sharing parts of the objects directory with symbolic
links at the time. Update this test to reflect which options are and
aren't supported.

Helped-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'da/difftool-dir-diff-symlink-fix' into maint</title>
<updated>2021-10-12T20:51:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-12T20:51:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef09a7fbbe5a74e628be3aa8af98f67344606807'/>
<id>urn:sha1:ef09a7fbbe5a74e628be3aa8af98f67344606807</id>
<content type='text'>
"git difftool --dir-diff" mishandled symbolic links.

* da/difftool-dir-diff-symlink-fix:
  difftool: fix symlink-file writing in dir-diff mode
</content>
</entry>
<entry>
<title>Merge branch 'jk/clone-unborn-head-in-bare' into maint</title>
<updated>2021-10-12T20:51:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-12T20:51:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c365967f217de9f90ba0c6005e65269388540ddb'/>
<id>urn:sha1:c365967f217de9f90ba0c6005e65269388540ddb</id>
<content type='text'>
"git clone" from a repository whose HEAD is unborn into a bare
repository didn't follow the branch name the other side used, which
is corrected.

* jk/clone-unborn-head-in-bare:
  clone: handle unborn branch in bare repos
</content>
</entry>
<entry>
<title>Merge branch 'en/stash-df-fix' into maint</title>
<updated>2021-10-12T20:51:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-12T20:51:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e61304f21d7e9f54dd84a6507383db27e0914c6f'/>
<id>urn:sha1:e61304f21d7e9f54dd84a6507383db27e0914c6f</id>
<content type='text'>
"git stash", where the tentative change involves changing a
directory to a file (or vice versa), was confused, which has been
corrected.

* en/stash-df-fix:
  stash: restore untracked files AFTER restoring tracked files
  stash: avoid feeding directories to update-index
  t3903: document a pair of directory/file bugs
</content>
</entry>
<entry>
<title>Merge branch 'en/am-abort-fix' into maint</title>
<updated>2021-10-12T20:51:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-12T20:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b809c3d9005cdbf6b193a78a32240b247ee81b36'/>
<id>urn:sha1:b809c3d9005cdbf6b193a78a32240b247ee81b36</id>
<content type='text'>
When "git am --abort" fails to abort correctly, it still exited
with exit status of 0, which has been corrected.

* en/am-abort-fix:
  am: fix incorrect exit status on am fail to abort
  t4151: add a few am --abort tests
  git-am.txt: clarify --abort behavior
</content>
</entry>
<entry>
<title>Merge branch 'ps/update-ref-batch-flush' into maint</title>
<updated>2021-10-12T20:51:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-12T20:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b5f309dc7f9b358e8a0dd0c0db0ca2afe3dae973'/>
<id>urn:sha1:b5f309dc7f9b358e8a0dd0c0db0ca2afe3dae973</id>
<content type='text'>
"git update-ref --stdin" failed to flush its output as needed,
which potentially led the conversation to a deadlock.

* ps/update-ref-batch-flush:
  t1400: avoid SIGPIPE race condition on fifo
  update-ref: fix streaming of status updates
</content>
</entry>
<entry>
<title>Merge branch 'tb/pack-finalize-ordering' into maint</title>
<updated>2021-10-12T20:51:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-12T20:51:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=628746020326d329c4e50289da41d2b7fc3e51fa'/>
<id>urn:sha1:628746020326d329c4e50289da41d2b7fc3e51fa</id>
<content type='text'>
The order in which various files that make up a single (conceptual)
packfile has been reevaluated and straightened up.  This matters in
correctness, as an incomplete set of files must not be shown to a
running Git.

* tb/pack-finalize-ordering:
  pack-objects: rename .idx files into place after .bitmap files
  pack-write: split up finish_tmp_packfile() function
  builtin/index-pack.c: move `.idx` files into place last
  index-pack: refactor renaming in final()
  builtin/repack.c: move `.idx` files into place last
  pack-write.c: rename `.idx` files after `*.rev`
  pack-write: refactor renaming in finish_tmp_packfile()
  bulk-checkin.c: store checksum directly
  pack.h: line-wrap the definition of finish_tmp_packfile()
</content>
</entry>
</feed>
