From 3ab1ea73002ab4a6bf791c892dcb60fc8bb394db Mon Sep 17 00:00:00 2001 From: Julius Enarusai Date: Wed, 27 Mar 2002 19:12:18 +0000 Subject: [PATCH] Added LDAP_LOG messages --- libraries/libldap/cyrus.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 562c87a3af..5f128098d3 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -353,8 +353,12 @@ Sockbuf_IO ldap_pvt_sockbuf_io_sasl = { int ldap_pvt_sasl_install( Sockbuf *sb, void *ctx_arg ) { +#ifdef NEW_LOGGING + LDAP_LOG (( "cyrus", LDAP_LEVEL_ENTRY, "ldap_pvt_sasl_install\n" )); +#else Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_install\n", 0, 0, 0 ); +#endif /* don't install the stuff unless security has been negotiated */ @@ -459,8 +463,13 @@ ldap_int_sasl_open( return ld->ld_errno; } +#ifdef NEW_LOGGING + LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, + "ldap_int_sasl_open: host=%s\n", host )); +#else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: host=%s\n", host, 0, 0 ); +#endif lc->lconn_sasl_ctx = ctx; @@ -476,8 +485,13 @@ ldap_int_sasl_open( (void) sasl_setprop( ctx, SASL_SSF_EXTERNAL, (void *) &extprops ); #endif +#ifdef NEW_LOGGING + LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, + "ldap_int_sasl_open: ssf=%ld\n", (long) ssf )); +#else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: ssf=%ld\n", (long) ssf, 0, 0 ); +#endif } return LDAP_SUCCESS; @@ -517,8 +531,13 @@ ldap_int_sasl_bind( struct berval ccred; ber_socket_t sd; +#ifdef NEW_LOGGING + LDAP_LOG (( "cyrus", LDAP_LEVEL_ARGS, + "ldap_int_sasl_bind: %s\n", mechs ? mechs : "" )); +#else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n", mechs ? mechs : "", 0, 0 ); +#endif /* do a quick !LDAPv3 check... ldap_sasl_bind will do the rest. */ if (ld->ld_version < LDAP_VERSION3) { @@ -621,9 +640,15 @@ ldap_int_sasl_bind( if ( rc != LDAP_SUCCESS && rc != LDAP_SASL_BIND_IN_PROGRESS ) { if( scred && scred->bv_len ) { /* and server provided us with data? */ +#ifdef NEW_LOGGING + LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, + "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", + rc, saslrc, scred->bv_len )); +#else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", rc, saslrc, scred->bv_len ); +#endif ber_bvfree( scred ); } return ld->ld_errno; @@ -633,9 +658,15 @@ ldap_int_sasl_bind( /* we're done, no need to step */ if( scred && scred->bv_len ) { /* but server provided us with data! */ +#ifdef NEW_LOGGING + LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, + "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", + rc, saslrc, scred->bv_len )); +#else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", rc, saslrc, scred->bv_len ); +#endif ber_bvfree( scred ); return ld->ld_errno = LDAP_LOCAL_ERROR; } @@ -650,8 +681,13 @@ ldap_int_sasl_bind( (SASL_CONST char **)&ccred.bv_val, &credlen ); +#ifdef NEW_LOGGING + LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, + "ldap_int_sasl_bind: sasl_client_step: %d\n", saslrc )); +#else Debug( LDAP_DEBUG_TRACE, "sasl_client_step: %d\n", saslrc, 0, 0 ); +#endif #if SASL_VERSION_MAJOR >= 2 /* XXX the application should free interact results. */ -- 2.39.5