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

Re: git-daemon doesn't work as expected in v2.45.1 and friends

From
Junio C Hamano <gitster@pobox.com>
Date
May 21, 2024, 20:40 UTC
Message-ID
<xmqq7cfmaofl.fsf@gitster.g>
In-Reply-To
<xmqq5xv7chud.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> Reverting f4aa8c8b may not be easy to do mechanically, as it
> introduces the die_upon_dubious_ownership(), but 1204e1a8 uses an
> identical copy of the same function introduced by 8c9c051b (setup.c:
> introduce `die_upon_dubious_ownership()`, 2024-04-15), and reverting
> f4aa8c8b mechanically out of the merged result in v2.45.1 would
> likely to remove the function that is still in use, which would need
> to be retained.
Well the result can be seen at
    https://lore.kernel.org/git/20240521195659.870714-1-gitster@pobox.com/

but I am inclined to say that its [12/12] (partial reversion of f4aa8c8b) is highly questionable, after thinking about it a bit more. It is true that you can run git-daemon as 'nobody', let it peek into repositories owned by real users, feeling safe that 'nobody' would not be able to harm these repositories at all.

But unless this is a tightly controlled hosting environment where no repository owned by "real users" have malicious hooks and config files, a "real user" could attack "nobody", and the safe.directory mechanism that is over-agressive in denying things may alleviate the problem. At places like k.org where the repository data including its hooks and configuration files are trusted, setting up the configuration safe.directory in the ~nobody/.gitconfig to cover the real user repositories would probably be a simple enough workaround.

Previous: Junio C Hamano
Message 4 of 4 in “git-daemon doesn't work as expected in v2.45.1 and friends”
  1. Ondrej PohorelskyMay 20, 2024
  2. Konstantin RyabitsevMay 21, 2024
  3. Junio C HamanoMay 21, 2024
  4. Junio C HamanoMay 21, 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.