diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-10-02 09:51:52 (GMT) |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-10-02 09:51:52 (GMT) |
commit | 1bb1bee0bf98eb8902eb413ffff01bb326ef40b4 (patch) | |
tree | bbd4e73bac1925fdd9d66fa321cc45f46570f2d5 | |
parent | b1471a257cd4f509c6c369a12f320b930f7a3c93 (diff) | |
download | site-1bb1bee0bf98eb8902eb413ffff01bb326ef40b4.tar.gz |
Run Git hooks as "plugins" user
Our Git hooks modify files in the home directory of the "plugins" user.
-rwxr-xr-x | libexec/plugins-hook | 4 |
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 | ||
15 | set -u | 15 | run_as='plugins' |
16 | 16 | ||
17 | set -u | ||
17 | export PATH='/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' | 18 | export PATH='/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' |
19 | test $(whoami) = "$run_as" || exec sudo -u "$run_as" "$0" "$@" | ||
18 | 20 | ||
19 | hook_name=${0##*/} | 21 | hook_name=${0##*/} |
20 | hook_directory="/home/plugins/libexec/$hook_name.d" | 22 | hook_directory="/home/plugins/libexec/$hook_name.d" |