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.

My hosting provider had enabled Trusted Path Execution (Grsec), so all my subversion hooks (for example post-commit) stopped working. Any attempt to commit something ends with warning:

post-commit hook failed (exit code 255) with no output.

I checked, that scripts can be run manually using following syntax:

bash post-commit [PATH] [REV]

but not by:

./post-commit [PATH] [REV]

I think Subversion uses the last one, which cause the problem. So is it possible to change the way which subversion handle hooks?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Hook execution method is hard-coded in Subversion and you have to patch the source and re-build it, if you want to change that. The relevant code may be found in subversion/libsvn_repos/repos.{c,h} in the source distribution.

By the way, hooks are currently executed by their full path (as in /path/to/your/repo/hooks/post-commit) and not with cd /path/to/your/repo && ./post-commit.

share|improve this answer
    
Is there any alternative which doesn't include recompilation of Subversion? Maybe it can be changed in grsec without turning off TPE? –  Krzysztof Bzowski Jun 18 '12 at 15:05
    
As far as I know Grsecurity's TPE allows execution only in root owned directories writable only by root and directories owned by the executing user which aren't group writable nor world writable, so some tweaking of the hooks directory ownership and permission should do the trick. –  Vladimir Blaskov Jun 19 '12 at 7:55
add comment

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.