# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
-## Copyright 1998-2006 The OpenLDAP Foundation.
+## Copyright 1998-2011 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
echo "Testing ldapwhoami as proxy US, $AUTHZID..."
$LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "cn=proxy US,ou=Admin,dc=example,dc=com" -w proxy -e\!"authzid=$AUTHZID"
RC=$?
-if test $RC != 0 ; then
+if test $RC != 0 && test $BACKEND != null ; then
echo "ldapwhoami failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
if test $RC != 1 ; then
echo "ldapwhoami should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
AUTHZID="u:bjensen"
if test $RC != 1 ; then
echo "ldapwhoami should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
echo "Testing ldapwhoami as proxy IT..."
if test $RC != 1 ; then
echo "ldapwhoami should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
AUTHZID="u:bjorn"
if test $RC != 1 ; then
echo "ldapwhoami should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
AUTHZID="dn:cn=Sandbox,ou=Admin,dc=example,dc=com"
echo "Testing ldapwhoami as proxy IT, $AUTHZID..."
$LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "cn=proxy IT,ou=Admin,dc=example,dc=com" -w proxy -e\!"authzid=$AUTHZID"
RC=$?
-if test $RC != 0 ; then
+if test $RC != 0 && test $BACKEND != null ; then
echo "ldapwhoami failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
-D "$ID" -w jaj > $SEARCHOUT 2>&1
RC=$?
-if test $RC != 0 ; then
+if test $RC != 0 && test $BACKEND != null ; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+$LDIFFILTER -s ldif=e < $SEARCHOUT > $SEARCHFLT
echo "Filtering original ldif used to create database..."
-. $LDIFFILTER < $IDASSERTOUT > $LDIFFLT
+$LDIFFILTER -s ldif=e < $IDASSERTOUT > $LDIFFLT
echo "Comparing filter output..."
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
-
+
if test $? != 0 ; then
echo "comparison failed - search with identity assertion didn't succeed"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
fi
echo "Filtering ldapsearch results..."
- . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+ $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
echo "Filtering original ldif used to create database..."
- . $LDIFFILTER < $IDASSERTOUT > $LDIFFLT
+ $LDIFFILTER < $IDASSERTOUT > $LDIFFLT
echo "Comparing filter output..."
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"
-exit 0
+test $KILLSERVERS != no && wait
+
+exit 0