Re: git-daemon --inetd
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Sep 16, 2005, 17:30 UTC
- Message-ID
- <Pine.LNX.4.58.0509161027460.26803@g5.osdl.org>
- In-Reply-To
- <7vbr2tqwl0.fsf@assigned-by-dhcp.cox.net>
On Fri, 16 Sep 2005, Junio C Hamano wrote:
> > Later exchanges between you and HPA appeared to me that we would > need a chroot environment which has "enough stuff" and that this > patch may not help him very much. Am I mistaken?
No, I think that's correct.
> I think resolving user and group to numeric before you do > chroot() might make the setting up of chrooted environment a > little simpler; no need for supporting getpwnam and getgrnam > there.
Right you are. Much better.
> On the other hand it may not matter -- you can always > give numeric uid/gid to begin with.
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.
I think we can drop the patch for now. It doesn't buy much.
Linus