From: Kurt Zeilenga Date: Sat, 16 Sep 2006 11:48:52 +0000 (+0000) Subject: return structuralObjectClass errors X-Git-Tag: OPENLDAP_REL_ENG_2_3_MP~124 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2c4b2b5566e14bbda986be58733d16c94f8b5e35;p=openldap return structuralObjectClass errors (likely need to be applied to other backends) --- diff --git a/servers/slapd/add.c b/servers/slapd/add.c index b69f7a720d..e00f6d1a40 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -639,10 +639,16 @@ int slap_add_opattrs( if ( oc ) { rc = structural_class( oc->a_vals, &tmp, NULL, text, textbuf, textlen ); - if( rc != LDAP_SUCCESS ) return rc; - - attr_merge_one( op->ora_e, slap_schema.si_ad_structuralObjectClass, - &tmp, NULL ); + if( rc == LDAP_SUCCESS ) { + attr_merge_one( op->ora_e, + slap_schema.si_ad_structuralObjectClass, + &tmp, NULL ); + + } else if ( !SLAP_NO_SCHEMA_CHECK( op->o_bd ) && + !get_no_schema_check( op ) ) + { + return rc; + } } } @@ -736,5 +742,6 @@ int slap_add_opattrs( slap_schema.si_ad_modifyTimestamp, ×tamp, NULL ); } } + return LDAP_SUCCESS; } diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 918ee89a74..b66f19f6db 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -93,7 +93,13 @@ txnReturn: /* add opattrs to shadow as well, only missing attrs will actually * be added; helps compatibility with older OL versions */ - slap_add_opattrs( op, &rs->sr_text, textbuf, textlen, 1 ); + rs->sr_err = slap_add_opattrs( op, &rs->sr_text, textbuf, textlen, 1 ); + if ( rs->sr_err != LDAP_SUCCESS ) { + Debug( LDAP_DEBUG_TRACE, + LDAP_XSTRING(bdb_add) ": entry failed op attrs add: " + "%s (%d)\n", rs->sr_text, rs->sr_err, 0 ); + goto return_results; + } /* check entry's schema */ rs->sr_err = entry_schema_check( op, op->oq_add.rs_e, NULL,