summaryrefslogtreecommitdiff
path: root/regress/keys-command.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/keys-command.sh')
-rw-r--r--regress/keys-command.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/regress/keys-command.sh b/regress/keys-command.sh
index 4029e2c78..d166fc589 100644
--- a/regress/keys-command.sh
+++ b/regress/keys-command.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: keys-command.sh,v 1.4 2016/09/26 21:34:38 bluhm Exp $ 1# $OpenBSD: keys-command.sh,v 1.5 2018/11/22 08:48:32 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="authorized keys from command" 4tid="authorized keys from command"
@@ -19,7 +19,8 @@ expected_key_fp=`$SSHKEYGEN -lf $OBJ/rsa.pub | awk '{ print $2 }'`
19 19
20# Establish a AuthorizedKeysCommand in /var/run where it will have 20# Establish a AuthorizedKeysCommand in /var/run where it will have
21# acceptable directory permissions. 21# acceptable directory permissions.
22KEY_COMMAND="/var/run/keycommand_${LOGNAME}" 22KEY_COMMAND="/var/run/keycommand_${LOGNAME}.$$"
23trap "${SUDO} rm -f ${KEY_COMMAND}" 0
23cat << _EOF | $SUDO sh -c "rm -f '$KEY_COMMAND' ; cat > '$KEY_COMMAND'" 24cat << _EOF | $SUDO sh -c "rm -f '$KEY_COMMAND' ; cat > '$KEY_COMMAND'"
24#!/bin/sh 25#!/bin/sh
25echo args: "\$@" >> $OBJ/keys-command-args 26echo args: "\$@" >> $OBJ/keys-command-args
@@ -78,5 +79,3 @@ if [ -x $KEY_COMMAND ]; then
78else 79else
79 echo "SKIPPED: $KEY_COMMAND not executable (/var/run mounted noexec?)" 80 echo "SKIPPED: $KEY_COMMAND not executable (/var/run mounted noexec?)"
80fi 81fi
81
82$SUDO rm -f $KEY_COMMAND