From 3bacb800d4462703184b2a1b62d60339ca1cb9ef Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 19 Jun 2000 20:53:56 +0000 Subject: [PATCH] unrecognized objectIdentifer in desc form shall result in an undefined matched. unrecognized objectIdentifer in OID form shall result in false match. --- servers/slapd/schema_prep.c | 13 ++++++++++++- servers/slapd/value.c | 3 +-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index d2bcae6679..837083b14e 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -36,7 +36,18 @@ objectClassMatch( ObjectClass *oc = oc_find( value->bv_val ); ObjectClass *asserted = oc_find( a->bv_val ); - if( asserted == NULL || oc == NULL ) { + if( asserted == NULL ) { + if( isdigit( *value.bv_val ) ) { + /* OID form, return FALSE */ + *matchp = 1; + return LDAP_SUCCESS; + } + + /* desc form, return undefined */ + return LDAP_CONSTRAINT_VIOLATION; + } + + if ( oc == NULL ) { return LDAP_CONSTRAINT_VIOLATION; } diff --git a/servers/slapd/value.c b/servers/slapd/value.c index 74434b6126..0ddd2518e5 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -187,8 +187,7 @@ int value_find( rc = value_match( &match, ad, mr, vals[i], nval == NULL ? val : nval, &text ); - if( rc == LDAP_SUCCESS && match == 0 ) - { + if( rc == LDAP_SUCCESS && match == 0 ) { return LDAP_SUCCESS; } }