#!/bin/bash PATHTOLIST=`echo ${PATH} | sed s/:/" "/g` EXECDIRS="${PATHTOLIST} /usr/libexec" ELFBINS="" for i in ${EXECDIRS}; do echo "Searching directory $i..."; ELFBINS=`find $i -type f -exec sh -c \ "file {} | grep ELF" \; |awk -F":" '{print$1}';` for c in ${ELFBINS}; do ldd $c |& grep -q $2; if [ $? == 0 ]; then echo -e "Fixing $c"; #Check if we need to create the #PT_PAX_FLAGS header paxctl -v $c &> /dev/null; if [ $? == 1 ]; then paxctl -C $c; fi paxctl $1 $c; fi done done