[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

problems with sgid "svnserve"

From: Perry E. Metzger <perry_at_piermont.com>
Date: 2004-02-13 23:56:38 CET

>> I created an svn group, made svnserve setgid "svn", and made the
>> repository db and locks directories and files writable by group
>> "svn". (It is nowhere documented what portions of the repository need
>> to be writable -- that's unfortunate.)
> Actually, this seems to be not entirely the case -- I'm having trouble
> with post-commit scripts. In particular, my commit mail script is not
> running sgid svn.

So it appears that, on linux (where I was running my tests), if the
shell is executed and the effective gid != the real gid, the shell (or
perhaps the kernel, I haven't looked at the source) sets the effective
gid to the real gid first. This does not appear to happen for other
interpreters. Perhaps someone who knows more about linux than me can
explain why -- I'm a poor BSDhead.

To get around this, I temporarily changed post-commit to a perl script
that sets the real gid to the effective gid and executes the real
script. Doubtless this provides for a bit of a security hole in that
one could play games the with the shell's file descriptors etc. --
doubtless the reason for the "protection" in the behavior -- but for
the moment, this has hacked around the issue for me.

Probably the right thing to do is to put some support into svnserve
for running the hooks in a sgid environment safely. Given that, the
rest of the stuff will just work right.

Perry E. Metzger		perry@piermont.com
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Feb 13 23:56:58 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.