diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2018-11-22 08:48:32 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2018-11-22 20:58:27 +1100 |
commit | e4ae345dc75b34fd870c2e8690d831d2c1088eb7 (patch) | |
tree | 3f48b32dd7835a20f41a5b5f26ba9a05207e18e0 /regress/principals-command.sh | |
parent | f72d0f52effca5aa20a193217346615ecd3eed53 (diff) |
upstream: Append pid to temp files in /var/run and set a cleanup
trap for them. This allows multiple instances of tests to run without
colliding.
OpenBSD-Regress-ID: 57add105ecdfc54752d8003acdd99eb68c3e0b4c
Diffstat (limited to 'regress/principals-command.sh')
-rw-r--r-- | regress/principals-command.sh | 5 |
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 @@ | |||
1 | # $OpenBSD: principals-command.sh,v 1.5 2018/10/31 11:09:27 dtucker Exp $ | 1 | # $OpenBSD: principals-command.sh,v 1.6 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 principals command" | 4 | tid="authorized principals command" |
@@ -30,7 +30,8 @@ CA_FP=`${SSHKEYGEN} -lf $OBJ/user_ca_key.pub | awk '{ print $2 }'` | |||
30 | 30 | ||
31 | # Establish a AuthorizedPrincipalsCommand in /var/run where it will have | 31 | # Establish a AuthorizedPrincipalsCommand in /var/run where it will have |
32 | # acceptable directory permissions. | 32 | # acceptable directory permissions. |
33 | PRINCIPALS_COMMAND="/var/run/principals_command_${LOGNAME}" | 33 | PRINCIPALS_COMMAND="/var/run/principals_command_${LOGNAME}.$$" |
34 | trap "$SUDO rm -f ${PRINCIPALS_COMMAND}" 0 | ||
34 | cat << _EOF | $SUDO sh -c "cat > '$PRINCIPALS_COMMAND'" | 35 | cat << _EOF | $SUDO sh -c "cat > '$PRINCIPALS_COMMAND'" |
35 | #!/bin/sh | 36 | #!/bin/sh |
36 | test "x\$1" != "x${LOGNAME}" && exit 1 | 37 | test "x\$1" != "x${LOGNAME}" && exit 1 |