summaryrefslogtreecommitdiffstats
path: root/libexec/plugins-hook
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-10-02 09:51:52 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-10-02 09:51:52 (GMT)
commit1bb1bee0bf98eb8902eb413ffff01bb326ef40b4 (patch)
treebbd4e73bac1925fdd9d66fa321cc45f46570f2d5 /libexec/plugins-hook
parentb1471a257cd4f509c6c369a12f320b930f7a3c93 (diff)
downloadsite-1bb1bee0bf98eb8902eb413ffff01bb326ef40b4.tar.gz
Run Git hooks as "plugins" user
Our Git hooks modify files in the home directory of the "plugins" user.
Diffstat (limited to 'libexec/plugins-hook')
-rwxr-xr-xlibexec/plugins-hook4
1 files changed, 3 insertions, 1 deletions
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 @@
12# ANY WARRANTY, to the extent permitted by law; without even the implied 12# ANY WARRANTY, to the extent permitted by law; without even the implied
13# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 14
15set -u 15run_as='plugins'
16 16
17set -u
17export PATH='/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' 18export PATH='/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin'
19test $(whoami) = "$run_as" || exec sudo -u "$run_as" "$0" "$@"
18 20
19hook_name=${0##*/} 21hook_name=${0##*/}
20hook_directory="/home/plugins/libexec/$hook_name.d" 22hook_directory="/home/plugins/libexec/$hook_name.d"