summaryrefslogtreecommitdiffstats
path: root/regress/sftp-chroot.sh
diff options
context:
space:
mode:
authorbluhm@openbsd.org <bluhm@openbsd.org>2016-09-26 23:34:38 +0200
committerDamien Miller <djm@mindrot.org>2016-09-30 22:44:00 +0200
commitce44c970f913d2a047903dba8670554ac42fc479 (patch)
tree27d0a9067e7d9669e5422ba6ef2f2cc9b59fbf48 /regress/sftp-chroot.sh
parentupstream commit (diff)
downloadopenssh-ce44c970f913d2a047903dba8670554ac42fc479.tar.xz
openssh-ce44c970f913d2a047903dba8670554ac42fc479.zip
upstream commit
Allow to run ssh regression tests as root. If the user is already root, the test should not expect that SUDO is set. If ssh needs another user, use sudo or doas to switch from root if necessary. OK dtucker@ Upstream-Regress-ID: b464e55185ac4303529e3e6927db41683aaeace2
Diffstat (limited to 'regress/sftp-chroot.sh')
-rw-r--r--regress/sftp-chroot.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/regress/sftp-chroot.sh b/regress/sftp-chroot.sh
index 9c26eb680..4ea2fce85 100644
--- a/regress/sftp-chroot.sh
+++ b/regress/sftp-chroot.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: sftp-chroot.sh,v 1.4 2014/01/20 00:00:30 dtucker Exp $
+# $OpenBSD: sftp-chroot.sh,v 1.5 2016/09/26 21:34:38 bluhm Exp $
# Placed in the Public Domain.
tid="sftp in chroot"
@@ -7,7 +7,7 @@ CHROOT=/var/run
FILENAME=testdata_${USER}
PRIVDATA=${CHROOT}/${FILENAME}
-if [ -z "$SUDO" ]; then
+if [ -z "$SUDO" -a ! -w /var/run ]; then
echo "skipped: need SUDO to create file in /var/run, test won't work without"
exit 0
fi