From: Rein Tollevik Date: Tue, 18 Nov 2008 22:16:42 +0000 (+0000) Subject: Only use a db_stat in PATH if it matches our environment. X-Git-Tag: ACLCHECK_0~1077 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=74e4f9051fd3bfde0bd63448fd89468c24a50a2a;p=openldap Only use a db_stat in PATH if it matches our environment. --- diff --git a/tests/scripts/test053-syncprov-glue b/tests/scripts/test053-syncprov-glue index 0a4d70d110..429b17becf 100755 --- a/tests/scripts/test053-syncprov-glue +++ b/tests/scripts/test053-syncprov-glue @@ -476,12 +476,20 @@ if test $RC != 0 ; then exit $RC fi -type db_stat >/dev/null 2>&1 -RC=$? -if test $RC != 0 ; then - echo "Could not find db_stat ($RC)!" +db_stat= +for path in `echo "$PATH" | sed -e 's/:/ /g'`; do + if test -f "$path/db_stat" && \ + "$path/db_stat" -E -h $PRODDIR/db > /dev/null 2>&1 + then + db_stat="$path/db_stat" + break + fi +done + +if test -z "$db_stat" ; then + echo "Could not find a working db_stat in PATH!" lock_bug=1 -elif db_stat -E -h $PRODDIR/db | egrep -q 'HELD .* len:'; then +elif "$db_stat" -E -h $PRODDIR/db | egrep -q 'HELD .* len:'; then echo "WARNING: Glue lock bug hit, next modify could deadlock" lock_bug=2 else