From 61b10db5d6923fb8a6df1e4158300fb9d3c613db Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 17 Jan 2017 12:43:38 +0000 Subject: [PATCH] perform read test on file, not just permission check svn path=/trunk/; revision=51 --- static.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static.sh b/static.sh index 56d3a25..bf109ed 100755 --- a/static.sh +++ b/static.sh @@ -35,7 +35,7 @@ if printf '%s' "${HTTP_RANGE}" |grep -qE '^bytes=[0-9]+-[0-9]*\r?$'; then _bend="${_range#*-}" fi -if [ -x "$file" -o \! -r "$file" -o \! -f "$file" ]; then +if ! [ -f "$file" ] || [ -x "$file" ] || ! grep -qm1 '' "$file" ; then printf 'Status:403 Forbidden\r\n\r\n' elif [ "$date" = "$cachedate" ]; then printf 'Status:304 Not Modified\r\n' -- 2.39.2