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?


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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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