From: Michael Tremer Date: Sat, 13 Feb 2010 11:40:02 +0000 (+0100) Subject: QA: New check for executeable stacks. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12227ac87c18d93d3a7d06026fcd3f6da5d172c3;p=ipfire-3.x.git QA: New check for executeable stacks. Files with executable stacks will not work properly. --- diff --git a/pkgs/Constants b/pkgs/Constants index 473f12620..e86f0e260 100644 --- a/pkgs/Constants +++ b/pkgs/Constants @@ -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 index 000000000..ce384f1b9 --- /dev/null +++ b/tools/quality-agent.d/050-execstacks @@ -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