#!/bin/sh -e # check given debs for SSP and print out the deb and filename of non-SSP ELF # files D=`mktemp -d` trap "rm -rf $D" 0 1 2 3 11 13 15 [ -f "$1" ] || { echo "Usage: $0 " exit 1 } dpkg-deb -x "$1" "$D" find "$D" -type f | while read f; do # ignore non-ELF files readelf -h "$f" > /dev/null 2>&1 || continue strings "$f" | grep -q __stack_chk_fail || { echo "$1: ${f#$D} not built with SSP" } done