Commit 49f324a1 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

fix ITS#1671 and more

parent 724666c4
......@@ -145,7 +145,7 @@ access_allowed(
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY,
"access_allowed: conn %d %s access to \"%s\" \"%s\" requested\n",
"access_allowed: conn %lu %s access to \"%s\" \"%s\" requested\n",
conn ? conn->c_connid : -1, access2str( access ), e->e_dn, attr ));
#else
Debug( LDAP_DEBUG_ACL,
......@@ -165,7 +165,7 @@ access_allowed(
if ( be != NULL && be_isroot( be, &op->o_ndn ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_INFO,
"access_allowed: conn %d root access granted\n",
"access_allowed: conn %lu root access granted\n",
conn->c_connid));
#else
Debug( LDAP_DEBUG_ACL,
......@@ -186,7 +186,7 @@ access_allowed(
{
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"access_allowed: conn %d NoUserMod Operational attribute: %s access granted\n",
"access_allowed: conn %lu NoUserMod Operational attribute: %s access granted\n",
conn->c_connid, attr ));
#else
Debug( LDAP_DEBUG_ACL, "NoUserMod Operational attribute:"
......@@ -200,7 +200,7 @@ access_allowed(
if( be != NULL && be->be_acl == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"access_allowed: conn %d backend default %s access %s to \"%s\"\n",
"access_allowed: conn %lu backend default %s access %s to \"%s\"\n",
conn->c_connid, access2str( access ),
be->be_dfltaccess >= access ? "granted" : "denied", op->o_dn.bv_val ));
#else
......@@ -218,7 +218,7 @@ access_allowed(
} else if ( be == NULL && global_acl == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"access_allowed: conn %d global default %s access %s to \"%s\"\n",
"access_allowed: conn %lu global default %s access %s to \"%s\"\n",
conn->c_connid, access2str( access ),
global_default_access >= access ? "granted" : "denied", op->o_dn.bv_val ));
#else
......@@ -260,7 +260,7 @@ access_allowed(
for (i = 0; i < MAXREMATCHES && matches[i].rm_so > 0; i++) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"access_allowed: conn %d match[%d]: %d %d ",
"access_allowed: conn %lu match[%d]: %d %d ",
conn->c_connid, i,
(int)matches[i].rm_so, (int)matches[i].rm_eo ));
#else
......@@ -294,7 +294,7 @@ vd_access:
if ( ACL_IS_INVALID( mask ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"access_allowed: conn %d \"%s\" (%s) invalid!\n",
"access_allowed: conn %lu \"%s\" (%s) invalid!\n",
conn->c_connid, e->e_dn, attr ));
#else
Debug( LDAP_DEBUG_ACL,
......@@ -306,7 +306,8 @@ vd_access:
} else if ( control == ACL_BREAK ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"access_allowed: conn %d no more rules\n", conn->c_connid ));
"access_allowed: conn %lu no more rules\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_ACL,
"=> access_allowed: no more rules\n", 0, 0, 0);
......@@ -317,7 +318,7 @@ vd_access:
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY,
"access_allowed: conn %d %s access %s by %s\n",
"access_allowed: conn %lu %s access %s by %s\n",
conn->c_connid,
access2str( access ),
ACL_GRANT( mask, access ) ? "granted" : "denied",
......@@ -535,7 +536,6 @@ acl_mask(
AccessControlState *state )
{
int i, odnlen, patlen;
int vd_recorded = 0;
Access *b;
#ifdef LDAP_DEBUG
char accessmaskbuf[ACCESSMASK_MAXLEN];
......@@ -552,7 +552,7 @@ acl_mask(
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY,
"acl_mask: conn %d access to entry \"%s\", attr \"%s\" requested\n",
"acl_mask: conn %lu access to entry \"%s\", attr \"%s\" requested\n",
conn->c_connid, e->e_dn, attr ));
LDAP_LOG(( "acl", LDAP_LEVEL_ARGS,
......@@ -592,7 +592,7 @@ acl_mask(
if ( b->a_dn_pat.bv_len != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d check a_dn_pat: %s\n",
"acl_mask: conn %lu check a_dn_pat: %s\n",
conn->c_connid, b->a_dn_pat.bv_val ));
#else
Debug( LDAP_DEBUG_ACL, "<= check a_dn_pat: %s\n",
......@@ -678,7 +678,7 @@ acl_mask(
if ( b->a_sockurl_pat.bv_len ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d check a_sockurl_pat: %s\n",
"acl_mask: conn %lu check a_sockurl_pat: %s\n",
conn->c_connid, b->a_sockurl_pat.bv_val ));
#else
Debug( LDAP_DEBUG_ACL, "<= check a_sockurl_pat: %s\n",
......@@ -702,7 +702,7 @@ acl_mask(
if ( b->a_domain_pat.bv_len ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d check a_domain_pat: %s\n",
"acl_mask: conn %lu check a_domain_pat: %s\n",
conn->c_connid, b->a_domain_pat.bv_val ));
#else
Debug( LDAP_DEBUG_ACL, "<= check a_domain_pat: %s\n",
......@@ -725,7 +725,7 @@ acl_mask(
if ( b->a_peername_pat.bv_len ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d check a_perrname_path: %s\n",
"acl_mask: conn %lu check a_perrname_path: %s\n",
conn->c_connid, b->a_peername_pat.bv_val ));
#else
Debug( LDAP_DEBUG_ACL, "<= check a_peername_path: %s\n",
......@@ -748,7 +748,7 @@ acl_mask(
if ( b->a_sockname_pat.bv_len ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d check a_sockname_path: %s\n",
"acl_mask: conn %lu check a_sockname_path: %s\n",
conn->c_connid, b->a_sockname_pat.bv_val ));
#else
Debug( LDAP_DEBUG_ACL, "<= check a_sockname_path: %s\n",
......@@ -783,7 +783,7 @@ acl_mask(
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d check a_dn_pat: %s\n",
"acl_mask: conn %lu check a_dn_pat: %s\n",
conn->c_connid, attr ));
#else
Debug( LDAP_DEBUG_ACL, "<= check a_dn_at: %s\n",
......@@ -894,7 +894,7 @@ acl_mask(
if ( b->a_authz.sai_ssf ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d check a_authz.sai_ssf: ACL %u > OP %u\n",
"acl_mask: conn %lu check a_authz.sai_ssf: ACL %u > OP %u\n",
conn->c_connid, b->a_authz.sai_ssf, op->o_ssf ));
#else
Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_ssf: ACL %u > OP %u\n",
......@@ -908,7 +908,7 @@ acl_mask(
if ( b->a_authz.sai_transport_ssf ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d check a_authz.sai_transport_ssf: ACL %u > OP %u\n",
"acl_mask: conn %lu check a_authz.sai_transport_ssf: ACL %u > OP %u\n",
conn->c_connid, b->a_authz.sai_transport_ssf, op->o_transport_ssf ));
#else
Debug( LDAP_DEBUG_ACL,
......@@ -923,7 +923,7 @@ acl_mask(
if ( b->a_authz.sai_tls_ssf ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d check a_authz.sai_tls_ssf: ACL %u > OP %u\n",
"acl_mask: conn %lu check a_authz.sai_tls_ssf: ACL %u > OP %u\n",
conn->c_connid, b->a_authz.sai_tls_ssf, op->o_tls_ssf ));
#else
Debug( LDAP_DEBUG_ACL,
......@@ -938,7 +938,7 @@ acl_mask(
if ( b->a_authz.sai_sasl_ssf ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d check a_authz.sai_sasl_ssf: ACL %u > OP %u\n",
"acl_mask: conn %lu check a_authz.sai_sasl_ssf: ACL %u > OP %u\n",
conn->c_connid, b->a_authz.sai_sasl_ssf, op->o_sasl_ssf ));
#else
Debug( LDAP_DEBUG_ACL,
......@@ -1033,7 +1033,7 @@ acl_mask(
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_RESULTS,
"acl_mask: conn %d [%d] applying %s (%s)\n",
"acl_mask: conn %lu [%d] applying %s (%s)\n",
conn->c_connid, i, accessmask2str( modmask, accessmaskbuf),
b->a_type == ACL_CONTINUE ? "continue" : b->a_type == ACL_BREAK
? "break" : "stop" ));
......@@ -1071,7 +1071,7 @@ acl_mask(
#ifdef NEW_LOGGING
LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
"acl_mask: conn %d [%d] mask: %s\n",
"acl_mask: conn %lu [%d] mask: %s\n",
conn->c_connid, i, accessmask2str( *mask, accessmaskbuf) ));
#else
Debug( LDAP_DEBUG_ACL,
......@@ -1095,7 +1095,7 @@ acl_mask(
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_RESULTS,
"acl_mask: conn %d no more <who> clauses, returning %d (stop)\n",
"acl_mask: conn %lu no more <who> clauses, returning %d (stop)\n",
conn->c_connid, accessmask2str( *mask, accessmaskbuf) ));
#else
Debug( LDAP_DEBUG_ACL,
......@@ -1129,7 +1129,7 @@ acl_check_modlist(
if ( be_isroot( be, &op->o_ndn ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1,
"acl_check_modlist: conn %d access granted to root user\n",
"acl_check_modlist: conn %lu access granted to root user\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_ACL,
......@@ -1143,7 +1143,7 @@ acl_check_modlist(
if( be != NULL && be->be_acl == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
"acl_check_modlist: conn %d backend default %s access %s to \"%s\"\n",
"acl_check_modlist: conn %lu backend default %s access %s to \"%s\"\n",
conn->c_connid, access2str( ACL_WRITE ),
be->be_dfltaccess >= ACL_WRITE ? "granted" : "denied", op->o_dn.bv_val ));
#else
......@@ -1160,7 +1160,7 @@ acl_check_modlist(
} else if ( be == NULL && global_acl == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
"acl_check_modlist: conn %d global default %s access %s to \"%s\"\n",
"acl_check_modlist: conn %lu global default %s access %s to \"%s\"\n",
conn->c_connid, access2str( ACL_WRITE ),
global_default_access >= ACL_WRITE ? "granted" : "denied", op->o_dn ));
#else
......@@ -1185,7 +1185,7 @@ acl_check_modlist(
if ( is_at_no_user_mod( mlist->sml_desc->ad_type ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
"acl_check_modlist: conn %d no-user-mod %s: modify access granted\n",
"acl_check_modlist: conn %lu no-user-mod %s: modify access granted\n",
conn->c_connid, mlist->sml_desc->ad_cname.bv_val ));
#else
Debug( LDAP_DEBUG_ACL, "acl: no-user-mod %s:"
......@@ -1257,6 +1257,7 @@ acl_check_modlist(
return( 1 );
}
#if 0 /* not used any more */
static char *
aci_bvstrdup( struct berval *bv )
{
......@@ -1269,6 +1270,7 @@ aci_bvstrdup( struct berval *bv )
}
return(s);
}
#endif
static int
aci_get_part(
......@@ -1815,11 +1817,11 @@ string_expand(
#ifdef NEW_LOGGING
LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
"string_expand: pattern = %.*s\n", pat->bv_len, pat->bv_val ));
"string_expand: pattern = %.*s\n", (int)pat->bv_len, pat->bv_val ));
LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1,
"string_expand: expanded = %s\n", bv->bv_val ));
#else
Debug( LDAP_DEBUG_TRACE, "=> string_expand: pattern: %.*s\n", pat->bv_len, pat->bv_val, 0 );
Debug( LDAP_DEBUG_TRACE, "=> string_expand: pattern: %.*s\n", (int)pat->bv_len, pat->bv_val, 0 );
Debug( LDAP_DEBUG_TRACE, "=> string_expand: expanded: %s\n", bv->bv_val, 0, 0 );
#endif
}
......
......@@ -59,7 +59,7 @@ shell_back_search(
fprintf( wfp, "deref: %d\n", deref );
fprintf( wfp, "sizelimit: %d\n", size );
fprintf( wfp, "timelimit: %d\n", time );
fprintf( wfp, "filter: %s\n", filterstr );
fprintf( wfp, "filter: %s\n", filterstr->bv_val );
fprintf( wfp, "attrsonly: %d\n", attrsonly ? 1 : 0 );
fprintf( wfp, "attrs:%s", attrs == NULL ? " all" : "" );
for ( an = attrs; an && an->an_name.bv_val; an++ ) {
......
......@@ -288,10 +288,10 @@ static Connection* connection_get( ber_socket_t s )
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_RESULTS,
"connection_get: get for %d got connid %ld\n",s, c->c_connid ));
"connection_get: get for %d got connid %lu\n", s, c->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE,
"connection_get(%d): got connid=%ld\n",
"connection_get(%d): got connid=%lu\n",
s, c->c_connid, 0 );
#endif
......@@ -534,7 +534,7 @@ long connection_init(
{
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
"connection_init: conn %d set nonblocking failed\n",
"connection_init: conn %lu set nonblocking failed\n",
c->c_connid ));
#else
Debug( LDAP_DEBUG_ANY,
......@@ -698,7 +698,7 @@ connection_destroy( Connection *c )
slapd_remove( sd, 0 );
Statslog( LDAP_DEBUG_STATS,
"conn=%ld fd=%d closed\n",
"conn=%lu fd=%d closed\n",
c->c_connid, sd, 0, 0, 0 );
}
......@@ -765,11 +765,11 @@ void connection_closing( Connection *c )
ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd );
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
"connection_closing: conn %d readying socket %d for close.\n",
"connection_closing: conn %lu readying socket %d for close.\n",
c->c_connid, sd ));
#else
Debug( LDAP_DEBUG_TRACE,
"connection_closing: readying conn=%ld sd=%d for close\n",
"connection_closing: readying conn=%lu sd=%d for close\n",
c->c_connid, sd, 0 );
#endif
/* update state to closing */
......@@ -802,11 +802,11 @@ static void connection_close( Connection *c )
if( !LDAP_STAILQ_EMPTY(&c->c_ops) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
"connection_close: conn %d deferring sd %d\n",
"connection_close: conn %lu deferring sd %d\n",
c->c_connid, sd ));
#else
Debug( LDAP_DEBUG_TRACE,
"connection_close: deferring conn=%ld sd=%d\n",
"connection_close: deferring conn=%lu sd=%d\n",
c->c_connid, sd, 0 );
#endif
return;
......@@ -814,10 +814,10 @@ static void connection_close( Connection *c )
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_RESULTS,
"connection_close: conn %d sd %d\n",
"connection_close: conn %lu sd %d\n",
c->c_connid, sd ));
#else
Debug( LDAP_DEBUG_TRACE, "connection_close: conn=%ld sd=%d\n",
Debug( LDAP_DEBUG_TRACE, "connection_close: conn=%lu sd=%d\n",
c->c_connid, sd, 0 );
#endif
connection_destroy( c );
......@@ -920,7 +920,7 @@ connection_operation( void *arg_v )
if( conn->c_sasl_bind_in_progress && tag != LDAP_REQ_BIND ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
"connection_operation: conn %d SASL bind in progress (tag=%ld).\n",
"connection_operation: conn %lu SASL bind in progress (tag=%ld).\n",
conn->c_connid, (long)tag ));
#else
Debug( LDAP_DEBUG_ANY, "connection_operation: "
......@@ -977,7 +977,7 @@ connection_operation( void *arg_v )
default:
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
"connection_operation: conn %d unknown LDAP request 0x%lx\n",
"connection_operation: conn %lu unknown LDAP request 0x%lx\n",
conn->c_connid, tag ));
#else
Debug( LDAP_DEBUG_ANY, "unknown LDAP request 0x%lx\n",
......@@ -1065,11 +1065,11 @@ int connection_read(ber_socket_t s)
if( c->c_conn_state == SLAP_C_CLOSING ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
"connection_read: conn %d connection closing, ignoring input\n",
"connection_read: conn %lu connection closing, ignoring input\n",
c->c_connid));
#else
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): closing, ignoring input for id=%ld\n",
"connection_read(%d): closing, ignoring input for id=%lu\n",
s, c->c_connid, 0 );
#endif
connection_return( c );
......@@ -1079,10 +1079,10 @@ int connection_read(ber_socket_t s)
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
"connection_read: conn %d checking for input.\n", c->c_connid ));
"connection_read: conn %lu checking for input.\n", c->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): checking for input on id=%ld\n",
"connection_read(%d): checking for input on id=%lu\n",
s, c->c_connid, 0 );
#endif
......@@ -1097,12 +1097,12 @@ int connection_read(ber_socket_t s)
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
"connection_read: conn %d TLS accept error, error %d\n",
"connection_read: conn %lu TLS accept error, error %d\n",
c->c_connid, rc ));
#else
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): TLS accept error "
"error=%d id=%ld, closing\n",
"error=%d id=%lu, closing\n",
s, rc, c->c_connid );
#endif
c->c_needs_tls_accept = 0;
......@@ -1158,12 +1158,12 @@ int connection_read(ber_socket_t s)
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
"connection_read: conn %d SASL install error %d, closing\n",
"connection_read: conn %lu SASL install error %d, closing\n",
c->c_connid, rc ));
#else
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): SASL install error "
"error=%d id=%ld, closing\n",
"error=%d id=%lu, closing\n",
s, rc, c->c_connid );
#endif
/* connections_mutex and c_mutex are locked */
......@@ -1191,11 +1191,11 @@ int connection_read(ber_socket_t s)
if( rc < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
"connection_read: conn %d input error %d, closing.\n",
"connection_read: conn %lu input error %d, closing.\n",
c->c_connid, rc ));
#else
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): input error=%d id=%ld, closing.\n",
"connection_read(%d): input error=%d id=%lu, closing.\n",
s, rc, c->c_connid );
#endif
/* connections_mutex and c_mutex are locked */
......@@ -1238,7 +1238,8 @@ connection_input(
== NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
"connection_input: conn %d ber_alloc failed.\n", conn->c_connid ));
"connection_input: conn %lu ber_alloc failed.\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 );
#endif
......@@ -1259,7 +1260,7 @@ connection_input(
inet_ntoa( peeraddr.sa_in_addr.sin_addr ),
(unsigned) ntohs( peeraddr.sa_in_addr.sin_port ) );
Statslog( LDAP_DEBUG_STATS,
"conn=%ld UDP request from %s (%s) accepted.\n",
"conn=%lu UDP request from %s (%s) accepted.\n",
conn->c_connid, peername, conn->c_sock_name.bv_val, 0, 0 );
}
#endif
......@@ -1272,7 +1273,7 @@ connection_input(
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
"connection_input: conn %d ber_get_next failed, errno %d (%s).\n",
"connection_input: conn %lu ber_get_next failed, errno %d (%s).\n",
conn->c_connid, err, sock_errstr(err) ));
#else
Debug( LDAP_DEBUG_TRACE,
......@@ -1296,7 +1297,7 @@ connection_input(
/* log, close and send error */
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
"connection_input: conn %d ber_get_int returns 0x%lx.\n",
"connection_input: conn %lu ber_get_int returns 0x%lx.\n",
conn->c_connid, tag ));
#else
Debug( LDAP_DEBUG_ANY, "ber_get_int returns 0x%lx\n", tag, 0,
......@@ -1310,7 +1311,7 @@ connection_input(
/* log, close and send error */
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
"connection_input: conn %d ber_peek_tag returns 0x%lx.\n",
"connection_input: conn %lu ber_peek_tag returns 0x%lx.\n",
conn->c_connid, tag ));
#else
Debug( LDAP_DEBUG_ANY, "ber_peek_tag returns 0x%lx\n", tag, 0,
......@@ -1330,7 +1331,7 @@ connection_input(
if (tag != LDAP_REQ_ABANDON && tag != LDAP_REQ_SEARCH) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
"connection_input: conn %d invalid req for UDP 0x%lx.\n",
"connection_input: conn %lu invalid req for UDP 0x%lx.\n",
conn->c_connid, tag ));
#else
Debug( LDAP_DEBUG_ANY, "invalid req for UDP 0x%lx\n", tag, 0,
......@@ -1360,7 +1361,7 @@ connection_input(
{
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
"connection_input: conn %d deferring operation\n",
"connection_input: conn %lu deferring operation\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_ANY, "deferring operation\n", 0, 0, 0 );
......@@ -1400,11 +1401,11 @@ connection_resched( Connection *conn )
if( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
"connection_resched: conn %d reaquiring locks.\n",
"connection_resched: conn %lu reaquiring locks.\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE,
"connection_resched: reaquiring locks conn=%ld sd=%d\n",
"connection_resched: reaquiring locks conn=%lu sd=%d\n",
conn->c_connid, sd, 0 );
#endif
/*
......@@ -1420,21 +1421,21 @@ connection_resched( Connection *conn )
if( conn->c_conn_state != SLAP_C_CLOSING ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
"connection_resched: conn %d closed by other thread.\n",
"connection_resched: conn %lu closed by other thread.\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE, "connection_resched: "
"closed by other thread conn=%ld sd=%d\n",
"closed by other thread conn=%lu sd=%d\n",
conn->c_connid, sd, 0 );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
"connection_resched: conn %d attempting closing.\n",
"connection_resched: conn %lu attempting closing.\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE, "connection_resched: "
"attempting closing conn=%ld sd=%d\n",
"attempting closing conn=%lu sd=%d\n",
conn->c_connid, sd, 0 );
#endif
connection_close( conn );
......@@ -1505,7 +1506,7 @@ static int connection_op_activate( Connection *conn, Operation *op )
if ( status != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_ERR,
"connection_op_activate: conn %d thread pool submit failed.\n",
"connection_op_activate: conn %lu thread pool submit failed.\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_ANY,
......@@ -1546,11 +1547,11 @@ int connection_write(ber_socket_t s)
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1,
"connection_write conn %d waking output.\n",
"connection_write conn %lu waking output.\n",
c->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE,
"connection_write(%d): waking output for id=%ld\n",
"connection_write(%d): waking output for id=%lu\n",
s, c->c_connid, 0 );
#endif
ldap_pvt_thread_cond_signal( &c->c_write_cv );
......
......@@ -93,7 +93,7 @@ int get_ctrls(
Operation *op,
int sendres )
{
int nctrls;
int nctrls = 0;
ber_tag_t tag;
ber_len_t len;
char *opaque;
......@@ -121,7 +121,7 @@ int get_ctrls(
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
"get_ctrls: conn %d\n", conn->c_connid ));
"get_ctrls: conn %lu\n", conn->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE, "=> get_ctrls\n", 0, 0, 0 );
#endif
......@@ -142,7 +142,7 @@ int get_ctrls(
}
#endif
op->o_ctrls[nctrls=0] = NULL;
op->o_ctrls[nctrls] = NULL;
/* step through each element */
for( tag = ber_first_element( ber, &len, &opaque );
......@@ -192,7 +192,7 @@ int get_ctrls(
if( tag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"get_ctrls: conn %d get OID failed.\n",
"get_ctrls: conn %lu get OID failed.\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get oid failed.\n",
......@@ -214,7 +214,7 @@ int get_ctrls(
if( tag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"get_ctrls: conn %d get crit failed.\n",
"get_ctrls: conn %lu get crit failed.\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get crit failed.\n",
......@@ -236,13 +236,13 @@ int get_ctrls(
if( tag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "get_ctrls: conn %d: "
LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "get_ctrls: conn %lu: "
"%s (%scritical): get value failed.\n",
conn->c_connid,
c->ldctl_oid ? c->ldctl_oid : "(NULL)",
c->ldctl_iscritical ? "" : "non" ));
#else
Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: conn %d: "
Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: conn %lu: "
"%s (%scritical): get value failed.\n",
conn->c_connid,
c->ldctl_oid ? c->ldctl_oid : "(NULL)",
......@@ -258,7 +258,7 @@ int get_ctrls(
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"get_ctrls: conn %d oid=\"%s\" (%scritical)\n",
"get_ctrls: conn %lu oid=\"%s\" (%scritical)\n",
conn->c_connid,
c->ldctl_oid ? c->ldctl_oid : "(NULL)",
c->ldctl_iscritical ? "" : "non" ));
......@@ -344,7 +344,7 @@ int get_ctrls(
return_results:
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_RESULTS,
"get_ctrls: conn=%d n=%d rc=%d err=%s\n",
"get_ctrls: conn=%lu n=%d rc=%d err=%s\n",