gitolite/hooks/gitolite-admin/post-update
Sitaram Chamarty 5fd9328c1c "accidental [mis]feature" -- yet another admin->shell hole blocked!
This is a pretty big hole, really.  Only the fact that Eli called it an
"accidental feature" helped catch it :)

Notes on the code:

An explicit list of paths -- maybe just "conf", "keydir", and "local" --
would have been easier, but this isn't too bad, I think.
2010-04-12 21:10:56 +05:30

18 lines
443 B
Bash
Executable file

#!/bin/sh
# checkout the master branch to $GL_ADMINDIR
# (the GL_ADMINDIR env var would have been set by gl-auth-command)
GIT_WORK_TREE=$GL_ADMINDIR git checkout -f master -- \
`git ls-tree master | cut -f2 | perl -lne 'print unless /^(src|hooks)$/'`
od=$PWD
cd $GL_ADMINDIR
$GL_BINDIR/gl-compile-conf
cd $od
if [ -f hooks/post-update.secondary ] || [ -L hooks/post-update.secondary ]
then
exec hooks/post-update.secondary "$@"
fi