diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2020-01-23 10:19:59 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2020-01-23 22:20:53 +1100 |
commit | ba247af8e9e302910e22881ef9d307a8afeef036 (patch) | |
tree | 02cc3111229fb84e4cee13888e12df601f2a2eb8 /regress/test-exec.sh | |
parent | 74deb7029be4c00810443114aac9308875a81dae (diff) |
upstream: When checking for unsafe directories, ignore non-directories
(ie symlinks, where permissions are not relevant).
OpenBSD-Regress-ID: fb6cfc8b022becb62b2dcb99ed3f072b3326e501
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index c26e47f7f..f17f9493d 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: test-exec.sh,v 1.71 2020/01/23 03:42:41 dtucker Exp $ | 1 | # $OpenBSD: test-exec.sh,v 1.72 2020/01/23 10:19:59 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | #SUDO=sudo | 4 | #SUDO=sudo |
@@ -449,10 +449,12 @@ else | |||
449 | unsafe="" | 449 | unsafe="" |
450 | dir="${OBJ}" | 450 | dir="${OBJ}" |
451 | while test ${dir} != "/"; do | 451 | while test ${dir} != "/"; do |
452 | perms=`ls -ld ${dir}` | 452 | if test -d "${dir}" ; then |
453 | case "${perms}" in | 453 | perms=`ls -ld ${dir}` |
454 | case "${perms}" in | ||
454 | ?????w????*|????????w?*) unsafe="${unsafe} ${dir}" ;; | 455 | ?????w????*|????????w?*) unsafe="${unsafe} ${dir}" ;; |
455 | esac | 456 | esac |
457 | fi | ||
456 | dir=`dirname ${dir}` | 458 | dir=`dirname ${dir}` |
457 | done | 459 | done |
458 | if ! test -z "${unsafe}"; then | 460 | if ! test -z "${unsafe}"; then |