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

Re: [PATCH] git-daemon --base-path

From
Junio C Hamano <junkio@cox.net>
Date
Dec 23, 2005, 04:19 UTC
Message-ID
<7vlkycfnro.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051223012739.29168.55858.stgit@machine.or.cz>
Petr Baudis <pasky@suse.cz> writes:
> Tommi Virtanen expressed a wish on #git to be able to use short and elegant
> git URLs by making git-daemon 'root' in a given directory. This patch
> implements this, causing git-daemon to interpret all paths relative to
> the given base path if any is given.

This is much nicer than chrooting or having a symlink hanging under /. Another possibility would be to have ~git/ a symlink to such directory and make it a whitelist -- then you do not need this patch. The URL would be "git://ho.st/~git/xxx" which is short-and-sweet.

> +		snprintf(rpath, PATH_MAX, "%s%s", base_path, dir);
> +		dir = rpath;
> +	}

We probably would want to verify base_path exists and is without excess trailing slash when parsing arguments, if we are going to do this.

Previous: Petr Baudis
Message 2 of 2 in “git-daemon --base-path”
  1. git-daemon --base-pathPetr Baudis, Dec 23, 2005
  2. Junio C HamanoDec 23, 2005

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.