diff options
author | Rich Megginson <rmeggins@redhat.com> | 2010-09-22 15:56:14 -0600 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2010-09-22 17:15:00 -0600 |
commit | 4bd78323d0bb1299a19e0ed1feebc79ff997c92f (patch) | |
tree | 2c7ec282617e944268b0e4929573c845aea10af2 | |
parent | 1cbaa1c2fd6f6fa2dad9eb68f760cdd6024f86f5 (diff) | |
download | ds-4bd78323d0bb1299a19e0ed1feebc79ff997c92f.tar.gz ds-4bd78323d0bb1299a19e0ed1feebc79ff997c92f.tar.xz ds-4bd78323d0bb1299a19e0ed1feebc79ff997c92f.zip |
Bug 634561 - Server crushes when using Windows Sync Agreement
https://bugzilla.redhat.com/show_bug.cgi?id=634561
Resolves: bug 634561
Bug Description: Server crushes when using Windows Sync Agreement
Reviewed by: ???
Branch: 389-ds-base-1.2.6
Fix Description: The regular replication protocol and the windows sync
protocol have two completely different struct repl_connection. They
are almost the same, almost identical fields, but they are different.
When additional fields were added to the struct repl_connection, not
at the end of the structure, and identical changes were not made to the
struct repl_connection in windows_connection.c, the structures got out
of sync. The authors tried to anticipate this condition by providing
windows_ versions of all of the conn_ functions. We were not using the
windows_ versions of these functions in all places in the winsync code.
The fix is to use the windows_ versions of these functions throughout
the winsync code, and to make the struct repl_connection the same size
up through the char *plain field. If additional fields are added to
either structure at the end, this problem should not occur in the
future.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
4 files changed, 12 insertions, 10 deletions
diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c index a1e74c44..80dcd3bb 100644 --- a/ldap/servers/plugins/replication/windows_connection.c +++ b/ldap/servers/plugins/replication/windows_connection.c @@ -75,6 +75,8 @@ typedef struct repl_connection int supports_ldapv3; /* 1 if does, 0 if doesn't, -1 if not determined */ int supports_ds50_repl; /* 1 if does, 0 if doesn't, -1 if not determined */ int supports_ds40_repl; /* 1 if does, 0 if doesn't, -1 if not determined */ + int supports_ds71_repl; /* 1 if does, 0 if doesn't, -1 if not determined */ + int supports_ds90_repl; /* 1 if does, 0 if doesn't, -1 if not determined */ int linger_time; /* time in seconds to leave an idle connection open */ int supports_dirsync; /* 1 if does, 0 if doesn't, -1 if not determined */ PRBool linger_active; diff --git a/ldap/servers/plugins/replication/windows_inc_protocol.c b/ldap/servers/plugins/replication/windows_inc_protocol.c index f2e9034d..2b41276d 100644 --- a/ldap/servers/plugins/replication/windows_inc_protocol.c +++ b/ldap/servers/plugins/replication/windows_inc_protocol.c @@ -988,9 +988,9 @@ windows_inc_run(Private_Repl_Protocol *prp) /* remove_protocol_callbacks(prp); */ prp->stopped = 1; /* Cancel any linger timer that might be in effect... */ - conn_cancel_linger(prp->conn); + windows_conn_cancel_linger(prp->conn); /* ... and disconnect, if currently connected */ - conn_disconnect(prp->conn); + windows_conn_disconnect(prp->conn); LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_run\n" ); } @@ -1294,7 +1294,7 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu if (CONN_OPERATION_SUCCESS != replay_crc) { int operation, error; - conn_get_error(prp->conn, &operation, &error); + windows_conn_get_error(prp->conn, &operation, &error); csn_as_string(entry.op->csn, PR_FALSE, csn_str); /* Figure out what to do next */ if (CONN_OPERATION_FAILED == replay_crc) diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c index f69cb7a8..06d2cad0 100644 --- a/ldap/servers/plugins/replication/windows_protocol_util.c +++ b/ldap/servers/plugins/replication/windows_protocol_util.c @@ -1553,7 +1553,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op if (CONN_OPERATION_FAILED == return_value) { int operation = 0; int error = 0; - conn_get_error(prp->conn, &operation, &error); + windows_conn_get_error(prp->conn, &operation, &error); /* The remote entry is missing. Let's add the renamed entry. */ if (LDAP_NO_SUCH_OBJECT == error) { return_value = process_replay_add(prp, @@ -4494,7 +4494,7 @@ windows_process_total_add(Private_Repl_Protocol *prp,Slapi_Entry *e, Slapi_DN* r int operation = 0; int error = 0; - conn_get_error(prp->conn, &operation, &error); + windows_conn_get_error(prp->conn, &operation, &error); if (windows_ignore_error_and_keep_going(error)) { retval = CONN_OPERATION_SUCCESS; diff --git a/ldap/servers/plugins/replication/windows_tot_protocol.c b/ldap/servers/plugins/replication/windows_tot_protocol.c index 9c22b8d1..47bb3d03 100644 --- a/ldap/servers/plugins/replication/windows_tot_protocol.c +++ b/ldap/servers/plugins/replication/windows_tot_protocol.c @@ -120,7 +120,7 @@ windows_tot_run(Private_Repl_Protocol *prp) goto done; } - conn_set_timeout(prp->conn, agmt_get_timeout(prp->agmt)); + windows_conn_set_timeout(prp->conn, agmt_get_timeout(prp->agmt)); /* acquire remote replica */ agmt_set_last_init_start(prp->agmt, current_time()); @@ -132,14 +132,14 @@ windows_tot_run(Private_Repl_Protocol *prp) if (rc != ACQUIRE_SUCCESS) { int optype, ldaprc; - conn_get_error(prp->conn, &optype, &ldaprc); + windows_conn_get_error(prp->conn, &optype, &ldaprc); agmt_set_last_init_status(prp->agmt, ldaprc, prp->last_acquire_response_code, NULL); goto done; } else if (prp->terminate) { - conn_disconnect(prp->conn); + windows_conn_disconnect(prp->conn); prp->stopped = 1; goto done; } @@ -272,7 +272,7 @@ windows_tot_stop(Private_Repl_Protocol *prp) "protocol not stopped after waiting for %d seconds " "for agreement %s\n", PR_IntervalToSeconds(now-start), agmt_get_long_name(prp->agmt)); - conn_disconnect(prp->conn); + windows_conn_disconnect(prp->conn); return_value = -1; } else @@ -383,7 +383,7 @@ int send_entry (Slapi_Entry *e, void *cb_data) if (prp->terminate) { - conn_disconnect(prp->conn); + windows_conn_disconnect(prp->conn); prp->stopped = 1; ((callback_data*)cb_data)->rc = -1; LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= send_entry\n" ); |