authzFrom: dn.children:ou=Alumni Association,ou=People,dc=example
,dc=com
authzFrom: dn.subtree:ou=Groups,dc=example,dc=com
-authzFrom: ldap:///dc=example,dc=com??sub?uid=fail
authzTo: dn.exact:cn=Barbara Jensen,ou=Information Technology Division,ou=Peop
le,dc=example,dc=com
authzTo: u:melliot
le,dc=com
authzTo: dn.onelevel:ou=Information Technology Division,ou=People,dc=example,dc=com
authzTo: dn.regex:^cn=Dorothy.*dc=example,dc=com$
-authzTo: dn.children:ou=Alumni Association,ou=People,dc=example,d
- c=com
+authzTo: dn.children:ou=Alumni Association,ou=People,dc=example,dc=com
authzTo: dn.subtree:ou=Groups,dc=example,dc=com
-authzTo: ldap:///dc=example,dc=com??sub?uid=fail
dn: cn=Dorothy Stevens,ou=Alumni Association,ou=People,dc=example,dc=com
objectclass: OpenLDAPperson
-e \!authzid="$AUTHZID"
RC=$?
-if test $RC != 1 ; then
+case $RC in
+1)
+ ;;
+0)
+ echo "ldapwhoami should have failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit -1
+ ;;
+*)
echo "ldapwhoami failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
-fi
+ ;;
+esac
BINDDN="cn=Must Fail,dc=example,dc=com"
BINDPW=fail
-e \!authzid="$AUTHZID"
RC=$?
-if test $RC != 1 ; then
+case $RC in
+1)
+ ;;
+0)
+ echo "ldapwhoami should have failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit -1
+ ;;
+*)
echo "ldapwhoami failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
-fi
+ ;;
+esac
# authzTo: bjorn => someone else
echo "Testing authzTo..."
-e \!authzid="$AUTHZID"
RC=$?
-if test $RC != 1 ; then
+case $RC in
+1)
+ ;;
+0)
+ echo "ldapwhoami should have failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit -1
+ ;;
+*)
echo "ldapwhoami failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
-fi
+ ;;
+esac
BINDDN="cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com"
BINDPW=bjorn
-e \!authzid="$AUTHZID"
RC=$?
-if test $RC != 1 ; then
+case $RC in
+1)
+ ;;
+0)
+ echo "ldapwhoami should have failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit -1
+ ;;
+*)
echo "ldapwhoami failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
-fi
+ ;;
+esac
BINDDN="cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com"
BINDPW=bjorn