Skip to content
Snippets Groups Projects
Commit b9f7fb07 authored by Jan Synacek's avatar Jan Synacek Committed by Quanah Gibson-Mount
Browse files

ITS#7418 Fix slapo-constraint: handle uri and restrict correctly

parent c81e0b4d
No related branches found
No related tags found
No related merge requests found
...@@ -845,9 +845,6 @@ constraint_check_count_violation( Modifications *m, Entry *target_entry, constra ...@@ -845,9 +845,6 @@ constraint_check_count_violation( Modifications *m, Entry *target_entry, constra
unsigned ca; unsigned ca;
int j; int j;
if ( cp->set )
return 0;
for ( j = 0; cp->ap[j]; j++ ) { for ( j = 0; cp->ap[j]; j++ ) {
/* Get this attribute count */ /* Get this attribute count */
if ( target_entry ) if ( target_entry )
...@@ -905,7 +902,6 @@ constraint_update( Operation *op, SlapReply *rs ) ...@@ -905,7 +902,6 @@ constraint_update( Operation *op, SlapReply *rs )
int rc; int rc;
char *msg = NULL; char *msg = NULL;
int is_v; int is_v;
int first = 1;
if (get_relax(op)) { if (get_relax(op)) {
return SLAP_CB_CONTINUE; return SLAP_CB_CONTINUE;
...@@ -933,15 +929,17 @@ constraint_update( Operation *op, SlapReply *rs ) ...@@ -933,15 +929,17 @@ constraint_update( Operation *op, SlapReply *rs )
return(rs->sr_err); return(rs->sr_err);
} }
op->o_bd = on->on_info->oi_origdb;
rc = be_entry_get_rw( op, &op->o_req_ndn, NULL, NULL, 0, &target_entry );
op->o_bd = be;
/* Do we need to count attributes? */ /* Do we need to count attributes? */
for(cp = c; cp; cp = cp->ap_next) { for(cp = c; cp; cp = cp->ap_next) {
if (cp->count != 0 || cp->set || cp->restrict_lud != 0) { if (cp->restrict_lud && constraint_check_restrict(op, cp, target_entry) == 0) {
if (first) { continue;
op->o_bd = on->on_info->oi_origdb; }
rc = be_entry_get_rw( op, &op->o_req_ndn, NULL, NULL, 0, &target_entry );
op->o_bd = be; if (cp->count != 0) {
first = 0;
}
if (rc != 0 || target_entry == NULL) { if (rc != 0 || target_entry == NULL) {
Debug(LDAP_DEBUG_TRACE, Debug(LDAP_DEBUG_TRACE,
"==> constraint_update rc = %d DN=\"%s\"%s\n", "==> constraint_update rc = %d DN=\"%s\"%s\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment