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

Re: Limited operations in unsafe repositories

From
Jeff King <peff@peff.net>
Date
Jan 11, 2024, 07:30 UTC
Message-ID
<20240111073007.GE48154@coredump.intra.peff.net>
In-Reply-To
<ZZ-V-vwnm2hOkrMC@tanuki>
On Thu, Jan 11, 2024 at 08:17:14AM +0100, Patrick Steinhardt wrote:
Show 15 quoted lines
> > Right, it's not config itself that's unsafe; it's that many options are.
> > We could try to annotate them to say "it is OK to parse core.eol but not
> > core.pager", presumably with an allow-known-good approach (since so many
> > ard bad!). But that feels like an ongoing maintenance headache, and an
> > easy way to make a mistake (your mention of terminal sequences makes me
> > assume you're thinking of "color.diff.*", etc). A rule like "we do not
> > read repo-level config at all" seems easier to explain (to me, anyway).
> 
> With the exemption of the repository format, I assume? We have to parse
> things like `core.repositoryFormatVersion` and extensions in order to
> figure out how a repository has to be accessed. So I agree that we
> should not partition config based on safeness, which is going to be a
> headache as you rightly point out. But we can partition based on whether
> or not config is required in order to access the repository, where the
> set of relevant config keys is a whole lot smaller.

Right. See the pseudo-patch I posted earlier. I think we just want to touch do_git_config_sequence(), which leaves repo discovery and stuff like "git config --local" working.

-Peff
Previous: Patrick Steinhardt
Message 7 of 7 in “Limited operations in unsafe repositories”
  1. brian m. carlsonJan 7, 2024
  2. Jeff KingJan 10, 2024
  3. brian m. carlsonJan 10, 2024
  4. Junio C HamanoJan 11, 2024
  5. Jeff KingJan 11, 2024
  6. Patrick SteinhardtJan 11, 2024
  7. Jeff KingJan 11, 2024

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.