Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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: – Stephen Watkins Jun 21 '11 at 0:42
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


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.