From 783ff95ab8c2ccc42901200bdc25a426377a3886 Mon Sep 17 00:00:00 2001 From: Charlie Date: Wed, 28 Oct 2009 13:58:26 -0600 Subject: Add policy checks --- check-receive-policy | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 check-receive-policy (limited to 'check-receive-policy') diff --git a/check-receive-policy b/check-receive-policy new file mode 100755 index 0000000..1956a07 --- /dev/null +++ b/check-receive-policy @@ -0,0 +1,15 @@ +#!/bin/sh -eu +set -eu + +# Check if user is allowed +user=`id -un` +match=`test -f git-receive-allow && grep -Fx "$user" git-receive-allow || true` +echo $match > /tmp/match.log +if [ -z "$match" ]; then + cat <&2 +--- +You're not allowed to push to this repository as $user. +--- +EOF + exit 1 +fi -- cgit v1.2.3