From: Pierangelo Masarati Date: Sat, 20 Dec 2008 22:56:03 +0000 (+0000) Subject: honor RFC4528 assertion control for LDAP add operations (ITS#5861; blind fix) X-Git-Tag: ACLCHECK_0~1019 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3cafd7b1eba56cab979a2d6d45c62c161d7554f7;p=openldap honor RFC4528 assertion control for LDAP add operations (ITS#5861; blind fix) --- diff --git a/servers/slapd/back-sql/add.c b/servers/slapd/back-sql/add.c index 8b8100fbc0..a18e18e827 100644 --- a/servers/slapd/back-sql/add.c +++ b/servers/slapd/back-sql/add.c @@ -975,6 +975,17 @@ backsql_add( Operation *op, SlapReply *rs ) slap_add_opattrs( op, &rs->sr_text, textbuf, textlen, 1 ); + if ( get_assert( op ) && + ( test_filter( op, op->ora_e, get_assertion( op )) != LDAP_COMPARE_TRUE )) + { + Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): " + "assertion control failed -- aborting\n", + op->ora_e->e_name.bv_val, 0, 0 ); + e = NULL; + rs->sr_err = LDAP_ASSERTION_FAILED; + goto done; + } + /* search structuralObjectClass */ for ( at = op->ora_e->e_attrs; at != NULL; at = at->a_next ) { if ( at->a_desc == slap_schema.si_ad_structuralObjectClass ) {