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 @@ -# $OpenBSD: test-exec.sh,v 1.70 2020/01/21 08:06:27 djm Exp $ +# $OpenBSD: test-exec.sh,v 1.71 2020/01/23 03:42:41 dtucker Exp $ # Placed in the Public Domain. #SUDO=sudo @@ -444,6 +444,29 @@ EOF # be abused to locally escalate privileges. if [ ! -z "$TEST_SSH_UNSAFE_PERMISSIONS" ]; then echo "StrictModes no" >> $OBJ/sshd_config +else + # check and warn if excessive permissions are likely to cause failures. + unsafe="" + dir="${OBJ}" + while test ${dir} != "/"; do + perms=`ls -ld ${dir}` + case "${perms}" in + ?????w????*|????????w?*) unsafe="${unsafe} ${dir}" ;; + esac + dir=`dirname ${dir}` + done + if ! test -z "${unsafe}"; then + cat <