Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:15

Petr Baudis [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help