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

Ben Boeckel mathstuf at gmail.com
Sun Oct 28 02:00:29 CET 2012


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





More information about the CGit mailing list