浏览代码

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
Rich Megginson 15 年之前
父节点
当前提交
4b520bfed9
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      ldap/servers/plugins/replication/repl5_replica.c

+ 4 - 5
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;