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

Re: User-relative paths

From
Junio C Hamano <junkio@cox.net>
Date
Oct 23, 2005, 22:57 UTC
Message-ID
<7vd5lvx2n5.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0510231427230.10477@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 8 quoted lines
>> But it is orthogonal to what you are doing in this patch.
>
> Well, not necessarily.
>
> It's quite arguable that sanity testing might be per-user and could be 
> done by the shell. I'm not at all sure that srvside_chdir() should do any 
> extra testing: if you have real ssh access, the user has the right to do 
> anything he damn well pleases.

The point of the patch, unless I am mistaken, is to add ~user/ expansion to the pathname grokking, so that a remote user does not have to know exactly where on the server each user's home directory is.

I agree 100% with you that srvside_chdir() is not the place to do policy checking. In order to avoid the aliasing problem (which motivated HPA to add --strict option), the receiving end, be it git-daemon driving upload-pack or git-shell driving receive-pack or upload-pack, can do ~user/ expansion first, then run their policy checking on the canonicalized path before spawning the lower level programs using the already canonicalized path.

To also support the case where upload-pack and receive-pack are started directly from the ssh connection, these programs need to apply ~user/ expansion to the incoming path themselves by default. In order to avoid double expansion, git-daemon and git-shell should pass --no-user-expansion flag to the lower level programs when it starts them if we do this.

A common library that takes the path supplied from the other end and does ~user/ expansion would be useful for the above; we can lift that logic from Andreas' srvside_chdir().

Previous: Linus TorvaldsNext: Junio C Hamano
Message 12 of 30 in “Server side programs”
  1. Andreas EricssonOct 22, 2005
  2. Junio C HamanoOct 23, 2005
  3. Andreas EricssonOct 23, 2005
  4. Petr BaudisOct 23, 2005
  5. Junio C HamanoOct 23, 2005
  6. Petr BaudisOct 23, 2005
  7. Junio C HamanoOct 23, 2005
  8. Daniel BarkalowOct 24, 2005
  9. Andreas EricssonOct 25, 2005
  10. Junio C HamanoOct 23, 2005
  11. Linus TorvaldsOct 23, 2005
  12. Junio C HamanoOct 23, 2005
  13. Junio C HamanoOct 23, 2005
  14. H. Peter AnvinOct 24, 2005
  15. Linus TorvaldsOct 24, 2005
  16. H. Peter AnvinOct 24, 2005
  17. Junio C HamanoOct 24, 2005
  18. Add git-shell.Junio C Hamano, Oct 24, 2005
  19. Linus TorvaldsOct 24, 2005
  20. Linus TorvaldsOct 24, 2005
  21. Junio C HamanoOct 24, 2005
  22. Junio C HamanoOct 24, 2005
  23. git_progname (was: Re: User-relative paths)Andreas Ericsson, Oct 25, 2005
  24. Petr BaudisOct 25, 2005
  25. Andreas EricssonOct 25, 2005
  26. Andreas EricssonOct 25, 2005
  27. Petr BaudisOct 25, 2005
  28. Junio C HamanoOct 26, 2005
  29. Matthias UrlichsOct 27, 2005
  30. Linus TorvaldsOct 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.