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

Re: git-daemon --inetd

From
HAH. Peter Anvin <hpa@zytor.com>
Date
Sep 16, 2005, 18:23 UTC
Message-ID
<432B0D97.2030903@zytor.com>
In-Reply-To
<Pine.LNX.4.58.0509161027460.26803@g5.osdl.org>
Linus Torvalds wrote:
Show 10 quoted lines
> 
> Well, the symbolic names are much nicer and more readable. So it would be 
> better to do the uid/gid translation early, and change the "chroot" thing 
> to be done after all that.
> 
> It gets a bit messy.. Easy enough to just save a "const char *new_root",
> but then you have to split up the "set_user_group()" to be two functions,
> around the actual chroot(), since the chroot needs to be done while we're
> still root.
> 

Actually, initgroups() and setgroups(), and setgid() for that matter, can be done before the chroot(). The only thing that needs to remain until the end is setuid().

At one time I played around in tftp-hpa with trying to get Linux to keep only CAP_SYS_CHROOT around, but I think I gave up on it. The way Linux capabilities play with the rest of the permission system isn't very useful :(

	-hpa
Previous: Linus Torvalds
Message 15 of 15 in “git-daemon --inetd”
  1. H. Peter AnvinSep 15, 2005
  2. Linus TorvaldsSep 15, 2005
  3. H. Peter AnvinSep 15, 2005
  4. Linus TorvaldsSep 15, 2005
  5. H. Peter AnvinSep 15, 2005
  6. Linus TorvaldsSep 15, 2005
  7. Martin LanghoffSep 15, 2005
  8. Jon SeymourOct 22, 2005
  9. Linus TorvaldsOct 22, 2005
  10. Junio C HamanoSep 15, 2005
  11. Junio C HamanoSep 16, 2005
  12. Junio C HamanoSep 16, 2005
  13. H. Peter AnvinSep 16, 2005
  14. Linus TorvaldsSep 16, 2005
  15. H. Peter AnvinSep 16, 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.