ldap/servers/plugins/replication/repl5_replica.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
New commits:
commit 4b520bfed95c10ecf9239f7a42f3fb38b673d203
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Apr 2 17:38:57 2010 -0600
Bug 561575 - setup-ds-admin fails to supply nsds5ReplicaName when configuring via
ConfigFile
https://bugzilla.redhat.com/show_bug.cgi?id=561575
Resolves: bug 561575
Bug Description: setup-ds-admin fails to supply nsds5ReplicaName when configuring via
ConfigFile
Reviewed by: nhosoi (Thanks!)
Branch: HEAD
Fix Description: The main problem was that the mod val was a berval, so we
needed |LDAP_MOD_BVALUES for the mod_op. The other problem is that the
mod and values were being used out of scope. While this seems to work, it's
better to make sure all of the values are in scope.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/repl5_replica.c
b/ldap/servers/plugins/replication/repl5_replica.c
index a563835..f669900 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -2104,6 +2104,9 @@ _replica_update_state (time_t when, void *arg)
LDAPMod *mods[3];
Slapi_PBlock *pb = NULL;
char *dn = NULL;
+ struct berval *vals[2];
+ struct berval val;
+ LDAPMod mod;
if (NULL == replica_name)
return;
@@ -2173,13 +2176,9 @@ _replica_update_state (time_t when, void *arg)
/* write replica name if it has not been written before */
if (r->new_name)
{
- struct berval *vals[2];
- struct berval val;
- LDAPMod mod;
-
mods[1] = &mod;
- mod.mod_op = LDAP_MOD_REPLACE;
+ mod.mod_op = LDAP_MOD_REPLACE|LDAP_MOD_BVALUES;
mod.mod_type = (char*)attr_replicaName;
mod.mod_bvalues = vals;
vals [0] = &val;