浏览代码

Ticket #48223 - Winsync fails when AD users have multiple spaces (two)inside the value of the rdn attribute

Description: When the dirsync search returns a remote entry, winsync
search the entry with DN to retrieve the whole attribute value pairs.
The DN used for the search was normalized which replaced multiple white-
spaces with one in the DN.  This patch does not used the normalized DN,
but the same DN given by AD.

The DN normalization behaviour was introduced to fix a ticket #529 -
dn normalization must handle multiple space characters in attributes.

Added additional debugging to get the info which entry failed to sync.

https://fedorahosted.org/389/ticket/48223

Reviewed by [email protected] (Thank you, Rich!!)
Noriko Hosoi 10 年之前
父节点
当前提交
2c484cc6e8

+ 1 - 1
ldap/servers/plugins/posix-winsync/posix-group-func.c

@@ -95,7 +95,7 @@ getEntry(const char *udn, char **attrs)
     }
     }
     else {
     else {
         slapi_log_error(SLAPI_LOG_FATAL, POSIX_WINSYNC_PLUGIN_NAME,
         slapi_log_error(SLAPI_LOG_FATAL, POSIX_WINSYNC_PLUGIN_NAME,
-                        "getEntry: error searching for uid: %d\n", rc);
+                        "getEntry: error searching for uid %s: %d\n", udn, rc);
     }
     }
 
 
     return NULL;
     return NULL;

+ 7 - 4
ldap/servers/plugins/replication/windows_protocol_util.c

@@ -3226,7 +3226,7 @@ windows_get_remote_entry (Private_Repl_Protocol *prp, const Slapi_DN* remote_dn,
 	const char *searchbase = NULL;
 	const char *searchbase = NULL;
 	Slapi_Entry *found_entry = NULL;
 	Slapi_Entry *found_entry = NULL;
 
 
-	searchbase = slapi_sdn_get_dn(remote_dn);
+	searchbase = slapi_sdn_get_udn(remote_dn);
 	cres = windows_search_entry_ext(prp->conn, (char*)searchbase, filter, &found_entry, NULL, LDAP_SCOPE_BASE);
 	cres = windows_search_entry_ext(prp->conn, (char*)searchbase, filter, &found_entry, NULL, LDAP_SCOPE_BASE);
 	if (cres)
 	if (cres)
 	{
 	{
@@ -5886,13 +5886,16 @@ retry:
 						remote_entry = NULL;
 						remote_entry = NULL;
 					} else 
 					} else 
 					{
 					{
-						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));
+						slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name,
+						                "%s: windows_process_dirsync_entry: failed to fetch inbound entry %s.\n",
+						                agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(slapi_entry_get_sdn_const(e)));
 					}
 					}
 					slapi_entry_free(local_entry);
 					slapi_entry_free(local_entry);
 					if (rc) {
 					if (rc) {
 						/* Something bad happened */
 						/* Something bad happened */
-						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),
-							slapi_sdn_get_dn(slapi_entry_get_sdn_const(e)));
+						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), slapi_sdn_get_dn(slapi_entry_get_sdn_const(e)));
 					}
 					}
 				} else 
 				} else 
 				{
 				{