goto done;
}
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu ADD dn=\"%s\"\n",
- op->o_connid, op->o_opid, e->e_name.bv_val, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s ADD dn=\"%s\"\n",
+ op->o_log_prefix, e->e_name.bv_val, 0, 0, 0 );
if( e->e_nname.bv_len == 0 ) {
/* protocolError may be a more appropriate error */
op->oq_bind.rb_cred.bv_val != NULL && op->oq_bind.rb_cred.bv_len )
{
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu DNSSRV BIND dn=\"%s\" provided passwd\n",
- op->o_connid, op->o_opid,
- op->o_req_dn.bv_val == NULL ? "" : op->o_req_dn.bv_val , 0, 0 );
+ "%s DNSSRV BIND dn=\"%s\" provided passwd\n",
+ op->o_log_prefix,
+ op->o_req_dn.bv_val == NULL ? "" : op->o_req_dn.bv_val , 0, 0, 0 );
Debug( LDAP_DEBUG_TRACE,
"DNSSRV: BIND dn=\"%s\" provided cleartext password\n",
}
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu DNSSRV p=%d dn=\"%s\" url=\"%s\"\n",
- op->o_connid, op->o_opid, op->o_protocol,
- op->o_req_dn.bv_val, urls[0].bv_val );
+ "%s DNSSRV p=%d dn=\"%s\" url=\"%s\"\n",
+ op->o_log_prefix, op->o_protocol,
+ op->o_req_dn.bv_val, urls[0].bv_val, 0 );
Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> url=\"%s\"\n",
op->o_req_dn.bv_val, urls[0].bv_val, 0 );
}
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu DNSSRV p=%d dn=\"%s\" url=\"%s\"\n",
- op->o_connid, op->o_opid, op->o_protocol,
- op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "", urls[0].bv_val );
+ "%s DNSSRV p=%d dn=\"%s\" url=\"%s\"\n",
+ op->o_log_prefix, op->o_protocol,
+ op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "", urls[0].bv_val, 0 );
Debug( LDAP_DEBUG_TRACE,
"DNSSRV: ManageDSAit scope=%d dn=\"%s\" -> url=\"%s\"\n",
if ( op->o_conn->c_sasl_bind_in_progress ) {
be = op->o_conn->c_authz_backend;
}
- if ( op->o_conn->c_dn.bv_len ) {
+ if ( !BER_BVISEMPTY( &op->o_conn->c_dn ) ) {
/* log authorization identity demotion */
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu BIND anonymous mech=implicit ssf=0\n",
- op->o_connid, op->o_opid, 0, 0, 0 );
+ "%s BIND anonymous mech=implicit ssf=0\n",
+ op->o_log_prefix, 0, 0, 0, 0 );
}
connection2anonymous( op->o_conn );
if ( op->o_conn->c_sasl_bind_in_progress ) {
op->o_conn->c_authz_backend = be;
}
ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
- if ( op->o_dn.bv_val != NULL ) {
- free( op->o_dn.bv_val );
- op->o_dn.bv_val = ch_strdup( "" );
+ if ( !BER_BVISNULL( &op->o_dn ) ) {
+ /* NOTE: temporarily wasting few bytes
+ * (until bind is completed), but saving
+ * a couple of ch_free() and ch_strdup("") */
+ op->o_dn.bv_val[0] = '\0';
op->o_dn.bv_len = 0;
}
- if ( op->o_ndn.bv_val != NULL ) {
- free( op->o_ndn.bv_val );
- op->o_ndn.bv_val = ch_strdup( "" );
+ if ( !BER_BVISNULL( &op->o_ndn ) ) {
+ op->o_ndn.bv_val[0] = '\0';
op->o_ndn.bv_len = 0;
}
(unsigned long) op->orb_method );
}
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu BIND dn=\"%s\" method=%ld\n",
- op->o_connid, op->o_opid, op->o_req_dn.bv_val,
- (unsigned long) op->orb_method, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s BIND dn=\"%s\" method=%ld\n",
+ op->o_log_prefix, op->o_req_dn.bv_val,
+ (unsigned long) op->orb_method, 0, 0 );
if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) {
Debug( LDAP_DEBUG_ANY, "do_bind: unknown version=%ld\n",
op->o_conn->c_sasl_bindop = NULL;
- if( op->o_req_dn.bv_val != NULL ) {
+ if( !BER_BVISNULL( &op->o_req_dn ) ) {
slap_sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
BER_BVZERO( &op->o_req_dn );
}
- if( op->o_req_ndn.bv_val != NULL ) {
+ if( !BER_BVISNULL( &op->o_req_ndn ) ) {
slap_sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
BER_BVZERO( &op->o_req_ndn );
}
goto cleanup;
}
- if( mech.bv_len == 0 ) {
+ if( BER_BVISNULL( &mech ) || BER_BVISEMPTY( &mech ) ) {
Debug( LDAP_DEBUG_ANY,
"do_bind: no sasl mechanism provided\n",
0, 0, 0 );
ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
if( rs->sr_err == LDAP_SUCCESS ) {
ber_dupbv(&op->o_conn->c_dn, &op->orb_edn);
- if( op->orb_edn.bv_len != 0 ) {
+ if( !BER_BVISEMPTY( &op->orb_edn ) ) {
/* edn is always normalized already */
ber_dupbv( &op->o_conn->c_ndn, &op->o_conn->c_dn );
}
op->o_conn->c_ssf = op->orb_ssf;
}
- if( op->o_conn->c_dn.bv_len != 0 ) {
+ if( !BER_BVISEMPTY( &op->o_conn->c_dn ) ) {
ber_len_t max = sockbuf_max_incoming_auth;
ber_sockbuf_ctrl( op->o_conn->c_sb,
LBER_SB_OPT_SET_MAX_INCOMING, &max );
/* log authorization identity */
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu BIND dn=\"%s\" mech=%s ssf=%d\n",
- op->o_connid, op->o_opid,
- op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
- op->o_conn->c_authmech.bv_val, op->orb_ssf );
+ "%s BIND dn=\"%s\" mech=%s ssf=%d\n",
+ op->o_log_prefix,
+ BER_BVISNULL( &op->o_conn->c_dn ) ? "<empty>" : op->o_conn->c_dn.bv_val,
+ op->o_conn->c_authmech.bv_val, op->orb_ssf, 0 );
Debug( LDAP_DEBUG_TRACE,
"do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
op->o_conn->c_authmech.bv_val,
- op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
+ BER_BVISNULL( &op->o_conn->c_dn ) ? "<empty>" : op->o_conn->c_dn.bv_val,
op->orb_ssf );
} else if ( rs->sr_err == LDAP_SASL_BIND_IN_PROGRESS ) {
op->o_conn->c_sasl_bind_in_progress = 1;
} else {
- if ( op->o_conn->c_sasl_bind_mech.bv_val ) {
+ if ( !BER_BVISNULL( &op->o_conn->c_sasl_bind_mech ) ) {
free( op->o_conn->c_sasl_bind_mech.bv_val );
BER_BVZERO( &op->o_conn->c_sasl_bind_mech );
}
/* Not SASL, cancel any in-progress bind */
ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
- if ( op->o_conn->c_sasl_bind_mech.bv_val != NULL ) {
- free(op->o_conn->c_sasl_bind_mech.bv_val);
+ if ( !BER_BVISNULL( &op->o_conn->c_sasl_bind_mech ) ) {
+ free( op->o_conn->c_sasl_bind_mech.bv_val );
BER_BVZERO( &op->o_conn->c_sasl_bind_mech );
}
op->o_conn->c_sasl_bind_in_progress = 0;
}
if ( op->orb_method == LDAP_AUTH_SIMPLE ) {
- ber_str2bv( "SIMPLE", sizeof("SIMPLE")-1, 0, &mech );
+ BER_BVSTR( &mech, "SIMPLE" );
/* accept "anonymous" binds */
- if ( op->orb_cred.bv_len == 0 || op->o_req_ndn.bv_len == 0 ) {
+ if ( BER_BVISEMPTY( &op->orb_cred ) || BER_BVISEMPTY( &op->o_req_ndn ) ) {
rs->sr_err = LDAP_SUCCESS;
- if( op->orb_cred.bv_len &&
+ if( !BER_BVISEMPTY( &op->orb_cred ) &&
!( global_allows & SLAP_ALLOW_BIND_ANON_CRED ))
{
/* cred is not empty, disallow */
rs->sr_err = LDAP_INVALID_CREDENTIALS;
- } else if ( op->o_req_ndn.bv_len &&
+ } else if ( !BER_BVISEMPTY( &op->o_req_ndn ) &&
!( global_allows & SLAP_ALLOW_BIND_ANON_DN ))
{
/* DN is not empty, disallow */
op->o_protocol, 0, 0 );
goto cleanup;
}
- ber_str2bv( "KRBV4", sizeof("KRBV4")-1, 0, &mech );
+ BER_BVSTR( &mech, "KRBV4" );
} else if ( op->orb_method == LDAP_AUTH_KRBV42 ) {
rs->sr_err = LDAP_AUTH_METHOD_NOT_SUPPORTED;
BER_BVZERO( &op->o_req_dn );
op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
BER_BVZERO( &op->o_req_ndn );
- if ( op->o_conn->c_dn.bv_len != 0 ) {
+ if ( !BER_BVISEMPTY( &op->o_conn->c_dn ) ) {
ber_len_t max = sockbuf_max_incoming_auth;
ber_sockbuf_ctrl( op->o_conn->c_sb,
LBER_SB_OPT_SET_MAX_INCOMING, &max );
}
/* log authorization identity */
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu BIND dn=\"%s\" mech=%s (SLAPI) ssf=0\n",
- op->o_connid, op->o_opid,
- op->o_conn->c_dn.bv_val
- ? op->o_conn->c_dn.bv_val : "<empty>",
- mech.bv_val, 0 );
+ "%s BIND dn=\"%s\" mech=%s (SLAPI) ssf=0\n",
+ op->o_log_prefix,
+ BER_BVISNULL( &op->o_conn->c_dn )
+ ? "<empty>" : op->o_conn->c_dn.bv_val,
+ mech.bv_val, 0, 0 );
ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
}
goto cleanup;
}
/* be_bind returns regular/global edn */
- if( op->orb_edn.bv_len ) {
+ if( !BER_BVISEMPTY( &op->orb_edn ) ) {
op->o_conn->c_dn = op->orb_edn;
} else {
ber_dupbv(&op->o_conn->c_dn, &op->o_req_dn);
ber_dupbv( &op->o_conn->c_ndn, &op->o_req_ndn );
- if( op->o_conn->c_dn.bv_len != 0 ) {
+ if( !BER_BVISEMPTY( &op->o_conn->c_dn ) ) {
ber_len_t max = sockbuf_max_incoming_auth;
ber_sockbuf_ctrl( op->o_conn->c_sb,
LBER_SB_OPT_SET_MAX_INCOMING, &max );
/* log authorization identity */
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu BIND dn=\"%s\" mech=%s ssf=0\n",
- op->o_connid, op->o_opid,
- op->o_conn->c_dn.bv_val, mech.bv_val, 0 );
+ "%s BIND dn=\"%s\" mech=%s ssf=0\n",
+ op->o_log_prefix,
+ op->o_conn->c_dn.bv_val, mech.bv_val, 0, 0 );
Debug( LDAP_DEBUG_TRACE,
"do_bind: v%d bind: \"%s\" to \"%s\"\n",
/* send this here to avoid a race condition */
send_ldap_result( op, rs );
- } else if (op->orb_edn.bv_val != NULL) {
+ } else if ( !BER_BVISNULL( &op->orb_edn ) ) {
free( op->orb_edn.bv_val );
}
ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n",
- op->o_connid, op->o_opid, op->o_req_dn.bv_val,
- ava.aa_desc->ad_cname.bv_val, 0 );
+ "%s CMP dn=\"%s\" attr=\"%s\"\n",
+ op->o_log_prefix, op->o_req_dn.bv_val,
+ ava.aa_desc->ad_cname.bv_val, 0, 0 );
if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n",
- op->o_connid, op->o_opid, op->o_req_dn.bv_val,
- ava.aa_desc->ad_cname.bv_val, 0 );
+ "%s CMP dn=\"%s\" attr=\"%s\"\n",
+ op->o_log_prefix, op->o_req_dn.bv_val,
+ ava.aa_desc->ad_cname.bv_val, 0, 0 );
if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
op->o_req_dn.bv_val,
ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n",
- op->o_connid, op->o_opid, op->o_req_dn.bv_val,
- ava.aa_desc->ad_cname.bv_val, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s CMP dn=\"%s\" attr=\"%s\"\n",
+ op->o_log_prefix, op->o_req_dn.bv_val,
+ ava.aa_desc->ad_cname.bv_val, 0, 0 );
#if defined( LDAP_SLAPI )
#define pb op->o_pb
return 0;
}
+static void
+connection_init_log_prefix( Operation *op )
+{
+ if ( op->o_connid == (unsigned long)(-1) ) {
+ snprintf( op->o_log_prefix, sizeof( op->o_log_prefix ),
+ "conn=-1 op=%lu", op->o_opid );
+
+ } else {
+ snprintf( op->o_log_prefix, sizeof( op->o_log_prefix ),
+ "conn=%lu op=%lu", op->o_connid, op->o_opid );
+ }
+}
+
static int connection_op_activate( Operation *op )
{
int status;
}
op->o_connid = op->o_conn->c_connid;
+ connection_init_log_prefix( op );
LDAP_STAILQ_INSERT_TAIL( &op->o_conn->c_ops, op, o_next );
op->o_conn = conn;
op->o_connid = op->o_conn->c_connid;
+ connection_init_log_prefix( op );
op->o_time = slap_get_time();
}
op->o_dn.bv_val = NULL;
op->o_ndn = dn;
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu PROXYAUTHZ dn=\"%s\"\n",
- op->o_connid, op->o_opid, dn.bv_val, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s PROXYAUTHZ dn=\"%s\"\n",
+ op->o_log_prefix, dn.bv_val, 0, 0, 0 );
/*
* NOTE: since slap_sasl_getdn() returns a normalized dn,
goto cleanup;
}
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu DEL dn=\"%s\"\n",
- op->o_connid, op->o_opid, op->o_req_dn.bv_val, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s DEL dn=\"%s\"\n",
+ op->o_log_prefix, op->o_req_dn.bv_val, 0, 0, 0 );
op->o_bd = frontendDB;
rs->sr_err = frontendDB->be_delete( op, rs );
assert( op );
assert( limit );
- Debug( LDAP_DEBUG_TRACE, "==> limits_get: conn=%lu op=%lu dn=\"%s\"\n",
- op->o_connid, op->o_opid,
- BER_BVISNULL( ndn ) ? "[anonymous]" : ndn->bv_val );
+ Debug( LDAP_DEBUG_TRACE, "==> limits_get: %s dn=\"%s\"\n",
+ op->o_log_prefix,
+ BER_BVISNULL( ndn ) ? "[anonymous]" : ndn->bv_val, 0 );
/*
* default values
*/
char abuf[BUFSIZ/2], *ptr = abuf;
int len = 0;
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD dn=\"%s\"\n",
- op->o_connid, op->o_opid, op->o_req_dn.bv_val, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s MOD dn=\"%s\"\n",
+ op->o_log_prefix, op->o_req_dn.bv_val, 0, 0, 0 );
for ( tmp = modlist; tmp != NULL; tmp = tmp->sml_next ) {
if (len + 1 + tmp->sml_type.bv_len > sizeof(abuf)) {
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD attr=%s\n",
- op->o_connid, op->o_opid, abuf, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s MOD attr=%s\n",
+ op->o_log_prefix, abuf, 0, 0, 0 );
- len = 0;
+ len = 0;
ptr = abuf;
if( 1 + tmp->sml_type.bv_len > sizeof(abuf)) {
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD attr=%s\n",
- op->o_connid, op->o_opid, tmp->sml_type.bv_val, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s MOD attr=%s\n",
+ op->o_log_prefix, tmp->sml_type.bv_val, 0, 0, 0 );
continue;
}
}
len += tmp->sml_type.bv_len;
}
if (len) {
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD attr=%s\n",
- op->o_connid, op->o_opid, abuf, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s MOD attr=%s\n",
+ op->o_log_prefix, abuf, 0, 0, 0 );
}
}
#endif /* LDAP_DEBUG */
goto cleanup;
}
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MODRDN dn=\"%s\"\n",
- op->o_connid, op->o_opid, op->o_req_dn.bv_val, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s MODRDN dn=\"%s\"\n",
+ op->o_log_prefix, op->o_req_dn.bv_val, 0, 0, 0 );
manageDSAit = get_manageDSAit( op );
if ( send_ldap_response( op, rs ) == SLAP_CB_CONTINUE ) {
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu DISCONNECT tag=%lu err=%d text=%s\n",
- op->o_connid, op->o_opid, rs->sr_tag, rs->sr_err,
- rs->sr_text ? rs->sr_text : "" );
+ "%s DISCONNECT tag=%lu err=%d text=%s\n",
+ op->o_log_prefix, rs->sr_tag, rs->sr_err,
+ rs->sr_text ? rs->sr_text : "", 0 );
}
}
assert( !LDAP_API_ERROR( rs->sr_err ));
Debug( LDAP_DEBUG_TRACE,
- "send_ldap_result: conn=%lu op=%lu p=%d\n",
- op->o_connid, op->o_opid, op->o_protocol );
+ "send_ldap_result: %s p=%d\n",
+ op->o_log_prefix, op->o_protocol, 0 );
Debug( LDAP_DEBUG_ARGS,
"send_ldap_result: err=%d matched=\"%s\" text=\"%s\"\n",
rs->sr_err, rs->sr_nentries );
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu SEARCH RESULT tag=%lu err=%s text=%s\n",
- op->o_connid, op->o_opid, rs->sr_tag, nbuf,
- rs->sr_text ? rs->sr_text : "" );
+ "%s SEARCH RESULT tag=%lu err=%s text=%s\n",
+ op->o_log_prefix, rs->sr_tag, nbuf,
+ rs->sr_text ? rs->sr_text : "", 0 );
} else {
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu RESULT tag=%lu err=%d text=%s\n",
- op->o_connid, op->o_opid, rs->sr_tag, rs->sr_err,
- rs->sr_text ? rs->sr_text : "" );
+ "%s RESULT tag=%lu err=%d text=%s\n",
+ op->o_log_prefix, rs->sr_tag, rs->sr_err,
+ rs->sr_text ? rs->sr_text : "", 0 );
}
}
ldap_pvt_thread_mutex_unlock( &slap_counters.sc_sent_mutex );
}
- Statslog( LDAP_DEBUG_STATS2, "conn=%lu op=%lu ENTRY dn=\"%s\"\n",
- op->o_connid, op->o_opid, rs->sr_entry->e_dn, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS2, "%s ENTRY dn=\"%s\"\n",
+ op->o_log_prefix, rs->sr_entry->e_dn, 0, 0, 0 );
Debug( LDAP_DEBUG_TRACE,
"<= send_search_entry: conn %lu exit.\n", op->o_connid, 0, 0 );
}
#endif
- Statslog( LDAP_DEBUG_STATS2, "conn=%lu op=%lu REF dn=\"%s\"\n",
- op->o_connid, op->o_opid, rs->sr_entry ? rs->sr_entry->e_dn : "(null)", 0, 0 );
+ Statslog( LDAP_DEBUG_STATS2, "%s REF dn=\"%s\"\n",
+ op->o_log_prefix, rs->sr_entry ? rs->sr_entry->e_dn : "(null)",
+ 0, 0, 0 );
Debug( LDAP_DEBUG_TRACE, "<= send_search_reference\n", 0, 0, 0 );
sprintf(abuf, "scope=%d deref=%d", op->ors_scope, op->ors_deref);
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu SRCH base=\"%s\" %s filter=\"%s\"\n",
- op->o_connid, op->o_opid, op->o_req_dn.bv_val, abuf,
- op->ors_filterstr.bv_val );
+ "%s SRCH base=\"%s\" %s filter=\"%s\"\n",
+ op->o_log_prefix, op->o_req_dn.bv_val, abuf,
+ op->ors_filterstr.bv_val, 0 );
for ( i = 0; i<siz; i++ ) {
alen = op->ors_attrs[i].an_name.bv_len;
alen = sizeof(abuf)-1;
}
if (len && (len + 1 + alen >= sizeof(abuf))) {
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu SRCH attr=%s\n",
- op->o_connid, op->o_opid, abuf, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s SRCH attr=%s\n",
+ op->o_log_prefix, abuf, 0, 0, 0 );
len = 0;
ptr = abuf;
}
*ptr = '\0';
}
if (len) {
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu SRCH attr=%s\n",
- op->o_connid, op->o_opid, abuf, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s SRCH attr=%s\n",
+ op->o_log_prefix, abuf, 0, 0, 0 );
}
}
typedef struct slap_op {
unsigned long o_opid; /* id of this operation */
unsigned long o_connid; /* id of conn initiating this op */
+ char o_log_prefix[sizeof("conn=18446744073709551615 op=18446744073709551615")];
struct slap_conn *o_conn; /* connection spawning this op */
BackendDB *o_bd; /* backend DB processing this op */
( op->o_conn->c_dn.bv_len != 0 ) )
{
Statslog( LDAP_DEBUG_STATS,
- "conn=%lu op=%lu AUTHZ anonymous mech=starttls ssf=0\n",
- op->o_connid, op->o_opid, 0, 0, 0 );
+ "%s AUTHZ anonymous mech=starttls ssf=0\n",
+ op->o_log_prefix, 0, 0, 0, 0 );
/* force to anonymous */
connection2anonymous( op->o_conn );
* UnBindRequest ::= NULL
*/
- Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu UNBIND\n", op->o_connid,
- op->o_opid, 0, 0, 0 );
+ Statslog( LDAP_DEBUG_STATS, "%s UNBIND\n", op->o_log_prefix,
+ 0, 0, 0, 0 );
/* pass the unbind to all backends */
backend_unbind( op, rs );