From 1bb1bee0bf98eb8902eb413ffff01bb326ef40b4 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Wed, 2 Oct 2013 11:51:52 +0200 Subject: Run Git hooks as "plugins" user Our Git hooks modify files in the home directory of the "plugins" user. diff --git a/libexec/plugins-hook b/libexec/plugins-hook index c2cce60..bc2eddc 100755 --- a/libexec/plugins-hook +++ b/libexec/plugins-hook @@ -12,9 +12,11 @@ # ANY WARRANTY, to the extent permitted by law; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -set -u +run_as='plugins' +set -u export PATH='/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' +test $(whoami) = "$run_as" || exec sudo -u "$run_as" "$0" "$@" hook_name=${0##*/} hook_directory="/home/plugins/libexec/$hook_name.d" -- cgit v0.10-9-g596f