Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Yesterday, I mistakenly wrote a post-commit hook that fatally broke my server. In fact, when I committed via TortoiseSVN, I could see the post-commit hook remove significant system resources. When I tried to reboot the server, the server did not boot.

Anyway, I'm about to setup SVN again, and I don't want to make the same mistake. How do I restrict my post-commit hook permissions to only be able to modify certain folders?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

What user is SVN running as?

On my system, SVN is running with the Apache user via DAV, so the user it is running as is www-data, so it wouldn't have access to critical system resources outside the scope.

share|improve this answer
    
Actually, I'm not sure who SVN itself was running as. I know I was committing under my user that I setup, which does have extensive permissions. Does the post-commit hook get run under the permissions of the committer or as the permissions of the SVN executable? I setup SVN using this guide: help.ubuntu.com/community/Subversion –  Stephen Watkins Jun 21 '11 at 0:42
1  
Yes. If you're using the direct access method, it will run as the user you login with. I would suggest making the switch to WebDAV, so that commits/hooks will run as www-data, which will prevent a bad hook from causing any system wide problem. –  Matt Beckman Jun 21 '11 at 17:45
    
Oh, I see. I'll do it that way then. Thanks. –  Stephen Watkins Jun 21 '11 at 19:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.