]> git.sur5r.net Git - openldap/commitdiff
Only use a db_stat in PATH if it matches our environment.
authorRein Tollevik <rein@openldap.org>
Tue, 18 Nov 2008 22:16:42 +0000 (22:16 +0000)
committerRein Tollevik <rein@openldap.org>
Tue, 18 Nov 2008 22:16:42 +0000 (22:16 +0000)
tests/scripts/test053-syncprov-glue

index 0a4d70d110a4b15bee5c76947efd982b357b2b3b..429b17becfc32c1e4446e611b33c3040d213ccbe 100755 (executable)
@@ -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