--- bin/misc-functions.sh 2006-05-03 19:04:35.000000000 +0200 +++ bin/misc-functions.sh.orig 2006-04-30 12:07:09.000000000 +0200 @@ -88,18 +88,14 @@ qa_var="QA_TEXTRELS_${ARCH}" [[ -n ${!qa_var} ]] && QA_TEXTRELS=${!qa_var} [[ -n ${QA_STRICT_TEXTRELS} ]] && QA_TEXTRELS="" - QA_TEXTRELS=$(echo ${QA_TEXTRELS}) # strip newlines - f="" - s=$(scanelf -qyRF '"#t%p"' "${D}" | grep -v 'usr/lib/debug/') - s=$(echo ${s}) # strip newlines - # eval needed to get ${QA_TEXTRELS} expanded so bash splits - # words taking account of spaces in quoted words. - eval "for s in ${s}; do - for t in ${QA_TEXTRELS}; do - [[ \${s} =~ \"^\${t}$\" ]] && continue 2 - done - f=\"\${f}\${s}\n\" - done" + f=$(scanelf -qyRF '%t %p' "${D}" | grep -v ' usr/lib/debug/' | \ + gawk ' + BEGIN { split("'"${QA_TEXTRELS}"'", ignore); } + { for (idx in ignore) + if ($NF ~ "^"ignore[idx]"$") + next; + print; + }') if [[ -n ${f} ]] ; then scanelf -qyRF '%T %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-textrel.log echo -ne '\a\n' @@ -111,14 +107,13 @@ echo " For more information, see http://hardened.gentoo.org/pic-fix-guide.xml" echo " Please include this file in your report:" echo " ${T}/scanelf-textrel.log" - printf "${f}" + echo "${f}" echo -ne '\a\n' die_msg="${die_msg} textrels," sleep 1 fi # Also, executable stacks only matter on linux (and just glibc atm ...) - f="" case ${CTARGET:-${CHOST}} in *-linux-gnu*) # Check for files with executable stacks, but only on arches which @@ -135,18 +130,16 @@ qa_var="QA_EXECSTACK_${ARCH}" [[ -n ${!qa_var} ]] && QA_EXECSTACK=${!qa_var} [[ -n ${QA_STRICT_EXECSTACK} ]] && QA_EXECSTACK="" - QA_EXECSTACK=$(echo ${QA_EXECSTACK}) # strip newlines - s=$(scanelf -qyRF '"#e%p"' "${D}" | grep -v 'usr/lib/debug/') - s=$(echo ${s}) # strip newlines - # eval needed to get ${QA_TEXTRELS} expanded so bash splits - # words taking account of spaces in quoted words. - eval "for s in ${s}; do - for e in ${QA_EXECSTACK}; do - [[ \${s} =~ \"^\${e}$\" ]] && continue 2 - done - f=\"\${f}\${s}\n\" - done" + f=$(scanelf -qyRF '%e %p' "${D}" | grep -v ' usr/lib/debug/' | \ + gawk ' + BEGIN { split("'"${QA_EXECSTACK}"'", ignore); } + { for (idx in ignore) + if ($NF ~ "^"ignore[idx]"$") + next; + print; + }') ;; + *) f="" ;; esac ;; esac @@ -161,7 +154,7 @@ echo " For more information, see http://hardened.gentoo.org/gnu-stack.xml" echo " Please include this file in your report:" echo " ${T}/scanelf-execstack.log" - printf "${f}" + echo "${f}" echo -ne '\a\n' die_msg="${die_msg} execstacks" sleep 1