]> piware.de Git - bin.git/commitdiff
add deb-checkssp
authormartin@piware.de <>
Wed, 6 Sep 2006 10:19:30 +0000 (12:19 +0200)
committermartin@piware.de <>
Wed, 6 Sep 2006 10:19:30 +0000 (12:19 +0200)
deb-checkssp [new file with mode: 0755]

diff --git a/deb-checkssp b/deb-checkssp
new file mode 100755 (executable)
index 0000000..21fe6c1
--- /dev/null
@@ -0,0 +1,20 @@
+#!/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
+
+for i; do
+    rm -rf D/*
+
+    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
+done