]> piware.de Git - bin.git/blob - deb-checkssp
add scandoc
[bin.git] / deb-checkssp
1 #!/bin/sh -e
2
3 # check given debs for SSP and print out the deb and filename of non-SSP ELF
4 # files
5
6 D=`mktemp -d`
7 trap "rm -rf $D" 0 1 2 3 11 13 15
8
9 [ -f "$1" ] || {
10     echo "Usage: $0 <deb>"
11     exit 1
12 }
13
14 dpkg-deb -x "$1" "$D"
15 find "$D" -type f | while read f; do
16     # ignore non-ELF files
17     readelf -h "$f" > /dev/null 2>&1 || continue
18     strings "$f" | grep -q __stack_chk_fail || {
19         echo "$1: ${f#$D} not built with SSP"
20     }
21 done