12 . $SRCDIR/scripts/defines.sh $SRCDIR $BDB2
14 echo "Cleaning up in $DBDIR..."
18 echo "Running ldif2ldbm to build slapd database..."
19 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
22 echo "ldif2ldbm failed!"
26 echo "Starting slapd on TCP/IP port $PORT..."
27 $SLAPD -f $ACLCONF -p $PORT -d $LVL > $MASTERLOG 2>&1 &
30 echo "Testing slapd access control..."
31 for i in 0 1 2 3 4 5; do
32 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
33 'cn=Monitor' > /dev/null 2>&1
36 echo "Waiting 5 seconds for slapd to start..."
42 echo "ldapsearch failed!"
47 cat /dev/null > $SEARCHOUT
50 # Try to read an entry inside the Alumni Association container. It should
51 # give us nothing if we're not bound, and should return all attributes
52 # if we're bound as anyone under UM.
54 $LDAPSEARCH -L -b "$JAJDN" -h localhost -p $PORT "objectclass=*" \
57 $LDAPSEARCH -L -b "$JAJDN" -h localhost -p $PORT \
58 -D "$BABSDN" -w bjensen "objectclass=*" >> $SEARCHOUT 2>&1
62 # Try to add a "member" attribute to the "All Staff" group. It should
63 # fail when we add some DN other than our own, and should succeed when
66 $LDAPMODIFY -D "$JAJDN" -h localhost -p $PORT -w jaj > \
67 /dev/null 2>&1 << EOMODS1
68 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
71 member: cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
75 $LDAPMODIFY -D "$JAJDN" -h localhost -p $PORT -w jaj > \
76 /dev/null 2>&1 << EOMODS2
77 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
80 member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
85 # Try to modify the "All Staff" group. Two attempts are made:
86 # 1) bound as "James A Jones 1" - should fail
87 # 2) bound as "Barbara Jensen" - should succeed
89 $LDAPMODIFY -D "$JAJDN" -h localhost -p $PORT -w jaj > \
90 /dev/null 2>&1 << EOMODS3
91 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
97 $LDAPMODIFY -D "$BJORNSDN" -h localhost -p $PORT -w bjorn > \
98 /dev/null 2>&1 << EOMODS4
99 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
102 telephonenumber: +1 810 555 1212
106 echo "Using ldapsearch to retrieve all the entries..."
107 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
108 'objectClass=*' | . $SRCDIR/scripts/acfilter.sh >> $SEARCHOUT 2>&1
111 if [ $RC != 0 ]; then
112 echo "ldapsearch failed!"
116 echo "Comparing database to reference file"
117 cmp $SEARCHOUT $ACLOUTMASTER
119 echo "comparison failed - modify operations did not complete correctly"
123 echo ">>>>> Test succeeded"