summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-04-02 17:38:57 -0600
committerRich Megginson <rmeggins@redhat.com>2010-04-05 08:08:35 -0600
commit4b520bfed95c10ecf9239f7a42f3fb38b673d203 (patch)
tree959a3576375a65baa511426b1a0cd3bb79702535
parentf232bda45d7bc6216b091f38fa7ab4549ede6fde (diff)
downloadds-4b520bfed95c10ecf9239f7a42f3fb38b673d203.tar.gz
ds-4b520bfed95c10ecf9239f7a42f3fb38b673d203.tar.xz
ds-4b520bfed95c10ecf9239f7a42f3fb38b673d203.zip
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
-rw-r--r--ldap/servers/plugins/replication/repl5_replica.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index a563835a..f669900f 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;