diff options
Diffstat (limited to 'regress/sftp-chroot.sh')
-rw-r--r-- | regress/sftp-chroot.sh | 7 |
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 | ||
4 | tid="sftp in chroot" | 4 | tid="sftp in chroot" |
5 | 5 | ||
6 | CHROOT=/var/run | 6 | CHROOT=/var/run |
7 | FILENAME=testdata_${USER} | 7 | FILENAME=testdata_${USER}.$$ |
8 | PRIVDATA=${CHROOT}/${FILENAME} | 8 | PRIVDATA=${CHROOT}/${FILENAME} |
9 | trap "${SUDO} rm -f ${PRIVDATA}" 0 | ||
9 | 10 | ||
10 | if [ -z "$SUDO" -a ! -w /var/run ]; then | 11 | if [ -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" |
30 | cmp $PRIVDATA $COPY || fail "$PRIVDATA $COPY differ" | 31 | cmp $PRIVDATA $COPY || fail "$PRIVDATA $COPY differ" |
31 | |||
32 | $SUDO rm $PRIVDATA | ||