From mboxrd@z Thu Jan 1 00:00:00 1970 From: mathstuf at gmail.com (Ben Boeckel) Date: Sun, 28 Oct 2012 01:00:29 +0000 (UTC) Subject: [PATCHv2 3/3] Helper script to interface to gitolite References: <1350378927-10834-1-git-send-email-valentin.haenel@gmx.de> <1350894558-24840-3-git-send-email-valentin.haenel@gmx.de> Message-ID: 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 :) ). -- Ben