From 08cc781298e3bebe234f75b609af914ac65a94a4 Mon Sep 17 00:00:00 2001 From: "martin@piware.de" <> Date: Wed, 6 Sep 2006 12:31:19 +0200 Subject: [PATCH] rework SSP checking and for-archive --- deb-checkssp | 21 +++++++++++---------- for-archive | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/deb-checkssp b/deb-checkssp index 21fe6c1..6eab47c 100755 --- a/deb-checkssp +++ b/deb-checkssp @@ -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 " + 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 diff --git a/for-archive b/for-archive index 4ef14e5..d3930f1 100755 --- a/for-archive +++ b/for-archive @@ -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 -- 2.39.5