git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: 'safe.directory' setting ignored for some operations?

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Apr 11, 2025, 00:47 UTC
Message-ID
<Z_hmnPoPjXQm6lyP@tapette.crustytoothpaste.net>
In-Reply-To
<20250410224223.GA3191424@coredump.intra.peff.net>
On 2025-04-10 at 22:42:23, Jeff King wrote:
> Yeah, that's true in v2.48.0 and later. (I tried it after writing the
> earlier email and was a little puzzled that it works with --no-local but
> not otherwise, but it sounds like that's known).

It is. The reason for that is that we try to hardlink if `--no-local` is not provided, which has all the normal security concerns across ownership boundaries. However, `--no-local` uses the normal `git-upload-pack` mechanism, which we know is secure on untrusted repositories.

One thing we could do to improve things is detect if the repository is owned by another user and just set `--no-local` automatically, but that's a #leftoverbits for someone.

-- 
brian m. carlson (they/them)
Toronto, Ontario, CA
Previous: Jeff KingNext: Nikolaus Rath
Message 5 of 6 in “'safe.directory' setting ignored for some operations?”
  1. Nikolaus RathApr 10, 2025
  2. Jeff KingApr 10, 2025
  3. brian m. carlsonApr 10, 2025
  4. Jeff KingApr 10, 2025
  5. brian m. carlsonApr 11, 2025
  6. Nikolaus RathApr 11, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.