summaryrefslogtreecommitdiff
path: root/regress/test-exec.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r--regress/test-exec.sh25
1 files changed, 24 insertions, 1 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index b448192e1..c26e47f7f 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: test-exec.sh,v 1.70 2020/01/21 08:06:27 djm Exp $ 1# $OpenBSD: test-exec.sh,v 1.71 2020/01/23 03:42:41 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4#SUDO=sudo 4#SUDO=sudo
@@ -444,6 +444,29 @@ EOF
444# be abused to locally escalate privileges. 444# be abused to locally escalate privileges.
445if [ ! -z "$TEST_SSH_UNSAFE_PERMISSIONS" ]; then 445if [ ! -z "$TEST_SSH_UNSAFE_PERMISSIONS" ]; then
446 echo "StrictModes no" >> $OBJ/sshd_config 446 echo "StrictModes no" >> $OBJ/sshd_config
447else
448 # check and warn if excessive permissions are likely to cause failures.
449 unsafe=""
450 dir="${OBJ}"
451 while test ${dir} != "/"; do
452 perms=`ls -ld ${dir}`
453 case "${perms}" in
454 ?????w????*|????????w?*) unsafe="${unsafe} ${dir}" ;;
455 esac
456 dir=`dirname ${dir}`
457 done
458 if ! test -z "${unsafe}"; then
459 cat <<EOD
460
461WARNING: Unsafe (group or world writable) directory permissions found:
462${unsafe}
463
464These could be abused to locally escalate privileges. If you are
465sure that this is not a risk (eg there are no other users), you can
466bypass this check by setting TEST_SSH_UNSAFE_PERMISSIONS=1
467
468EOD
469 fi
447fi 470fi
448 471
449if [ ! -z "$TEST_SSH_SSHD_CONFOPTS" ]; then 472if [ ! -z "$TEST_SSH_SSHD_CONFOPTS" ]; then