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

Re: How to get git-daemon to work in a post-CVE world?

From
Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Date
Mar 31, 2025, 20:45 UTC
Message-ID
<20250331-thistle-wolverine-of-jest-b11d9b@lemur>
In-Reply-To
<CAE8gLh=1bqA6UTR4wAX1u1naic2cSGiekz0jLKxWeaxBKa=xiQ@mail.gmail.com>
On Mon, Mar 31, 2025 at 10:15:00PM +0200, MegaBrutal wrote:
Show 29 quoted lines
> > > I'm new to the list, just thought it's the best place to talk about
> > > Git. I'm running a public read-only git server with git-daemon. I've
> > > recently noticed that my repos can't be cloned and found that
> > > particular CVE which made git to verify the owners of the git repos.
> > >
> > > fatal: detected dubious ownership in repository at '/srv/git/mgsautils.git'
> > >
> > > The feasible solution is to declare the directory safe in .gitconfig.
> >
> > You can set global values in /etc/gitconfig, e.g.:
> >
> >     [safe]
> >       directory = /srv/git/*
> 
> Thanks! While it is much more convenient to set it in one global
> /etc/gitconfig than individual home directories, I encountered the
> following problems:
> 
> 1. It doesn't do anything with the other error I get, when the
> problematic directory is '.'. I still keep getting that error message.
> 2. Git daemon doesn't seem to resolve the '*' wildcard, i.e. with the
> wildcard I get the original message back which complains about
> '/srv/git/mgsautils.git', despite it should be covered by
> '/srv/git/*'. When I supply the full path, however, the error message
> is still about '.'.
> 
> I even performed a whole Ubuntu release upgrade to get a new version
> of Git, but 2.43.0 acts the same. Seems like git-daemon is more
> stricts than plain git – what might be the problem?

2.43.0 is not very new. I believe in that version it only supported setting that to '*' as a wildcard, so the following should work for you, hopefully:

    [safe]
      directory = *
-K
Previous: MegaBrutal
Message 4 of 4 in “How to get git-daemon to work in a post-CVE world?”
  1. MegaBrutalMar 30, 2025
  2. Konstantin RyabitsevMar 31, 2025
  3. MegaBrutalMar 31, 2025
  4. Konstantin RyabitsevMar 31, 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.