5 echo "Cleaning up in $DBDIR..."
9 echo "Running ldif2ldbm to build slapd database..."
10 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
13 echo "ldif2ldbm failed!"
17 echo "Starting slapd on TCP/IP port $PORT..."
18 $SLAPD -f $ACLCONF -p $PORT -d 1 > $MASTERLOG 2>&1 &
21 echo "Testing slapd access control..."
22 for i in 0 1 2 3 4 5; do
23 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
24 'cn=Monitor' > /dev/null 2>&1
27 echo "Waiting 5 seconds for slapd to start..."
33 echo "ldapsearch failed!"
38 cat /dev/null > $SEARCHOUT
41 # Try to read an entry inside the Alumni Association container. It should
42 # give us nothing if we're not bound, and should return all attributes
43 # if we're bound as anyone under UM.
45 $LDAPSEARCH -L -b "$JAJDN" -h localhost -p $PORT "objectclass=*" \
48 $LDAPSEARCH -L -b "$JAJDN" -h localhost -p $PORT \
49 -D "$BABSDN" -w bjensen "objectclass=*" >> $SEARCHOUT 2>&1
53 # Try to add a "member" attribute to the "All Staff" group. It should
54 # fail when we add some DN other than our own, and should succeed when
57 $LDAPMODIFY -D "$JAJDN" -h localhost -p $PORT -w jaj > \
58 /dev/null 2>&1 << EOMODS1
59 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
62 member: cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
66 $LDAPMODIFY -D "$JAJDN" -h localhost -p $PORT -w jaj > \
67 /dev/null 2>&1 << EOMODS2
68 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
71 member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
76 # Try to modify the "All Staff" group. Two attempts are made:
77 # 1) bound as "James A Jones 1" - should fail
78 # 2) bound as "Barbara Jensen" - should succeed
80 $LDAPMODIFY -D "$JAJDN" -h localhost -p $PORT -w jaj > \
81 /dev/null 2>&1 << EOMODS3
82 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
88 $LDAPMODIFY -D "$BJORNSDN" -h localhost -p $PORT -w bjorn > \
89 /dev/null 2>&1 << EOMODS4
90 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
93 telephonenumber: +1 810 555 1212
97 echo "Using ldapsearch to retrieve all the entries..."
98 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
99 'objectClass=*' | egrep -iv '^modifytimestamp|^modifiersname' \
103 if [ $RC != 0 ]; then
104 echo "ldapsearch failed!"
108 echo "Comparing database to reference file"
109 cmp $SEARCHOUT $ACLOUTMASTER
111 echo "comparison failed - modify operations did not complete correctly"
115 echo ">>>>> Test succeeded"