return -1;
}
-#if 0
- Debug( LDAP_DEBUG_TRACE, "Merging oc [%ld] %s\n",
- (long) val.bv_len, val.bv_val, 0 );
-#endif
nval.bv_val = oc->soc_oid;
nval.bv_len = strlen(oc->soc_oid);
+#if 0
+ Debug( LDAP_DEBUG_TRACE, "Merging oc [%ld] %s (%s)\n",
+ (long) val.bv_len, val.bv_val, nval.bv_val );
+#endif
+
if( attr_merge_one( e, ad_objectClasses, &val, &nval ) )
{
return -1;
void *ctx )
{
int rc;
- struct berval oid;
- ber_len_t len = 0;
+ struct berval comp;
+ ber_len_t len;
- if( val->bv_len == 0 ) return LDAP_INVALID_SYNTAX;
+ if( SLAP_MR_IS_VALUE_OF_ASSERTION_SYNTAX( usage )) {
+ ber_dupbv_x( normalized, val, ctx );
+ return LDAP_SUCCESS;
+ }
- if( val->bv_val[0] == '(' /*')'*/ ||
- val->bv_val[0] == '{' /*'}'*/ )
+ if( val->bv_len < 3 ) return LDAP_INVALID_SYNTAX;
+
+ if( val->bv_val[0] != '(' /*')'*/ &&
+ val->bv_val[0] != '{' /*'}'*/ )
{
- len = 1;
+ return LDAP_INVALID_SYNTAX;
}
/* trim leading white space */
- for( ;
+ for( len=1;
len < val->bv_len && ASCII_SPACE(val->bv_val[len]);
len++ )
{
}
/* grab next word */
- oid.bv_val = &val->bv_val[len];
+ comp.bv_val = &val->bv_val[len];
len = val->bv_len - len;
- for( oid.bv_len=0;
- !ASCII_SPACE(oid.bv_val[oid.bv_len]) && oid.bv_len < len;
- oid.bv_len++ )
+ for( comp.bv_len=0;
+ !ASCII_SPACE(comp.bv_val[comp.bv_len]) && comp.bv_len < len;
+ comp.bv_len++ )
{
/* empty */
}
if( mr == slap_schema.si_mr_objectIdentifierFirstComponentMatch ) {
- rc = numericoidValidate( NULL, &oid );
+ rc = numericoidValidate( NULL, &comp );
} else if( mr == slap_schema.si_mr_integerFirstComponentMatch ) {
- rc = integerValidate( NULL, &oid );
+ rc = integerValidate( NULL, &comp );
} else {
rc = LDAP_INVALID_SYNTAX;
}
if( rc == LDAP_SUCCESS ) {
- ber_dupbv_x( normalized, &oid, ctx );
+ ber_dupbv_x( normalized, &comp, ctx );
}
return rc;
echo "Using ldapsearch to retrieve the root DSE..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -b "" -s base -h $LOCALHOST -p $PORT1 '+extensibleObject' > $SEARCHOUT 2>&1
+ $LDAPSEARCH -b "" -s base -h $LOCALHOST -p $PORT1 \
+ '+extensibleObject' > $SEARCHOUT 2>&1
RC=$?
if test $RC = 0 ; then
break
sleep 5
done
+if test $RC = 0 ; then
+ echo "Using ldapsearch to retrieve the cn=Subschema..."
+ $LDAPSEARCH -b "cn=Subschema" -s base -h $LOCALHOST -p $PORT1 \
+ '(objectClasses=2.5.6.0)' cn objectClass >> $SEARCHOUT 2>&1
+ RC=$?
+
+fi
+
if test $RC = 0 -a $MONITORDB = yes ; then
echo "Using ldapsearch to retrieve the cn=Monitor..."
- $LDAPSEARCH -b "cn=Monitor" -s base -h $LOCALHOST -p $PORT1 '+extensibleObject' >> $SEARCHOUT 2>&1
+ $LDAPSEARCH -b "cn=Monitor" -s base -h $LOCALHOST -p $PORT1 \
+ '+extensibleObject' >> $SEARCHOUT 2>&1
RC=$?
fi
cat $SEARCHOUT
+
if test $RC != 0 ; then
echo ">>>>> Test failed"
else
- if grep "TLS:" $SEARCHOUT; then
- RC=-1
+ RC=`grep '^dn:' $SEARCHOUT | wc -l`
+ if test $RC != 3 ; then
+ echo ">>>>> Test failed: expected 3 entries, got" $RC
+ RC=1
else
- echo ">>>>> Test succeeded"
+ echo ">>>>> Test succeeded"
+ RC=0
fi
fi