Skip to content

Commit

Permalink
Add Test Validating Stack is not Executable in playTests.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhandte committed Jan 4, 2022
1 parent 9a9d1ec commit 35208f7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/playTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,15 @@ zstd -d -f tmp_corrupt.zst --no-check
zstd -d -f tmp_corrupt.zst --check --no-check # final flag overrides
zstd -d -f tmp.zst --no-check

if [ "$isWindows" = false ]; then
if [ -n "$(which readelf)" ]; then
println "test: check if binary has executable stack"
file "$ZSTD_BIN"
readelf -lW "$ZSTD_BIN"
readelf -lW "$ZSTD_BIN" | grep 'GNU_STACK .* RW ' || die "zstd binary has executable stack!"
fi
fi

println "\n===> zstdgrep tests"
ln -sf "$ZSTD_BIN" zstdcat
rm -f tmp_grep
Expand Down

0 comments on commit 35208f7

Please sign in to comment.