Skip to content

Commit

Permalink
upstream: When checking for unsafe directories, ignore non-directories
Browse files Browse the repository at this point in the history
(ie symlinks, where permissions are not relevant).

OpenBSD-Regress-ID: fb6cfc8b022becb62b2dcb99ed3f072b3326e501
  • Loading branch information
daztucker committed Jan 23, 2020
1 parent 74deb70 commit ba247af
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions regress/test-exec.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $OpenBSD: test-exec.sh,v 1.71 2020/01/23 03:42:41 dtucker Exp $
# $OpenBSD: test-exec.sh,v 1.72 2020/01/23 10:19:59 dtucker Exp $
# Placed in the Public Domain.

#SUDO=sudo
Expand Down Expand Up @@ -449,10 +449,12 @@ else
unsafe=""
dir="${OBJ}"
while test ${dir} != "/"; do
perms=`ls -ld ${dir}`
case "${perms}" in
if test -d "${dir}" ; then
perms=`ls -ld ${dir}`
case "${perms}" in
?????w????*|????????w?*) unsafe="${unsafe} ${dir}" ;;
esac
esac
fi
dir=`dirname ${dir}`
done
if ! test -z "${unsafe}"; then
Expand Down

0 comments on commit ba247af

Please sign in to comment.