浏览代码

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 <[email protected]>
  Date:   Fri Aug 16 14:04:27 2013 -0700

Reviewed by Rich (Thank you!!)

https://fedorahosted.org/389/ticket/48
Noriko Hosoi 12 年之前
父节点
当前提交
52f79065ba
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      ldap/servers/plugins/replication/windows_protocol_util.c

+ 3 - 4
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);
 					windows_log_add_entry_remote(local_dn, remote_dn);
 					return_value = windows_conn_send_add(prp->conn, slapi_sdn_get_dn(remote_dn),
 					return_value = windows_conn_send_add(prp->conn, slapi_sdn_get_dn(remote_dn),
 						entryattrs, NULL, NULL);
 						entryattrs, NULL, NULL);
+					windows_conn_get_error(prp->conn, &ldap_op, &ldap_result_code);
 					if (LDAP_ALREADY_EXISTS == ldap_result_code) {
 					if (LDAP_ALREADY_EXISTS == ldap_result_code) {
-						/* Igoring ALREADY EXIST case. */
+						/* Ignoring ALREADY EXIST case. */
 						ldap_result_code = LDAP_SUCCESS;
 						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 ??? */
 						/* op failed but no ldap error code ??? */
 						ldap_result_code = LDAP_OPERATIONS_ERROR;
 						ldap_result_code = LDAP_OPERATIONS_ERROR;
 					}
 					}