# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
-## Copyright 1998-2004 The OpenLDAP Foundation.
+## Copyright 1998-2005 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
+echo "### This test requires the ldap backend."
+echo "### If available, and explicitly requested, it can use SASL bind;"
+echo "### note that SASL must be properly set up, and the requested"
+echo "### mechanism must be available. Define SLAPD_USE_SASL={yes|<mech>},"
+echo "### with \"yes\" defaulting to DIGEST-MD5 to enable SASL authc[/authz]."
+
if test $BACKLDAP = "ldapno" ; then
echo "LDAP backend not available, test skipped"
exit 0
fi
+if test $RWM = rwmno ; then
+ echo "Rewrite/remap overlay not available, test skipped"
+ exit 0
+fi
+
if test $WITH_SASL = "yes" ; then
if test $USE_SASL != "no" ; then
if test $USE_SASL = "yes" ; then
else
MECH="$USE_SASL"
fi
- echo "Using SASL authc/authz with mech=$MECH; unset SLAPD_USE_SASL to disable"
+ echo "Using SASL authc[/authz] with mech=$MECH; unset SLAPD_USE_SASL to disable"
else
echo "Using proxyAuthz with simple authc..."
- echo " set SLAPD_USE_SASL={yes|<mech>} to enable SASL authc/authz"
- echo " if SLAPD_USE_SASL=\"yes\", <mech> defaults to DIGEST-MD5"
- echo " FIXME: should be mandatory, right?"
- echo " FIXME: authz with CRAM-MD5 does not work..."
fi
else
echo "SASL not available; using proxyAuthz with simple authc..."
fi
AUTHZID="u:bjorn"
-echo "Testing ldapwhoami as proxy US, $AUTHZID..."
+echo "Testing ldapwhoami as proxy US, $AUTHZID... (should fail)"
$LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "cn=proxy US,ou=Admin,dc=example,dc=com" -w proxy -e\!"authzid=$AUTHZID"
RC=$?
if test $RC != 1 ; then
fi
AUTHZID="u:bjensen"
-echo "Testing ldapwhoami as proxy US, $AUTHZID..."
+echo "Testing ldapwhoami as proxy US, $AUTHZID... (should fail)"
$LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "cn=proxy US,ou=Admin,dc=example,dc=com" -w proxy -e\!"authzid=$AUTHZID"
RC=$?
if test $RC != 1 ; then
fi
AUTHZID="u:it/jaj"
-echo "Testing ldapwhoami as proxy IT, $AUTHZID..."
+echo "Testing ldapwhoami as proxy IT, $AUTHZID... (should fail)"
$LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "cn=proxy IT,ou=Admin,dc=example,dc=com" -w proxy -e\!"authzid=$AUTHZID"
RC=$?
if test $RC != 1 ; then
fi
AUTHZID="u:bjorn"
-echo "Testing ldapwhoami as proxy IT, $AUTHZID..."
+echo "Testing ldapwhoami as proxy IT, $AUTHZID... (should fail)"
$LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "cn=proxy IT,ou=Admin,dc=example,dc=com" -w proxy -e\!"authzid=$AUTHZID"
RC=$?
if test $RC != 1 ; then
if test $? != 0 ; then
echo "comparison failed - search with identity assertion didn't succeed"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
fi
if test $? != 0 ; then
echo "comparison failed - search with SASL bind and identity assertion didn't succeed"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
fi
fi