|
|
dc8c34 |
From 447814d2e8742dcb41d5df533c617ba68b0321df Mon Sep 17 00:00:00 2001
|
|
|
dc8c34 |
From: Noriko Hosoi <nhosoi@redhat.com>
|
|
|
dc8c34 |
Date: Thu, 8 Jan 2015 17:52:03 -0800
|
|
|
dc8c34 |
Subject: [PATCH 297/305] Ticket #47884 - WinSync - manual replica refresh
|
|
|
dc8c34 |
removes AD-only member values from DS and AD in groups
|
|
|
dc8c34 |
|
|
|
dc8c34 |
Description: windows_generate_update_mods had a bug which confused to
|
|
|
dc8c34 |
handle local and remote entry in the logic. The bug was fixed with
|
|
|
dc8c34 |
Ticket #460 in 1.3.2 and newer. Back-porting the function windows_
|
|
|
dc8c34 |
generate_update_mods to 1.3.1 and 1.2.11, as well.
|
|
|
dc8c34 |
|
|
|
dc8c34 |
https://fedorahosted.org/389/ticket/47884
|
|
|
dc8c34 |
(cherry picked from commit 8e79befefef3f9fae94c0d61169d6d1b182bc872)
|
|
|
dc8c34 |
---
|
|
|
dc8c34 |
.../plugins/replication/windows_protocol_util.c | 30 +++++++++++++++-------
|
|
|
dc8c34 |
1 file changed, 21 insertions(+), 9 deletions(-)
|
|
|
dc8c34 |
|
|
|
dc8c34 |
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
|
|
|
dc8c34 |
index 627e8ad..c95bdbb 100644
|
|
|
dc8c34 |
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
|
|
|
dc8c34 |
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
|
|
|
dc8c34 |
@@ -4324,9 +4324,16 @@ windows_generate_dn_value_mods(char *local_type, const Slapi_Attr *attr, Slapi_M
|
|
|
dc8c34 |
return ret;
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
|
|
|
dc8c34 |
-/* Generate the mods for an update in either direction. Be careful... the "remote" entry is the DS entry in the to_windows case, but the AD entry in the other case. */
|
|
|
dc8c34 |
+/*
|
|
|
dc8c34 |
+ * Generate the mods for an update in either direction.
|
|
|
dc8c34 |
+ */
|
|
|
dc8c34 |
static int
|
|
|
dc8c34 |
-windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,Slapi_Entry *local_entry, int to_windows, Slapi_Mods *smods, int *do_modify)
|
|
|
dc8c34 |
+windows_generate_update_mods(Private_Repl_Protocol *prp,
|
|
|
dc8c34 |
+ Slapi_Entry *remote_entry,
|
|
|
dc8c34 |
+ Slapi_Entry *local_entry,
|
|
|
dc8c34 |
+ int to_windows,
|
|
|
dc8c34 |
+ Slapi_Mods *smods,
|
|
|
dc8c34 |
+ int *do_modify)
|
|
|
dc8c34 |
{
|
|
|
dc8c34 |
int retval = 0;
|
|
|
dc8c34 |
Slapi_Attr *attr = NULL;
|
|
|
dc8c34 |
@@ -4336,6 +4343,8 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
|
|
|
dc8c34 |
int rc = 0;
|
|
|
dc8c34 |
int is_nt4 = windows_private_get_isnt4(prp->agmt);
|
|
|
dc8c34 |
const Slapi_DN *local_subtree = NULL;
|
|
|
dc8c34 |
+ Slapi_Entry *target_entry = NULL;
|
|
|
dc8c34 |
+
|
|
|
dc8c34 |
/* Iterate over the attributes on the remote entry, updating the local entry where appropriate */
|
|
|
dc8c34 |
LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_generate_update_mods\n", 0, 0, 0 );
|
|
|
dc8c34 |
|
|
|
dc8c34 |
@@ -4352,14 +4361,16 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
|
|
|
dc8c34 |
|
|
|
dc8c34 |
if (to_windows)
|
|
|
dc8c34 |
{
|
|
|
dc8c34 |
- windows_is_local_entry_user_or_group(remote_entry,&is_user,&is_group);
|
|
|
dc8c34 |
+ windows_is_local_entry_user_or_group(local_entry,&is_user,&is_group);
|
|
|
dc8c34 |
+ target_entry = local_entry;
|
|
|
dc8c34 |
} else
|
|
|
dc8c34 |
{
|
|
|
dc8c34 |
windows_is_remote_entry_user_or_group(remote_entry,&is_user,&is_group);
|
|
|
dc8c34 |
+ target_entry = remote_entry;
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
|
|
|
dc8c34 |
- for (rc = slapi_entry_first_attr(remote_entry, &attr); rc == 0;
|
|
|
dc8c34 |
- rc = slapi_entry_next_attr(remote_entry, attr, &attr))
|
|
|
dc8c34 |
+ for (rc = slapi_entry_first_attr(target_entry, &attr); rc == 0;
|
|
|
dc8c34 |
+ rc = slapi_entry_next_attr(target_entry, attr, &attr))
|
|
|
dc8c34 |
{
|
|
|
dc8c34 |
int is_present_local = 0;
|
|
|
dc8c34 |
char *type = NULL;
|
|
|
dc8c34 |
@@ -4399,7 +4410,7 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
|
|
|
dc8c34 |
if (to_windows && (0 == slapi_attr_type_cmp(local_type, "streetAddress", SLAPI_TYPE_CMP_SUBTYPE))) {
|
|
|
dc8c34 |
- slapi_entry_attr_find(local_entry,FAKE_STREET_ATTR_NAME,&local_attr);
|
|
|
dc8c34 |
+ slapi_entry_attr_find(remote_entry,FAKE_STREET_ATTR_NAME,&local_attr);
|
|
|
dc8c34 |
} else {
|
|
|
dc8c34 |
slapi_entry_attr_find(local_entry,local_type,&local_attr);
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
@@ -4441,8 +4452,8 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
|
|
|
dc8c34 |
if (!values_equal)
|
|
|
dc8c34 |
{
|
|
|
dc8c34 |
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
|
|
|
dc8c34 |
- "windows_generate_update_mods: %s, %s : values are different\n",
|
|
|
dc8c34 |
- slapi_sdn_get_dn(slapi_entry_get_sdn_const(local_entry)), local_type);
|
|
|
dc8c34 |
+ "windows_generate_update_mods: %s, %s : values are different\n",
|
|
|
dc8c34 |
+ slapi_entry_get_dn_const(local_entry), local_type);
|
|
|
dc8c34 |
|
|
|
dc8c34 |
if (to_windows && ((0 == slapi_attr_type_cmp(local_type, "streetAddress", SLAPI_TYPE_CMP_SUBTYPE)) ||
|
|
|
dc8c34 |
(0 == slapi_attr_type_cmp(local_type, "telephoneNumber", SLAPI_TYPE_CMP_SUBTYPE)) ||
|
|
|
dc8c34 |
@@ -4498,7 +4509,8 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
|
|
|
dc8c34 |
} else
|
|
|
dc8c34 |
{
|
|
|
dc8c34 |
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
|
|
|
dc8c34 |
- "windows_generate_update_mods: %s, %s : values are equal\n", slapi_sdn_get_dn(slapi_entry_get_sdn_const(local_entry)), local_type);
|
|
|
dc8c34 |
+ "windows_generate_update_mods: %s, %s : values are equal\n",
|
|
|
dc8c34 |
+ slapi_entry_get_dn_const(local_entry), local_type);
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
} else {
|
|
|
dc8c34 |
/* A dn-valued attribute : need to take special steps */
|
|
|
dc8c34 |
--
|
|
|
dc8c34 |
1.9.3
|
|
|
dc8c34 |
|