Search code examples
svntelnetpost-commit-hook

SVN post commit hook won't execute telnet


I have a SVN repo served by Apache over DAV.

I've created a post-commit hook that I want to open a telnet session to a server.

When I execute the commands from the command prompt, it works fine.

But when I execute it with the hook, it fails, saying that it doesn't have permissions to execute.

My script is simple:

 #!/bin/sh
 REPOS="$1"
 REV="$2"

 echo -e symeon\\nfrobnitz\\n.say \#foo easitag $REV $(svnlook author $REPOS -r $REV)    $(svnlook changed $REPOS -r $REV): $(svnlook log $REPOS -r $REV) | telnet server 8080

The hook is running on a RedHat Enterprise Linux machine. I'm assuming it's executing as the apache user.

Anyone know why?


Solution

  • I found this on a rather obscure forum:

    The apache user is disallowed to make http connections by default. To enable this, do the following from root:

    setsebool -P httpd_can_network_connect 1

    that was found on http://forums.phpfreaks.com/topic/64806-solved-could-not-connect-to-server-permission-denied/