summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2023-01-13 04:23:01 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2023-01-13 04:23:01 +0000
commit1d938ac0c12d55246d73bc0fd7e73a38472ae1ca (patch)
tree48897bdc3df82e6f1856f7013a0a5755bfc9f6ad /regress
parent682022e5bb09e6eefbe9f45aa5f40c2ff5466f35 (diff)
Add scp's path to test sshd's PATH.
If the scp we're testing is fully qualified (eg it's not in the system PATH) then add its path to the under-test sshd's PATH so we can find it. Prompted by bz#3518.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/ssh/test-exec.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/test-exec.sh b/regress/usr.bin/ssh/test-exec.sh
index 55874921ea7..8f26b596175 100644
--- a/regress/usr.bin/ssh/test-exec.sh
+++ b/regress/usr.bin/ssh/test-exec.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: test-exec.sh,v 1.92 2022/07/25 07:12:45 dtucker Exp $
+# $OpenBSD: test-exec.sh,v 1.93 2023/01/13 04:23:00 dtucker Exp $
# Placed in the Public Domain.
#SUDO=sudo
@@ -332,6 +332,13 @@ cat << EOF > $OBJ/sshd_config
Subsystem sftp $SFTPSERVER
EOF
+# If we're testing a non-installed scp, add its directory to sshd's PATH
+# so we can test it.
+case "$SCP" in
+/*) PATH_WITH_SCP="`dirname $SCP`:$PATH"
+ echo " SetEnv PATH='$PATH_WITH_SCP'" >>$OBJ/sshd_config ;;
+esac
+
# This may be necessary if /usr/src and/or /usr/obj are group-writable,
# but if you aren't careful with permissions then the unit tests could
# be abused to locally escalate privileges.