]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8731 Apply doc/devel/variadic_debug/07-shortcut.cocci
authorOndřej Kuzník <ondra@openldap.org>
Fri, 15 Feb 2019 16:50:54 +0000 (16:50 +0000)
committerOndřej Kuzník <ondra@openldap.org>
Fri, 15 Feb 2019 16:51:53 +0000 (16:51 +0000)
26 files changed:
servers/slapd/aclparse.c
servers/slapd/back-asyncmeta/bind.c
servers/slapd/back-asyncmeta/candidates.c
servers/slapd/back-asyncmeta/conn.c
servers/slapd/back-asyncmeta/init.c
servers/slapd/back-asyncmeta/meta_result.c
servers/slapd/back-bdb/dn2id.c
servers/slapd/back-ldap/bind.c
servers/slapd/back-ldif/ldif.c
servers/slapd/back-meta/bind.c
servers/slapd/back-meta/candidates.c
servers/slapd/back-meta/conn.c
servers/slapd/back-meta/init.c
servers/slapd/back-meta/search.c
servers/slapd/back-monitor/init.c
servers/slapd/back-sql/add.c
servers/slapd/back-sql/config.c
servers/slapd/back-sql/entry-id.c
servers/slapd/back-sql/schema-map.c
servers/slapd/back-wt/init.c
servers/slapd/daemon.c
servers/slapd/overlays/memberof.c
servers/slapd/overlays/rwmconf.c
servers/slapd/schema_check.c
servers/slapd/slapadd.c
servers/slapd/syncrepl.c

index 2b6928c47c5d35e75c9488cc5e5cac6aaf19fe21..2b65b6444c235800df2e9fc3a1c92d5a1d2692e5 100644 (file)
@@ -168,12 +168,9 @@ regtest(const char *fname, int lineno, char *pat) {
 
                regerror(e, &re, error, sizeof(error));
 
-               snprintf( buf, sizeof( buf ),
-                       "regular expression \"%s\" bad because of %s",
-                       pat, error );
-               Debug( LDAP_DEBUG_ANY,
-                       "%s: line %d: %s\n",
-                       fname, lineno, buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "%s: line %d: regular expression \"%s\" bad because of %s\n",
+                     fname, lineno, pat, error );
                acl_usage();
                exit( EXIT_FAILURE );
        }
@@ -515,16 +512,11 @@ parse_acl(
 
                                                if( !mr_usable_with_at( a->acl_attrval_mr, a->acl_attrs[ 0 ].an_desc->ad_type ) )
                                                {
-                                                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                                       snprintf( buf, sizeof( buf ),
-                                                               "matching rule \"%s\" use "
-                                                               "with attr \"%s\" not appropriate.",
-                                                               mr, a->acl_attrs[ 0 ].an_name.bv_val );
-                                                               
-
-                                                       Debug( LDAP_DEBUG_ANY, "%s: line %d: %s\n",
-                                                               fname, lineno, buf );
+                                                       Debug(LDAP_DEBUG_ANY,
+                                                             "%s: line %d: matching rule \"%s\" use " "with attr \"%s\" not appropriate.\n",
+                                                             fname, lineno,
+                                                             mr,
+                                                             a->acl_attrs[0].an_name.bv_val );
                                                        goto fail;
                                                }
                                        }
@@ -539,12 +531,12 @@ parse_acl(
 
                                                                regerror( e, &a->acl_attrval_re, err, sizeof( err ) );
 
-                                                               snprintf( buf, sizeof( buf ),
-                                                                       "regular expression \"%s\" bad because of %s",
-                                                                       right, err );
-
-                                                               Debug( LDAP_DEBUG_ANY, "%s: line %d: %s\n",
-                                                                       fname, lineno, buf );
+                                                               Debug(LDAP_DEBUG_ANY,
+                                                                     "%s: line %d: regular expression \"%s\" bad because of %s\n",
+                                                                     fname,
+                                                                     lineno,
+                                                                     right,
+                                                                     err );
                                                                goto fail;
                                                        }
                                                        a->acl_attrval_style = ACL_STYLE_REGEX;
@@ -574,45 +566,34 @@ parse_acl(
                                                                } else if ( !strcasecmp( style, "children" ) ) {
                                                                        a->acl_attrval_style = ACL_STYLE_CHILDREN;
                                                                } else {
-                                                                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                                                       snprintf( buf, sizeof( buf ),
-                                                                               "unknown val.<style> \"%s\" for attributeType \"%s\" "
-                                                                                       "with DN syntax.",
-                                                                               style,
-                                                                               a->acl_attrs[0].an_desc->ad_cname.bv_val );
-
-                                                                       Debug( LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL, 
-                                                                               "%s: line %d: %s\n",
-                                                                               fname, lineno, buf );
+                                                                       Debug(LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL,
+                                                                             "%s: line %d: unknown val.<style> \"%s\" for attributeType \"%s\" " "with DN syntax.\n",
+                                                                             fname,
+                                                                             lineno,
+                                                                             style,
+                                                                             a->acl_attrs[0].an_desc->ad_cname.bv_val );
                                                                        goto fail;
                                                                }
 
                                                                rc = dnNormalize( 0, NULL, NULL, &bv, &a->acl_attrval, NULL );
                                                                if ( rc != LDAP_SUCCESS ) {
-                                                                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                                                       snprintf( buf, sizeof( buf ),
-                                                                               "unable to normalize DN \"%s\" "
-                                                                               "for attributeType \"%s\" (%d).",
-                                                                               bv.bv_val,
-                                                                               a->acl_attrs[0].an_desc->ad_cname.bv_val,
-                                                                               rc );
-                                                                       Debug( LDAP_DEBUG_ANY, 
-                                                                               "%s: line %d: %s\n",
-                                                                               fname, lineno, buf );
+                                                                       Debug(LDAP_DEBUG_ANY,
+                                                                             "%s: line %d: unable to normalize DN \"%s\" " "for attributeType \"%s\" (%d).\n",
+                                                                             fname,
+                                                                             lineno,
+                                                                             bv.bv_val,
+                                                                             a->acl_attrs[0].an_desc->ad_cname.bv_val,
+                                                                             rc );
                                                                        goto fail;
                                                                }
 
                                                        } else {
-                                                               char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                                               snprintf( buf, sizeof( buf ),
-                                                                       "unknown val.<style> \"%s\" for attributeType \"%s\".",
-                                                                       style, a->acl_attrs[0].an_desc->ad_cname.bv_val );
-                                                               Debug( LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL, 
-                                                                       "%s: line %d: %s\n",
-                                                                       fname, lineno, buf );
+                                                               Debug(LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL,
+                                                                     "%s: line %d: unknown val.<style> \"%s\" for attributeType \"%s\".\n",
+                                                                     fname,
+                                                                     lineno,
+                                                                     style,
+                                                                     a->acl_attrs[0].an_desc->ad_cname.bv_val );
                                                                goto fail;
                                                        }
                                                }
@@ -646,14 +627,12 @@ parse_acl(
                                                        &text,
                                                        NULL );
                                                if ( rc != LDAP_SUCCESS ) {
-                                                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                                       snprintf( buf, sizeof( buf ), "%s: line %d: "
-                                                               " attr \"%s\" normalization failed (%d: %s)",
-                                                               fname, lineno,
-                                                               a->acl_attrs[ 0 ].an_name.bv_val, rc, text );
-                                                       Debug( LDAP_DEBUG_ANY, "%s: line %d: %s.\n",
-                                                               fname, lineno, buf );
+                                                       Debug(LDAP_DEBUG_ANY,
+                                                             "%s: line %d: %s: line %d: " " attr \"%s\" normalization failed (%d: %s).\n",
+                                                             fname, lineno,
+                                                             fname, lineno,
+                                                             a->acl_attrs[0].an_name.bv_val,
+                                                             rc, text );
                                                        goto fail;
                                                }
                                        }
@@ -697,11 +676,10 @@ parse_acl(
                                                        buf[ SLAP_TEXT_BUFLEN ];
 
                                                regerror( e, &a->acl_dn_re, err, sizeof( err ) );
-                                               snprintf( buf, sizeof( buf ),
-                                                       "regular expression \"%s\" bad because of %s",
-                                                       right, err );
-                                               Debug( LDAP_DEBUG_ANY, "%s: line %d: %s\n",
-                                                       fname, lineno, buf );
+                                               Debug(LDAP_DEBUG_ANY,
+                                                     "%s: line %d: regular expression \"%s\" bad because of %s\n",
+                                                     fname, lineno, right,
+                                                     err );
                                                goto fail;
                                        }
                                }
@@ -1061,14 +1039,10 @@ parse_acl(
                                        rc = slap_str2ad( right, &bdn->a_at, &text );
 
                                        if( rc != LDAP_SUCCESS ) {
-                                               char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                               snprintf( buf, sizeof( buf ),
-                                                       "dnattr \"%s\": %s",
-                                                       right, text );
-                                               Debug( LDAP_DEBUG_ANY,
-                                                       "%s: line %d: %s\n",
-                                                       fname, lineno, buf );
+                                               Debug(LDAP_DEBUG_ANY,
+                                                     "%s: line %d: dnattr \"%s\": %s\n",
+                                                     fname, lineno, right,
+                                                     text );
                                                goto fail;
                                        }
 
@@ -1078,16 +1052,10 @@ parse_acl(
                                                !is_at_syntax( bdn->a_at->ad_type,
                                                SLAPD_NAMEUID_SYNTAX ))
                                        {
-                                               char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                               snprintf( buf, sizeof( buf ),
-                                                       "dnattr \"%s\": "
-                                                       "inappropriate syntax: %s\n",
-                                                       right,
-                                                       bdn->a_at->ad_type->sat_syntax_oid );
-                                               Debug( LDAP_DEBUG_ANY,
-                                                       "%s: line %d: %s\n",
-                                                       fname, lineno, buf );
+                                               Debug(LDAP_DEBUG_ANY,
+                                                     "%s: line %d: dnattr \"%s\": " "inappropriate syntax: %s\n\n",
+                                                     fname, lineno, right,
+                                                     bdn->a_at->ad_type->sat_syntax_oid );
                                                goto fail;
                                        }
 
@@ -1230,14 +1198,10 @@ parse_acl(
 
                                        rc = slap_str2ad( attr_name, &b->a_group_at, &text );
                                        if ( rc != LDAP_SUCCESS ) {
-                                               char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                               snprintf( buf, sizeof( buf ),
-                                                       "group \"%s\": %s.",
-                                                       right, text );
-                                               Debug( LDAP_DEBUG_ANY,
-                                                       "%s: line %d: %s\n",
-                                                       fname, lineno, buf );
+                                               Debug(LDAP_DEBUG_ANY,
+                                                     "%s: line %d: group \"%s\": %s.\n",
+                                                     fname, lineno, right,
+                                                     text );
                                                goto fail;
                                        }
 
@@ -1248,19 +1212,11 @@ parse_acl(
                                                && !is_at_subtype( b->a_group_at->ad_type,
                                                        slap_schema.si_ad_labeledURI->ad_type ) /* e.g. memberURL */ )
                                        {
-                                               char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                               snprintf( buf, sizeof( buf ),
-                                                       "group \"%s\" attr \"%s\": inappropriate syntax: %s; "
-                                                       "must be " SLAPD_DN_SYNTAX " (DN), "
-                                                       SLAPD_NAMEUID_SYNTAX " (NameUID) "
-                                                       "or a subtype of labeledURI.",
-                                                       right,
-                                                       attr_name,
-                                                       at_syntax( b->a_group_at->ad_type ) );
-                                               Debug( LDAP_DEBUG_ANY,
-                                                       "%s: line %d: %s\n",
-                                                       fname, lineno, buf );
+                                               Debug(LDAP_DEBUG_ANY,
+                                                     "%s: line %d: group \"%s\" attr \"%s\": inappropriate syntax: %s; " "must be " SLAPD_DN_SYNTAX " (DN), " SLAPD_NAMEUID_SYNTAX " (NameUID) " "or a subtype of labeledURI.\n",
+                                                     fname, lineno, right,
+                                                     attr_name,
+                                                     at_syntax(b->a_group_at->ad_type) );
                                                goto fail;
                                        }
 
@@ -1276,14 +1232,11 @@ parse_acl(
                                                        ocs, NULL );
 
                                                if( rc != 0 ) {
-                                                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                                       snprintf( buf, sizeof( buf ),
-                                                               "group: \"%s\" not allowed by \"%s\".",
-                                                               b->a_group_at->ad_cname.bv_val,
-                                                               b->a_group_oc->soc_oid );
-                                                       Debug( LDAP_DEBUG_ANY, "%s: line %d: %s\n",
-                                                               fname, lineno, buf );
+                                                       Debug(LDAP_DEBUG_ANY,
+                                                             "%s: line %d: group: \"%s\" not allowed by \"%s\".\n",
+                                                             fname, lineno,
+                                                             b->a_group_at->ad_cname.bv_val,
+                                                             b->a_group_oc->soc_oid );
                                                        goto fail;
                                                }
                                        }
index f766f2678dc4a5d8f17566f04d67c01d968f745e..6e4aec380c20bc038495bc44b4c55f36562145c2 100644 (file)
@@ -96,19 +96,11 @@ asyncmeta_back_bind( Operation *op, SlapReply *rs )
         * invalidCredentials */
        mc = asyncmeta_getconn( op, rs, candidates, NULL, LDAP_BACK_BIND_DONTSEND, 1 );
        if ( !mc ) {
-               if ( LogTest( LDAP_DEBUG_ANY ) ) {
-                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                       snprintf( buf, sizeof( buf ),
-                               "asyncmeta_back_bind: no target "
-                               "for dn \"%s\" (%d%s%s).",
-                               op->o_req_dn.bv_val, rs->sr_err,
-                               rs->sr_text ? ". " : "",
-                               rs->sr_text ? rs->sr_text : "" );
-                       Debug( LDAP_DEBUG_ANY,
-                               "%s %s\n",
-                               op->o_log_prefix, buf );
-               }
+               Debug(LDAP_DEBUG_ANY,
+                     "%s asyncmeta_back_bind: no target " "for dn \"%s\" (%d%s%s).\n",
+                     op->o_log_prefix, op->o_req_dn.bv_val,
+                     rs->sr_err, rs->sr_text ? ". " : "",
+                     rs->sr_text ? rs->sr_text : "" );
 
                /* FIXME: there might be cases where we don't want
                 * to map the error onto invalidCredentials */
@@ -341,12 +333,10 @@ retry:;
                        ldap_get_option( msc->msc_ld, LDAP_OPT_ERROR_NUMBER,
                                &rs->sr_err );
 
-                       snprintf( buf, sizeof( buf ),
-                               "err=%d (%s) nretries=%d",
-                               rs->sr_err, ldap_err2string( rs->sr_err ), nretries );
-                       Debug( LDAP_DEBUG_ANY,
-                               "### %s asyncmeta_bind_op_result[%d]: %s.\n",
-                               op->o_log_prefix, candidate, buf );
+                       Debug(LDAP_DEBUG_ANY,
+                             "### %s asyncmeta_bind_op_result[%d]: err=%d (%s) nretries=%d.\n",
+                             op->o_log_prefix, candidate, rs->sr_err,
+                             ldap_err2string(rs->sr_err), nretries );
                        break;
 
                default:
@@ -973,18 +963,11 @@ retry:;
 
                                rs->sr_err = slap_map_api2result( rs );
 
-                               if ( LogTest( LDAP_DEBUG_ANY ) ) {
-                                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                       snprintf( buf, sizeof( buf ),
-                                               "asyncmeta_back_op_result[%d] "
-                                               "err=%d text=\"%s\" matched=\"%s\"",
-                                               i, rs->sr_err,
-                                               ( xtext ? xtext : "" ),
-                                               ( xmatched ? xmatched : "" ) );
-                                       Debug( LDAP_DEBUG_ANY, "%s %s.\n",
-                                               op->o_log_prefix, buf );
-                               }
+                               Debug(LDAP_DEBUG_ANY,
+                                     "%s asyncmeta_back_op_result[%d] " "err=%d text=\"%s\" matched=\"%s\".\n",
+                                     op->o_log_prefix, i, rs->sr_err,
+                                     (xtext ? xtext : ""),
+                                     (xmatched ? xmatched : "") );
 
                                /*
                                 * FIXME: need to rewrite "match" (need rwinfo)
@@ -1711,12 +1694,11 @@ asyncmeta_dobind_init(Operation *op, SlapReply *rs, bm_context_t *bc, a_metaconn
                        bound = 1;
                }
 
-               snprintf( buf, sizeof( buf ), " mc=%p ld=%p%s DN=\"%s\"",
-                       (void *)mc, (void *)msc->msc_ld,
-                       bound ? " bound" : " anonymous",
-                       bound == 0 ? "" : msc->msc_bound_ndn.bv_val );
-               Debug( LDAP_DEBUG_ANY, "### %s asyncmeta_search_dobind_init[%d]%s\n",
-                       op->o_log_prefix, candidate, buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "### %s asyncmeta_search_dobind_init[%d] mc=%p ld=%p%s DN=\"%s\"\n",
+                     op->o_log_prefix, candidate, (void *)mc,
+                     (void *)msc->msc_ld, bound ? " bound" : " anonymous",
+                     bound == 0 ? "" : msc->msc_bound_ndn.bv_val );
 #endif /* DEBUG_205 */
 
                retcode = META_SEARCH_CANDIDATE;
@@ -1727,10 +1709,10 @@ asyncmeta_dobind_init(Operation *op, SlapReply *rs, bm_context_t *bc, a_metaconn
 #ifdef DEBUG_205
                char    buf[ SLAP_TEXT_BUFLEN ] = { '\0' };
 
-               snprintf( buf, sizeof( buf ), " mc=%p ld=%p needbind",
-                       (void *)mc, (void *)msc->msc_ld );
-               Debug( LDAP_DEBUG_ANY, "### %s asyncmeta_search_dobind_init[%d]%s\n",
-                       op->o_log_prefix, candidate, buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "### %s asyncmeta_search_dobind_init[%d] mc=%p ld=%p needbind\n",
+                     op->o_log_prefix, candidate, (void *)mc,
+                     (void *)msc->msc_ld );
 #endif /* DEBUG_205 */
 
                candidates[ candidate ].sr_msgid = META_MSGID_NEED_BIND;
@@ -1742,10 +1724,10 @@ asyncmeta_dobind_init(Operation *op, SlapReply *rs, bm_context_t *bc, a_metaconn
 #ifdef DEBUG_205
                char buf[ SLAP_TEXT_BUFLEN ];
 
-               snprintf( buf, sizeof( buf ), " mc=%p ld=%p binding",
-                       (void *)mc, (void *)msc->msc_ld );
-               Debug( LDAP_DEBUG_ANY, "### %s asyncmeta_search_dobind_init[%d]%s\n",
-                       op->o_log_prefix, candidate, buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "### %s asyncmeta_search_dobind_init[%d] mc=%p ld=%p binding\n",
+                     op->o_log_prefix, candidate, (void *)mc,
+                     (void *)msc->msc_ld );
 #endif /* DEBUG_205 */
 
                if ( msc->msc_ld == NULL ) {
@@ -1858,14 +1840,10 @@ retry_bind:
        candidates[ candidate ].sr_msgid = msgid;
        asyncmeta_set_msc_time(msc);
 #ifdef DEBUG_205
-       {
-               char buf[ SLAP_TEXT_BUFLEN ];
-
-               snprintf( buf, sizeof( buf ), "asyncmeta_search_dobind_init[%d] mc=%p ld=%p rc=%d",
-                       candidate, (void *)mc, (void *)mc->mc_conns[ candidate ].msc_ld, rc );
-               Debug( LDAP_DEBUG_ANY, "### %s %s\n",
-                       op->o_log_prefix, buf );
-       }
+       Debug(LDAP_DEBUG_ANY,
+             "### %s asyncmeta_search_dobind_init[%d] mc=%p ld=%p rc=%d\n",
+             op->o_log_prefix, candidate, (void *)mc,
+             (void *)mc->mc_conns[candidate].msc_ld, rc );
 #endif /* DEBUG_205 */
 
        switch ( rc ) {
@@ -1936,21 +1914,14 @@ retry_dobind:
        /* need to retry */
        retries--;
        if ( LogTest( LDAP_DEBUG_ANY ) ) {
-               char    buf[ SLAP_TEXT_BUFLEN ];
-
                /* this lock is required; however,
                 * it's invoked only when logging is on */
                ldap_pvt_thread_mutex_lock( &mt->mt_uri_mutex );
-               snprintf( buf, sizeof( buf ),
-                         "retrying URI=\"%s\" DN=\"%s\"",
-                         mt->mt_uri,
-                         BER_BVISNULL( &msc->msc_bound_ndn ) ?
-                         "" : msc->msc_bound_ndn.bv_val );
+               Debug(LDAP_DEBUG_ANY,
+                     "%s asyncmeta_search_dobind_init_with_retry[%d]: retrying URI=\"%s\" DN=\"%s\".\n",
+                     op->o_log_prefix, candidate, mt->mt_uri,
+                     BER_BVISNULL(&msc->msc_bound_ndn) ? "" : msc->msc_bound_ndn.bv_val );
                ldap_pvt_thread_mutex_unlock( &mt->mt_uri_mutex );
-
-               Debug( LDAP_DEBUG_ANY,
-                      "%s asyncmeta_search_dobind_init_with_retry[%d]: %s.\n",
-                      op->o_log_prefix, candidate, buf );
        }
 
        ldap_pvt_thread_mutex_lock( &mc->mc_om_mutex );
index 89970a4cb462f7bc43755b5bfebe4825caa39a6c..c55e9382894bc12e3e90db1e28d284ba8faea3a0 100644 (file)
@@ -260,10 +260,10 @@ asyncmeta_clear_one_msc(
 #ifdef DEBUG_205
                char    buf[ BUFSIZ ];
 
-               snprintf( buf, sizeof( buf ), "asyncmeta_clear_one_msc ldap_unbind_ext[%d] ld=%p",
-                       candidate, (void *)msc->msc_ld );
-               Debug( LDAP_DEBUG_ANY, "### %s %s\n",
-                      op ? op->o_log_prefix : "", buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "### %s asyncmeta_clear_one_msc ldap_unbind_ext[%d] ld=%p\n",
+                     op ? op->o_log_prefix : "", candidate,
+                     (void *)msc->msc_ld );
 #endif /* DEBUG_205 */
 
                ldap_unbind_ext( msc->msc_ld, NULL, NULL );
index 7185ffc52a9b47fed69305e31dc092211605c707..eb90afa56881388960696a38e82d815b0af3b3d6 100644 (file)
@@ -149,16 +149,11 @@ asyncmeta_init_one_conn(
                                dont_retry = ( ri->ri_num[ ri->ri_idx ] == SLAP_RETRYNUM_TAIL
                                        || slap_get_time() < ri->ri_last + ri->ri_interval[ ri->ri_idx ] );
                                if ( !dont_retry ) {
-                                       if ( LogTest( LDAP_DEBUG_ANY ) ) {
-                                               char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                               snprintf( buf, sizeof( buf ),
-                                                       "asyncmeta_init_one_conn[%d]: quarantine "
-                                                       "retry block #%d try #%d",
-                                                       candidate, ri->ri_idx, ri->ri_count );
-                                               Debug( LDAP_DEBUG_ANY, "%s %s.\n",
-                                                       op->o_log_prefix, buf );
-                                       }
+                                       Debug(LDAP_DEBUG_ANY,
+                                             "%s asyncmeta_init_one_conn[%d]: quarantine " "retry block #%d try #%d.\n",
+                                             op->o_log_prefix,
+                                             candidate, ri->ri_idx,
+                                             ri->ri_count );
 
                                        mt->mt_isquarantined = LDAP_BACK_FQ_RETRYING;
                                }
@@ -542,21 +537,14 @@ asyncmeta_retry(
        struct berval save_cred;
 
        if ( LogTest( LDAP_DEBUG_ANY ) ) {
-               char    buf[ SLAP_TEXT_BUFLEN ];
-
                /* this lock is required; however,
                 * it's invoked only when logging is on */
                        ldap_pvt_thread_mutex_lock( &mt->mt_uri_mutex );
-                       snprintf( buf, sizeof( buf ),
-                                 "retrying URI=\"%s\" DN=\"%s\"",
-                                 mt->mt_uri,
-                                 BER_BVISNULL( &msc->msc_bound_ndn ) ?
-                                 "" : msc->msc_bound_ndn.bv_val );
+                       Debug(LDAP_DEBUG_ANY,
+                             "%s asyncmeta_retry[%d]: retrying URI=\"%s\" DN=\"%s\".\n",
+                             op->o_log_prefix, candidate, mt->mt_uri,
+                             BER_BVISNULL(&msc->msc_bound_ndn) ? "" : msc->msc_bound_ndn.bv_val );
                        ldap_pvt_thread_mutex_unlock( &mt->mt_uri_mutex );
-
-                       Debug( LDAP_DEBUG_ANY,
-                              "%s asyncmeta_retry[%d]: %s.\n",
-                              op->o_log_prefix, candidate, buf );
        }
 
        ( void )rewrite_session_delete( mt->mt_rwmap.rwm_rw, op->o_conn );
@@ -1233,15 +1221,10 @@ asyncmeta_quarantine(
                        break;
 
                case LDAP_BACK_FQ_RETRYING:
-                       if ( LogTest( LDAP_DEBUG_ANY ) ) {
-                               char    buf[ SLAP_TEXT_BUFLEN ];
-
-                               snprintf( buf, sizeof( buf ),
-                                       "asyncmeta_quarantine[%d]: block #%d try #%d failed",
-                                       candidate, ri->ri_idx, ri->ri_count );
-                               Debug( LDAP_DEBUG_ANY, "%s %s.\n",
-                                       op->o_log_prefix, buf );
-                       }
+                       Debug(LDAP_DEBUG_ANY,
+                             "%s asyncmeta_quarantine[%d]: block #%d try #%d failed.\n",
+                             op->o_log_prefix, candidate, ri->ri_idx,
+                             ri->ri_count );
 
                        ++ri->ri_count;
                        if ( ri->ri_num[ ri->ri_idx ] != SLAP_RETRYNUM_FOREVER
index 6bdcc063ad66917cd59796ff52c0df10d0d6cb9e..f4e4658d9c60af7ad82f59521f3682087dd29372 100644 (file)
@@ -200,12 +200,9 @@ asyncmeta_target_finish(
        if ( ( mt->mt_idassert_flags & LDAP_BACK_AUTH_AUTHZ_ALL )
                && !( mt->mt_idassert_flags & LDAP_BACK_AUTH_PRESCRIPTIVE ) )
        {
-               snprintf( msg, msize,
-                       "%s: inconsistent idassert configuration "
-                       "(likely authz=\"*\" used with \"non-prescriptive\" flag)",
-                       log );
-               Debug( LDAP_DEBUG_ANY, "%s (target %s)\n",
-                       msg, mt->mt_uri );
+               Debug(LDAP_DEBUG_ANY,
+                     "%s: inconsistent idassert configuration " "(likely authz=\"*\" used with \"non-prescriptive\" flag) (target %s)\n",
+                     log, mt->mt_uri );
                return 1;
        }
 
index bf5af8cd7dc420defc814d64cde93d65530496c2..47651344de9eada8c9798844905ed8e0090f6d6a 100644 (file)
@@ -234,13 +234,10 @@ asyncmeta_send_entry(
                        {
                                char    buf[ SLAP_TEXT_BUFLEN ];
 
-                               snprintf( buf, sizeof( buf ),
-                                       "%s meta_send_entry(\"%s\"): "
-                                       "slap_bv2undef_ad(%s): %s\n",
-                                       op->o_log_prefix, ent.e_name.bv_val,
-                                       mapped.bv_val, text );
-
-                               Debug( LDAP_DEBUG_ANY, "%s", buf );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "%s meta_send_entry(\"%s\"): " "slap_bv2undef_ad(%s): %s\n",
+                                     op->o_log_prefix, ent.e_name.bv_val,
+                                     mapped.bv_val, text );
                                ( void )ber_scanf( &ber, "x" /* [W] */ );
                                op->o_tmpfree( attr, op->o_tmpmemctx );
                                continue;
@@ -1647,13 +1644,10 @@ again:
                        mc->mc_info->mi_targets[i]->mt_timeout_ops = 0;
                        break;
                default:
-                       {
                        Debug( LDAP_DEBUG_ANY,
-                                  "asyncmeta_op_handle_result: "
-                                  "unrecognized response message tag=%d\n",
-                                  rc );
-
-                       }
+                             "asyncmeta_op_handle_result: "
+                             "unrecognized response message tag=%d\n",
+                             rc );
                }
                if (msg)
                        ldap_msgfree(msg);
index bccef1507cd6f212bf027d41be11c523e0f6ce6c..aba74a602bb7fbf3d36092092b0a6f4157666120 100644 (file)
@@ -63,11 +63,10 @@ bdb_dn2id_add(
        /* store it -- don't override */
        rc = db->put( db, txn, &key, &data, DB_NOOVERWRITE );
        if( rc != 0 ) {
-               char buf[ SLAP_TEXT_BUFLEN ];
-               snprintf( buf, sizeof( buf ), "%s => bdb_dn2id_add dn=\"%s\" ID=0x%lx",
-                       op->o_log_prefix, e->e_name.bv_val, e->e_id );
-               Debug( LDAP_DEBUG_ANY, "%s: put failed: %s %d\n",
-                       buf, db_strerror(rc), rc );
+               Debug(LDAP_DEBUG_ANY,
+                     "%s => bdb_dn2id_add dn=\"%s\" ID=0x%lx: put failed: %s %d\n",
+                     op->o_log_prefix, e->e_name.bv_val, e->e_id,
+                     db_strerror(rc), rc );
                goto done;
        }
 
index 2f862cae9dc94b9e616f4654c46b4ce81125cd13..815b9b39f653b29ab7537e7480949c6c986c5392 100644 (file)
@@ -1095,17 +1095,10 @@ retry_lock:
        
                ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );
 
-               if ( LogTest( LDAP_DEBUG_TRACE ) ) {
-                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                       snprintf( buf, sizeof( buf ),
-                               "lc=%p inserted refcnt=%u rc=%d",
-                               (void *)lc, refcnt, rs->sr_err );
-                               
-                       Debug( LDAP_DEBUG_TRACE,
-                               "=>ldap_back_getconn: %s: %s\n",
-                               op->o_log_prefix, buf );
-               }
+               Debug(LDAP_DEBUG_TRACE,
+                     "=>ldap_back_getconn: %s: lc=%p inserted refcnt=%u rc=%d\n",
+                     op->o_log_prefix, (void *)lc, refcnt,
+                     rs->sr_err );
        
                if ( !LDAP_BACK_PCONN_ISPRIV( lc ) ) {
                        /* Err could be -1 in case a duplicate ldapconn is inserted */
@@ -1164,16 +1157,9 @@ retry_lock:
                        ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );
                }
 
-               if ( LogTest( LDAP_DEBUG_TRACE ) ) {
-                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                       snprintf( buf, sizeof( buf ),
-                               "conn %p fetched refcnt=%u%s",
-                               (void *)lc, refcnt,
-                               expiring ? " expiring" : "" );
-                       Debug( LDAP_DEBUG_TRACE,
-                               "=>ldap_back_getconn: %s.\n", buf );
-               }
+               Debug(LDAP_DEBUG_TRACE,
+                     "=>ldap_back_getconn: conn %p fetched refcnt=%u%s.\n",
+                     (void *)lc, refcnt, expiring ? " expiring" : "" );
        }
 
 #ifdef HAVE_TLS
index b5cb6cb960b6b604b4ec158601461080d1fc3ca4..bfd9df18de4b716e91af4094e914efe8d825206a 100644 (file)
@@ -1604,11 +1604,10 @@ ldif_move_entry(
                        }
 
                        if ( rc != LDAP_SUCCESS ) {
-                               char s[128];
-                               snprintf( s, sizeof s, "%s (%s)", *text, STRERROR( errno ));
-                               Debug( LDAP_DEBUG_ANY,
-                                       "ldif_move_entry: %s: \"%s\" -> \"%s\"\n",
-                                       s, op->o_req_dn.bv_val, entry->e_dn );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "ldif_move_entry: %s (%s): \"%s\" -> \"%s\"\n",
+                                     *text, STRERROR(errno),
+                                     op->o_req_dn.bv_val, entry->e_dn );
                        }
                }
 
index 48778857aaeb579d55714c89c8ff3805473cacf6..d62a2faeee6c0e6118757d498e79045efc872f05 100644 (file)
@@ -94,19 +94,11 @@ meta_back_bind( Operation *op, SlapReply *rs )
         * invalidCredentials */
        mc = meta_back_getconn( op, rs, NULL, LDAP_BACK_BIND_DONTSEND );
        if ( !mc ) {
-               if ( LogTest( LDAP_DEBUG_ANY ) ) {
-                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                       snprintf( buf, sizeof( buf ),
-                               "meta_back_bind: no target "
-                               "for dn \"%s\" (%d%s%s).",
-                               op->o_req_dn.bv_val, rs->sr_err,
-                               rs->sr_text ? ". " : "",
-                               rs->sr_text ? rs->sr_text : "" );
-                       Debug( LDAP_DEBUG_ANY,
-                               "%s %s\n",
-                               op->o_log_prefix, buf );
-               }
+               Debug(LDAP_DEBUG_ANY,
+                     "%s meta_back_bind: no target " "for dn \"%s\" (%d%s%s).\n",
+                     op->o_log_prefix, op->o_req_dn.bv_val,
+                     rs->sr_err, rs->sr_text ? ". " : "",
+                     rs->sr_text ? rs->sr_text : "" );
 
                /* FIXME: there might be cases where we don't want
                 * to map the error onto invalidCredentials */
@@ -409,12 +401,10 @@ retry:;
                        ldap_get_option( msc->msc_ld, LDAP_OPT_ERROR_NUMBER,
                                &rs->sr_err );
 
-                       snprintf( buf, sizeof( buf ),
-                               "err=%d (%s) nretries=%d",
-                               rs->sr_err, ldap_err2string( rs->sr_err ), nretries );
-                       Debug( LDAP_DEBUG_ANY,
-                               "### %s meta_back_bind_op_result[%d]: %s.\n",
-                               op->o_log_prefix, candidate, buf );
+                       Debug(LDAP_DEBUG_ANY,
+                             "### %s meta_back_bind_op_result[%d]: err=%d (%s) nretries=%d.\n",
+                             op->o_log_prefix, candidate, rs->sr_err,
+                             ldap_err2string(rs->sr_err), nretries );
                        break;
 
                default:
@@ -793,13 +783,11 @@ retry_binding:;
                        LDAP_BACK_CONN_BINDING_CLEAR( msc );
                        ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex );
 
-                       snprintf( buf, sizeof( buf ),
-                               "meta_back_dobind[%d]: (%s) err=%d (%s).",
-                               i, isroot ? op->o_bd->be_rootdn.bv_val : "anonymous",
-                               rc, ldap_err2string( rc ) );
-                       Debug( LDAP_DEBUG_ANY,
-                               "%s %s\n",
-                               op->o_log_prefix, buf );
+                       Debug(LDAP_DEBUG_ANY,
+                             "%s meta_back_dobind[%d]: (%s) err=%d (%s).\n",
+                             op->o_log_prefix, i,
+                             isroot ? op->o_bd->be_rootdn.bv_val : "anonymous",
+                             rc, ldap_err2string(rc) );
 
                        /*
                         * null cred bind should always succeed
@@ -1189,18 +1177,11 @@ retry:;
 
                                rs->sr_err = slap_map_api2result( rs );
        
-                               if ( LogTest( LDAP_DEBUG_ANY ) ) {
-                                       char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                       snprintf( buf, sizeof( buf ),
-                                               "meta_back_op_result[%d] "
-                                               "err=%d text=\"%s\" matched=\"%s\"", 
-                                               i, rs->sr_err,
-                                               ( xtext ? xtext : "" ),
-                                               ( xmatched ? xmatched : "" ) );
-                                       Debug( LDAP_DEBUG_ANY, "%s %s.\n",
-                                               op->o_log_prefix, buf );
-                               }
+                               Debug(LDAP_DEBUG_ANY,
+                                     "%s meta_back_op_result[%d] " "err=%d text=\"%s\" matched=\"%s\".\n",
+                                     op->o_log_prefix, i, rs->sr_err,
+                                     (xtext ? xtext : ""),
+                                     (xmatched ? xmatched : "") );
 
                                /*
                                 * FIXME: need to rewrite "match" (need rwinfo)
index cfbd643a383a2c37e6a9cee3425deab43bf2158a..57d9ea64e970ea91ead0a2c1f573acbb2260f329 100644 (file)
@@ -256,10 +256,10 @@ meta_clear_one_candidate(
 #ifdef DEBUG_205
                char    buf[ BUFSIZ ];
 
-               snprintf( buf, sizeof( buf ), "meta_clear_one_candidate ldap_unbind_ext[%d] mc=%p ld=%p",
-                       candidate, (void *)mc, (void *)msc->msc_ld );
-               Debug( LDAP_DEBUG_ANY, "### %s %s\n",
-                       op ? op->o_log_prefix : "", buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "### %s meta_clear_one_candidate ldap_unbind_ext[%d] mc=%p ld=%p\n",
+                     op ? op->o_log_prefix : "", candidate, (void *)mc,
+                     (void *)msc->msc_ld );
 #endif /* DEBUG_205 */
 
                ldap_unbind_ext( msc->msc_ld, NULL, NULL );
index f772958ef89310c417a1120e7edfac8b1fbba457..0c221d6ca5d0c4dc3a4b57298f505b323591b16a 100644 (file)
@@ -299,16 +299,11 @@ meta_back_init_one_conn(
                                dont_retry = ( ri->ri_num[ ri->ri_idx ] == SLAP_RETRYNUM_TAIL
                                        || slap_get_time() < ri->ri_last + ri->ri_interval[ ri->ri_idx ] );
                                if ( !dont_retry ) {
-                                       if ( LogTest( LDAP_DEBUG_ANY ) ) {
-                                               char    buf[ SLAP_TEXT_BUFLEN ];
-
-                                               snprintf( buf, sizeof( buf ),
-                                                       "meta_back_init_one_conn[%d]: quarantine "
-                                                       "retry block #%d try #%d",
-                                                       candidate, ri->ri_idx, ri->ri_count );
-                                               Debug( LDAP_DEBUG_ANY, "%s %s.\n",
-                                                       op->o_log_prefix, buf );
-                                       }
+                                       Debug(LDAP_DEBUG_ANY,
+                                             "%s meta_back_init_one_conn[%d]: quarantine " "retry block #%d try #%d.\n",
+                                             op->o_log_prefix,
+                                             candidate, ri->ri_idx,
+                                             ri->ri_count );
 
                                        mt->mt_isquarantined = LDAP_BACK_FQ_RETRYING;
                                }
@@ -725,21 +720,14 @@ meta_back_retry(
                struct berval save_cred;
 
                if ( LogTest( LDAP_DEBUG_ANY ) ) {
-                       char    buf[ SLAP_TEXT_BUFLEN ];
-
                        /* this lock is required; however,
                         * it's invoked only when logging is on */
                        ldap_pvt_thread_mutex_lock( &mt->mt_uri_mutex );
-                       snprintf( buf, sizeof( buf ),
-                               "retrying URI=\"%s\" DN=\"%s\"",
-                               mt->mt_uri,
-                               BER_BVISNULL( &msc->msc_bound_ndn ) ?
-                                       "" : msc->msc_bound_ndn.bv_val );
+                       Debug(LDAP_DEBUG_ANY,
+                             "%s meta_back_retry[%d]: retrying URI=\"%s\" DN=\"%s\".\n",
+                             op->o_log_prefix, candidate, mt->mt_uri,
+                             BER_BVISNULL(&msc->msc_bound_ndn) ? "" : msc->msc_bound_ndn.bv_val );
                        ldap_pvt_thread_mutex_unlock( &mt->mt_uri_mutex );
-
-                       Debug( LDAP_DEBUG_ANY,
-                               "%s meta_back_retry[%d]: %s.\n",
-                               op->o_log_prefix, candidate, buf );
                }
 
                /* save credentials, if any, for later use;
@@ -1864,15 +1852,10 @@ meta_back_quarantine(
                        break;
 
                case LDAP_BACK_FQ_RETRYING:
-                       if ( LogTest( LDAP_DEBUG_ANY ) ) {
-                               char    buf[ SLAP_TEXT_BUFLEN ];
-
-                               snprintf( buf, sizeof( buf ),
-                                       "meta_back_quarantine[%d]: block #%d try #%d failed",
-                                       candidate, ri->ri_idx, ri->ri_count );
-                               Debug( LDAP_DEBUG_ANY, "%s %s.\n",
-                                       op->o_log_prefix, buf );
-                       }
+                       Debug(LDAP_DEBUG_ANY,
+                             "%s meta_back_quarantine[%d]: block #%d try #%d failed.\n",
+                             op->o_log_prefix, candidate, ri->ri_idx,
+                             ri->ri_count );
 
                        ++ri->ri_count;
                        if ( ri->ri_num[ ri->ri_idx ] != SLAP_RETRYNUM_FOREVER
index c3205b598701c7fb27632c0c098295bebc3aa7a7..f71a1a635c205ab1512329502f8e1d5a0821f07d 100644 (file)
@@ -194,12 +194,9 @@ meta_target_finish(
        if ( ( mt->mt_idassert_flags & LDAP_BACK_AUTH_AUTHZ_ALL )
                && !( mt->mt_idassert_flags & LDAP_BACK_AUTH_PRESCRIPTIVE ) )
        {
-               snprintf( msg, msize,
-                       "%s: inconsistent idassert configuration "
-                       "(likely authz=\"*\" used with \"non-prescriptive\" flag)",
-                       log );
-               Debug( LDAP_DEBUG_ANY, "%s (target %s)\n",
-                       msg, mt->mt_uri );
+               Debug(LDAP_DEBUG_ANY,
+                     "%s: inconsistent idassert configuration " "(likely authz=\"*\" used with \"non-prescriptive\" flag) (target %s)\n",
+                     log, mt->mt_uri );
                return 1;
        }
 
index 6b6b5a552a70a03bffbb43aa74f2a2d48fd436cb..092fa0cf335122118ce0753babbf3f11276944db 100644 (file)
@@ -109,12 +109,11 @@ meta_search_dobind_init(
                        bound = 1;
                }
 
-               snprintf( buf, sizeof( buf ), " mc=%p ld=%p%s DN=\"%s\"",
-                       (void *)mc, (void *)msc->msc_ld,
-                       bound ? " bound" : " anonymous",
-                       bound == 0 ? "" : msc->msc_bound_ndn.bv_val );
-               Debug( LDAP_DEBUG_ANY, "### %s meta_search_dobind_init[%d]%s\n",
-                       op->o_log_prefix, candidate, buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "### %s meta_search_dobind_init[%d] mc=%p ld=%p%s DN=\"%s\"\n",
+                     op->o_log_prefix, candidate, (void *)mc,
+                     (void *)msc->msc_ld, bound ? " bound" : " anonymous",
+                     bound == 0 ? "" : msc->msc_bound_ndn.bv_val );
 #endif /* DEBUG_205 */
 
                retcode = META_SEARCH_CANDIDATE;
@@ -125,10 +124,10 @@ meta_search_dobind_init(
 #ifdef DEBUG_205
                char    buf[ SLAP_TEXT_BUFLEN ] = { '\0' };
 
-               snprintf( buf, sizeof( buf ), " mc=%p ld=%p needbind",
-                       (void *)mc, (void *)msc->msc_ld );
-               Debug( LDAP_DEBUG_ANY, "### %s meta_search_dobind_init[%d]%s\n",
-                       op->o_log_prefix, candidate, buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "### %s meta_search_dobind_init[%d] mc=%p ld=%p needbind\n",
+                     op->o_log_prefix, candidate, (void *)mc,
+                     (void *)msc->msc_ld );
 #endif /* DEBUG_205 */
 
                candidates[ candidate ].sr_msgid = META_MSGID_NEED_BIND;
@@ -140,10 +139,10 @@ meta_search_dobind_init(
 #ifdef DEBUG_205
                char buf[ SLAP_TEXT_BUFLEN ];
 
-               snprintf( buf, sizeof( buf ), " mc=%p ld=%p binding",
-                       (void *)mc, (void *)msc->msc_ld );
-               Debug( LDAP_DEBUG_ANY, "### %s meta_search_dobind_init[%d]%s\n",
-                       op->o_log_prefix, candidate, buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "### %s meta_search_dobind_init[%d] mc=%p ld=%p binding\n",
+                     op->o_log_prefix, candidate, (void *)mc,
+                     (void *)msc->msc_ld );
 #endif /* DEBUG_205 */
 
                if ( msc->msc_ld == NULL ) {
@@ -259,14 +258,10 @@ retry:;
                        NULL, NULL, &candidates[ candidate ].sr_msgid );
 
 #ifdef DEBUG_205
-       {
-               char buf[ SLAP_TEXT_BUFLEN ];
-
-               snprintf( buf, sizeof( buf ), "meta_search_dobind_init[%d] mc=%p ld=%p rc=%d",
-                       candidate, (void *)mc, (void *)mc->mc_conns[ candidate ].msc_ld, rc );
-               Debug( LDAP_DEBUG_ANY, "### %s %s\n",
-                       op->o_log_prefix, buf );
-       }
+       Debug(LDAP_DEBUG_ANY,
+             "### %s meta_search_dobind_init[%d] mc=%p ld=%p rc=%d\n",
+             op->o_log_prefix, candidate, (void *)mc,
+             (void *)mc->mc_conns[candidate].msc_ld, rc );
 #endif /* DEBUG_205 */
 
        switch ( rc ) {
@@ -294,21 +289,14 @@ down:;
 
                        assert( mc->mc_refcnt > 0 );
                        if ( LogTest( LDAP_DEBUG_ANY ) ) {
-                               char    buf[ SLAP_TEXT_BUFLEN ];
-
                                /* this lock is required; however,
                                 * it's invoked only when logging is on */
                                ldap_pvt_thread_mutex_lock( &mt->mt_uri_mutex );
-                               snprintf( buf, sizeof( buf ),
-                                       "retrying URI=\"%s\" DN=\"%s\"",
-                                       mt->mt_uri,
-                                       BER_BVISNULL( &msc->msc_bound_ndn ) ?
-                                               "" : msc->msc_bound_ndn.bv_val );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "%s meta_search_dobind_init[%d]: retrying URI=\"%s\" DN=\"%s\".\n",
+                                     op->o_log_prefix, candidate, mt->mt_uri,
+                                     BER_BVISNULL(&msc->msc_bound_ndn) ? "" : msc->msc_bound_ndn.bv_val );
                                ldap_pvt_thread_mutex_unlock( &mt->mt_uri_mutex );
-
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s meta_search_dobind_init[%d]: %s.\n",
-                                       op->o_log_prefix, candidate, buf );
                        }
 
                        meta_clear_one_candidate( op, mc, candidate );
@@ -1130,19 +1118,15 @@ getconn:;
 
 #ifdef DEBUG_205
                        if ( msc->msc_ld == NULL ) {
-                               char    buf[ SLAP_TEXT_BUFLEN ];
-
                                ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex );
-                               snprintf( buf, sizeof( buf ),
-                                       "%s meta_back_search[%ld] mc=%p msgid=%d%s%s%s\n",
-                                       op->o_log_prefix, (long)i, (void *)mc,
-                                       candidates[ i ].sr_msgid,
-                                       META_IS_BINDING( &candidates[ i ] ) ? " binding" : "",
-                                       LDAP_BACK_CONN_BINDING( &mc->mc_conns[ i ] ) ? " connbinding" : "",
-                                       META_BACK_CONN_CREATING( &mc->mc_conns[ i ] ) ? " conncreating" : "" );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "!!! %s meta_back_search[%ld] mc=%p msgid=%d%s%s%s\n\n",
+                                     op->o_log_prefix, (long)i, (void *)mc,
+                                     candidates[i].sr_msgid,
+                                     META_IS_BINDING(&candidates[i]) ? " binding" : "",
+                                     LDAP_BACK_CONN_BINDING(&mc->mc_conns[i]) ? " connbinding" : "",
+                                     META_BACK_CONN_CREATING(&mc->mc_conns[i]) ? " conncreating" : "" );
                                ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex );
-                                       
-                               Debug( LDAP_DEBUG_ANY, "!!! %s\n", buf );
                        }
 #endif /* DEBUG_205 */
                        
@@ -1758,12 +1742,11 @@ free_message:;
 #ifdef DEBUG_205
                                                        char buf[ SLAP_TEXT_BUFLEN ];
 
-                                                       snprintf( buf, sizeof( buf), "%s meta_back_search(abandon) "
-                                                               "ldap_unbind_ext[%ld] mc=%p ld=%p",
-                                                               op->o_log_prefix, i, (void *)mc,
-                                                               (void *)mc->mc_conns[i].msc_ld );
-
-                                                       Debug( LDAP_DEBUG_ANY, "### %s\n", buf );
+                                                       Debug(LDAP_DEBUG_ANY,
+                                                             "### %s meta_back_search(abandon) " "ldap_unbind_ext[%ld] mc=%p ld=%p\n",
+                                                             op->o_log_prefix,
+                                                             i, (void *)mc,
+                                                             (void *)mc->mc_conns[i].msc_ld );
 #endif /* DEBUG_205 */
 
                                                        meta_clear_one_candidate( op, mc, i );
@@ -2152,13 +2135,10 @@ meta_send_entry(
                        {
                                char    buf[ SLAP_TEXT_BUFLEN ];
 
-                               snprintf( buf, sizeof( buf ),
-                                       "%s meta_send_entry(\"%s\"): "
-                                       "slap_bv2undef_ad(%s): %s\n",
-                                       op->o_log_prefix, ent.e_name.bv_val,
-                                       mapped.bv_val, text );
-
-                               Debug( LDAP_DEBUG_ANY, "%s", buf );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "%s meta_send_entry(\"%s\"): " "slap_bv2undef_ad(%s): %s\n",
+                                     op->o_log_prefix, ent.e_name.bv_val,
+                                     mapped.bv_val, text );
                                ( void )ber_scanf( &ber, "x" /* [W] */ );
                                attr_free( attr );
                                continue;
index c964bdcc43040e2907485d960790bd128cc031a3..56f8a4d9532f9a6c356e870875fb9b6651c6da4c 100644 (file)
@@ -988,16 +988,11 @@ monitor_back_register_entry_attrs(
        if ( filter == NULL ) filter = &empty_bv;
 
        if ( be_monitor == NULL ) {
-               char            buf[ SLAP_TEXT_BUFLEN ];
-
-               snprintf( buf, sizeof( buf ),
-                       "monitor_back_register_entry_%s(base=\"%s\" scope=%s filter=\"%s\"): "
-                       "monitor database not configured.\n",
-                       fname,
-                       BER_BVISNULL( nbase ) ? "" : nbase->bv_val,
-                       ldap_pvt_scope2str( scope ),
-                       BER_BVISNULL( filter ) ? "" : filter->bv_val );
-               Debug( LDAP_DEBUG_ANY, "%s\n", buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "monitor_back_register_entry_%s(base=\"%s\" scope=%s filter=\"%s\"): " "monitor database not configured.\n\n",
+                     fname, BER_BVISNULL(nbase) ? "" : nbase->bv_val,
+                     ldap_pvt_scope2str(scope),
+                     BER_BVISNULL(filter) ? "" : filter->bv_val );
 
                return -1;
        }
@@ -1036,19 +1031,12 @@ monitor_back_register_entry_attrs(
 
                if ( BER_BVISNULL( &ndn ) ) {
                        if ( monitor_search2ndn( nbase, scope, filter, &ndn ) ) {
-                               char            buf[ SLAP_TEXT_BUFLEN ];
-
-                               snprintf( buf, sizeof( buf ),
-                                       "monitor_back_register_entry_%s(\"\"): "
-                                       "base=\"%s\" scope=%s filter=\"%s\": "
-                                       "unable to find entry\n",
-                                       fname,
-                                       nbase->bv_val ? nbase->bv_val : "\"\"",
-                                       ldap_pvt_scope2str( scope ),
-                                       filter->bv_val );
-
-                               /* entry does not exist */
-                               Debug( LDAP_DEBUG_ANY, "%s\n", buf );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "monitor_back_register_entry_%s(\"\"): " "base=\"%s\" scope=%s filter=\"%s\": " "unable to find entry\n\n",
+                                     fname,
+                                     nbase->bv_val ? nbase->bv_val : "\"\"",
+                                     ldap_pvt_scope2str(scope),
+                                     filter->bv_val );
                                return -1;
                        }
 
@@ -1443,16 +1431,11 @@ monitor_back_unregister_entry_attrs(
        char            *fname = ( target_a == NULL ? "callback" : "attrs" );
 
        if ( be_monitor == NULL ) {
-               char            buf[ SLAP_TEXT_BUFLEN ];
-
-               snprintf( buf, sizeof( buf ),
-                       "monitor_back_unregister_entry_%s(base=\"%s\" scope=%s filter=\"%s\"): "
-                       "monitor database not configured.\n",
-                       fname,
-                       BER_BVISNULL( nbase ) ? "" : nbase->bv_val,
-                       ldap_pvt_scope2str( scope ),
-                       BER_BVISNULL( filter ) ? "" : filter->bv_val );
-               Debug( LDAP_DEBUG_ANY, "%s\n", buf );
+               Debug(LDAP_DEBUG_ANY,
+                     "monitor_back_unregister_entry_%s(base=\"%s\" scope=%s filter=\"%s\"): " "monitor database not configured.\n\n",
+                     fname, BER_BVISNULL(nbase) ? "" : nbase->bv_val,
+                     ldap_pvt_scope2str(scope),
+                     BER_BVISNULL(filter) ? "" : filter->bv_val );
 
                return -1;
        }
@@ -1494,18 +1477,11 @@ monitor_back_unregister_entry_attrs(
 
                if ( BER_BVISNULL( &ndn ) ) {
                        if ( monitor_search2ndn( nbase, scope, filter, &ndn ) ) {
-                               char            buf[ SLAP_TEXT_BUFLEN ];
-
-                               snprintf( buf, sizeof( buf ),
-                                       "monitor_back_unregister_entry_%s(\"\"): "
-                                       "base=\"%s\" scope=%d filter=\"%s\": "
-                                       "unable to find entry\n",
-                                       fname,
-                                       nbase->bv_val ? nbase->bv_val : "\"\"",
-                                       scope, filter->bv_val );
-
-                               /* entry does not exist */
-                               Debug( LDAP_DEBUG_ANY, "%s\n", buf );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "monitor_back_unregister_entry_%s(\"\"): " "base=\"%s\" scope=%d filter=\"%s\": " "unable to find entry\n\n",
+                                     fname,
+                                     nbase->bv_val ? nbase->bv_val : "\"\"",
+                                     scope, filter->bv_val );
                                return -1;
                        }
 
index 0a143b7a7fceeb5b356d5f0a131b39ca350bdd58..ff12cd91f620fa17d388e552df69b96c60cf5a31 100644 (file)
@@ -855,14 +855,10 @@ backsql_add_attr(
                }
 
 #ifdef LDAP_DEBUG
-               if ( LogTest( LDAP_DEBUG_TRACE ) ) {
-                       snprintf( logbuf, sizeof( logbuf ), "val[%lu], id=" BACKSQL_IDNUMFMT,
-                                       i, new_keyval );
-                       Debug( LDAP_DEBUG_TRACE, "   backsql_add_attr(\"%s\"): "
-                               "executing \"%s\" %s\n", 
-                               op->ora_e->e_name.bv_val,
-                               at_rec->bam_add_proc, logbuf );
-               }
+               Debug(LDAP_DEBUG_TRACE,
+                     "   backsql_add_attr(\"%s\"): " "executing \"%s\" val[%lu], id=" BACKSQL_IDNUMFMT "\n",
+                     op->ora_e->e_name.bv_val, at_rec->bam_add_proc,
+                     i, new_keyval );
 #endif
                rc = SQLExecute( sth );
                if ( rc == SQL_SUCCESS && prc == LDAP_SUCCESS ) {
@@ -1383,16 +1379,11 @@ backsql_add( Operation *op, SlapReply *rs )
                goto done;
        }
 
-       if ( LogTest( LDAP_DEBUG_TRACE ) ) {
-               char buf[ SLAP_TEXT_BUFLEN ];
-
-               snprintf( buf, sizeof(buf),
-                       "executing \"%s\" for dn=\"%s\"  oc_map_id=" BACKSQL_IDNUMFMT " p_id=" BACKSQL_IDFMT " keyval=" BACKSQL_IDNUMFMT,
-                       bi->sql_insentry_stmt, op->ora_e->e_name.bv_val,
-                       oc->bom_id, BACKSQL_IDARG(bsi.bsi_base_id.eid_id),
-                       new_keyval );
-               Debug( LDAP_DEBUG_TRACE, "   backsql_add(): %s\n", buf );
-       }
+       Debug(LDAP_DEBUG_TRACE,
+             "   backsql_add(): executing \"%s\" for dn=\"%s\"  oc_map_id=" BACKSQL_IDNUMFMT " p_id=" BACKSQL_IDFMT " keyval=" BACKSQL_IDNUMFMT "\n",
+             bi->sql_insentry_stmt, op->ora_e->e_name.bv_val,
+             oc->bom_id, BACKSQL_IDARG(bsi.bsi_base_id.eid_id),
+             new_keyval );
 
        rc = SQLExecute( sth );
        if ( rc != SQL_SUCCESS ) {
index 706633e951556322676b4d8d1bc069687126376f..7d9a1f263cdb4478170af01eece8c9a28233f08b 100644 (file)
@@ -703,14 +703,10 @@ create_baseObject(
        rc = ldap_bv2rdn( &be->be_suffix[ 0 ], &rdn, (char **)&p,
                        LDAP_DN_FORMAT_LDAP );
        if ( rc != LDAP_SUCCESS ) {
-               snprintf( buf, sizeof(buf),
-                       "unable to extract RDN "
-                       "from baseObject DN \"%s\" (%d: %s)",
-                       be->be_suffix[ 0 ].bv_val,
-                       rc, ldap_err2string( rc ) );
-               Debug( LDAP_DEBUG_TRACE,
-                       "<==backsql_db_config (%s line %d): %s\n",
-                       fname, lineno, buf );
+               Debug(LDAP_DEBUG_TRACE,
+                     "<==backsql_db_config (%s line %d): unable to extract RDN " "from baseObject DN \"%s\" (%d: %s)\n",
+                     fname, lineno, be->be_suffix[0].bv_val, rc,
+                     ldap_err2string(rc) );
                return 1;
        }
 
@@ -725,15 +721,10 @@ create_baseObject(
 
                rc = slap_bv2ad( &ava->la_attr, &ad, &text );
                if ( rc != LDAP_SUCCESS ) {
-                       snprintf( buf, sizeof(buf),
-                               "AttributeDescription of naming "
-                               "attribute #%d from baseObject "
-                               "DN \"%s\": %d: %s",
-                               iAVA, be->be_suffix[ 0 ].bv_val,
-                               rc, ldap_err2string( rc ) );
-                       Debug( LDAP_DEBUG_TRACE,
-                               "<==backsql_db_config (%s line %d): %s\n",
-                               fname, lineno, buf );
+                       Debug(LDAP_DEBUG_TRACE,
+                             "<==backsql_db_config (%s line %d): AttributeDescription of naming " "attribute #%d from baseObject " "DN \"%s\": %d: %s\n",
+                             fname, lineno, iAVA, be->be_suffix[0].bv_val,
+                             rc, ldap_err2string(rc) );
                        return 1;
                }
                
@@ -750,16 +741,11 @@ create_baseObject(
                                &bv, NULL );
        
                        if ( rc != LDAP_SUCCESS ) {
-                               snprintf( buf, sizeof(buf),
-                                       "prettying of attribute #%d "
-                                       "from baseObject "
-                                       "DN \"%s\" failed: %d: %s",
-                                       iAVA, be->be_suffix[ 0 ].bv_val,
-                                       rc, ldap_err2string( rc ) );
-                               Debug( LDAP_DEBUG_TRACE,
-                                       "<==backsql_db_config (%s line %d): "
-                                       "%s\n",
-                                       fname, lineno, buf );
+                               Debug(LDAP_DEBUG_TRACE,
+                                     "<==backsql_db_config (%s line %d): " "prettying of attribute #%d " "from baseObject " "DN \"%s\" failed: %d: %s\n",
+                                     fname, lineno, iAVA,
+                                     be->be_suffix[0].bv_val, rc,
+                                     ldap_err2string(rc) );
                                return 1;
                        }
                }
index 8f885ef9951be94a8517616e566ae06a527fc5cc..2cac48c84c1378dc2d8cdbc683d85d5f420e02e6 100644 (file)
@@ -267,13 +267,10 @@ backsql_dn2id(
                char    buf[ SLAP_TEXT_BUFLEN ];
 
 #ifdef LDAP_DEBUG
-               snprintf( buf, sizeof(buf),
-                       "id=%s keyval=%s oc_id=%s dn=%s",
-                       row.cols[ 0 ], row.cols[ 1 ],
-                       row.cols[ 2 ], row.cols[ 3 ] );
-               Debug( LDAP_DEBUG_TRACE,
-                       "   backsql_dn2id(\"%s\"): %s\n",
-                       ndn->bv_val, buf );
+               Debug(LDAP_DEBUG_TRACE,
+                     "   backsql_dn2id(\"%s\"): id=%s keyval=%s oc_id=%s dn=%s\n",
+                     ndn->bv_val, row.cols[0], row.cols[1], row.cols[2],
+                     row.cols[3] );
 #endif /* LDAP_DEBUG */
 
                res = LDAP_SUCCESS;
@@ -786,21 +783,16 @@ backsql_get_attr_vals( void *v_at, void *v_bsi )
                                }
 
                                if ( retval != LDAP_SUCCESS ) {
-                                       char    buf[ SLAP_TEXT_BUFLEN ];
-
                                        /* FIXME: we're ignoring invalid values,
                                         * but we're accepting the attributes;
                                         * should we fail at all? */
-                                       snprintf( buf, sizeof( buf ),
-                                                       "unable to %s value #%lu "
-                                                       "of AttributeDescription %s",
-                                                       pretty ? "prettify" : "validate",
-                                                       k - oldcount,
-                                                       at->bam_ad->ad_cname.bv_val );
-                                       Debug( LDAP_DEBUG_TRACE,
-                                               "==>backsql_get_attr_vals(\"%s\"): "
-                                               "%s (%d)\n",
-                                               bsi->bsi_e->e_name.bv_val, buf, retval );
+                                       Debug(LDAP_DEBUG_TRACE,
+                                             "==>backsql_get_attr_vals(\"%s\"): " "unable to %s value #%lu " "of AttributeDescription %s (%d)\n",
+                                             bsi->bsi_e->e_name.bv_val,
+                                             pretty ? "prettify" : "validate",
+                                             k - oldcount,
+                                             at->bam_ad->ad_cname.bv_val,
+                                             retval );
                                        continue;
                                }
 #endif /* BACKSQL_PRETTY_VALIDATE */
@@ -826,15 +818,12 @@ backsql_get_attr_vals( void *v_at, void *v_bsi )
                                                /* FIXME: we're ignoring invalid values,
                                                 * but we're accepting the attributes;
                                                 * should we fail at all? */
-                                               snprintf( buf, sizeof( buf ),
-                                                       "unable to normalize value #%lu "
-                                                       "of AttributeDescription %s",
-                                                       k - oldcount,
-                                                       at->bam_ad->ad_cname.bv_val );
-                                               Debug( LDAP_DEBUG_TRACE,
-                                                       "==>backsql_get_attr_vals(\"%s\"): "
-                                                       "%s (%d)\n",
-                                                       bsi->bsi_e->e_name.bv_val, buf, retval );
+                                               Debug(LDAP_DEBUG_TRACE,
+                                                     "==>backsql_get_attr_vals(\"%s\"): " "unable to normalize value #%lu " "of AttributeDescription %s (%d)\n",
+                                                     bsi->bsi_e->e_name.bv_val,
+                                                     k - oldcount,
+                                                     at->bam_ad->ad_cname.bv_val,
+                                                     retval );
 
 #ifdef BACKSQL_PRETTY_VALIDATE
                                                if ( pretty ) {
index aa89936fb921635c44c2901f4273ae8f783be746..23c3e0f99ac65d1f7b65b8636f2f28680f60bcd0 100644 (file)
@@ -369,27 +369,13 @@ backsql_oc_get_attr_mapping( void *v_oc, void *v_bas )
                        }
                }
 
-               {
-                       char            buf[ SLAP_TEXT_BUFLEN ];
-
-                       snprintf( buf, sizeof( buf ),
-                               "attributeType: "
-                               "name=\"%s\" "
-                               "sel_expr=\"%s\" "
-                               "from=\"%s\" "
-                               "join_where=\"%s\" "
-                               "add_proc=\"%s\" "
-                               "delete_proc=\"%s\" "
-                               "sel_expr_u=\"%s\"",
-                               at_row.cols[ 0 ],
-                               at_row.cols[ 1 ],
-                               at_row.cols[ 2 ],
-                               at_row.cols[ 3 ] ? at_row.cols[ 3 ] : "",
-                               at_row.cols[ 4 ] ? at_row.cols[ 4 ] : "",
-                               at_row.cols[ 5 ] ? at_row.cols[ 5 ] : "",
-                               at_row.cols[ 8 ] ? at_row.cols[ 8 ] : "");
-                       Debug( LDAP_DEBUG_TRACE, "%s\n", buf );
-               }
+               Debug(LDAP_DEBUG_TRACE,
+                     "attributeType: " "name=\"%s\" " "sel_expr=\"%s\" " "from=\"%s\" " "join_where=\"%s\" " "add_proc=\"%s\" " "delete_proc=\"%s\" " "sel_expr_u=\"%s\"\n",
+                     at_row.cols[0], at_row.cols[1], at_row.cols[2],
+                     at_row.cols[3] ? at_row.cols[3] : "",
+                     at_row.cols[4] ? at_row.cols[4] : "",
+                     at_row.cols[5] ? at_row.cols[5] : "",
+                     at_row.cols[8] ? at_row.cols[8] : "" );
 
                rc = slap_str2ad( at_row.cols[ 0 ], &ad, &text );
                if ( rc != LDAP_SUCCESS ) {
@@ -589,31 +575,15 @@ backsql_load_schema_map( backsql_info *bi, SQLHDBC dbh )
                        }
                }
 
-               {
-                       char            buf[ SLAP_TEXT_BUFLEN ];
-
-                       snprintf( buf, sizeof( buf ),
-                               "objectClass: "
-                               "id=\"%s\" "
-                               "name=\"%s\" "
-                               "keytbl=\"%s\" "
-                               "keycol=\"%s\" "
-                               "create_proc=\"%s\" "
-                               "create_keyval=\"%s\" "
-                               "delete_proc=\"%s\" "
-                               "expect_return=\"%s\""
-                               "create_hint=\"%s\" ",
-                               oc_row.cols[ 0 ],
-                               oc_row.cols[ 1 ],
-                               oc_row.cols[ 2 ],
-                               oc_row.cols[ 3 ],
-                               oc_row.cols[ 4 ] ? oc_row.cols[ 4 ] : "",
-                               ( BACKSQL_CREATE_NEEDS_SELECT( bi ) && oc_row.cols[ 5 ] ) ? oc_row.cols[ 5 ] : "",
-                               oc_row.cols[ delete_proc_idx ] ? oc_row.cols[ delete_proc_idx ] : "",
-                               oc_row.cols[ delete_proc_idx + 1 ],
-                               ( ( oc_row.ncols > create_hint_idx ) && oc_row.cols[ create_hint_idx ] ) ? oc_row.cols[ create_hint_idx ] : "" );
-                       Debug( LDAP_DEBUG_TRACE, "%s\n", buf );
-               }
+               Debug(LDAP_DEBUG_TRACE,
+                     "objectClass: " "id=\"%s\" " "name=\"%s\" " "keytbl=\"%s\" " "keycol=\"%s\" " "create_proc=\"%s\" " "create_keyval=\"%s\" " "delete_proc=\"%s\" " "expect_return=\"%s\"" "create_hint=\"%s\" \n",
+                     oc_row.cols[0], oc_row.cols[1], oc_row.cols[2],
+                     oc_row.cols[3],
+                     oc_row.cols[4] ? oc_row.cols[4] : "",
+                     (BACKSQL_CREATE_NEEDS_SELECT(bi) && oc_row.cols[5]) ? oc_row.cols[5] : "",
+                     oc_row.cols[delete_proc_idx] ? oc_row.cols[delete_proc_idx] : "",
+                     oc_row.cols[delete_proc_idx + 1],
+                     ((oc_row.ncols > create_hint_idx) && oc_row.cols[create_hint_idx]) ? oc_row.cols[create_hint_idx] : "" );
 
                oc_map = (backsql_oc_map_rec *)ch_calloc( 1,
                                sizeof( backsql_oc_map_rec ) );
index 36d0fd1510a72a6720c0083e419db72a4b05d8a7..87a683f3bb1fc30668f10c1c8466e94b4bfab4a0 100644 (file)
@@ -238,12 +238,10 @@ wt_back_initialize( BackendInfo *bi )
                SLAP_BFLAG_REFERRALS;
 
        bi->bi_controls = controls;
-
-       { /* version check */
-               Debug( LDAP_DEBUG_TRACE,
-                          LDAP_XSTRING(wt_back_initialize) ": %s\n",
-                          wiredtiger_version(NULL, NULL, NULL) );
-       }
+/* version check */
+       Debug( LDAP_DEBUG_TRACE,
+                  LDAP_XSTRING(wt_back_initialize) ": %s\n",
+                  wiredtiger_version(NULL, NULL, NULL) );
 
        bi->bi_open = 0;
        bi->bi_close = 0;
index 6f667fbab59d3dc17f9ed9d644942f5141a5a797..f5e1b55032a6733ee03aead26b66ab4eee0ea680 100644 (file)
@@ -2436,12 +2436,10 @@ slapd_daemon_task(
                                                err, sock_errstr(err) );
                                }
 
-                               snprintf( buf, sizeof( buf ),
-                                       "url=%s (#%d) RCVBUF original size=%d requested size=%d real size=%d", 
-                                       slap_listeners[l]->sl_url.bv_val, l, origsize, size, realsize );
-                               Debug( LDAP_DEBUG_ANY,
-                                       "slapd_daemon_task: %s\n",
-                                       buf );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "slapd_daemon_task: url=%s (#%d) RCVBUF original size=%d requested size=%d real size=%d\n",
+                                     slap_listeners[l]->sl_url.bv_val, l,
+                                     origsize, size, realsize );
                        }
 
                        size = 0;
@@ -2494,12 +2492,10 @@ slapd_daemon_task(
                                                err, sock_errstr(err) );
                                }
 
-                               snprintf( buf, sizeof( buf ),
-                                       "url=%s (#%d) SNDBUF original size=%d requested size=%d real size=%d", 
-                                       slap_listeners[l]->sl_url.bv_val, l, origsize, size, realsize );
-                               Debug( LDAP_DEBUG_ANY,
-                                       "slapd_daemon_task: %s\n",
-                                       buf );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "slapd_daemon_task: url=%s (#%d) SNDBUF original size=%d requested size=%d real size=%d\n",
+                                     slap_listeners[l]->sl_url.bv_val, l,
+                                     origsize, size, realsize );
                        }
                }
 #endif /* LDAP_TCP_BUFFER */
index 1dc40a9c3365f381f785ac1743a2a49a3a9b3105..93e8eca65ca6c0ac5c4ec6421469810aceb07424 100644 (file)
@@ -430,12 +430,10 @@ memberof_value_modify(
                op2.o_bd->bd_info = bi;
                LDAP_SLIST_REMOVE(&op2.o_extra, &oex, OpExtra, oe_next);
                if ( rs2.sr_err != LDAP_SUCCESS ) {
-                       char buf[ SLAP_TEXT_BUFLEN ];
-                       snprintf( buf, sizeof( buf ),
-                               "memberof_value_modify DN=\"%s\" add %s=\"%s\" failed err=%d",
-                               op2.o_req_dn.bv_val, ad->ad_cname.bv_val, new_dn->bv_val, rs2.sr_err );
-                       Debug( LDAP_DEBUG_ANY, "%s: %s\n",
-                               op->o_log_prefix, buf );
+                       Debug(LDAP_DEBUG_ANY,
+                             "%s: memberof_value_modify DN=\"%s\" add %s=\"%s\" failed err=%d\n",
+                             op->o_log_prefix, op2.o_req_dn.bv_val,
+                             ad->ad_cname.bv_val, new_dn->bv_val, rs2.sr_err );
                }
 
                assert( op2.orm_modlist == &mod[ mcnt ] );
@@ -472,12 +470,10 @@ memberof_value_modify(
                op2.o_bd->bd_info = bi;
                LDAP_SLIST_REMOVE(&op2.o_extra, &oex, OpExtra, oe_next);
                if ( rs2.sr_err != LDAP_SUCCESS ) {
-                       char buf[ SLAP_TEXT_BUFLEN ];
-                       snprintf( buf, sizeof( buf ),
-                               "memberof_value_modify DN=\"%s\" delete %s=\"%s\" failed err=%d",
-                               op2.o_req_dn.bv_val, ad->ad_cname.bv_val, old_dn->bv_val, rs2.sr_err );
-                       Debug( LDAP_DEBUG_ANY, "%s: %s\n",
-                               op->o_log_prefix, buf );
+                       Debug(LDAP_DEBUG_ANY,
+                             "%s: memberof_value_modify DN=\"%s\" delete %s=\"%s\" failed err=%d\n",
+                             op->o_log_prefix, op2.o_req_dn.bv_val,
+                             ad->ad_cname.bv_val, old_dn->bv_val, rs2.sr_err );
                }
 
                assert( op2.orm_modlist == &mod[ mcnt ] );
index b07d371a29a7a5f349da55751274a707160f97bc..eb86d5c987b10340b89c75705b03042a075f9e55 100644 (file)
@@ -184,12 +184,10 @@ rwm_map_config(
                                                &mapping[0].m_src_ad, &text,
                                                SLAP_AD_PROXIED );
                                if ( rc != LDAP_SUCCESS ) {
-                                       char prefix[1024];
-                                       snprintf( prefix, sizeof(prefix),
-       "%s: line %d: source attributeType '%s': %d",
-                                               fname, lineno, src, rc );
-                                       Debug( LDAP_DEBUG_ANY, "%s (%s)\n",
-                                               prefix, text ? text : "null" );
+                                       Debug(LDAP_DEBUG_ANY,
+                                             "%s: line %d: source attributeType '%s': %d (%s)\n",
+                                             fname, lineno, src, rc,
+                                             text ? text : "null" );
                                        goto error_return;
                                }
 
@@ -208,12 +206,10 @@ rwm_map_config(
                                        &mapping[0].m_dst_ad, &text,
                                        SLAP_AD_PROXIED );
                        if ( rc != LDAP_SUCCESS ) {
-                               char prefix[1024];
-                               snprintf( prefix, sizeof(prefix), 
-       "%s: line %d: destination attributeType '%s': %d",
-                                       fname, lineno, dst, rc );
-                               Debug( LDAP_DEBUG_ANY, "%s (%s)\n",
-                                       prefix, text ? text : "null" );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "%s: line %d: destination attributeType '%s': %d (%s)\n",
+                                     fname, lineno, dst, rc,
+                                     text ? text : "null" );
                                goto error_return;
                        }
                }
index 2bcde087c89ba1d390da1d86bb81aeb4b048cd7e..1b539f5feb0af447f03bc12c6a8cf2892934e35d 100644 (file)
@@ -112,13 +112,9 @@ entry_schema_check(
                if( is_at_single_value( a->a_desc->ad_type ) &&
                        a->a_vals[1].bv_val != NULL )
                {
-                       snprintf( textbuf, textlen, 
-                               "attribute '%s' cannot have multiple values",
-                               type );
-
-                       Debug( LDAP_DEBUG_ANY,
-                           "Entry (%s), %s\n",
-                           e->e_dn, textbuf );
+                       Debug(LDAP_DEBUG_ANY,
+                             "Entry (%s), attribute '%s' cannot have multiple values\n",
+                             e->e_dn, type );
 
                        return LDAP_CONSTRAINT_VIOLATION;
                }
@@ -165,26 +161,18 @@ entry_schema_check(
 
        sc = oc_bvfind( &asc->a_vals[0] );
        if( sc == NULL ) {
-               snprintf( textbuf, textlen, 
-                       "unrecognized structuralObjectClass '%s'",
-                       asc->a_vals[0].bv_val );
-
-               Debug( LDAP_DEBUG_ANY,
-                       "entry_check_schema(%s): %s\n",
-                       e->e_dn, textbuf );
+               Debug(LDAP_DEBUG_ANY,
+                     "entry_check_schema(%s): unrecognized structuralObjectClass '%s'\n",
+                     e->e_dn, asc->a_vals[0].bv_val );
 
                rc = LDAP_OBJECT_CLASS_VIOLATION;
                goto done;
        }
 
        if( sc->soc_kind != LDAP_SCHEMA_STRUCTURAL ) {
-               snprintf( textbuf, textlen, 
-                       "structuralObjectClass '%s' is not STRUCTURAL",
-                       asc->a_vals[0].bv_val );
-
-               Debug( LDAP_DEBUG_ANY,
-                       "entry_check_schema(%s): %s\n",
-                       e->e_dn, textbuf );
+               Debug(LDAP_DEBUG_ANY,
+                     "entry_check_schema(%s): structuralObjectClass '%s' is not STRUCTURAL\n",
+                     e->e_dn, asc->a_vals[0].bv_val );
 
                rc = LDAP_OTHER;
                goto done;
@@ -192,13 +180,9 @@ entry_schema_check(
 
 got_soc:
        if( !manage && sc->soc_obsolete ) {
-               snprintf( textbuf, textlen, 
-                       "structuralObjectClass '%s' is OBSOLETE",
-                       asc->a_vals[0].bv_val );
-
-               Debug( LDAP_DEBUG_ANY,
-                       "entry_check_schema(%s): %s\n",
-                       e->e_dn, textbuf );
+               Debug(LDAP_DEBUG_ANY,
+                     "entry_check_schema(%s): structuralObjectClass '%s' is OBSOLETE\n",
+                     e->e_dn, asc->a_vals[0].bv_val );
 
                rc = LDAP_OBJECT_CLASS_VIOLATION;
                goto done;
@@ -256,13 +240,9 @@ got_soc:
        /* check that the entry has required attrs of the content rule */
        if( cr ) {
                if( !manage && cr->scr_obsolete ) {
-                       snprintf( textbuf, textlen, 
-                               "content rule '%s' is obsolete",
-                               ldap_contentrule2name( &cr->scr_crule ));
-
-                       Debug( LDAP_DEBUG_ANY,
-                               "Entry (%s): %s\n",
-                               e->e_dn, textbuf );
+                       Debug(LDAP_DEBUG_ANY,
+                             "Entry (%s): content rule '%s' is obsolete\n",
+                             e->e_dn, ldap_contentrule2name(&cr->scr_crule) );
 
                        rc = LDAP_OBJECT_CLASS_VIOLATION;
                        goto done;
@@ -279,14 +259,11 @@ got_soc:
 
                        /* not there => schema violation */
                        if ( a == NULL ) {
-                               snprintf( textbuf, textlen, 
-                                       "content rule '%s' requires attribute '%s'",
-                                       ldap_contentrule2name( &cr->scr_crule ),
-                                       at->sat_cname.bv_val );
-
-                               Debug( LDAP_DEBUG_ANY,
-                                       "Entry (%s): %s\n",
-                                       e->e_dn, textbuf );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "Entry (%s): content rule '%s' requires attribute '%s'\n",
+                                     e->e_dn,
+                                     ldap_contentrule2name(&cr->scr_crule),
+                                     at->sat_cname.bv_val );
 
                                rc = LDAP_OBJECT_CLASS_VIOLATION;
                                goto done;
@@ -304,14 +281,11 @@ got_soc:
 
                        /* there => schema violation */
                        if ( a != NULL ) {
-                               snprintf( textbuf, textlen, 
-                                       "content rule '%s' precluded attribute '%s'",
-                                       ldap_contentrule2name( &cr->scr_crule ),
-                                       at->sat_cname.bv_val );
-
-                               Debug( LDAP_DEBUG_ANY,
-                                       "Entry (%s): %s\n",
-                                       e->e_dn, textbuf );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "Entry (%s): content rule '%s' precluded attribute '%s'\n",
+                                     e->e_dn,
+                                     ldap_contentrule2name(&cr->scr_crule),
+                                     at->sat_cname.bv_val );
 
                                rc = LDAP_OBJECT_CLASS_VIOLATION;
                                goto done;
@@ -324,13 +298,9 @@ got_soc:
                oc = socs[i];
                if ( !manage && oc->soc_obsolete ) {
                        /* disallow obsolete classes */
-                       snprintf( textbuf, textlen, 
-                               "objectClass '%s' is OBSOLETE",
-                               aoc->a_vals[i].bv_val );
-
-                       Debug( LDAP_DEBUG_ANY,
-                               "entry_check_schema(%s): %s\n",
-                               e->e_dn, textbuf );
+                       Debug(LDAP_DEBUG_ANY,
+                             "entry_check_schema(%s): objectClass '%s' is OBSOLETE\n",
+                             e->e_dn, aoc->a_vals[i].bv_val );
 
                        rc = LDAP_OBJECT_CLASS_VIOLATION;
                        goto done;
@@ -371,13 +341,9 @@ got_soc:
                                }
 
                                if( xc != NULL ) {
-                                       snprintf( textbuf, textlen, "instantiation of "
-                                               "abstract objectClass '%s' not allowed",
-                                               aoc->a_vals[i].bv_val );
-
-                                       Debug( LDAP_DEBUG_ANY,
-                                               "entry_check_schema(%s): %s\n",
-                                               e->e_dn, textbuf );
+                                       Debug(LDAP_DEBUG_ANY,
+                                             "entry_check_schema(%s): instantiation of " "abstract objectClass '%s' not allowed\n",
+                                             e->e_dn, aoc->a_vals[i].bv_val );
 
                                        rc = LDAP_OBJECT_CLASS_VIOLATION;
                                        goto done;
@@ -429,13 +395,9 @@ got_soc:
 
                        s = oc_check_required( e, oc, &aoc->a_vals[i] );
                        if (s != NULL) {
-                               snprintf( textbuf, textlen, 
-                                       "object class '%s' requires attribute '%s'",
-                                       aoc->a_vals[i].bv_val, s );
-
-                               Debug( LDAP_DEBUG_ANY,
-                                       "Entry (%s): %s\n",
-                                       e->e_dn, textbuf );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "Entry (%s): object class '%s' requires attribute '%s'\n",
+                                     e->e_dn, aoc->a_vals[i].bv_val, s );
 
                                rc = LDAP_OBJECT_CLASS_VIOLATION;
                                goto done;
@@ -483,13 +445,9 @@ got_soc:
                if ( rc != LDAP_SUCCESS ) {
                        char *type = a->a_desc->ad_cname.bv_val;
 
-                       snprintf( textbuf, textlen, 
-                               "attribute '%s' not allowed",
-                               type );
-
-                       Debug( LDAP_DEBUG_ANY,
-                           "Entry (%s), %s\n",
-                           e->e_dn, textbuf );
+                       Debug(LDAP_DEBUG_ANY,
+                             "Entry (%s), attribute '%s' not allowed\n",
+                             e->e_dn, type );
 
                        goto done;
                }
index 4015957f85dc2e6f129b02c005643137c5a55ae4..e77cae96608ffee9f12d1de6443839916459b5a8 100644 (file)
@@ -290,16 +290,13 @@ again:
                        }
 
                        if ( SLAP_SINGLE_SHADOW(be) && got != GOT_ALL ) {
-                               char buf[SLAP_TEXT_BUFLEN];
-
-                               snprintf( buf, sizeof(buf),
-                                       "%s%s%s",
-                                       ( !(got & GOT_UUID) ? slap_schema.si_ad_entryUUID->ad_cname.bv_val : "" ),
-                                       ( !(got & GOT_CSN) ? "," : "" ),
-                                       ( !(got & GOT_CSN) ? slap_schema.si_ad_entryCSN->ad_cname.bv_val : "" ) );
-
-                               Debug( LDAP_DEBUG_ANY, "%s: warning, missing attrs %s from entry dn=\"%s\"\n",
-                                       progname, buf, e->e_name.bv_val );
+                               Debug(LDAP_DEBUG_ANY,
+                                     "%s: warning, missing attrs %s%s%s from entry dn=\"%s\"\n",
+                                     progname,
+                                     (!(got & GOT_UUID) ? slap_schema.si_ad_entryUUID->ad_cname.bv_val : ""),
+                                     (!(got & GOT_CSN) ? "," : ""),
+                                     (!(got & GOT_CSN) ? slap_schema.si_ad_entryCSN->ad_cname.bv_val : ""),
+                                     e->e_name.bv_val );
                        }
 
                        sid = slap_tool_update_ctxcsn_check( progname, e );
index 24a77b4c8faae73174699a394f25e83cb1fc76fb..826c0563929d51149a04f973f91e7cb9f79ee96c 100644 (file)
@@ -5308,15 +5308,12 @@ nonpresent_callback(
                                present_uuid = presentlist_find( si->si_presentlist, &a->a_nvals[0] );
                        }
 
-                       if ( LogTest( LDAP_DEBUG_SYNC ) ) {
-                               char buf[sizeof("rid=999 non")];
-
-                               snprintf( buf, sizeof(buf), "%s %s", si->si_ridtxt,
-                                       present_uuid ? "" : "non" );
-
-                               Debug( LDAP_DEBUG_SYNC, "nonpresent_callback: %spresent UUID %s, dn %s\n",
-                                       buf, a ? a->a_vals[0].bv_val : "<missing>", rs->sr_entry->e_name.bv_val );
-                       }
+                       Debug(LDAP_DEBUG_SYNC,
+                             "nonpresent_callback: %s %spresent UUID %s, dn %s\n",
+                             si->si_ridtxt,
+                             present_uuid ? "" : "non",
+                             a ? a->a_vals[0].bv_val : "<missing>",
+                             rs->sr_entry->e_name.bv_val );
 
                        if ( a == NULL ) return 0;
                }