From 52f79065ba7c0a3649c561204e6497c75e76051a Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Aug 22 2013 20:39:32 +0000 Subject: Ticket #48 - Active Directory has certain uids which are reserved and will cause a Directory Server replica initialization of an AD server to abort. Coverity CID 11943 - Logically dead code Fix description: The following commit mistakenly put the "Ignoring ALREADY EXIST case" code before retrieving the ldap_result_code. This patch fixes the order. commit b00b8acca54267560c6d7ec614bc52cfe541200a Author: Noriko Hosoi Date: Fri Aug 16 14:04:27 2013 -0700 Reviewed by Rich (Thank you!!) https://fedorahosted.org/389/ticket/48 --- diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c index 02ac783..e618be0 100644 --- a/ldap/servers/plugins/replication/windows_protocol_util.c +++ b/ldap/servers/plugins/replication/windows_protocol_util.c @@ -1220,12 +1220,11 @@ process_replay_add(Private_Repl_Protocol *prp, Slapi_Entry *add_entry, Slapi_Ent windows_log_add_entry_remote(local_dn, remote_dn); return_value = windows_conn_send_add(prp->conn, slapi_sdn_get_dn(remote_dn), entryattrs, NULL, NULL); + windows_conn_get_error(prp->conn, &ldap_op, &ldap_result_code); if (LDAP_ALREADY_EXISTS == ldap_result_code) { - /* Igoring ALREADY EXIST case. */ + /* Ignoring ALREADY EXIST case. */ ldap_result_code = LDAP_SUCCESS; - } - windows_conn_get_error(prp->conn, &ldap_op, &ldap_result_code); - if ((return_value != CONN_OPERATION_SUCCESS) && !ldap_result_code) { + } else if ((return_value != CONN_OPERATION_SUCCESS) && !ldap_result_code) { /* op failed but no ldap error code ??? */ ldap_result_code = LDAP_OPERATIONS_ERROR; }