summaryrefslogtreecommitdiffstats
path: root/regress/sftp-chroot.sh
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2018-11-22 09:48:32 +0100
committerDarren Tucker <dtucker@dtucker.net>2018-11-22 10:58:27 +0100
commite4ae345dc75b34fd870c2e8690d831d2c1088eb7 (patch)
tree3f48b32dd7835a20f41a5b5f26ba9a05207e18e0 /regress/sftp-chroot.sh
parentupstream: UsePrivilegeSeparation no is deprecated (diff)
downloadopenssh-e4ae345dc75b34fd870c2e8690d831d2c1088eb7.tar.xz
openssh-e4ae345dc75b34fd870c2e8690d831d2c1088eb7.zip
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/sftp-chroot.sh')
-rw-r--r--regress/sftp-chroot.sh7
1 files changed, 3 insertions, 4 deletions
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