summaryrefslogtreecommitdiffstats
path: root/regress/principals-command.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/principals-command.sh')
-rw-r--r--regress/principals-command.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/regress/principals-command.sh b/regress/principals-command.sh
index 66b5b5bde..197c00021 100644
--- a/regress/principals-command.sh
+++ b/regress/principals-command.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: principals-command.sh,v 1.5 2018/10/31 11:09:27 dtucker Exp $
+# $OpenBSD: principals-command.sh,v 1.6 2018/11/22 08:48:32 dtucker Exp $
# Placed in the Public Domain.
tid="authorized principals command"
@@ -30,7 +30,8 @@ CA_FP=`${SSHKEYGEN} -lf $OBJ/user_ca_key.pub | awk '{ print $2 }'`
# Establish a AuthorizedPrincipalsCommand in /var/run where it will have
# acceptable directory permissions.
-PRINCIPALS_COMMAND="/var/run/principals_command_${LOGNAME}"
+PRINCIPALS_COMMAND="/var/run/principals_command_${LOGNAME}.$$"
+trap "$SUDO rm -f ${PRINCIPALS_COMMAND}" 0
cat << _EOF | $SUDO sh -c "cat > '$PRINCIPALS_COMMAND'"
#!/bin/sh
test "x\$1" != "x${LOGNAME}" && exit 1