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

Re: git-daemon: path validation, export all option

From
AAAnton Altaparmakov <aia21@cam.ac.uk>
Date
Sep 27, 2005, 08:30 UTC
Message-ID
<1127809831.28407.6.camel@imp.csi.cam.ac.uk>
In-Reply-To
<7vslvr6t1u.fsf@assigned-by-dhcp.cox.net>
On Mon, 2005-09-26 at 21:19 -0700, Junio C Hamano wrote:
Show 28 quoted lines
> "H. Peter Anvin" <hpa@zytor.com> writes:
> 
> > A first attempt to make git-daemon a bit more suitable for kernel.org 
> > use: it allows the user to specify a whitelist of directories, rejects 
> > paths which have . or .. in them (to avoid bypassing the whitelist), and 
> > allows for an --export-all option.
> >
> > Signed-off-by: H. Peter Anvin <hpa@zytor.com>
> 
> I understand the motivation behind --export-all and directory
> whitelist and these changes look good.  Thanks.
> 
> > +	if ( ok_paths && *ok_paths ) {
> > +		int ok = 0;
> > +...
> > +	}
> > +
> > +	return 1;		/* Path acceptable */
> > +}
> 
> A microNit.  You could lose 'int ok' and return 1 directly where
> you assign 1 to it and break.
> 
> > -	chdir(".git");
> 
> I am unsure about this removal of "minor convenience feature".
> Although I do not think git-daemon is widely used on the field,
> this change breaks existing setup if there is any.

Please drop this one line change. It certainly breaks my personal setup. And all git tools are happy with being given the "master" directory or the "master/.git" so there is no reason for git-daemon not to accept that, too.

If hpa really can't live with the chdir, maybe we could add a "--strict-git-paths" option or something that will not do the chdir? It would be only a few lines of code in git-daemon to parse the option and then the chdir would become

if (!strict_git_paths)
	chdir(".git");
Best regards,
        Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
Previous: Junio C HamanoNext: H. Peter Anvin
Message 3 of 7 in “git-daemon: path validation, export all option”
  1. H. Peter AnvinSep 27, 2005
  2. Junio C HamanoSep 27, 2005
  3. Anton AltaparmakovSep 27, 2005
  4. H. Peter AnvinSep 27, 2005
  5. Junio C HamanoSep 27, 2005
  6. Linus TorvaldsSep 27, 2005
  7. H. Peter AnvinSep 27, 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.