9 . $SRCDIR/scripts/defines.sh $SRCDIR
11 echo "Cleaning up in $DBDIR..."
15 echo "Running ldif2ldbm to build slapd database..."
16 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
19 echo "ldif2ldbm failed!"
23 echo "Starting slapd on TCP/IP port $PORT..."
24 $SLAPD -f $ACLCONF -p $PORT -d 1 > $MASTERLOG 2>&1 &
27 echo "Testing slapd access control..."
28 for i in 0 1 2 3 4 5; do
29 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
30 'cn=Monitor' > /dev/null 2>&1
33 echo "Waiting 5 seconds for slapd to start..."
39 echo "ldapsearch failed!"
44 cat /dev/null > $SEARCHOUT
47 # Try to read an entry inside the Alumni Association container. It should
48 # give us nothing if we're not bound, and should return all attributes
49 # if we're bound as anyone under UM.
51 $LDAPSEARCH -L -b "$JAJDN" -h localhost -p $PORT "objectclass=*" \
54 $LDAPSEARCH -L -b "$JAJDN" -h localhost -p $PORT \
55 -D "$BABSDN" -w bjensen "objectclass=*" >> $SEARCHOUT 2>&1
59 # Try to add a "member" attribute to the "All Staff" group. It should
60 # fail when we add some DN other than our own, and should succeed when
63 $LDAPMODIFY -D "$JAJDN" -h localhost -p $PORT -w jaj > \
64 /dev/null 2>&1 << EOMODS1
65 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
68 member: cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
72 $LDAPMODIFY -D "$JAJDN" -h localhost -p $PORT -w jaj > \
73 /dev/null 2>&1 << EOMODS2
74 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
77 member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
82 # Try to modify the "All Staff" group. Two attempts are made:
83 # 1) bound as "James A Jones 1" - should fail
84 # 2) bound as "Barbara Jensen" - should succeed
86 $LDAPMODIFY -D "$JAJDN" -h localhost -p $PORT -w jaj > \
87 /dev/null 2>&1 << EOMODS3
88 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
94 $LDAPMODIFY -D "$BJORNSDN" -h localhost -p $PORT -w bjorn > \
95 /dev/null 2>&1 << EOMODS4
96 dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
99 telephonenumber: +1 810 555 1212
103 echo "Using ldapsearch to retrieve all the entries..."
104 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
105 'objectClass=*' | . $SRCDIR/scripts/acfilter.sh >> $SEARCHOUT 2>&1
108 if [ $RC != 0 ]; then
109 echo "ldapsearch failed!"
113 echo "Comparing database to reference file"
114 cmp $SEARCHOUT $ACLOUTMASTER
116 echo "comparison failed - modify operations did not complete correctly"
120 echo ">>>>> Test succeeded"