Pārlūkot izejas kodu

Bug 716980 - winsync uses old AD entry if new one not found

https://bugzilla.redhat.com/show_bug.cgi?id=716980
Resolves: bug 716980
Bug Description: winsync uses old AD entry if new one not found
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: Clear out the old raw_entry before doing the search.  This
will leave a NULL in the raw entry.  winsync plugins will need to handle a
NULL for the raw_entry and/or ad_entry.
I also improved an error message.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
Rich Megginson 14 gadi atpakaļ
vecāks
revīzija
958b4cdb50

+ 3 - 0
ldap/servers/plugins/replication/windows_connection.c

@@ -673,6 +673,9 @@ windows_search_entry_ext(Repl_Connection *conn, char* searchbase, char *filter,
 		ldap_controls_free(serverctrls_copy);
 		serverctrls_copy = NULL;
 
+		/* clear it here in case the search fails and
+		   we are left with a bogus old entry */
+		windows_private_set_raw_entry(conn->agmt, NULL);
 		if (LDAP_SUCCESS == ldap_rc)
 		{
 			LDAPMessage *message = ldap_first_entry(conn->ld, res);

+ 2 - 1
ldap/servers/plugins/replication/windows_protocol_util.c

@@ -4485,7 +4485,8 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
 			if (rc) 
 			{
 				slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name,
-					"windows_update_local_entry: failed to modify entry %s\n", escape_string(dn, dnbuf));
+					"windows_update_local_entry: failed to modify entry %s - error %d:%s\n",
+					escape_string(dn, dnbuf), rc, ldap_err2string(rc));
 			}
 			slapi_pblock_destroy(pb);
 		} else