From e4ae345dc75b34fd870c2e8690d831d2c1088eb7 Mon Sep 17 00:00:00 2001 From: "dtucker@openbsd.org" Date: Thu, 22 Nov 2018 08:48:32 +0000 Subject: 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 --- regress/sftp-chroot.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'regress/sftp-chroot.sh') diff --git a/regress/sftp-chroot.sh b/regress/sftp-chroot.sh index ba5bd1efb..5acc4d2de 100644 --- a/regress/sftp-chroot.sh +++ b/regress/sftp-chroot.sh @@ -1,11 +1,12 @@ -# $OpenBSD: sftp-chroot.sh,v 1.6 2018/02/09 03:42:57 dtucker Exp $ +# $OpenBSD: sftp-chroot.sh,v 1.7 2018/11/22 08:48:32 dtucker Exp $ # Placed in the Public Domain. tid="sftp in chroot" CHROOT=/var/run -FILENAME=testdata_${USER} +FILENAME=testdata_${USER}.$$ PRIVDATA=${CHROOT}/${FILENAME} +trap "${SUDO} rm -f ${PRIVDATA}" 0 if [ -z "$SUDO" -a ! -w /var/run ]; then echo "need SUDO to create file in /var/run, test won't work without" @@ -28,5 +29,3 @@ ${SFTP} -S "$SSH" -F $OBJ/ssh_config host:/${FILENAME} $COPY \ >>$TEST_REGRESS_LOGFILE 2>&1 || \ fatal "Fetch ${FILENAME} failed" cmp $PRIVDATA $COPY || fail "$PRIVDATA $COPY differ" - -$SUDO rm $PRIVDATA -- cgit v1.2.3