amoralej / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 years ago
Clone

Blame SOURCES/0017-Ticket-48223-Winsync-fails-when-AD-users-have-multip.patch

a2f18f
From 8622b69a733a6126414876f11ab627211cb3bd06 Mon Sep 17 00:00:00 2001
df9752
From: Noriko Hosoi <nhosoi@redhat.com>
df9752
Date: Mon, 13 Jul 2015 17:51:01 -0700
a2f18f
Subject: [PATCH 17/20] Ticket #48223 - Winsync fails when AD users have
a2f18f
 multiple spaces (two)inside the value of the rdn attribute
df9752
df9752
Description: When the dirsync search returns a remote entry, winsync
df9752
search the entry with DN to retrieve the whole attribute value pairs.
df9752
The DN used for the search was normalized which replaced multiple white-
df9752
spaces with one in the DN.  This patch does not used the normalized DN,
df9752
but the same DN given by AD.
df9752
df9752
The DN normalization behaviour was introduced to fix a ticket #529 -
df9752
dn normalization must handle multiple space characters in attributes.
df9752
df9752
Added additional debugging to get the info which entry failed to sync.
df9752
df9752
https://fedorahosted.org/389/ticket/48223
df9752
df9752
Reviewed by rmeggins@redhat.com (Thank you, Rich!!)
df9752
df9752
(cherry picked from commit 2c484cc6e89e473bced0e9b25dd6e68d53024bb3)
df9752
(cherry picked from commit 69fd1f188105b2c3ca1bee04b05909e53c980b34)
df9752
---
df9752
 ldap/servers/plugins/posix-winsync/posix-group-func.c    |  2 +-
df9752
 ldap/servers/plugins/replication/windows_protocol_util.c | 11 +++++++----
df9752
 2 files changed, 8 insertions(+), 5 deletions(-)
df9752
df9752
diff --git a/ldap/servers/plugins/posix-winsync/posix-group-func.c b/ldap/servers/plugins/posix-winsync/posix-group-func.c
df9752
index 5f841e5..a497f3f 100644
df9752
--- a/ldap/servers/plugins/posix-winsync/posix-group-func.c
df9752
+++ b/ldap/servers/plugins/posix-winsync/posix-group-func.c
df9752
@@ -95,7 +95,7 @@ getEntry(const char *udn, char **attrs)
df9752
     }
df9752
     else {
df9752
         slapi_log_error(SLAPI_LOG_FATAL, POSIX_WINSYNC_PLUGIN_NAME,
df9752
-                        "getEntry: error searching for uid: %d\n", rc);
df9752
+                        "getEntry: error searching for uid %s: %d\n", udn, rc);
df9752
     }
df9752
 
df9752
     return NULL;
df9752
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
a2f18f
index 4607251..6bf20b7 100644
df9752
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
df9752
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
a2f18f
@@ -3226,7 +3226,7 @@ windows_get_remote_entry (Private_Repl_Protocol *prp, const Slapi_DN* remote_dn,
df9752
 	const char *searchbase = NULL;
df9752
 	Slapi_Entry *found_entry = NULL;
df9752
 
df9752
-	searchbase = slapi_sdn_get_dn(remote_dn);
df9752
+	searchbase = slapi_sdn_get_udn(remote_dn);
df9752
 	cres = windows_search_entry_ext(prp->conn, (char*)searchbase, filter, &found_entry, NULL, LDAP_SCOPE_BASE);
df9752
 	if (cres)
df9752
 	{
a2f18f
@@ -5886,13 +5886,16 @@ retry:
df9752
 						remote_entry = NULL;
df9752
 					} else 
df9752
 					{
df9752
-						slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name,"%s: windows_process_dirsync_entry: failed to fetch inbound entry.\n",agmt_get_long_name(prp->agmt));
df9752
+						slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name,
df9752
+						                "%s: windows_process_dirsync_entry: failed to fetch inbound entry %s.\n",
df9752
+						                agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(slapi_entry_get_sdn_const(e)));
df9752
 					}
df9752
 					slapi_entry_free(local_entry);
df9752
 					if (rc) {
df9752
 						/* Something bad happened */
df9752
-						slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,"%s: windows_process_dirsync_entry: failed to update inbound entry for %s.\n",agmt_get_long_name(prp->agmt),
df9752
-							slapi_sdn_get_dn(slapi_entry_get_sdn_const(e)));
df9752
+						slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
df9752
+						                "%s: windows_process_dirsync_entry: failed to update inbound entry for %s.\n",
df9752
+						                agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(slapi_entry_get_sdn_const(e)));
df9752
 					}
df9752
 				} else 
df9752
 				{
df9752
-- 
df9752
1.9.3
df9752