summaryrefslogtreecommitdiff
path: root/regress/sftp-chroot.sh
diff options
context:
space:
mode:
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 @@
1# $OpenBSD: sftp-chroot.sh,v 1.6 2018/02/09 03:42:57 dtucker Exp $ 1# $OpenBSD: sftp-chroot.sh,v 1.7 2018/11/22 08:48:32 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="sftp in chroot" 4tid="sftp in chroot"
5 5
6CHROOT=/var/run 6CHROOT=/var/run
7FILENAME=testdata_${USER} 7FILENAME=testdata_${USER}.$$
8PRIVDATA=${CHROOT}/${FILENAME} 8PRIVDATA=${CHROOT}/${FILENAME}
9trap "${SUDO} rm -f ${PRIVDATA}" 0
9 10
10if [ -z "$SUDO" -a ! -w /var/run ]; then 11if [ -z "$SUDO" -a ! -w /var/run ]; then
11 echo "need SUDO to create file in /var/run, test won't work without" 12 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 \
28 >>$TEST_REGRESS_LOGFILE 2>&1 || \ 29 >>$TEST_REGRESS_LOGFILE 2>&1 || \
29 fatal "Fetch ${FILENAME} failed" 30 fatal "Fetch ${FILENAME} failed"
30cmp $PRIVDATA $COPY || fail "$PRIVDATA $COPY differ" 31cmp $PRIVDATA $COPY || fail "$PRIVDATA $COPY differ"
31
32$SUDO rm $PRIVDATA