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 );
}
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;
}
}
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;
} 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;
}
}
&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;
}
}
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;
}
}
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;
}
!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;
}
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;
}
&& !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;
}
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;
}
}
* 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 */
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:
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)
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;
#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;
#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 ) {
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 ) {
/* 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 );
#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 );
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;
}
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 );
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
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;
}
{
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;
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);
/* 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;
}
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 */
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
}
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 );
}
}
* 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 */
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:
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
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)
#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 );
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;
}
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;
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
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;
}
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;
#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;
#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 ) {
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 ) {
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 );
#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 */
#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 );
{
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;
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;
}
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;
}
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;
}
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;
}
}
#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 ) {
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 ) {
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;
}
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;
}
&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;
}
}
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;
}
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 */
/* 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 ) {
}
}
- {
- 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 ) {
}
}
- {
- 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 ) );
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;
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;
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 */
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 ] );
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 ] );
&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;
}
&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;
}
}
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;
}
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;
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;
/* 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;
/* 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;
/* 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;
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;
}
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;
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;
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;
}
}
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 );
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;
}