]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/constraint.c
ITS#6716 use sorted CSNs, fix sessionlog
[openldap] / servers / slapd / overlays / constraint.c
index dc6039de436dcfe0ab810f8c9a4d50e8126bcc84..fcb2830ee88cbf2e45d344ba3537fdfac10ee36e 100644 (file)
@@ -541,7 +541,7 @@ constraint_uri_cb( Operation *op, SlapReply *rs )
 }
 
 static int
-constraint_violation( constraint *c, struct berval *bv, Operation *op, SlapReply *rs)
+constraint_violation( constraint *c, struct berval *bv, Operation *op )
 {
        if ((!c) || (!bv)) return LDAP_SUCCESS;
        
@@ -556,19 +556,13 @@ constraint_violation( constraint *c, struct berval *bv, Operation *op, SlapReply
                Operation nop = *op;
                slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
                slap_callback cb;
-               SlapReply nrs = { REP_RESULT };
                int i;
-               int found;
+               int found = 0;
                int rc;
                size_t len;
                struct berval filterstr;
                char *ptr;
 
-               found = 0;
-
-               nrs.sr_entry = NULL;
-               nrs.sr_nentries = 0;
-
                cb.sc_next = NULL;
                cb.sc_response = constraint_uri_cb;
                cb.sc_cleanup = NULL;
@@ -645,6 +639,8 @@ constraint_violation( constraint *c, struct berval *bv, Operation *op, SlapReply
                        rc = LDAP_OTHER;
 
                } else {
+                       SlapReply nrs = { REP_RESULT };
+
                        Debug(LDAP_DEBUG_TRACE, 
                                "==> constraint_violation uri filter = %s\n",
                                filterstr.bv_val, 0, 0);
@@ -663,7 +659,6 @@ constraint_violation( constraint *c, struct berval *bv, Operation *op, SlapReply
 
                if (!found)
                        return LDAP_CONSTRAINT_VIOLATION; /* constraint violation */
-                       
        }
 
        return LDAP_SUCCESS;
@@ -796,7 +791,7 @@ constraint_add( Operation *op, SlapReply *rs )
                        }
 
                        for ( i = 0; b[i].bv_val; i++ ) {
-                               rc = constraint_violation( cp, &b[i], op, rs );
+                               rc = constraint_violation( cp, &b[i], op );
                                if ( rc ) {
                                        goto add_violation;
                                }
@@ -949,7 +944,7 @@ constraint_update( Operation *op, SlapReply *rs )
                                continue;
 
                        for ( i = 0; b[i].bv_val; i++ ) {
-                               rc = constraint_violation( cp, &b[i], op, rs );
+                               rc = constraint_violation( cp, &b[i], op );
                                if ( rc ) {
                                        goto mod_violation;
                                }