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

Re: git-daemon whitelist issue

From
Andreas Ericsson <ae@op5.se>
Date
May 26, 2008, 09:06 UTC
Message-ID
<483A7D83.2000501@op5.se>
In-Reply-To
<4838208A.6020205@gmail.com>
Jose Luis Rivas Contreras wrote:
Show 31 quoted lines
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> [Please CC me, I'm not subscribed]
> 
> Hi, I know this will be a dummy question but I cannot find how to solve
> this trying in several ways but none of them work. The issue is that
> when I try to clone I get:
> 
> May 24 09:25:39 jooga git-daemon: [14724]
> '/home/repo/git/xscreensaver.git': not in whitelist
> 
> My git-daemon conf is this:
> 8< -----
> service git
> {
>         disable         = no
>         type            = UNLISTED
>         socket_type     = stream
>         protocol        = tcp
>         user            = nobody
>         wait            = no
>         server          = /usr/bin/git-daemon
>         server_args     = --inetd --export-all
> }
> 8< -----
> 
> I've tried with `--inetd --export-all /home/repo/git', `--inetd
> - --export-all --base-path=/home/repo/git /home/repo/git', with
> interpolated to with a symlink but nothing works, I'm trying with:
> 

Specifying a symlinked path won't work. git-daemon (being of the one-shot-fork school of programs) simply does a chdir() to the requested directory and then getcwd(), which will never consider symlinks. This is a security feature, since directory recursion attacks will never ever work.

> git clone git://repo.ghostbar.ath.cx/home/repo/git/xscreensaver.git noseless
> 

When you specify base-path, you tell git-daemon to prepend the base-path to the directory the user requests.

Start git-daemon like this:
git-daemon --base-path=/home/repo/git --export-all
then do
git clone git://repo.ghostbar.ath.cx/xscreensaver.git

and it should work, assuming /home/repo/git/xscreensaver.git has no symlinks in it.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Jose Luis Rivas Contreras
Message 2 of 2 in “git-daemon whitelist issue”
  1. Jose Luis Rivas ContrerasMay 24, 2008
  2. Andreas EricssonMay 26, 2008

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.