]> piware.de Git - bin.git/commitdiff
rework SSP checking and for-archive
authormartin@piware.de <>
Wed, 6 Sep 2006 10:31:19 +0000 (12:31 +0200)
committermartin@piware.de <>
Wed, 6 Sep 2006 10:31:19 +0000 (12:31 +0200)
deb-checkssp
for-archive

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
index 4ef14e51fc5e936460e3338436754a590a32a378..d3930f15e9587459b3dcc2f11f2a2bbf6fb531d4 100755 (executable)
@@ -11,4 +11,4 @@ cmd=`which "$3"` || true
 list=`readlink -f "$1"`
 
 cd "$2"
-zgrep ^Filename: "$list" | cut -f 2- -d\  | xargs $cmd
+zgrep ^Filename: "$list" | cut -f 2- -d\  | xargs -l1 $cmd