]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/cyrus.c
Patch: More format bugs (ITS#1702)
[openldap] / libraries / libldap / cyrus.c
index 562c87a3af7cfeed8bf327e359343253acf061a2..5f128098d353f079f95da282ee06beb5c46ecb95 100644 (file)
@@ -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 : "<null>" ));
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n",
                mechs ? mechs : "<null>", 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. */