ldap/servers/plugins/replication/repl5_connection.c | 12 +++++++++++-
ldap/servers/plugins/replication/windows_connection.c | 12 +++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
New commits:
commit a24d9cca5f0618af8393f8659d559ec355beae12
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Fri Jul 8 12:59:09 2011 -0700
Bug 691313 - Need TLS/SSL error messages in repl status and errors log
When an error is encnountered during the bind operation in the
beginning of a replication session, the error is only logged
at the fatal level the first time it is encountered. If replication
level logging is turned on, it can be easy to miss the error the
first time, so the subsequent debug logging is not very useful.
This patch makes us log repeated bind errors at the replication log
level only. The first time an error is encountered, it will still
be logged at the fatal level.
diff --git a/ldap/servers/plugins/replication/repl5_connection.c
b/ldap/servers/plugins/replication/repl5_connection.c
index c77819a..4cf69d1 100644
--- a/ldap/servers/plugins/replication/repl5_connection.c
+++ b/ldap/servers/plugins/replication/repl5_connection.c
@@ -1799,7 +1799,8 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char
*password)
else
{
ldap_controls_free( ctrls );
- /* Do not report the same error over and over again */
+ /* Do not report the same error over and over again
+ * unless replication level logging is enabled. */
if (conn->last_ldap_error != rc)
{
char *errmsg = NULL;
@@ -1811,6 +1812,15 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char
*password)
agmt_get_long_name(conn->agmt),
mech ? mech : "SIMPLE", rc,
ldap_err2string(rc), errmsg);
+ } else {
+ char *errmsg = NULL;
+ /* errmsg is a pointer directly into the ld structure - do not free */
+ rc = slapi_ldap_get_lderrno( ld, NULL, &errmsg );
+ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
+ "%s: Replication bind with %s auth failed: LDAP error %d (%s) (%s)\n",
+ agmt_get_long_name(conn->agmt),
+ mech ? mech : "SIMPLE", rc,
+ ldap_err2string(rc), errmsg);
}
return (CONN_OPERATION_FAILED);
diff --git a/ldap/servers/plugins/replication/windows_connection.c
b/ldap/servers/plugins/replication/windows_connection.c
index 52a2424..f76e749 100644
--- a/ldap/servers/plugins/replication/windows_connection.c
+++ b/ldap/servers/plugins/replication/windows_connection.c
@@ -1802,7 +1802,8 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char
*password)
else
{
ldap_controls_free( ctrls );
- /* Do not report the same error over and over again */
+ /* Do not report the same error over and over again
+ * unless replication level logging is enabled. */
if (conn->last_ldap_error != rc)
{
char *errmsg = NULL;
@@ -1814,6 +1815,15 @@ bind_and_check_pwp(Repl_Connection *conn, char * binddn, char
*password)
agmt_get_long_name(conn->agmt),
mech ? mech : "SIMPLE", rc,
ldap_err2string(rc), errmsg);
+ } else {
+ char *errmsg = NULL;
+ /* errmsg is a pointer directly into the ld structure - do not free */
+ rc = slapi_ldap_get_lderrno( ld, NULL, &errmsg );
+ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
+ "%s: Replication bind with %s auth failed: LDAP error %d (%s) (%s)\n",
+ agmt_get_long_name(conn->agmt),
+ mech ? mech : "SIMPLE", rc,
+ ldap_err2string(rc), errmsg);
}
LDAPDebug( LDAP_DEBUG_TRACE, "<= bind_and_check_pwp -
CONN_OPERATION_FAILED\n", 0, 0, 0 );