From b97c9e45ff37ee6d6135a525a3c784136adcf188 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Mon, 29 Jul 2019 18:42:41 -0400 Subject: query authorized_keys.d in ssh-forced-command --- hooks/post-receive | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'hooks') diff --git a/hooks/post-receive b/hooks/post-receive index 74fe96b..72dc81d 100755 --- a/hooks/post-receive +++ b/hooks/post-receive @@ -15,38 +15,5 @@ warn() fi } -GET_NOMIC_USER() -{ - if [ "$NOMIC_USER" ] - then - return - elif [ "$SSH_USER_AUTH" ] && [ -f "$SSH_USER_AUTH" ] - then - read authtype keytype keyval < "$SSH_USER_AUTH" - [ "$authtype" = publickey ] || exit - - for keyname in authorized_keys.d/* - do - while read a b _ - do - case "$a $b" in - "$keytype $keyval") - NOMIC_USER=${keyname#authorized_keys.d/} - break - ;; - esac - done < "$keyname" - done - true - else - warn "\$SSH_USER_AUTH missing. Try putting 'ExposeAuthInfo yes' in /etc/ssh/sshd_config" - false - fi -} - GIT_WORK_TREE=. git checkout -f master -- authorized_keys.d/\* -if GET_NOMIC_USER -then - warn "NOMIC_USER=$NOMIC_USER" -fi -- cgit v1.2.3