]> piware.de Git - bin.git/blobdiff - deb-checkssp
rework SSP checking and for-archive
[bin.git] / deb-checkssp
index 21fe6c158e811b456f4b77f06621024339b499e9..6eab47c6fc11c33b71034fff46025431accf9824 100755 (executable)
@@ -6,15 +6,16 @@
 D=`mktemp -d`
 trap "rm -rf $D" 0 1 2 3 11 13 15
 
-for i; do
-    rm -rf D/*
+[ -f "$1" ] || {
+    echo "Usage: $0 <deb>"
+    exit 1
+}
 
-    dpkg-deb -x "$i" "$D"
-    find "$D" -type f | while read f; do
-       # ignore non-ELF files
-       readelf -h "$f" > /dev/null 2>&1 || continue
-       nm -D "$f" | grep -q __stack_chk_fail || {
-           echo "$i: ${f#$D} not built with SSP"
-       }
-    done
+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