diff options
Diffstat (limited to 'regress/keys-command.sh')
-rw-r--r-- | regress/keys-command.sh | 7 |
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 | ||
4 | tid="authorized keys from command" | 4 | tid="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. |
22 | KEY_COMMAND="/var/run/keycommand_${LOGNAME}" | 22 | KEY_COMMAND="/var/run/keycommand_${LOGNAME}.$$" |
23 | trap "${SUDO} rm -f ${KEY_COMMAND}" 0 | ||
23 | cat << _EOF | $SUDO sh -c "rm -f '$KEY_COMMAND' ; cat > '$KEY_COMMAND'" | 24 | cat << _EOF | $SUDO sh -c "rm -f '$KEY_COMMAND' ; cat > '$KEY_COMMAND'" |
24 | #!/bin/sh | 25 | #!/bin/sh |
25 | echo args: "\$@" >> $OBJ/keys-command-args | 26 | echo args: "\$@" >> $OBJ/keys-command-args |
@@ -78,5 +79,3 @@ if [ -x $KEY_COMMAND ]; then | |||
78 | else | 79 | else |
79 | echo "SKIPPED: $KEY_COMMAND not executable (/var/run mounted noexec?)" | 80 | echo "SKIPPED: $KEY_COMMAND not executable (/var/run mounted noexec?)" |
80 | fi | 81 | fi |
81 | |||
82 | $SUDO rm -f $KEY_COMMAND | ||