]> git.sur5r.net Git - openldap/commitdiff
honor RFC4528 assertion control for LDAP add operations (ITS#5861)
authorPierangelo Masarati <ando@openldap.org>
Sat, 20 Dec 2008 22:49:53 +0000 (22:49 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 20 Dec 2008 22:49:53 +0000 (22:49 +0000)
servers/slapd/back-bdb/add.c
servers/slapd/controls.c

index 402c837b9cc9f531bb55fadc7cb1a7d779f62dca..1c73bf636619ecc3f9c23cfafd4557be9a90b201 100644 (file)
@@ -112,6 +112,13 @@ txnReturn:
                goto return_results;
        }
 
+       if ( get_assert( op ) &&
+               ( test_filter( op, op->ora_e, get_assertion( op )) != LDAP_COMPARE_TRUE ))
+       {
+               rs->sr_err = LDAP_ASSERTION_FAILED;
+               goto return_results;
+       }
+
        subentry = is_entry_subentry( op->oq_add.rs_e );
 
        /* Get our reader TXN */
index f952b1dd944663e5b9c30c83363b01fcce067230..1a0e42b82dd67926f5002cd09789954972f6330a 100644 (file)
@@ -123,8 +123,7 @@ static char *session_tracking_extops[] = {
 static struct slap_control control_defs[] = {
        {  LDAP_CONTROL_ASSERT,
                (int)offsetof(struct slap_control_ids, sc_assert),
-               SLAP_CTRL_DELETE|SLAP_CTRL_MODIFY|SLAP_CTRL_RENAME|
-                       SLAP_CTRL_COMPARE|SLAP_CTRL_SEARCH,
+               SLAP_CTRL_UPDATE|SLAP_CTRL_COMPARE|SLAP_CTRL_SEARCH,
                NULL, NULL,
                parseAssert, LDAP_SLIST_ENTRY_INITIALIZER(next) },
        { LDAP_CONTROL_PRE_READ,