ITS#8731 Apply doc/devel/variadic_debug/07-shortcut.cocci

This commit is contained in:
Ondřej Kuzník 2019-02-15 16:50:54 +00:00
parent 251ce83d60
commit 76df74dbea
26 changed files with 372 additions and 699 deletions

View 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 );
"%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.",
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 );
Debug( LDAP_DEBUG_CONFIG | LDAP_DEBUG_ACL,
"%s: line %d: %s\n",
fname, lineno, buf );
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).",
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 );
Debug( LDAP_DEBUG_ANY,
"%s: line %d: %s\n",
fname, lineno, buf );
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 );
"%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)",
Debug(LDAP_DEBUG_ANY,
"%s: line %d: %s: line %d: " " attr \"%s\" normalization failed (%d: %s).\n",
fname, lineno,
a->acl_attrs[ 0 ].an_name.bv_val, rc, text );
Debug( LDAP_DEBUG_ANY, "%s: line %d: %s.\n",
fname, lineno, buf );
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 );
"%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 );
"%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 );
"%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,
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) );
Debug( LDAP_DEBUG_ANY,
"%s: line %d: %s\n",
fname, lineno, buf );
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\".",
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 );
Debug( LDAP_DEBUG_ANY, "%s: line %d: %s\n",
fname, lineno, buf );
goto fail;
}
}

View 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 );
}
"%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 );
"### %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,
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 : "") );
Debug( LDAP_DEBUG_ANY, "%s %s.\n",
op->o_log_prefix, buf );
}
/*
* 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",
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 );
Debug( LDAP_DEBUG_ANY, "### %s asyncmeta_search_dobind_init[%d]%s\n",
op->o_log_prefix, candidate, buf );
#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 );
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 );
"%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 );
}
ldap_pvt_thread_mutex_lock( &mc->mc_om_mutex );

View 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 );

View 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 );
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 );
"%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 );
}
( 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

View 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;
}

View 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",
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 );
Debug( LDAP_DEBUG_ANY, "%s", buf );
( 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 );
}
}
if (msg)
ldap_msgfree(msg);

View 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;
}

View 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 );
}
"=>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 );
}
"=>ldap_back_getconn: conn %p fetched refcnt=%u%s.\n",
(void *)lc, refcnt, expiring ? " expiring" : "" );
}
#ifdef HAVE_TLS

View 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 );
"ldif_move_entry: %s (%s): \"%s\" -> \"%s\"\n",
*text, STRERROR(errno),
op->o_req_dn.bv_val, entry->e_dn );
}
}

View 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 );
}
"%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 );
"### %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 );
"%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,
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 : "") );
Debug( LDAP_DEBUG_ANY, "%s %s.\n",
op->o_log_prefix, buf );
}
/*
* FIXME: need to rewrite "match" (need rwinfo)

View 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 );

View 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 );
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 );
"%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 );
}
/* 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

View 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;
}

View 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",
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 );
Debug( LDAP_DEBUG_ANY, "### %s meta_search_dobind_init[%d]%s\n",
op->o_log_prefix, candidate, buf );
#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 );
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 );
"%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 );
}
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",
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,
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 );
Debug( LDAP_DEBUG_ANY, "### %s\n", buf );
#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",
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 );
Debug( LDAP_DEBUG_ANY, "%s", buf );
( void )ber_scanf( &ber, "x" /* [W] */ );
attr_free( attr );
continue;

View 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,
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 );
Debug( LDAP_DEBUG_ANY, "%s\n", buf );
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",
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 );
/* entry does not exist */
Debug( LDAP_DEBUG_ANY, "%s\n", buf );
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,
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 );
Debug( LDAP_DEBUG_ANY, "%s\n", buf );
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",
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 );
/* entry does not exist */
Debug( LDAP_DEBUG_ANY, "%s\n", buf );
return -1;
}

View 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,
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 );
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 );
}
#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,
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 );
Debug( LDAP_DEBUG_TRACE, " backsql_add(): %s\n", buf );
}
rc = SQLExecute( sth );
if ( rc != SQL_SUCCESS ) {

View 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 );
"<==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 );
"<==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 );
"<==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;
}
}

View 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 );
" 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",
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 );
Debug( LDAP_DEBUG_TRACE,
"==>backsql_get_attr_vals(\"%s\"): "
"%s (%d)\n",
bsi->bsi_e->e_name.bv_val, buf, retval );
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 );
"==>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 ) {

View 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 ],
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] : "" );
Debug( LDAP_DEBUG_TRACE, "%s\n", buf );
}
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 ],
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] : "" );
Debug( LDAP_DEBUG_TRACE, "%s\n", buf );
}
oc_map = (backsql_oc_map_rec *)ch_calloc( 1,
sizeof( backsql_oc_map_rec ) );

View File

@ -238,12 +238,10 @@ wt_back_initialize( BackendInfo *bi )
SLAP_BFLAG_REFERRALS;
bi->bi_controls = controls;
{ /* version check */
/* 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;

View 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 );
"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 );
"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 */

View 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 ] );

View 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;
}
}

View 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 );
"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 );
"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 );
"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 );
"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 );
"Entry (%s): content rule '%s' is obsolete\n",
e->e_dn, ldap_contentrule2name(&cr->scr_crule) );
rc = LDAP_OBJECT_CLASS_VIOLATION;
goto done;
@ -279,15 +259,12 @@ got_soc:
/* not there => schema violation */
if ( a == NULL ) {
snprintf( textbuf, textlen,
"content rule '%s' requires attribute '%s'",
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 );
Debug( LDAP_DEBUG_ANY,
"Entry (%s): %s\n",
e->e_dn, textbuf );
rc = LDAP_OBJECT_CLASS_VIOLATION;
goto done;
}
@ -304,15 +281,12 @@ got_soc:
/* there => schema violation */
if ( a != NULL ) {
snprintf( textbuf, textlen,
"content rule '%s' precluded attribute '%s'",
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 );
Debug( LDAP_DEBUG_ANY,
"Entry (%s): %s\n",
e->e_dn, textbuf );
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 );
"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 );
"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 );
"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 );
"Entry (%s), attribute '%s' not allowed\n",
e->e_dn, type );
goto done;
}

View 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",
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 : "" ) );
Debug( LDAP_DEBUG_ANY, "%s: warning, missing attrs %s from entry dn=\"%s\"\n",
progname, buf, e->e_name.bv_val );
(!(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 );

View 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;
}