]> git.sur5r.net Git - openldap/commitdiff
Fix an error in debug message, and correctly keep track of attribute count
authorEmmanuel Dreyfus <manu@openldap.org>
Fri, 9 May 2008 21:49:47 +0000 (21:49 +0000)
committerEmmanuel Dreyfus <manu@openldap.org>
Fri, 9 May 2008 21:49:47 +0000 (21:49 +0000)
after a mod_replace

servers/slapd/overlays/constraint.c

index 7d2bf73aaa62e7844f66b625afa0396581761062..bb4d9504b121764d2bef8081d15f71c9e095f1b1 100644 (file)
@@ -601,14 +601,16 @@ constraint_modify( Operation *op, SlapReply *rs )
                                Debug(LDAP_DEBUG_TRACE, 
                                        "==> constraint_modify ce = %d, "
                                        "ca = %d, cp->count = %d\n",
-                                       ca, ce, cp->count);
+                                       ce, ca, cp->count);
 
                                if (m->sml_op == LDAP_MOD_ADD)
                                        if (ca + ce > cp->count)
                                                goto mod_violation;
-                               if (m->sml_op == LDAP_MOD_REPLACE)
+                               if (m->sml_op == LDAP_MOD_REPLACE) {
                                        if (ca > cp->count)
                                                goto mod_violation;
+                                       ce = ca;
+                               }
                        } 
 
                        /* DELETE are to be ignored beyond this point */