From a6a0db10e9124d1cd19f8d30412b0bff95d43e86 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sat, 28 May 2011 20:26:55 +0530 Subject: [PATCH] oopsies... should be checking for "-x" not just "-f or -l" to chain a hook it was trying to execute a broken symlink! (Thanks to Jeff of KDE for catching this) --- doc/monkeysphere.mkd | 2 +- hooks/common/update | 4 +--- hooks/gitolite-admin/post-update | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/monkeysphere.mkd b/doc/monkeysphere.mkd index 3497073..e42cab1 100644 --- a/doc/monkeysphere.mkd +++ b/doc/monkeysphere.mkd @@ -56,7 +56,7 @@ gitolite put your new hook in the correct place. ADMIN_POST_UPDATE_CHAINS_TO=hooks/post-update.tertiary - if [[ -f $ADMIN_POST_UPDATE_CHAINS_TO || -L $ADMIN_POST_UPDATE_CHAINS_TO ]]; then + if [[ -x $ADMIN_POST_UPDATE_CHAINS_TO ]]; then exec $ADMIN_POST_UPDATE_CHAINS_TO "$@" fi diff --git a/hooks/common/update b/hooks/common/update index c264d22..2065a04 100755 --- a/hooks/common/update +++ b/hooks/common/update @@ -88,9 +88,7 @@ check_ref (\@allowed_refs, $ENV{GL_REPO}, $_ , $att_acc # if we returned at all, all the checks succeeded. Check secondary hooks now $UPDATE_CHAINS_TO ||= 'hooks/update.secondary'; -( -f $UPDATE_CHAINS_TO or -l $UPDATE_CHAINS_TO ) - and system ( $UPDATE_CHAINS_TO, @ARGV ) - and die "$UPDATE_CHAINS_TO died\n"; +-x $UPDATE_CHAINS_TO and system ( $UPDATE_CHAINS_TO, @ARGV ) and die "$UPDATE_CHAINS_TO died\n"; # now log it and exit 0 so git can get on with it log_it("", "$att_acc\t" . substr($oldsha, 0, 14) . "\t" . substr($newsha, 0, 14) . diff --git a/hooks/gitolite-admin/post-update b/hooks/gitolite-admin/post-update index b7cbbb0..62cd647 100755 --- a/hooks/gitolite-admin/post-update +++ b/hooks/gitolite-admin/post-update @@ -26,7 +26,7 @@ cd $od ADMIN_POST_UPDATE_CHAINS_TO=`$GL_BINDIR/gl-query-rc ADMIN_POST_UPDATE_CHAINS_TO` [ -n "$ADMIN_POST_UPDATE_CHAINS_TO" ] || ADMIN_POST_UPDATE_CHAINS_TO=hooks/post-update.secondary -if [ -f $ADMIN_POST_UPDATE_CHAINS_TO ] || [ -L $ADMIN_POST_UPDATE_CHAINS_TO ] +if [ -x $ADMIN_POST_UPDATE_CHAINS_TO ] then exec $ADMIN_POST_UPDATE_CHAINS_TO "$@" fi