ID id;
ID2 id2;
char *ptr;
- int rc;
+ int rc = 0;
unsigned int x;
unsigned int nrlen, rlen;
diskNode *d;
id = isc->id;
while (id) {
- x = mdb_id2l_search( isc->scopes, id );
- if ( x <= isc->scopes[0].mid && isc->scopes[x].mid == id ) {
- if ( !isc->scopes[x].mval.mv_data ) {
- isc->nscope = x;
- return MDB_SUCCESS;
- }
- data = isc->scopes[x].mval;
- rc = 1;
- } else {
+ if ( !rc ) {
key.mv_data = &id;
rc = mdb_cursor_get( isc->mc, &key, &data, MDB_SET );
if ( rc )
isc->rdns[isc->numrdns].bv_val = d->nrdn+nrlen+1;
isc->numrdns++;
-
if (!rc && id != isc->id) {
id2.mid = id;
id2.mval = data;
ptr = data.mv_data;
ptr += data.mv_size - sizeof(ID);
memcpy( &id, ptr, sizeof(ID) );
+ x = mdb_id2l_search( isc->scopes, id );
+ if ( x <= isc->scopes[0].mid && isc->scopes[x].mid == id ) {
+ if ( !isc->scopes[x].mval.mv_data ) {
+ isc->nscope = x;
+ return MDB_SUCCESS;
+ }
+ data = isc->scopes[x].mval;
+ rc = 1;
+ }
if ( op->ors_scope == LDAP_SCOPE_ONELEVEL )
break;
}
exit $RC
fi
-cat /dev/null > $SEARCHOUT
-
echo "Testing exact searching..."
+echo "# Testing exact searching..." > $SEARCHOUT
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(sn=jENSEN)' >> $SEARCHOUT 2>&1
RC=$?
fi
echo "Testing approximate searching..."
+echo "# Testing approximate searching..." >> $SEARCHOUT
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(sn~=jENSEN)' name >> $SEARCHOUT 2>&1
RC=$?
fi
echo "Testing OR searching..."
+echo "# Testing OR searching..." >> $SEARCHOUT
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(|(givenname=Xx*yY*Z)(cn=)(undef=*)(objectclass=groupofnames)(sn=jones)(member=cn=Manager,dc=example,dc=com)(uniqueMember=cn=Manager,dc=example,dc=com))' >> $SEARCHOUT 2>&1
RC=$?
fi
echo "Testing AND matching and ends-with searching..."
+echo "# Testing AND matching and ends-with searching..." >> $SEARCHOUT
$LDAPSEARCH -S "" -b "ou=groups,$BASEDN" -s one -h $LOCALHOST -p $PORT1 \
'(&(objectclass=groupofnames)(cn=A*)(member=cn=Mark Elliot,ou=Alumni Association,ou=People,dc=example,dc=com))' >> $SEARCHOUT 2>&1
RC=$?
fi
echo "Testing NOT searching..."
+echo "# Testing NOT searching..." >> $SEARCHOUT
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1
RC=$?
fi
echo "Testing objectClass/attributeType inheritance ..."
+echo "# Testing objectClass/attributeType inheritance ..." >> $SEARCHOUT
$LDAPSEARCH -M -a never -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(&(objectClass=inetorgperson)(userid=uham))' \
"2.5.4.0" "userid" >> $SEARCHOUT 2>&1