From mboxrd@z Thu Jan 1 00:00:00 1970 From: valentin.haenel at gmx.de (Valentin Haenel) Date: Mon, 29 Oct 2012 10:27:54 +0100 Subject: [PATCHv2 3/3] Helper script to interface to gitolite In-Reply-To: References: <1350378927-10834-1-git-send-email-valentin.haenel@gmx.de> <1350894558-24840-3-git-send-email-valentin.haenel@gmx.de> Message-ID: <20121029092754.GB17370@kudu.in-berlin.de> * Ben Boeckel [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-