>From 221e93410d4c70dcd6a3376007ee1feeed370c10 Mon Sep 17 00:00:00 2001 From: Nathan Kinder Date: Fri, 31 Jul 2009 15:12:09 -0700 Subject: [PATCH] Bug 514955 - Don't replicate DNA generation modify operations. We currently replicate the modify that triggers DNA to generate a new value. thia can trigger a replica to generate a new value, causing different values to be assigned on different servers. We need to trim the mod that triggers generation and simply add the replace mod that adds the new value on the first server. --- ldap/servers/plugins/dna/dna.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c index b198ef3..1313412 100644 --- a/ldap/servers/plugins/dna/dna.c +++ b/ldap/servers/plugins/dna/dna.c @@ -2667,6 +2667,9 @@ static int dna_pre_op(Slapi_PBlock * pb, int modtype) if (numvals == 0) { generate = 1; + /* Remove this mod to prevent from it + * from being replicated. */ + slapi_mods_remove(smods); } else { Slapi_Attr *attr = NULL; int e_numvals = 0; @@ -2676,6 +2679,9 @@ static int dna_pre_op(Slapi_PBlock * pb, int modtype) slapi_attr_get_numvalues(attr, &e_numvals); if (numvals >= e_numvals) { generate = 1; + /* Remove this mod to prevent from it + * from being replicated. */ + slapi_mods_remove(smods); } } } @@ -2691,12 +2697,18 @@ static int dna_pre_op(Slapi_PBlock * pb, int modtype) config_entry->generate, len)) generate = 1; + /* Remove this mod to prevent from it + * from being replicated. */ + slapi_mods_remove(smods); break; } } else { /* This is a replace with no new values, so we need * to generate a new value. */ generate = 1; + /* Remove this mod to prevent from it + * from being replicated. */ + slapi_mods_remove(smods); } } } -- 1.6.2.5