[PATCHv2 3/3] Helper script to interface to gitolite

Valentin Haenel valentin.haenel at gmx.de
Mon Oct 29 10:27:54 CET 2012


* Ben Boeckel <mathstuf at gmail.com> [2012-10-28]:
> On Mon, Oct 22, 2012 at 08:29:18 GMT, Valentin Haenel wrote:
> > @@ -0,0 +1,18 @@
> > +#!/bin/sh
> > +# Wrapper around gitolite to perform
> > +# repository authentication from a
> > +# CGI environment
> > +prog="/usr/local/bin/gitolite"
> > +
> > +# Repository to check access against
> > +# Strip the trailing .git if one is
> > +# present
> > +export REPO=${1%%.git}
> > +export REMOTE_USER=${2}
> > +export PERM=${3-"R"}
> > +# HTTPD will not set some essential
> > +# variables expexted by gitolite
> > +# Set them here (EUID expected final)
> > +export HOME=`getent passwd $(id -n -u) | cut -d":" -f 6`
> > +
> > +exec $prog access -q ${REPO} ${REMOTE_USER} ${PERM}
> 
> Quoting highly recommended around the variables (I suspect other shell
> scripts need a once over for this, but let's not add more instances :)
> ).

Check.

V-




More information about the CGit mailing list