[Open-scap] [PATCH 08/17] Clear LD_PRELOAD when calling ps

Marshall Miller mmiller at tresys.com
Wed Jul 13 20:41:46 UTC 2011


The ps on Solaris reports incompatible ELF when libopenscap_testing.so is loaded with LD_PRELOAD
---
 tests/probes/process/test_probes_process.xml.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/probes/process/test_probes_process.xml.sh b/tests/probes/process/test_probes_process.xml.sh
index f41700b..2e33102 100644
--- a/tests/probes/process/test_probes_process.xml.sh
+++ b/tests/probes/process/test_probes_process.xml.sh
@@ -1,18 +1,18 @@
 #!/usr/bin/env bash
 
-TMP_P=(`ps -A -o pid -o ppid -o comm | awk '$1 != 2 && $2 != 2 {print $3}' | \
+TMP_P=(`LD_PRELOAD= ps -A -o pid -o ppid -o comm | awk '$1 != 2 && $2 != 2 {print $3}' | \
         sed -n '2,30p'`)
 
 COUNTER=1
 for I in "${TMP_P[@]}"; do
-    if [ `ps -A | grep $I | wc -l` -eq 1 ]; then
+    if [ `LD_PRELOAD= ps -A -o comm | grep $I | wc -l` -eq 1 ]; then
 	PROCS[$COUNTER]="$I"
 	COUNTER=$[$COUNTER+1];
     fi
 done
 
 function getField {
-    echo `ps -A -o comm -o ${1} | grep ${2} | awk '{ print $2 }'`
+    echo `LD_PRELOAD= ps -A -o comm -o ${1} | grep ${2} | awk '{ print $2 }'`
 }
 
 cat <<EOF
-- 
1.6.2.5




More information about the Open-scap-list mailing list