]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
QA: New check for executeable stacks.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 13 Feb 2010 11:40:02 +0000 (12:40 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 13 Feb 2010 11:40:02 +0000 (12:40 +0100)
Files with executable stacks will not work properly.

pkgs/Constants
tools/quality-agent.d/050-execstacks [new file with mode: 0755]

index 473f12620bd53bad16a9b3463fa9685121e7260b..e86f0e260821224e0a18f0ef65d08760ebc209eb 100644 (file)
@@ -71,3 +71,5 @@ export PKG_SUMMARY PKG_DESCRIPTION=$(strip $(PKG_DESCRIPTION))
 export PKG_DEPS PKG_BUILD_DEPS
 
 export CONTROL_PREIN CONTROL_PREUN CONTROL_POSTIN CONTROL_POSTUN
+
+export QUALITY_AGENT_WHITELIST_EXECSTACK
diff --git a/tools/quality-agent.d/050-execstacks b/tools/quality-agent.d/050-execstacks
new file mode 100755 (executable)
index 0000000..ce384f1
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+. $(dirname ${0})/qa-include
+
+# Also, executable stacks only matter on linux...
+log "Searching for executeable stacks"
+
+command="scanelf -qyRF '%e %p' ${BUILDROOT} 2>/dev/null"
+
+for i in $QUALITY_AGENT_WHITELIST_EXECSTACK; do
+       if [ -n "$FILTER" ]; then
+               FILTER="$FILTER|$i"
+       else
+               FILTER="$i"
+       fi
+done
+
+if [ -n "$FILTER" ]; then
+       log "  Filter: $FILTER"
+       command="$command | grep -vE \"$FILTER\""
+fi
+
+files=$(${command})
+if [ -n "${files}" ]; then
+       log "  QA Notice: The following files contain executable stacks"
+       log "   Files with executable stacks will not work properly (or at all!)"
+       log "   on some architectures/operating systems."
+       log "${files}"
+
+       exit 1
+fi
+
+exit 0