From: Kurt Zeilenga Date: Sat, 4 Sep 2004 04:54:28 +0000 (+0000) Subject: unifdef -UNEW_LOGGING X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~574 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d611a4b49a00238ed32ae84c68f27c6a0ef2273a;p=openldap unifdef -UNEW_LOGGING --- diff --git a/libraries/liblber/bprint.c b/libraries/liblber/bprint.c index fab02740c7..46fcae994a 100644 --- a/libraries/liblber/bprint.c +++ b/libraries/liblber/bprint.c @@ -229,81 +229,6 @@ ber_bprint( (*ber_pvt_log_print)( line ); } -#ifdef NEW_LOGGING -int ber_output_dump( - const char *subsys, - int level, - BerElement *ber, - int inout ) -{ - static const char hexdig[] = "0123456789abcdef"; - char buf[132]; - ber_len_t len; - char line[ BP_LEN ]; - ber_len_t i; - char *data = ber->ber_ptr; - - if ( inout == 1 ) { - len = ber_pvt_ber_remaining(ber); - } else { - len = ber_pvt_ber_write(ber); - } - - sprintf( buf, "ber_dump: buf=0x%08lx ptr=0x%08lx end=0x%08lx len=%ld\n", - (long) ber->ber_buf, - (long) ber->ber_ptr, - (long) ber->ber_end, - (long) len ); - - (void) ber_pvt_log_output( subsys, level, "%s", buf ); - -#define BP_OFFSET 9 -#define BP_GRAPH 60 -#define BP_LEN 80 - - assert( data != NULL ); - - /* in case len is zero */ - line[0] = '\n'; - line[1] = '\0'; - - for ( i = 0 ; i < len ; i++ ) { - int n = i % 16; - unsigned off; - - if( !n ) { - if( i ) { - (void) ber_pvt_log_output( subsys, level, "%s", line ); - } - memset( line, ' ', sizeof(line)-2 ); - line[sizeof(line)-2] = '\n'; - line[sizeof(line)-1] = '\0'; - - off = i % 0x0ffffU; - - line[2] = hexdig[0x0f & (off >> 12)]; - line[3] = hexdig[0x0f & (off >> 8)]; - line[4] = hexdig[0x0f & (off >> 4)]; - line[5] = hexdig[0x0f & off ]; - line[6] = ':'; - } - - off = BP_OFFSET + n*3 + ((n >= 8)?1:0); - line[off] = hexdig[ 0x0f & ( data[i] >> 4 ) ]; - line[off+1] = hexdig[ 0x0f & data[i] ]; - - off = BP_GRAPH + n + ((n >= 8)?1:0); - - if ( isprint( (unsigned char) data[i] )) { - line[BP_GRAPH + n] = data[i]; - } else { - line[BP_GRAPH + n] = '.'; - } - } - - return ber_pvt_log_output( subsys, level, "%s", line ); -} -#endif int ber_log_dump( diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index 7bb6d472e0..6fcaa8fa3b 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -669,17 +669,9 @@ ber_scanf ( BerElement *ber, fmt_reset = fmt; -#ifdef NEW_LOGGING - LDAP_LOG( BER, ENTRY, "ber_scanf fmt (%s) ber:\n", fmt, 0, 0 ); - - if ( LDAP_LOGS_TEST(BER, DETAIL2 )) { - BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 )); - } -#else ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug, "ber_scanf fmt (%s) ber:\n", fmt ); ber_log_dump( LDAP_DEBUG_BER, ber->ber_debug, ber, 1 ); -#endif for ( rc = 0; *fmt && rc != LBER_DEFAULT; fmt++ ) { /* When this is modified, remember to update @@ -824,13 +816,8 @@ ber_scanf ( BerElement *ber, default: if( ber->ber_debug ) { -#ifdef NEW_LOGGING - LDAP_LOG( BER, ERR, - "ber_scanf: unknown fmt %c\n", *fmt, 0, 0 ); -#else ber_log_printf( LDAP_DEBUG_ANY, ber->ber_debug, "ber_scanf: unknown fmt %c\n", *fmt ); -#endif } rc = LBER_DEFAULT; break; diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index 7c2253f881..44b51f29d1 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -818,13 +818,8 @@ ber_printf( BerElement *ber, LDAP_CONST char *fmt, ... ) default: if( ber->ber_debug ) { -#ifdef NEW_LOGGING - LDAP_LOG( BER, ERR, - "ber_printf: unknown fmt %c\n", *fmt, 0, 0 ); -#else ber_log_printf( LDAP_DEBUG_ANY, ber->ber_debug, "ber_printf: unknown fmt %c\n", *fmt ); -#endif } rc = -1; break; diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 1159614d79..14cf29b795 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -216,23 +216,12 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit ) towrite = ber->ber_ptr - ber->ber_rwptr; if ( sb->sb_debug ) { -#ifdef NEW_LOGGING - LDAP_LOG( BER, DETAIL1, - "ber_flush: %ld bytes to sd %ld%s\n", - towrite, (long)sb->sb_fd, - ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" ); - - if(LDAP_LOGS_TEST(BER, DETAIL2)) - BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 )); - -#else ber_log_printf( LDAP_DEBUG_TRACE, sb->sb_debug, "ber_flush: %ld bytes to sd %ld%s\n", towrite, (long) sb->sb_fd, ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" ); ber_log_bprint( LDAP_DEBUG_PACKETS, sb->sb_debug, ber->ber_rwptr, towrite ); -#endif } while ( towrite > 0 ) { @@ -484,12 +473,8 @@ ber_get_next( assert( SOCKBUF_VALID( sb ) ); assert( LBER_VALID( ber ) ); -#ifdef NEW_LOGGING - LDAP_LOG( BER, ENTRY, "ber_get_next: enter\n", 0, 0, 0 ); -#else ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug, "ber_get_next\n" ); -#endif /* * Any ber element looks like this: tag length contents. @@ -622,15 +607,9 @@ ber_get_next( } if ( sb->sb_max_incoming && ber->ber_len > sb->sb_max_incoming ) { -#ifdef NEW_LOGGING - LDAP_LOG( BER, ERR, - "ber_get_next: sockbuf_max_incoming exceeded " - "(%d > %d)\n", ber->ber_len, sb->sb_max_incoming, 0 ); -#else ber_log_printf( LDAP_DEBUG_CONNS, ber->ber_debug, "ber_get_next: sockbuf_max_incoming exceeded " "(%ld > %ld)\n", ber->ber_len, sb->sb_max_incoming ); -#endif errno = ERANGE; return LBER_DEFAULT; } @@ -691,18 +670,10 @@ done: ber->ber_rwptr = NULL; *len = ber->ber_len; if ( ber->ber_debug ) { -#ifdef NEW_LOGGING - LDAP_LOG( BER, DETAIL1, - "ber_get_next: tag 0x%lx len %ld\n", - ber->ber_tag, ber->ber_len, 0 ); - if(LDAP_LOGS_TEST(BER, DETAIL2)) - BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 )); -#else ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug, "ber_get_next: tag 0x%lx len %ld contents:\n", ber->ber_tag, ber->ber_len ); ber_log_dump( LDAP_DEBUG_BER, ber->ber_debug, ber, 1 ); -#endif } return (ber->ber_tag); } diff --git a/libraries/liblber/lber-int.h b/libraries/liblber/lber-int.h index 7686cd57d9..76a914e429 100644 --- a/libraries/liblber/lber-int.h +++ b/libraries/liblber/lber-int.h @@ -45,23 +45,6 @@ struct lber_options { long lbo_meminuse; }; -#ifdef NEW_LOGGING -/* -# ifdef LDAP_DEBUG -# ifdef LDAP_LOG -# undef LDAP_LOG -# endif -# define LDAP_LOG(a) ber_pvt_log_output a - */ -# define BER_DUMP(a) ber_output_dump a -/* -# else -# define LDAP_LOG(a) -# define BER_DUMP(a) -# endif - */ -#endif - LBER_F( int ) ber_pvt_log_output( const char *subsystem, int level, @@ -142,15 +125,6 @@ LBER_F (void) ber_rewind LDAP_P(( BerElement * )); */ #define ber_log_printf ber_pvt_log_printf -#ifdef NEW_LOGGING -LBER_F( int ) -ber_output_dump LDAP_P(( - const char *subsys, - int level, - BerElement *ber, - int inout )); -#endif - LBER_F( int ) ber_log_bprint LDAP_P(( int errlvl, diff --git a/libraries/libldap/abandon.c b/libraries/libldap/abandon.c index 24880ab4f9..468753ec19 100644 --- a/libraries/libldap/abandon.c +++ b/libraries/libldap/abandon.c @@ -67,11 +67,7 @@ ldap_abandon_ext( LDAPControl **cctrls ) { int rc; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "ldap_abandon_ext %d\n", msgid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_abandon_ext %d\n", msgid, 0, 0 ); -#endif /* check client controls */ #ifdef LDAP_R_COMPILE @@ -102,11 +98,7 @@ ldap_abandon_ext( int ldap_abandon( LDAP *ld, int msgid ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "ldap_abandon %d\n", msgid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_abandon %d\n", msgid, 0, 0 ); -#endif return ldap_abandon_ext( ld, msgid, NULL, NULL ) == LDAP_SUCCESS ? 0 : -1; } @@ -126,12 +118,8 @@ do_abandon( Sockbuf *sb; LDAPRequest *lr; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "do_abandon %d, msgid %d\n", origid, msgid, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_abandon origid %d, msgid %d\n", origid, msgid, 0 ); -#endif sendabandon = 1; diff --git a/libraries/libldap/add.c b/libraries/libldap/add.c index f1a55741b4..2da6567cbe 100644 --- a/libraries/libldap/add.c +++ b/libraries/libldap/add.c @@ -110,11 +110,7 @@ ldap_add_ext( int i, rc; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_add_ext\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_add_ext\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); assert( dn != NULL ); diff --git a/libraries/libldap/bind.c b/libraries/libldap/bind.c index f44397097a..a2e4a65830 100644 --- a/libraries/libldap/bind.c +++ b/libraries/libldap/bind.c @@ -70,11 +70,7 @@ int ldap_bind( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd, int authmethod ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_bind\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_bind\n", 0, 0, 0 ); -#endif switch ( authmethod ) { case LDAP_AUTH_SIMPLE: @@ -119,11 +115,7 @@ ldap_bind_s( LDAP_CONST char *passwd, int authmethod ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_bind_s\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_bind_s\n", 0, 0, 0 ); -#endif switch ( authmethod ) { case LDAP_AUTH_SIMPLE: diff --git a/libraries/libldap/compare.c b/libraries/libldap/compare.c index 8d8fe249f1..dadf96060a 100644 --- a/libraries/libldap/compare.c +++ b/libraries/libldap/compare.c @@ -65,11 +65,7 @@ ldap_compare_ext( BerElement *ber; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_compare\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_compare\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index e1610f6bd0..c21101a350 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -80,17 +80,10 @@ int ldap_int_sasl_init( void ) sprintf( version, "%u.%d.%d", (unsigned)rc >> 24, (rc >> 16) & 0xff, rc & 0xffff ); -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, INFO, - "ldap_int_sasl_init: SASL library version mismatch:" - " expected " SASL_VERSION_STRING "," - " got %s\n", version, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ldap_int_sasl_init: SASL library version mismatch:" " expected " SASL_VERSION_STRING "," " got %s\n", version, 0, 0 ); -#endif return -1; } } @@ -416,12 +409,8 @@ Sockbuf_IO ldap_pvt_sockbuf_io_sasl = { int ldap_pvt_sasl_install( Sockbuf *sb, void *ctx_arg ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ENTRY, "ldap_pvt_sasl_install\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_install\n", 0, 0, 0 ); -#endif /* don't install the stuff unless security has been negotiated */ @@ -526,13 +515,8 @@ ldap_int_sasl_open( return ld->ld_errno; } -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, "ldap_int_sasl_open: host=%s\n", - host, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: host=%s\n", host, 0, 0 ); -#endif lc->lconn_sasl_authctx = ctx; @@ -580,13 +564,8 @@ ldap_int_sasl_bind( ber_socket_t sd; void *ssl; -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ARGS, "ldap_int_sasl_bind: %s\n", - mechs ? mechs : "", 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n", mechs ? mechs : "", 0, 0 ); -#endif /* do a quick !LDAPv3 check... ldap_sasl_bind will do the rest. */ if (ld->ld_version < LDAP_VERSION3) { @@ -721,15 +700,9 @@ ldap_int_sasl_bind( if ( rc != LDAP_SUCCESS && rc != LDAP_SASL_BIND_IN_PROGRESS ) { if( scred && scred->bv_len ) { /* and server provided us with data? */ -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, - "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", - rc, saslrc, scred->bv_len ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", rc, saslrc, scred->bv_len ); -#endif ber_bvfree( scred ); } rc = ld->ld_errno; @@ -740,15 +713,9 @@ ldap_int_sasl_bind( /* we're done, no need to step */ if( scred && scred->bv_len ) { /* but server provided us with data! */ -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, - "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", - rc, saslrc, scred->bv_len ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", rc, saslrc, scred->bv_len ); -#endif ber_bvfree( scred ); rc = ld->ld_errno = LDAP_LOCAL_ERROR; goto done; @@ -764,13 +731,8 @@ ldap_int_sasl_bind( (SASL_CONST char **)&ccred.bv_val, &credlen ); -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, - "ldap_int_sasl_bind: sasl_client_step: %d\n", saslrc,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "sasl_client_step: %d\n", saslrc, 0, 0 ); -#endif if( saslrc == SASL_INTERACT ) { int res; diff --git a/libraries/libldap/delete.c b/libraries/libldap/delete.c index cde4632db4..cac083f71e 100644 --- a/libraries/libldap/delete.c +++ b/libraries/libldap/delete.c @@ -59,11 +59,7 @@ ldap_delete_ext( BerElement *ber; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_delete_ext\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_delete_ext\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -151,11 +147,7 @@ ldap_delete( LDAP *ld, LDAP_CONST char *dn ) * DelRequet ::= DistinguishedName, */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_delete\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_delete\n", 0, 0, 0 ); -#endif return ldap_delete_ext( ld, dn, NULL, NULL, &msgid ) == LDAP_SUCCESS ? msgid : -1 ; diff --git a/libraries/libldap/error.c b/libraries/libldap/error.c index 78acbf581f..b2be1dd668 100644 --- a/libraries/libldap/error.c +++ b/libraries/libldap/error.c @@ -143,11 +143,7 @@ ldap_err2string( int err ) { const struct ldaperror *e; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_err2string\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_err2string\n", 0, 0, 0 ); -#endif e = ldap_int_error( err ); @@ -160,11 +156,7 @@ ldap_perror( LDAP *ld, LDAP_CONST char *str ) { int i; const struct ldaperror *e; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_perror\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_perror\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -247,11 +239,7 @@ ldap_parse_result( ber_tag_t tag; BerElement *ber; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_result\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_parse_result\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); diff --git a/libraries/libldap/extended.c b/libraries/libldap/extended.c index 0fb11184ad..10726c179a 100644 --- a/libraries/libldap/extended.c +++ b/libraries/libldap/extended.c @@ -57,11 +57,7 @@ ldap_extended_operation( int rc; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_extended_operation\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_extended_operation\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -131,11 +127,7 @@ ldap_extended_operation_s( int msgid; LDAPMessage *res; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_extended_operation_s\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_extended_operation_s\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -187,11 +179,7 @@ ldap_parse_extended_result ( assert( LDAP_VALID( ld ) ); assert( res != NULL ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_extended_result\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_parse_extended_result\n", 0, 0, 0 ); -#endif if( ld->ld_version < LDAP_VERSION3 ) { ld->ld_errno = LDAP_NOT_SUPPORTED; @@ -314,11 +302,7 @@ ldap_parse_intermediate ( assert( LDAP_VALID( ld ) ); assert( res != NULL ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_intermediate\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_parse_intermediate\n", 0, 0, 0 ); -#endif if( ld->ld_version < LDAP_VERSION3 ) { ld->ld_errno = LDAP_NOT_SUPPORTED; diff --git a/libraries/libldap/filter.c b/libraries/libldap/filter.c index 9a432cb878..c4422526cd 100644 --- a/libraries/libldap/filter.c +++ b/libraries/libldap/filter.c @@ -366,11 +366,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) * Note: tags in a choice are always explicit */ -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, ARGS, "ldap_pvt_put_filter: \"%s\"\n", str_in,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_filter: \"%s\"\n", str_in, 0, 0 ); -#endif freeme = LDAP_STRDUP( str_in ); if( freeme == NULL ) return LDAP_NO_MEMORY; @@ -388,12 +384,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) switch ( *str ) { case '&': -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: AND\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_filter: AND\n", 0, 0, 0 ); -#endif str = put_complex_filter( ber, str, LDAP_FILTER_AND, 0 ); @@ -406,12 +398,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) break; case '|': -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: OR\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_filter: OR\n", 0, 0, 0 ); -#endif str = put_complex_filter( ber, str, LDAP_FILTER_OR, 0 ); @@ -424,12 +412,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) break; case '!': -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: NOT\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_filter: NOT\n", 0, 0, 0 ); -#endif str = put_complex_filter( ber, str, LDAP_FILTER_NOT, 0 ); @@ -442,12 +426,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: simple\n", 0,0,0); -#else Debug( LDAP_DEBUG_TRACE, "put_filter: simple\n", 0, 0, 0 ); -#endif balance = 1; escape = 0; @@ -492,12 +472,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) break; case /*'('*/ ')': -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: end\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_filter: end\n", 0, 0, 0 ); -#endif if ( ber_printf( ber, /*"["*/ "]" ) == -1 ) { rc = -1; goto done; @@ -511,12 +487,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) break; default: /* assume it's a simple type=value filter */ -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: default\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_filter: default\n", 0, 0, 0 ); -#endif next = strchr( str, '\0' ); if ( put_simple_filter( ber, str ) == -1 ) { rc = -1; @@ -544,12 +516,8 @@ put_filter_list( BerElement *ber, char *str, ber_tag_t tag ) char *next = NULL; char save; -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, ARGS, "put_filter_list \"%s\"\n", str,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_filter_list \"%s\"\n", str, 0, 0 ); -#endif while ( *str ) { while ( *str && LDAP_SPACE( (unsigned char) *str ) ) { @@ -588,12 +556,8 @@ put_simple_filter( ber_tag_t ftype; int rc = -1; -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, ARGS, "put_simple_filter: \"%s\"\n", str,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_simple_filter: \"%s\"\n", str, 0, 0 ); -#endif str = LDAP_STRDUP( str ); if( str == NULL ) return -1; @@ -759,12 +723,8 @@ put_substring_filter( BerElement *ber, char *type, char *val ) int gotstar = 0; ber_tag_t ftype = LDAP_FILTER_SUBSTRINGS; -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, ARGS, "put_substring_filter \"%s=%s\"\n", type, val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_substring_filter \"%s=%s\"\n", type, val, 0 ); -#endif if ( ber_printf( ber, "t{s{" /*"}}"*/, ftype, type ) == -1 ) { return -1; @@ -846,11 +806,7 @@ put_vrFilter( BerElement *ber, const char *str_in ) * matchValue [3] AssertionValue } */ -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, ARGS, "put_vrFilter: \"%s\"\n", str_in, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_vrFilter: \"%s\"\n", str_in, 0, 0 ); -#endif freeme = LDAP_STRDUP( str_in ); if( freeme == NULL ) return LDAP_NO_MEMORY; @@ -890,13 +846,8 @@ put_vrFilter( BerElement *ber, const char *str_in ) default: -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, DETAIL1, - "put_vrFilter: simple\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_vrFilter: simple\n", 0, 0, 0 ); -#endif balance = 1; escape = 0; @@ -941,12 +892,8 @@ put_vrFilter( BerElement *ber, const char *str_in ) break; case /*'('*/ ')': -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, DETAIL1, "put_vrFilter: end\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_vrFilter: end\n", 0, 0, 0 ); -#endif if ( ber_printf( ber, /*"["*/ "]" ) == -1 ) { rc = -1; goto done; @@ -960,13 +907,8 @@ put_vrFilter( BerElement *ber, const char *str_in ) break; default: /* assume it's a simple type=value filter */ -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, DETAIL1, "put_vrFilter: default\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_vrFilter: default\n", 0, 0, 0 ); -#endif next = strchr( str, '\0' ); if ( put_simple_vrFilter( ber, str ) == -1 ) { rc = -1; @@ -1008,12 +950,8 @@ put_vrFilter_list( BerElement *ber, char *str ) char *next = NULL; char save; -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, ARGS, "put_vrFilter_list \"%s\"\n", str, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_vrFilter_list \"%s\"\n", str, 0, 0 ); -#endif while ( *str ) { while ( *str && LDAP_SPACE( (unsigned char) *str ) ) { @@ -1046,12 +984,8 @@ put_simple_vrFilter( ber_tag_t ftype; int rc = -1; -#ifdef NEW_LOGGING - LDAP_LOG ( FILTER, ARGS, "put_simple_vrFilter: \"%s\"\n", str, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "put_simple_vrFilter: \"%s\"\n", str, 0, 0 ); -#endif str = LDAP_STRDUP( str ); if( str == NULL ) return -1; diff --git a/libraries/libldap/getattr.c b/libraries/libldap/getattr.c index c0ff95cef6..8a71876f94 100644 --- a/libraries/libldap/getattr.c +++ b/libraries/libldap/getattr.c @@ -36,11 +36,7 @@ ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **berout ) char *attr; BerElement *ber; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_first_attribute\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -102,11 +98,7 @@ ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber ) ber_tag_t tag; char *attr; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_next_attribute\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -139,11 +131,7 @@ ldap_get_attribute_ber( LDAP *ld, LDAPMessage *entry, BerElement *ber, ber_tag_t tag; int rc = LDAP_SUCCESS; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_get_attribute_ber\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_get_attribute_ber\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index fc43edb0c3..72acabbe66 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -89,11 +89,7 @@ ldap_get_dn( LDAP *ld, LDAPMessage *entry ) char *dn; BerElement tmp; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_get_dn\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_get_dn\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID(ld) ); @@ -116,11 +112,7 @@ ldap_get_dn_ber( LDAP *ld, LDAPMessage *entry, BerElement **berout, ber_len_t len = 0; int rc = LDAP_SUCCESS; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_get_dn_ber\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_get_dn_ber\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID(ld) ); @@ -167,11 +159,7 @@ ldap_dn2ufn( LDAP_CONST char *dn ) { char *out = NULL; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2ufn\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_dn2ufn\n", 0, 0, 0 ); -#endif ( void )ldap_dn_normalize( dn, LDAP_DN_FORMAT_LDAP, &out, LDAP_DN_FORMAT_UFN ); @@ -190,11 +178,7 @@ ldap_explode_dn( LDAP_CONST char *dn, int notypes ) int iRDN; unsigned flag = notypes ? LDAP_DN_FORMAT_UFN : LDAP_DN_FORMAT_LDAPV3; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_explode_dn\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_explode_dn\n", 0, 0, 0 ); -#endif if ( ldap_str2dn( dn, &tmpDN, LDAP_DN_FORMAT_LDAP ) != LDAP_SUCCESS ) { @@ -234,11 +218,7 @@ ldap_explode_rdn( LDAP_CONST char *rdn, int notypes ) const char *p; int iAVA; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_explode_rdn\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_explode_rdn\n", 0, 0, 0 ); -#endif /* * we only parse the first rdn @@ -319,11 +299,7 @@ ldap_dn2dcedn( LDAP_CONST char *dn ) { char *out = NULL; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2dcedn\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_dn2dcedn\n", 0, 0, 0 ); -#endif ( void )ldap_dn_normalize( dn, LDAP_DN_FORMAT_LDAP, &out, LDAP_DN_FORMAT_DCE ); @@ -336,11 +312,7 @@ ldap_dcedn2dn( LDAP_CONST char *dce ) { char *out = NULL; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_dcedn2dn\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_dcedn2dn\n", 0, 0, 0 ); -#endif ( void )ldap_dn_normalize( dce, LDAP_DN_FORMAT_DCE, &out, LDAP_DN_FORMAT_LDAPV3 ); @@ -352,11 +324,7 @@ ldap_dn2ad_canonical( LDAP_CONST char *dn ) { char *out = NULL; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2ad_canonical\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_dn2ad_canonical\n", 0, 0, 0 ); -#endif ( void )ldap_dn_normalize( dn, LDAP_DN_FORMAT_LDAP, &out, LDAP_DN_FORMAT_AD_CANONICAL ); @@ -388,11 +356,7 @@ ldap_dn_normalize( LDAP_CONST char *dnin, int rc; LDAPDN tmpDN = NULL; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_dn_normalize\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_dn_normalize\n", 0, 0, 0 ); -#endif assert( dnout ); @@ -755,11 +719,7 @@ ldap_bv2dn_x( struct berval *bvin, LDAPDN *dn, unsigned flags, void *ctx ) str = bv->bv_val; end = str + bv->bv_len; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "ldap_bv2dn(%s,%u)\n", str, flags, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> ldap_bv2dn(%s,%u)\n", str, flags, 0 ); -#endif *dn = NULL; @@ -941,13 +901,8 @@ return_result:; LDAP_FREEX( tmpDN, ctx ); } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, "<= ldap_bv2dn(%s)=%d %s\n", - str, rc, ldap_err2string( rc ) ); -#else Debug( LDAP_DEBUG_TRACE, "<= ldap_bv2dn(%s)=%d %s\n", str, rc, ldap_err2string( rc ) ); -#endif *dn = newDN; return( rc ); @@ -3057,11 +3012,7 @@ int ldap_dn2bv_x( LDAPDN dn, struct berval *bv, unsigned flags, void *ctx ) bv->bv_len = 0; bv->bv_val = NULL; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "=> ldap_dn2bv(%u)\n", flags, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> ldap_dn2bv(%u)\n", flags, 0, 0 ); -#endif /* * a null dn means an empty dn string @@ -3370,13 +3321,8 @@ int ldap_dn2bv_x( LDAPDN dn, struct berval *bv, unsigned flags, void *ctx ) return LDAP_PARAM_ERROR; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, "<= ldap_dn2bv(%s)=%d %s\n", - bv->bv_val, rc, ldap_err2string( rc ) ); -#else Debug( LDAP_DEBUG_TRACE, "<= ldap_dn2bv(%s)=%d %s\n", bv->bv_val, rc, ldap_err2string( rc ) ); -#endif return_results:; return( rc ); diff --git a/libraries/libldap/getvalues.c b/libraries/libldap/getvalues.c index 606e261681..c5a0d7cbb5 100644 --- a/libraries/libldap/getvalues.c +++ b/libraries/libldap/getvalues.c @@ -42,11 +42,7 @@ ldap_get_values( LDAP *ld, LDAPMessage *entry, LDAP_CONST char *target ) assert( entry != NULL ); assert( target != NULL ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_get_values\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_get_values\n", 0, 0, 0 ); -#endif ber = *entry->lm_ber; @@ -103,11 +99,7 @@ ldap_get_values_len( LDAP *ld, LDAPMessage *entry, LDAP_CONST char *target ) assert( entry != NULL ); assert( target != NULL ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_get_values_len\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_get_values_len\n", 0, 0, 0 ); -#endif ber = *entry->lm_ber; diff --git a/libraries/libldap/groupings.c b/libraries/libldap/groupings.c index cada361ccb..25cb4b9686 100644 --- a/libraries/libldap/groupings.c +++ b/libraries/libldap/groupings.c @@ -40,11 +40,7 @@ int ldap_grouping_create( BerElement *ber = NULL; struct berval bv = BER_BVNULL; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_grouping_create\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_grouping_create\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -90,11 +86,7 @@ int ldap_grouping_create_s( int msgid; LDAPMessage *res; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_grouping_create_s\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_grouping_create_s\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c index 03e55c85cf..7e88825da4 100644 --- a/libraries/libldap/init.c +++ b/libraries/libldap/init.c @@ -124,12 +124,7 @@ static void openldap_ldap_init_w_conf( return; } -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, DETAIL1, - "openldap_init_w_conf: trying %s\n", file, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "ldap_init: trying %s\n", file, 0, 0); -#endif fp = fopen(file, "r"); if(fp == NULL) { @@ -137,11 +132,7 @@ static void openldap_ldap_init_w_conf( return; } -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, DETAIL1, "openldap_init_w_conf: using %s\n", file, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "ldap_init: using %s\n", file, 0, 0); -#endif while((start = fgets(linebuf, sizeof(linebuf), fp)) != NULL) { /* skip lines starting with '#' */ @@ -269,22 +260,12 @@ static void openldap_ldap_init_w_userconf(const char *file) home = getenv("HOME"); if (home != NULL) { -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, ARGS, - "openldap_init_w_userconf: HOME env is %s\n", home, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "ldap_init: HOME env is %s\n", home, 0, 0); -#endif path = LDAP_MALLOC(strlen(home) + strlen(file) + sizeof( LDAP_DIRSEP ".")); } else { -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, ARGS, "openldap_init_w_userconf: HOME env is NULL\n", - 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "ldap_init: HOME env is NULL\n", 0, 0, 0); -#endif } if(home != NULL && path != NULL) { @@ -566,50 +547,26 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl ) char *altfile = getenv(LDAP_ENV_PREFIX "CONF"); if( altfile != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, DETAIL1, - "openldap_init_w_userconf: %sCONF env is %s\n", - LDAP_ENV_PREFIX, altfile, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is %s\n", LDAP_ENV_PREFIX "CONF", altfile, 0); -#endif openldap_ldap_init_w_sysconf( altfile ); } else -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, DETAIL1, - "openldap_init_w_userconf: %sCONF env is NULL\n", - LDAP_ENV_PREFIX, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is NULL\n", LDAP_ENV_PREFIX "CONF", 0, 0); -#endif } { char *altfile = getenv(LDAP_ENV_PREFIX "RC"); if( altfile != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, DETAIL1, - "openldap_init_w_userconf: %sRC env is %s\n", - LDAP_ENV_PREFIX, altfile, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is %s\n", LDAP_ENV_PREFIX "RC", altfile, 0); -#endif openldap_ldap_init_w_userconf( altfile ); } else -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, DETAIL1, - "openldap_init_w_userconf: %sRC env is NULL\n", - LDAP_ENV_PREFIX, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is NULL\n", LDAP_ENV_PREFIX "RC", 0, 0); -#endif } openldap_ldap_init_w_env(gopts, NULL); diff --git a/libraries/libldap/kbind.c b/libraries/libldap/kbind.c index d136efdfe0..ead7462506 100644 --- a/libraries/libldap/kbind.c +++ b/libraries/libldap/kbind.c @@ -73,11 +73,7 @@ ldap_kerberos_bind1( LDAP *ld, LDAP_CONST char *dn ) ber_len_t credlen; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind1\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind1\n", 0, 0, 0 ); -#endif if( ld->ld_version > LDAP_VERSION2 ) { ld->ld_errno = LDAP_NOT_SUPPORTED; @@ -123,11 +119,7 @@ ldap_kerberos_bind1_s( LDAP *ld, LDAP_CONST char *dn ) int msgid; LDAPMessage *res; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind1_s\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind1_s\n", 0, 0, 0 ); -#endif /* initiate the bind */ if ( (msgid = ldap_kerberos_bind1( ld, dn )) == -1 ) @@ -161,11 +153,7 @@ ldap_kerberos_bind2( LDAP *ld, LDAP_CONST char *dn ) ber_len_t credlen; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind2\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind2\n", 0, 0, 0 ); -#endif if( ld->ld_version > LDAP_VERSION2 ) { ld->ld_errno = LDAP_NOT_SUPPORTED; @@ -210,11 +198,7 @@ ldap_kerberos_bind2_s( LDAP *ld, LDAP_CONST char *dn ) int msgid; LDAPMessage *res; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind2_s\n" , 0, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind2_s\n", 0, 0, 0 ); -#endif /* initiate the bind */ if ( (msgid = ldap_kerberos_bind2( ld, dn )) == -1 ) @@ -235,11 +219,7 @@ ldap_kerberos_bind_s( LDAP *ld, LDAP_CONST char *dn ) { int err; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind_s\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind_s\n", 0, 0, 0 ); -#endif if ( (err = ldap_kerberos_bind1_s( ld, dn )) != LDAP_SUCCESS ) return( err ); @@ -266,21 +246,11 @@ ldap_get_kerberosv4_credentials( int err; char realm[REALM_SZ], *cred, *krbinstance; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 ); -#endif if ( (err = krb_get_tf_realm( tkt_string(), realm )) != KSUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "ldap_get_kerberosv4_credentials: krb_get_tf_realm failed: %s\n", - krb_err_txt[err], 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ldap_get_kerberosv4_credentials: " "krb_get_tf_realm failed: %s\n", krb_err_txt[err], 0, 0 ); -#endif ld->ld_errno = LDAP_AUTH_UNKNOWN; return( NULL ); } @@ -297,14 +267,8 @@ ldap_get_kerberosv4_credentials( if ( (err = krb_mk_req( &ktxt, service, krbinstance, realm, 0 )) != KSUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "ldap_get_kerberosv4_credentials: krb_mk_req failed: %s\n", - krb_err_txt[err], 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ldap_get_kerberosv4_credentials: " "krb_mk_req failed (%s)\n", krb_err_txt[err], 0, 0 ); -#endif ld->ld_errno = LDAP_AUTH_UNKNOWN; return( NULL ); } diff --git a/libraries/libldap/modify.c b/libraries/libldap/modify.c index 34eaf9f114..8e0323fafc 100644 --- a/libraries/libldap/modify.c +++ b/libraries/libldap/modify.c @@ -84,11 +84,7 @@ ldap_modify_ext( LDAP *ld, * } */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_modify_ext\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_modify_ext\n", 0, 0, 0 ); -#endif /* check client controls */ rc = ldap_int_client_controls( ld, cctrls ); @@ -175,11 +171,7 @@ ldap_modify( LDAP *ld, LDAP_CONST char *dn, LDAPMod **mods ) { int rc, msgid; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_modify\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_modify\n", 0, 0, 0 ); -#endif rc = ldap_modify_ext( ld, dn, mods, NULL, NULL, &msgid ); diff --git a/libraries/libldap/modrdn.c b/libraries/libldap/modrdn.c index da58a3f06c..302ffa703f 100644 --- a/libraries/libldap/modrdn.c +++ b/libraries/libldap/modrdn.c @@ -79,11 +79,7 @@ ldap_rename( int rc; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_rename\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_rename\n", 0, 0, 0 ); -#endif /* check client controls */ rc = ldap_int_client_controls( ld, cctrls ); @@ -166,11 +162,7 @@ ldap_rename2( int msgid; int rc; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_rename2\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_rename2\n", 0, 0, 0 ); -#endif rc = ldap_rename( ld, dn, newrdn, newSuperior, deleteoldrdn, NULL, NULL, &msgid ); diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index d93e9bb76b..4bdd4948da 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -63,12 +63,8 @@ ldap_open( LDAP_CONST char *host, int port ) int rc; LDAP *ld; -#ifdef NEW_LOGGING - LDAP_LOG ( CONNECTION, ARGS, "ldap_open(%s, %d)\n", host, port, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_open(%s, %d)\n", host, port, 0 ); -#endif ld = ldap_init( host, port ); if ( ld == NULL ) { @@ -82,13 +78,8 @@ ldap_open( LDAP_CONST char *host, int port ) ld = NULL; } -#ifdef NEW_LOGGING - LDAP_LOG ( CONNECTION, RESULTS, "ldap_open: %s\n", - ld == NULL ? "succeeded" : "failed", 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_open: %s\n", ld == NULL ? "succeeded" : "failed", 0, 0 ); -#endif return ld; } @@ -114,11 +105,7 @@ ldap_create( LDAP **ldp ) return LDAP_LOCAL_ERROR; } -#ifdef NEW_LOGGING - LDAP_LOG ( CONNECTION, ENTRY, "ldap_create\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_create\n", 0, 0, 0 ); -#endif if ( (ld = (LDAP *) LDAP_CALLOC( 1, sizeof(LDAP) )) == NULL ) { return( LDAP_NO_MEMORY ); @@ -246,11 +233,7 @@ ldap_int_open_connection( char *host; int port, proto; -#ifdef NEW_LOGGING - LDAP_LOG ( CONNECTION, ENTRY, "ldap_int_open_connection\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_int_open_connection\n", 0, 0, 0 ); -#endif switch ( proto = ldap_pvt_url_scheme2proto( srv->lud_scheme ) ) { case LDAP_PROTO_TCP: diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index dedb57bb3e..fc8d4b04c9 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -768,11 +768,7 @@ ldap_int_select( LDAP *ld, struct timeval *timeout ) { struct selectinfo *sip; -#ifdef NEW_LOGGING - LDAP_LOG ( CONNECTION, ENTRY, "ldap_int_select\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_int_select\n", 0, 0, 0 ); -#endif #ifndef HAVE_POLL if ( ldap_int_tblsize == 0 ) ldap_int_ip_init(); diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 60afad2390..5d2c6b59da 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -95,11 +95,7 @@ ldap_send_initial_request( LDAPURLDesc *servers; int rc; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_send_initial_request\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_send_initial_request\n", 0, 0, 0 ); -#endif if ( ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_GET_FD, NULL ) == -1 ) { /* not connected yet */ @@ -110,15 +106,9 @@ ldap_send_initial_request( return( -1 ); } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "ldap_send_initial_request: ldap_open_defconn: successful\n" , - 0, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "ldap_open_defconn: successful\n", 0, 0, 0 ); -#endif } { @@ -201,11 +191,7 @@ ldap_send_server_request( LDAPRequest *lr; int incparent, rc; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_send_server_request\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_send_server_request\n", 0, 0, 0 ); -#endif incparent = 0; ld->ld_errno = LDAP_SUCCESS; /* optimistic */ @@ -305,11 +291,7 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb, LDAPURLDesc *srv; Sockbuf *sb = NULL; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_new_connection\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_new_connection\n", 0, 0, 0 ); -#endif /* * make a new LDAP server connection * XXX open connection synchronously for now @@ -371,13 +353,7 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb, ++lc->lconn_refcnt; /* avoid premature free */ ld->ld_defconn = lc; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "ldap_new_connection: Call application rebind_proc\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "Call application rebind_proc\n", 0, 0, 0); -#endif #ifdef LDAP_R_COMPILE ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex ); ldap_pvt_thread_mutex_unlock( &ld->ld_res_mutex ); @@ -405,13 +381,7 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb, ++lc->lconn_refcnt; /* avoid premature free */ ld->ld_defconn = lc; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "ldap_new_connection: anonymous rebind via ldap_bind_s\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "anonymous rebind via ldap_bind_s\n", 0, 0, 0); -#endif #ifdef LDAP_R_COMPILE ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex ); ldap_pvt_thread_mutex_unlock( &ld->ld_res_mutex ); @@ -490,11 +460,7 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) { LDAPConn *tmplc, *prevlc; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_free_connection\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_free_connection\n", 0, 0, 0 ); -#endif if ( force || --lc->lconn_refcnt <= 0 ) { if ( lc->lconn_status == LDAP_CONNST_CONNECTED ) { @@ -540,22 +506,12 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) LDAP_FREE( lc->lconn_rebind_queue); } LDAP_FREE( lc ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "ldap_free_connection: actually freed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_free_connection: actually freed\n", 0, 0, 0 ); -#endif } else { lc->lconn_lastused = time( NULL ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, "ldap_free_connection: refcnt %d\n", - lc->lconn_refcnt, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_free_connection: refcnt %d\n", lc->lconn_refcnt, 0, 0 ); -#endif } } @@ -685,13 +641,8 @@ ldap_free_request( LDAP *ld, LDAPRequest *lr ) { LDAPRequest **ttmplr; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "ldap_free_request (origid %d, msgid %d)\n", - lr->lr_origid, lr->lr_msgid, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_free_request (origid %d, msgid %d)\n", lr->lr_origid, lr->lr_msgid, 0 ); -#endif /* free all referrals (child requests) */ while ( lr->lr_child ) @@ -737,11 +688,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * ld->ld_errno = LDAP_SUCCESS; /* optimistic */ *hadrefp = 0; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_chase_v3referrals\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_chase_v3referrals\n", 0, 0, 0 ); -#endif unfollowed = NULL; rc = count = 0; @@ -754,14 +701,8 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * /* Check for hop limit exceeded */ if ( lr->lr_parentcnt >= ld->ld_refhoplimit ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "ldap_chase_v3referrals: more than %d referral hops (dropping)\n", - ld->ld_refhoplimit, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "more than %d referral hops (dropping)\n", ld->ld_refhoplimit, 0, 0 ); -#endif ld->ld_errno = LDAP_REFERRAL_LIMIT_EXCEEDED; rc = -1; goto done; @@ -809,15 +750,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * * if two search references come in one behind the other * for the same server with different contexts. */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "ldap_chase_v3referrals: queue referral \"%s\"\n", - refarray[i], 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_chase_v3referrals: queue referral \"%s\"\n", refarray[i], 0, 0); -#endif if( lc->lconn_rebind_queue == NULL ) { /* Create a referral list */ lc->lconn_rebind_queue = @@ -880,15 +815,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * goto done; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "ldap_chase_v3referrals: msgid %d, url \"%s\"\n", - lr->lr_msgid, refarray[i], 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_chase_v3referral: msgid %d, url \"%s\"\n", lr->lr_msgid, refarray[i], 0); -#endif /* Send the new request to the server - may require a bind */ rinfo.ri_msgid = origreq->lr_origid; @@ -903,14 +832,8 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * #endif if ( rc < 0 ) { /* Failure, try next referral in the list */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "ldap_chase_v3referrals: Unable to chase referral \"%s\" (%s)\n", - refarray[i], ldap_err2string( ld->ld_errno ), 0 ); -#else Debug( LDAP_DEBUG_ANY, "Unable to chase referral \"%s\" (%s)\n", refarray[i], ldap_err2string( ld->ld_errno ), 0); -#endif unfollowedcnt += ldap_append_referral( ld, &unfollowed, refarray[i]); ldap_free_urllist(srv); srv = NULL; @@ -988,11 +911,7 @@ ldap_chase_referrals( LDAP *ld, BerElement *ber; LDAPreqinfo rinfo; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_chase_referrals\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_chase_referrals\n", 0, 0, 0 ); -#endif ld->ld_errno = LDAP_SUCCESS; /* optimistic */ *hadrefp = 0; @@ -1015,15 +934,9 @@ ldap_chase_referrals( LDAP *ld, } if ( lr->lr_parentcnt >= ld->ld_refhoplimit ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, - "ldap_chase_referrals: more than %d referral hops (dropping)\n", - ld->ld_refhoplimit, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "more than %d referral hops (dropping)\n", ld->ld_refhoplimit, 0, 0 ); -#endif /* XXX report as error in ld->ld_errno? */ return( 0 ); } @@ -1048,14 +961,8 @@ ldap_chase_referrals( LDAP *ld, rc = ldap_url_parse_ext( ref, &srv ); if ( rc != LDAP_URL_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "ldap_chase_referrals: ignoring unknown referral <%s>\n", - ref, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ignoring unknown referral <%s>\n", ref, 0, 0 ); -#endif rc = ldap_append_referral( ld, &unfollowed, ref ); *hadrefp = 1; continue; @@ -1066,13 +973,8 @@ ldap_chase_referrals( LDAP *ld, srv->lud_dn = NULL; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "ldap_chase_referrals: chasing LDAP referral <%s>\n", ref, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "chasing LDAP referral: <%s>\n", ref, 0, 0 ); -#endif *hadrefp = 1; @@ -1103,15 +1005,9 @@ ldap_chase_referrals( LDAP *ld, if( rc >= 0 ) { ++count; } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "ldap_chase_referrals: Unable to chase referral <%s>\n", - ldap_err2string( ld->ld_errno), 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Unable to chase referral (%s)\n", ldap_err2string( ld->ld_errno ), 0, 0 ); -#endif rc = ldap_append_referral( ld, &unfollowed, ref ); } @@ -1178,17 +1074,10 @@ re_encode_request( LDAP *ld, char *orig_dn; char *dn; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "re_encode_request: new msgid %ld, new dn <%s>\n", - (long) msgid, - ( srv == NULL || srv->lud_dn == NULL ) ? "NONE" : srv->lud_dn, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "re_encode_request: new msgid %ld, new dn <%s>\n", (long) msgid, ( srv == NULL || srv->lud_dn == NULL) ? "NONE" : srv->lud_dn, 0 ); -#endif tmpber = *origber; @@ -1293,13 +1182,8 @@ re_encode_request( LDAP *ld, #ifdef LDAP_DEBUG if ( ldap_debug & LDAP_DEBUG_PACKETS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "re_encode_request: new request is:\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "re_encode_request new request is:\n", 0, 0, 0 ); -#endif ber_log_dump( LDAP_DEBUG_BER, ldap_debug, ber, 0 ); } #endif /* LDAP_DEBUG */ diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 03356c5cef..dd41a27a9c 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -111,11 +111,7 @@ ldap_result( assert( ld != NULL ); assert( result != NULL ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "ldap_result msgid %d\n", msgid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_result msgid %d\n", msgid, 0, 0 ); -#endif #ifdef LDAP_R_COMPILE ldap_pvt_thread_mutex_lock( &ld->ld_res_mutex ); @@ -149,27 +145,17 @@ chkResponseList( * wait until it arrives or timeout occurs. */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "ldap_chkResponseList for msgid=%d, all=%d\n", - msgid, all, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_chkResponseList for msgid=%d, all=%d\n", msgid, all, 0 ); -#endif lastlm = NULL; for ( lm = ld->ld_responses; lm != NULL; lm = nextlm ) { nextlm = lm->lm_next; if ( ldap_abandoned( ld, lm->lm_msgid ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "ldap_chkResponseList msg abandoned, msgid %d\n", msgid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_chkResponseList msg abandoned, msgid %d\n", msgid, 0, 0 ); -#endif ldap_mark_abandoned( ld, lm->lm_msgid ); if ( lastlm == NULL ) { @@ -227,23 +213,12 @@ chkResponseList( #ifdef LDAP_DEBUG if( lm == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, "ldap_chkResponseList returns NULL\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_chkResponseList returns NULL\n", 0, 0, 0); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "ldap_chkResponseList returns msgid %d, type 0x%02lu\n", - lm->lm_msgid, (unsigned long) lm->lm_msgtype, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_chkResponseList returns msgid %d, type 0x%02lu\n", lm->lm_msgid, (unsigned long) lm->lm_msgtype, 0); -#endif } #endif return lm; @@ -268,22 +243,11 @@ wait4msg( #ifdef LDAP_DEBUG if ( timeout == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "wait4msg (infinite timeout), msgid %d\n", msgid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "wait4msg (infinite timeout), msgid %d\n", msgid, 0, 0 ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "wait4msg (timeout %ld sec, %ld usec), msgid %d\n", - (long) timeout->tv_sec, (long) timeout->tv_usec, msgid ); -#else Debug( LDAP_DEBUG_TRACE, "wait4msg (timeout %ld sec, %ld usec), msgid %d\n", (long) timeout->tv_sec, (long) timeout->tv_usec, msgid ); -#endif } #endif /* LDAP_DEBUG */ @@ -298,13 +262,8 @@ wait4msg( rc = -2; while ( rc == -2 ) { #ifdef LDAP_DEBUG -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "wait4msg continue, msgid %d, all %d\n", msgid, all, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "wait4msg continue, msgid %d, all %d\n", msgid, all, 0 ); -#endif if ( ldap_debug & LDAP_DEBUG_TRACE ) { ldap_dump_connection( ld, ld->ld_conns, 1 ); ldap_dump_requests_and_responses( ld ); @@ -331,15 +290,9 @@ wait4msg( rc = ldap_int_select( ld, tvp ); #ifdef LDAP_DEBUG if ( rc == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "wait4msg: ldap_int_select returned -1: errno %d\n", - errno, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_int_select returned -1: errno %d\n", errno, 0, 0 ); -#endif } #endif @@ -392,13 +345,8 @@ wait4msg( break; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "wait4msg: %ld secs to go\n", (long) tv.tv_sec, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "wait4msg: %ld secs to go\n", (long) tv.tv_sec, 0, 0 ); -#endif start_time = tmp_time; } } @@ -440,11 +388,7 @@ try_read1msg( assert( lcp != NULL ); assert( *lcp != NULL ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "read1msg: msgid %d, all %d\n", msgid, all, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "read1msg: msgid %d, all %d\n", msgid, all, 0 ); -#endif lc = *lcp; @@ -481,14 +425,9 @@ nextresp3: if ( tag != LDAP_TAG_MESSAGE ) { if ( tag == LBER_DEFAULT) { #ifdef LDAP_DEBUG -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: ber_get_next failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_CONNS, "ber_get_next failed.\n", 0, 0, 0 ); #endif -#endif #ifdef EWOULDBLOCK if (errno==EWOULDBLOCK) return -2; #endif @@ -511,11 +450,7 @@ nextresp3: /* if it's been abandoned, toss it */ if ( ldap_abandoned( ld, id ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, "read1msg: abandoned\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "abandoned\n", 0, 0, 0); -#endif retry_ber: ber_free( ber, 1 ); if ( ber_sockbuf_ctrl( sb, LBER_SB_OPT_DATA_READY, NULL ) ) { @@ -525,15 +460,9 @@ retry_ber: } if (( lr = ldap_find_request_by_msgid( ld, id )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: no request for response with msgid %ld (tossing)\n", - (long) id, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "no request for response with msgid %ld (tossing)\n", (long) id, 0, 0 ); -#endif goto retry_ber; } #ifdef LDAP_CONNECTIONLESS @@ -549,17 +478,10 @@ nextresp2: return( -1 ); } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: ldap_read: message type %s msgid %ld, original id %ld\n", - ldap_int_msgtype2str( tag ), - (long) lr->lr_msgid, (long) lr->lr_origid ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_read: message type %s msgid %ld, original id %ld\n", ldap_int_msgtype2str( tag ), (long) lr->lr_msgid, (long) lr->lr_origid ); -#endif id = lr->lr_origid; refer_cnt = 0; @@ -594,16 +516,9 @@ nextresp2: /* If haven't got end search, set chasing referrals */ if( lr->lr_status != LDAP_REQST_COMPLETED) { lr->lr_status = LDAP_REQST_CHASINGREFS; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: search ref chased," - "mark request chasing refs, id = %d\n", - lr->lr_msgid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "read1msg: search ref chased, mark request chasing refs, id = %d\n", lr->lr_msgid, 0, 0); -#endif } v3ref = 1; /* We sucessfully chased the reference */ } @@ -627,16 +542,9 @@ nextresp2: if( ber_scanf( &tmpber, "{v}", &refs) == LBER_ERROR) { rc = LDAP_DECODING_ERROR; lr->lr_status = LDAP_REQST_COMPLETED; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: referral decode error," - "mark request completed, id = %d\n", - lr->lr_msgid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "read1msg: referral decode error, mark request completed, id = %d\n", lr->lr_msgid, 0, 0); -#endif } else { /* Chase the referral * Note: refs arrary is freed by ldap_chase_v3referrals @@ -644,16 +552,9 @@ nextresp2: refer_cnt = ldap_chase_v3referrals( ld, lr, refs, 0, &lr->lr_res_error, &hadref ); lr->lr_status = LDAP_REQST_COMPLETED; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: referral chased," - "mark request completed, id = %d\n", - lr->lr_msgid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "read1msg: referral chased, mark request completed, id = %d\n", lr->lr_msgid, 0, 0); -#endif if( refer_cnt > 0) { v3ref = 1; /* Referral successfully chased */ } @@ -702,15 +603,8 @@ nextresp2: refer_cnt = ldap_chase_referrals( ld, lr, &lr->lr_res_error, -1, &hadref ); lr->lr_status = LDAP_REQST_COMPLETED; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: V2 referral chased," - "mark request completed, id = %d\n", - lr->lr_msgid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "read1msg: V2 referral chased, mark request completed, id = %d\n", lr->lr_msgid, 0, 0); -#endif } /* save errno, message, and matched string */ @@ -723,27 +617,15 @@ nextresp2: } else { lr->lr_res_errno = LDAP_PARTIAL_RESULTS; } -#ifdef NEW_LOGGING -LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: new result: res_errno: %d, res_error: <%s>, res_matched: <%s>\n", - lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "", - lr->lr_res_matched ? lr->lr_res_matched : "" ); -#else Debug( LDAP_DEBUG_TRACE, "new result: res_errno: %d, res_error: <%s>, res_matched: <%s>\n", lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "", lr->lr_res_matched ? lr->lr_res_matched : "" ); -#endif } } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, "read1msg: %d new referrals\n", - refer_cnt, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "read1msg: %d new referrals\n", refer_cnt, 0, 0 ); -#endif if ( refer_cnt != 0 ) { /* chasing referrals */ ber_free( ber, 1 ); @@ -763,14 +645,8 @@ Debug( LDAP_DEBUG_TRACE, } lr->lr_status = LDAP_REQST_COMPLETED; /* declare this request done */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: mark request completed, id = %d\n", - lr->lr_msgid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "read1msg: mark request completed, id = %d\n", lr->lr_msgid, 0, 0); -#endif while ( lr->lr_parent != NULL ) { merge_error_info( ld, lr->lr_parent, lr ); @@ -794,21 +670,12 @@ Debug( LDAP_DEBUG_TRACE, if ( lr->lr_outrefcnt <= 0 && lr->lr_parent == NULL && tmplr == NULL ) { id = lr->lr_msgid; tag = lr->lr_res_msgtype; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: request %ld done\n", (long) id, 0, 0 ); - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: res_errno: %d,res_error: <%s>, res_matched: <%s>\n", - lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "", - lr->lr_res_matched ? lr->lr_res_matched : "" ); -#else Debug( LDAP_DEBUG_ANY, "request %ld done\n", (long) id, 0, 0 ); Debug( LDAP_DEBUG_TRACE, "res_errno: %d, res_error: <%s>, res_matched: <%s>\n", lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "", lr->lr_res_matched ? lr->lr_res_matched : "" ); -#endif if ( !simple_request ) { ber_free( ber, 1 ); ber = NULL; @@ -960,14 +827,8 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); goto exit; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "read1msg: adding response id %ld type %ld\n", - (long) new->lm_msgid, (long) new->lm_msgtype, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "adding response id %ld type %ld:\n", (long) new->lm_msgid, (long) new->lm_msgtype, 0 ); -#endif /* part of a search response - add to end of list of entries */ for ( tmp = l; (tmp->lm_chain != NULL) && @@ -1081,21 +942,12 @@ merge_error_info( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr ) } } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, "merged parent (id %d) error info: ", - parentr->lr_msgid, 0, 0 ); - LDAP_LOG( OPERATION, DETAIL1, "result errno %d, error <%s>, matched <%s>\n", - parentr->lr_res_errno, parentr->lr_res_error ? - parentr->lr_res_error : "", parentr->lr_res_matched ? - parentr->lr_res_matched : "" ); -#else Debug( LDAP_DEBUG_TRACE, "merged parent (id %d) error info: ", parentr->lr_msgid, 0, 0 ); Debug( LDAP_DEBUG_TRACE, "result errno %d, error <%s>, matched <%s>\n", parentr->lr_res_errno, parentr->lr_res_error ? parentr->lr_res_error : "", parentr->lr_res_matched ? parentr->lr_res_matched : "" ); -#endif } @@ -1141,11 +993,7 @@ ldap_msgfree( LDAPMessage *lm ) LDAPMessage *next; int type = 0; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_msgfree\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_msgfree\n", 0, 0, 0 ); -#endif for ( ; lm != NULL; lm = next ) { next = lm->lm_chain; @@ -1170,11 +1018,7 @@ ldap_msgdelete( LDAP *ld, int msgid ) assert( ld != NULL ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_msgdelete\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_msgdelete\n", 0, 0, 0 ); -#endif prev = NULL; #ifdef LDAP_R_COMPILE diff --git a/libraries/libldap/sasl.c b/libraries/libldap/sasl.c index 8dbbd81d5b..3b6dccf68d 100644 --- a/libraries/libldap/sasl.c +++ b/libraries/libldap/sasl.c @@ -74,11 +74,7 @@ ldap_sasl_bind( int rc; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ENTRY, "ldap_sasl_bind\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_sasl_bind\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -177,11 +173,7 @@ ldap_sasl_bind_s( LDAPMessage *result; struct berval *scredp = NULL; -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ENTRY, "ldap_sasl_bind_s\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_sasl_bind_s\n", 0, 0, 0 ); -#endif /* do a quick !LDAPv3 check... ldap_sasl_bind will do the rest. */ if( servercredp != NULL ) { @@ -263,11 +255,7 @@ ldap_parse_sasl_bind_result( ber_tag_t tag; BerElement *ber; -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ENTRY, "ldap_parse_sasl_bind_result\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_parse_sasl_bind_result\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -376,11 +364,7 @@ ldap_pvt_sasl_getmechs ( LDAP *ld, char **pmechlist ) char **values, *mechlist; int rc; -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ENTRY, "ldap_pvt_sasl_getmech\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_getmech\n", 0, 0, 0 ); -#endif rc = ldap_search_s( ld, "", LDAP_SCOPE_BASE, NULL, attrs, 0, &res ); @@ -470,28 +454,16 @@ ldap_sasl_interactive_bind_s( goto done; } -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, - "ldap_sasl_interactive_bind_s: server supports: %s\n", - smechs, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_sasl_interactive_bind_s: server supports: %s\n", smechs, 0, 0 ); -#endif mechs = smechs; } else { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, - "ldap_sasl_interactive_bind_s: user selected: %s\n", - mechs, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_sasl_interactive_bind_s: user selected: %s\n", mechs, 0, 0 ); -#endif } rc = ldap_int_sasl_bind( ld, dn, mechs, diff --git a/libraries/libldap/sbind.c b/libraries/libldap/sbind.c index 8a5e26ba44..2b6bcb343a 100644 --- a/libraries/libldap/sbind.c +++ b/libraries/libldap/sbind.c @@ -70,11 +70,7 @@ ldap_simple_bind( int msgid; struct berval cred; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_simple_bind\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_simple_bind\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -109,11 +105,7 @@ ldap_simple_bind_s( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd ) { struct berval cred; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_simple_bind_s\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_simple_bind_s\n", 0, 0, 0 ); -#endif if ( passwd != NULL ) { cred.bv_val = (char *) passwd; diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index aa699ccce9..a901888ffd 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -71,11 +71,7 @@ ldap_search_ext( int timelimit; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_search_ext\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_search_ext\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); @@ -186,11 +182,7 @@ ldap_search( BerElement *ber; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_search\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_search\n", 0, 0, 0 ); -#endif assert( ld != NULL ); assert( LDAP_VALID( ld ) ); diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 8c30370d84..dfbace08f7 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -227,15 +227,9 @@ ldap_pvt_tls_init_def_ctx( void ) int i; tls_def_ctx = SSL_CTX_new( SSLv23_method() ); if ( tls_def_ctx == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: " - "TLS could not allocate default ctx (%d).\n", - ERR_peek_error(), 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: could not allocate default ctx (%lu).\n", ERR_peek_error(),0,0); -#endif rc = -1; goto error_exit; } @@ -246,15 +240,9 @@ ldap_pvt_tls_init_def_ctx( void ) if ( tls_opt_ciphersuite && !SSL_CTX_set_cipher_list( tls_def_ctx, ciphersuite ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: " - "TLS could not set cipher list %s.\n", - tls_opt_ciphersuite, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: could not set cipher list %s.\n", tls_opt_ciphersuite, 0, 0 ); -#endif tls_report_error(); rc = -1; goto error_exit; @@ -265,20 +253,11 @@ ldap_pvt_tls_init_def_ctx( void ) cacertfile, cacertdir ) || !SSL_CTX_set_default_verify_paths( tls_def_ctx ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, - "ldap_pvt_tls_init_def_ctx: " - "TLS could not load verify locations " - "(file:`%s',dir:`%s').\n", - tls_opt_cacertfile ? tls_opt_cacertfile : "", - tls_opt_cacertdir ? tls_opt_cacertdir : "", 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: " "could not load verify locations (file:`%s',dir:`%s').\n", tls_opt_cacertfile ? tls_opt_cacertfile : "", tls_opt_cacertdir ? tls_opt_cacertdir : "", 0 ); -#endif tls_report_error(); rc = -1; goto error_exit; @@ -286,18 +265,11 @@ ldap_pvt_tls_init_def_ctx( void ) calist = get_ca_list( cacertfile, cacertdir ); if ( !calist ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: " - "TLS could not load client CA list (file: `%s',dir:`%s')\n", - tls_opt_cacertfile ? tls_opt_cacertfile : "", - tls_opt_cacertdir ? tls_opt_cacertdir : "", 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: " "could not load client CA list (file:`%s',dir:`%s').\n", tls_opt_cacertfile ? tls_opt_cacertfile : "", tls_opt_cacertdir ? tls_opt_cacertdir : "", 0 ); -#endif tls_report_error(); rc = -1; goto error_exit; @@ -310,14 +282,9 @@ ldap_pvt_tls_init_def_ctx( void ) !SSL_CTX_use_PrivateKey_file( tls_def_ctx, keyfile, SSL_FILETYPE_PEM ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: " - "TLS could not use key file `%s'.\n", tls_opt_keyfile, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: could not use key file `%s'.\n", tls_opt_keyfile,0,0); -#endif tls_report_error(); rc = -1; goto error_exit; @@ -327,15 +294,9 @@ ldap_pvt_tls_init_def_ctx( void ) !SSL_CTX_use_certificate_file( tls_def_ctx, certfile, SSL_FILETYPE_PEM ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: " - "TLS could not use certificate `%s'.\n", - tls_opt_certfile, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: could not use certificate `%s'.\n", tls_opt_certfile,0,0); -#endif tls_report_error(); rc = -1; goto error_exit; @@ -344,15 +305,9 @@ ldap_pvt_tls_init_def_ctx( void ) if ( ( tls_opt_certfile || tls_opt_keyfile ) && !SSL_CTX_check_private_key( tls_def_ctx ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, - "ldap_pvt_tls_init_def_ctx: TLS private key mismatch.\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: private key mismatch.\n", 0,0,0); -#endif tls_report_error(); rc = -1; goto error_exit; @@ -436,12 +391,7 @@ alloc_handle( void *ctx_arg ) ssl = SSL_new( ctx ); if ( ssl == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, - "alloc_handle: TLS can't create ssl handle.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY,"TLS: can't create ssl handle.\n",0,0,0); -#endif return NULL; } return ssl; @@ -787,12 +737,7 @@ ldap_int_tls_connect( LDAP *ld, LDAPConn *conn ) #endif } -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, - "ldap_int_tls_connect: TLS can't connect.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY,"TLS: can't connect.\n",0,0,0); -#endif ber_sockbuf_remove_io( sb, &sb_tls_sbio, LBER_SBIOD_LEVEL_TRANSPORT ); @@ -839,12 +784,7 @@ ldap_pvt_tls_accept( Sockbuf *sb, void *ctx_arg ) if ( err <= 0 ) { if ( update_flags( sb, ssl, err )) return 1; -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, - "ldap_pvt_tls_accept: TLS can't accept.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY,"TLS: can't accept.\n",0,0,0 ); -#endif tls_report_error(); ber_sockbuf_remove_io( sb, &sb_tls_sbio, @@ -950,15 +890,9 @@ ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in ) x = tls_get_cert((SSL *)s); if (!x) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, - "ldap_pvt_tls_check_hostname: " - "TLS unable to get peer certificate.\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: unable to get peer certificate.\n", 0, 0, 0 ); -#endif /* If this was a fatal condition, things would have * aborted long before now. */ @@ -1059,15 +993,9 @@ ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in ) if( X509_NAME_get_text_by_NID( xn, NID_commonName, buf, sizeof(buf)) == -1) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_check_hostname: " - "TLS unable to get common name from peer certificate.\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: unable to get common name from peer certificate.\n", 0, 0, 0 ); -#endif ret = LDAP_CONNECT_ERROR; ld->ld_error = LDAP_STRDUP( _("TLS: unable to get CN from peer certificate")); @@ -1093,15 +1021,9 @@ ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in ) } if( ret == LDAP_LOCAL_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_check_hostname: " - "TLS hostname (%s) does not match " - "common name in certificate (%s).\n", name, buf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: hostname (%s) does not match " "common name in certificate (%s).\n", name, buf, 0 ); -#endif ret = LDAP_CONNECT_ERROR; ld->ld_error = LDAP_STRDUP( _("TLS: hostname does not match CN in peer certificate")); @@ -1413,14 +1335,9 @@ tls_info_cb( const SSL *ssl, int where, int ret ) } #endif if ( where & SSL_CB_LOOP ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, "tls_info_cb: " - "TLS trace: %s:%s\n", op, state, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "TLS trace: %s:%s\n", op, state, 0 ); -#endif } else if ( where & SSL_CB_ALERT ) { char *atype = (char *) SSL_alert_type_string_long( ret ); @@ -1436,40 +1353,22 @@ tls_info_cb( const SSL *ssl, int where, int ret ) __etoa( adesc ); } #endif -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, - "tls_info_cb: TLS trace: SSL3 alert %s:%s:%s\n", - op, atype, adesc ); -#else Debug( LDAP_DEBUG_TRACE, "TLS trace: SSL3 alert %s:%s:%s\n", op, atype, adesc ); -#endif #ifdef HAVE_EBCDIC if ( atype ) LDAP_FREE( atype ); if ( adesc ) LDAP_FREE( adesc ); #endif } else if ( where & SSL_CB_EXIT ) { if ( ret == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, - "tls_info_cb: TLS trace: %s:failed in %s\n", - op, state, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "TLS trace: %s:failed in %s\n", op, state, 0 ); -#endif } else if ( ret < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, - "tls_info_cb: TLS trace: %s:error in %s\n", - op, state, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "TLS trace: %s:error in %s\n", op, state, 0 ); -#endif } } #ifdef HAVE_EBCDIC @@ -1511,18 +1410,6 @@ tls_verify_cb( int ok, X509_STORE_CTX *ctx ) __etoa( certerr ); } #endif -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ERR, - "TLS certificate verification: depth: %d, err: %d, subject: %s,", - errdepth, errnum, - sname ? sname : "-unknown-" ); - LDAP_LOG( TRANSPORT, ERR, " issuer: %s\n", iname ? iname : "-unknown-", 0, 0 ); - if ( !ok ) { - LDAP_LOG ( TRANSPORT, ERR, - "TLS certificate verification: Error, %s\n", - certerr, 0, 0 ); - } -#else Debug( LDAP_DEBUG_TRACE, "TLS certificate verification: depth: %d, err: %d, subject: %s,", errdepth, errnum, @@ -1533,7 +1420,6 @@ tls_verify_cb( int ok, X509_STORE_CTX *ctx ) "TLS certificate verification: Error, %s\n", certerr, 0, 0 ); } -#endif if ( sname ) CRYPTO_free ( sname ); if ( iname ) @@ -1569,14 +1455,8 @@ tls_report_error( void ) } __etoa( buf ); #endif -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, - "tls_report_error: TLS %s %s:%d\n", - buf, file, line ); -#else Debug( LDAP_DEBUG_ANY, "TLS: %s %s:%d\n", buf, file, line ); -#endif #ifdef HAVE_EBCDIC if ( file ) LDAP_FREE( (void *)file ); #endif @@ -1593,15 +1473,9 @@ tls_tmp_rsa_cb( SSL *ssl, int is_export, int key_length ) tmp_rsa = RSA_generate_key( key_length, RSA_F4, NULL, NULL ); if ( !tmp_rsa ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, ERR, - "tls_tmp_rsa_cb: TLS Failed to generate temporary %d-bit %s " - "RSA key\n", key_length, is_export ? "export" : "domestic", 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: Failed to generate temporary %d-bit %s RSA key\n", key_length, is_export ? "export" : "domestic", 0 ); -#endif return NULL; } return tmp_rsa; @@ -1629,30 +1503,18 @@ tls_seed_PRNG( const char *randfile ) } if (randfile == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, - "tls_seed_PRNG: TLS Use configuration file or " - "$RANDFILE to define seed PRNG\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: Use configuration file or $RANDFILE to define seed PRNG\n", 0, 0, 0); -#endif return -1; } total = RAND_load_file(randfile, -1); if (RAND_status() == 0) { -#ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, - "tls_seed_PRNG: TLS PRNG not been seeded with enough data\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TLS: PRNG not been seeded with enough data\n", 0, 0, 0); -#endif return -1; } diff --git a/libraries/libldap/unbind.c b/libraries/libldap/unbind.c index 678a2804ae..5c77d19754 100644 --- a/libraries/libldap/unbind.c +++ b/libraries/libldap/unbind.c @@ -67,11 +67,7 @@ ldap_unbind_ext_s( int ldap_unbind( LDAP *ld ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_unbind\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_unbind\n", 0, 0, 0 ); -#endif return( ldap_unbind_ext( ld, NULL, NULL ) ); } @@ -204,11 +200,7 @@ ldap_send_unbind( BerElement *ber; ber_int_t id; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_send_unbind\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_send_unbind\n", 0, 0, 0 ); -#endif #ifdef LDAP_CONNECTIONLESS if (LDAP_IS_UDP(ld)) diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index a0f7dab38d..be266ffe02 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -499,11 +499,7 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) * because a call to LDAP_INT_GLOBAL_OPT() will try to allocate * the options and cause infinite recursion */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "ldap_url_parse_ext(%s)\n", url_in, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_url_parse_ext(%s)\n", url_in, 0, 0 ); -#endif #endif *ludpp = NULL; /* pessimistic */ diff --git a/servers/slapd/abandon.c b/servers/slapd/abandon.c index 559bcaaa51..670e540f4e 100644 --- a/servers/slapd/abandon.c +++ b/servers/slapd/abandon.c @@ -38,11 +38,7 @@ do_abandon( Operation *op, SlapReply *rs ) Operation *o; int i; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "conn: %d do_abandon\n", op->o_connid, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0, 0 ); -#endif /* * Parse the abandon request. It looks like this: @@ -51,12 +47,7 @@ do_abandon( Operation *op, SlapReply *rs ) */ if ( ber_scanf( op->o_ber, "i", &id ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "conn: %d do_abandon: ber_scanf failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_abandon: ber_scanf failed\n", 0, 0 ,0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); return SLAPD_DISCONNECT; } @@ -66,22 +57,11 @@ do_abandon( Operation *op, SlapReply *rs ) return rs->sr_err; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, "do_abandon: conn: %d id=%ld\n", - op->o_connid, (long) id, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "do_abandon: id=%ld\n", (long) id, 0 ,0 ); -#endif if( id <= 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_abandon: conn: %d bad msgid %ld\n", - op->o_connid, (long) id, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_abandon: bad msgid %ld\n", (long) id, 0, 0 ); -#endif return LDAP_SUCCESS; } @@ -125,14 +105,8 @@ done: ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "do_abandon: conn: %d op=%ld %sfound\n", - op->o_connid, (long)id, o ? "" : "not " ); -#else Debug( LDAP_DEBUG_TRACE, "do_abandon: op=%ld %sfound\n", (long) id, o ? "" : "not ", 0 ); -#endif return LDAP_SUCCESS; } diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index a1dfd1f147..d1142bbe21 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -201,15 +201,9 @@ access_allowed_mask( state->as_vd_ad=desc; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, ENTRY, - "access_allowed: %s access to \"%s\" \"%s\" requested\n", - access2str( access ), e->e_dn, attr ); -#else Debug( LDAP_DEBUG_ACL, "=> access_allowed: %s access to \"%s\" \"%s\" requested\n", access2str( access ), e->e_dn, attr ); -#endif if ( op == NULL ) { /* no-op call */ @@ -244,15 +238,9 @@ access_allowed_mask( /* grant database root access */ if ( be != NULL && be_isroot( op ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, INFO, - "access_allowed: conn %lu root access granted\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= root access granted\n", 0, 0, 0 ); -#endif if ( maskp ) { mask = ACL_LVL_WRITE; } @@ -269,33 +257,19 @@ access_allowed_mask( && desc != slap_schema.si_ad_entry && desc != slap_schema.si_ad_children ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "access_allowed: conn %lu NoUserMod Operational attribute: %s " - "access granted\n", op->o_connid, attr , 0 ); -#else Debug( LDAP_DEBUG_ACL, "NoUserMod Operational attribute:" " %s access granted\n", attr, 0, 0 ); -#endif goto done; } /* use backend default access if no backend acls */ if( be != NULL && be->be_acl == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "access_allowed: backend default %s access %s to \"%s\"\n", - access2str( access ), - be->be_dfltaccess >= access ? "granted" : "denied", - op->o_dn.bv_val ? op->o_dn.bv_val : "(anonymous)" ); -#else Debug( LDAP_DEBUG_ACL, "=> access_allowed: backend default %s access %s to \"%s\"\n", access2str( access ), be->be_dfltaccess >= access ? "granted" : "denied", op->o_dn.bv_val ? op->o_dn.bv_val : "(anonymous)" ); -#endif ret = be->be_dfltaccess >= access; if ( maskp ) { @@ -313,18 +287,10 @@ access_allowed_mask( /* be is always non-NULL */ /* use global default access if no global acls */ } else if ( be == NULL && frontendDB->be_acl == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "access_allowed: global default %s access %s to \"%s\"\n", - access2str( access ), - frontendDB->be_dfltaccess >= access ? "granted" : "denied", - op->o_dn.bv_val ); -#else Debug( LDAP_DEBUG_ACL, "=> access_allowed: global default %s access %s to \"%s\"\n", access2str( access ), frontendDB->be_dfltaccess >= access ? "granted" : "denied", op->o_dn.bv_val ); -#endif ret = frontendDB->be_dfltaccess >= access; if ( maskp ) { @@ -368,25 +334,15 @@ access_allowed_mask( int i; for (i = 0; i < MAXREMATCHES && matches[i].rm_so > 0; i++) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "access_allowed: match[%d]: %d %d ", - i, (int)matches[i].rm_so, (int)matches[i].rm_eo ); -#else Debug( LDAP_DEBUG_ACL, "=> match[%d]: %d %d ", i, (int)matches[i].rm_so, (int)matches[i].rm_eo ); -#endif if( matches[i].rm_so <= matches[0].rm_eo ) { int n; for ( n = matches[i].rm_so; n < matches[i].rm_eo; n++) { Debug( LDAP_DEBUG_ACL, "%c", e->e_ndn[n], 0, 0 ); } } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, ARGS, "\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 ); -#endif } if (state) { @@ -411,41 +367,23 @@ vd_access: } if ( ACL_IS_INVALID( mask ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "access_allowed: conn %lu \"%s\" (%s) invalid!\n", - op->o_connid, e->e_dn, attr ); -#else Debug( LDAP_DEBUG_ACL, "=> access_allowed: \"%s\" (%s) invalid!\n", e->e_dn, attr, 0 ); -#endif ACL_INIT(mask); } else if ( control == ACL_BREAK ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "access_allowed: conn %lu no more rules\n", op->o_connid, 0,0 ); -#else Debug( LDAP_DEBUG_ACL, "=> access_allowed: no more rules\n", 0, 0, 0); -#endif goto done; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, ENTRY, - "access_allowed: %s access %s by %s\n", - access2str( access ), ACL_GRANT( mask, access ) ? "granted" : "denied", - accessmask2str( mask, accessmaskbuf ) ); -#else Debug( LDAP_DEBUG_ACL, "=> access_allowed: %s access %s by %s\n", access2str( access ), ACL_GRANT(mask, access) ? "granted" : "denied", accessmask2str( mask, accessmaskbuf ) ); -#endif ret = ACL_GRANT(mask, access); @@ -516,26 +454,14 @@ acl_get( if ( a->acl_dn_pat.bv_len || ( a->acl_dn_style != ACL_STYLE_REGEX )) { if ( a->acl_dn_style == ACL_STYLE_REGEX ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_get: dnpat [%d] %s nsub: %d\n", - *count, a->acl_dn_pat.bv_val, - (int) a->acl_dn_re.re_nsub ); -#else Debug( LDAP_DEBUG_ACL, "=> dnpat: [%d] %s nsub: %d\n", *count, a->acl_dn_pat.bv_val, (int) a->acl_dn_re.re_nsub ); -#endif if (regexec(&a->acl_dn_re, e->e_ndn, nmatch, matches, 0)) continue; } else { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, "acl_get: dn [%d] %s\n", - *count, a->acl_dn_pat.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ACL, "=> dn: [%d] %s\n", *count, a->acl_dn_pat.bv_val, 0 ); -#endif patlen = a->acl_dn_pat.bv_len; if ( dnlen < patlen ) continue; @@ -576,13 +502,8 @@ acl_get( continue; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_get: [%d] matched\n", *count, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "=> acl_get: [%d] matched\n", *count, 0, 0 ); -#endif } if ( a->acl_attrs && !ad_inlist( desc, a->acl_attrs ) ) { @@ -606,29 +527,17 @@ acl_get( } if ( a->acl_attrval_style == ACL_STYLE_REGEX ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_get: valpat %s\n", - a->acl_attrval.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "acl_get: valpat %s\n", a->acl_attrval.bv_val, 0, 0 ); -#endif if (regexec(&a->acl_attrval_re, val->bv_val, 0, NULL, 0)) continue; } else { int match = 0; const char *text; -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_get: val %s\n", - a->acl_attrval.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "acl_get: val %s\n", a->acl_attrval.bv_val, 0, 0 ); -#endif if ( a->acl_attrs[0].an_desc->ad_type->sat_syntax != slap_schema.si_syn_distinguishedName ) { if (value_match( &match, desc, @@ -685,21 +594,12 @@ acl_get( } } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_get: [%d] attr %s\n", *count, attr ,0 ); -#else Debug( LDAP_DEBUG_ACL, "=> acl_get: [%d] attr %s\n", *count, attr, 0); -#endif return a; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, RESULTS, "acl_get: done.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= acl_get: done.\n", 0, 0, 0 ); -#endif return( NULL ); } @@ -755,16 +655,6 @@ acl_mask( assert( attr != NULL ); -#ifdef NEW_LOGGING - LDAP_LOG( ACL, ENTRY, - "acl_mask: conn %lu access to entry \"%s\", attr \"%s\" requested\n", - op->o_connid, e->e_dn, attr ); - - LDAP_LOG( ACL, ARGS, - " to %s by \"%s\", (%s) \n", val ? "value" : "all values", - op->o_ndn.bv_val ? op->o_ndn.bv_val : "", - accessmask2str( *mask, accessmaskbuf ) ); -#else Debug( LDAP_DEBUG_ACL, "=> acl_mask: access to entry \"%s\", attr \"%s\" requested\n", e->e_dn, attr, 0 ); @@ -774,7 +664,6 @@ acl_mask( val ? "value" : "all values", op->o_ndn.bv_val ? op->o_ndn.bv_val : "", accessmask2str( *mask, accessmaskbuf ) ); -#endif if( state && ( state->as_recorded & ACL_STATE_RECORDED_VD ) @@ -795,14 +684,8 @@ acl_mask( /* AND clauses */ if ( b->a_dn_pat.bv_len != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu check a_dn_pat: %s\n", - op->o_connid, b->a_dn_pat.bv_val ,0 ); -#else Debug( LDAP_DEBUG_ACL, "<= check a_dn_pat: %s\n", b->a_dn_pat.bv_val, 0, 0); -#endif /* * if access applies to the entry itself, and the * user is bound as somebody in the same namespace as @@ -922,14 +805,8 @@ dn_match_cleanup:; if ( ! op->o_conn->c_listener ) { continue; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu check a_sockurl_pat: %s\n", - op->o_connid, b->a_sockurl_pat.bv_val , 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= check a_sockurl_pat: %s\n", b->a_sockurl_pat.bv_val, 0, 0 ); -#endif if ( !ber_bvccmp( &b->a_sockurl_pat, '*' ) ) { if ( b->a_sockurl_style == ACL_STYLE_REGEX) { @@ -962,14 +839,8 @@ dn_match_cleanup:; if ( !op->o_conn->c_peer_domain.bv_val ) { continue; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu check a_domain_pat: %s\n", - op->o_connid, b->a_domain_pat.bv_val , 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= check a_domain_pat: %s\n", b->a_domain_pat.bv_val, 0, 0 ); -#endif if ( !ber_bvccmp( &b->a_domain_pat, '*' ) ) { if ( b->a_domain_style == ACL_STYLE_REGEX) { if (!regex_matches( &b->a_domain_pat, op->o_conn->c_peer_domain.bv_val, @@ -1019,14 +890,8 @@ dn_match_cleanup:; if ( !op->o_conn->c_peer_name.bv_val ) { continue; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu check a_peername_path: %s\n", - op->o_connid, b->a_peername_pat.bv_val , 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= check a_peername_path: %s\n", b->a_peername_pat.bv_val, 0, 0 ); -#endif if ( !ber_bvccmp( &b->a_peername_pat, '*' ) ) { if ( b->a_peername_style == ACL_STYLE_REGEX ) { if (!regex_matches( &b->a_peername_pat, op->o_conn->c_peer_name.bv_val, @@ -1129,14 +994,8 @@ dn_match_cleanup:; if ( !op->o_conn->c_sock_name.bv_val ) { continue; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu check a_sockname_path: %s\n", - op->o_connid, b->a_sockname_pat.bv_val , 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= check a_sockname_path: %s\n", b->a_sockname_pat.bv_val, 0, 0 ); -#endif if ( !ber_bvccmp( &b->a_sockname_pat, '*' ) ) { if ( b->a_sockname_style == ACL_STYLE_REGEX) { if (!regex_matches( &b->a_sockname_pat, op->o_conn->c_sock_name.bv_val, @@ -1177,14 +1036,8 @@ dn_match_cleanup:; continue; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu check a_dn_pat: %s\n", - op->o_connid, attr , 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= check a_dn_at: %s\n", attr, 0, 0); -#endif bv = op->o_ndn; /* see if asker is listed in dnattr */ @@ -1305,63 +1158,35 @@ dn_match_cleanup:; } if ( b->a_authz.sai_ssf ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu check a_authz.sai_ssf: ACL %u > OP %u\n", - op->o_connid, b->a_authz.sai_ssf, op->o_ssf ); -#else Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_ssf: ACL %u > OP %u\n", b->a_authz.sai_ssf, op->o_ssf, 0 ); -#endif if ( b->a_authz.sai_ssf > op->o_ssf ) { continue; } } if ( b->a_authz.sai_transport_ssf ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu check a_authz.sai_transport_ssf: " - "ACL %u > OP %u\n", - op->o_connid, b->a_authz.sai_transport_ssf, - op->o_transport_ssf ); -#else Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_transport_ssf: ACL %u > OP %u\n", b->a_authz.sai_transport_ssf, op->o_transport_ssf, 0 ); -#endif if ( b->a_authz.sai_transport_ssf > op->o_transport_ssf ) { continue; } } if ( b->a_authz.sai_tls_ssf ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu check a_authz.sai_tls_ssf: ACL %u > " - "OP %u\n", - op->o_connid, b->a_authz.sai_tls_ssf, op->o_tls_ssf ); -#else Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_tls_ssf: ACL %u > OP %u\n", b->a_authz.sai_tls_ssf, op->o_tls_ssf, 0 ); -#endif if ( b->a_authz.sai_tls_ssf > op->o_tls_ssf ) { continue; } } if ( b->a_authz.sai_sasl_ssf ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu check a_authz.sai_sasl_ssf: " - "ACL %u > OP %u\n", - op->o_connid, b->a_authz.sai_sasl_ssf, op->o_sasl_ssf ); -#else Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_sasl_ssf: ACL %u > OP %u\n", b->a_authz.sai_sasl_ssf, op->o_sasl_ssf, 0 ); -#endif if ( b->a_authz.sai_sasl_ssf > op->o_sasl_ssf ) { continue; } @@ -1521,13 +1346,6 @@ dn_match_cleanup:; modmask = b->a_access_mask; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, RESULTS, - "acl_mask: [%d] applying %s (%s)\n", - i, accessmask2str( modmask, accessmaskbuf), - b->a_type == ACL_CONTINUE ? "continue" : b->a_type == ACL_BREAK - ? "break" : "stop" ); -#else Debug( LDAP_DEBUG_ACL, "<= acl_mask: [%d] applying %s (%s)\n", i, accessmask2str( modmask, accessmaskbuf ), @@ -1536,7 +1354,6 @@ dn_match_cleanup:; : b->a_type == ACL_BREAK ? "break" : "stop" ); -#endif /* save old mask */ oldmask = *mask; @@ -1559,15 +1376,9 @@ dn_match_cleanup:; *mask = modmask; } -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_mask: conn %lu [%d] mask: %s\n", - op->o_connid, i, accessmask2str( *mask, accessmaskbuf) ); -#else Debug( LDAP_DEBUG_ACL, "<= acl_mask: [%d] mask: %s\n", i, accessmask2str(*mask, accessmaskbuf), 0 ); -#endif if( b->a_type == ACL_CONTINUE ) { continue; @@ -1583,15 +1394,9 @@ dn_match_cleanup:; /* implicit "by * none" clause */ ACL_INIT(*mask); -#ifdef NEW_LOGGING - LDAP_LOG( ACL, RESULTS, - "acl_mask: conn %lu no more clauses, returning %d (stop)\n", - op->o_connid, accessmask2str( *mask, accessmaskbuf) , 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= acl_mask: no more clauses, returning %s (stop)\n", accessmask2str(*mask, accessmaskbuf), 0, 0 ); -#endif return ACL_STOP; } @@ -1625,32 +1430,18 @@ acl_check_modlist( /* short circuit root database access */ if ( be_isroot( op ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_check_modlist: conn %lu access granted to root user\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= acl_access_allowed: granted to database root\n", 0, 0, 0 ); -#endif goto done; } /* use backend default access if no backend acls */ if( op->o_bd != NULL && op->o_bd->be_acl == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_check_modlist: backend default %s access %s to \"%s\"\n", - access2str( ACL_WRITE ), - op->o_bd->be_dfltaccess >= ACL_WRITE ? "granted" : "denied", - op->o_dn.bv_val ); -#else Debug( LDAP_DEBUG_ACL, "=> access_allowed: backend default %s access %s to \"%s\"\n", access2str( ACL_WRITE ), op->o_bd->be_dfltaccess >= ACL_WRITE ? "granted" : "denied", op->o_dn.bv_val ); -#endif ret = (op->o_bd->be_dfltaccess >= ACL_WRITE); goto done; } @@ -1662,15 +1453,9 @@ acl_check_modlist( * by the user */ if ( is_at_no_user_mod( mlist->sml_desc->ad_type ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "acl_check_modlist: conn %lu no-user-mod %s: modify access granted\n", - op->o_connid, mlist->sml_desc->ad_cname.bv_val , 0 ); -#else Debug( LDAP_DEBUG_ACL, "acl: no-user-mod %s:" " modify access granted\n", mlist->sml_desc->ad_cname.bv_val, 0, 0 ); -#endif continue; } @@ -2302,14 +2087,8 @@ string_expand( *dp = '\0'; bv->bv_len = size; -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL1, - "string_expand: pattern = %.*s\n", (int)pat->bv_len, pat->bv_val, 0 ); - LDAP_LOG( ACL, DETAIL1, "string_expand: expanded = %s\n", bv->bv_val, 0, 0 ); -#else 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 } static int @@ -2335,32 +2114,20 @@ regex_matches( char error[ACL_BUF_SIZE]; regerror(rc, &re, error, sizeof(error)); -#ifdef NEW_LOGGING - LDAP_LOG( ACL, ERR, - "regex_matches: compile( \"%s\", \"%s\") failed %s\n", - pat->bv_val, str, error ); -#else Debug( LDAP_DEBUG_TRACE, "compile( \"%s\", \"%s\") failed %s\n", pat->bv_val, str, error ); -#endif return( 0 ); } rc = regexec(&re, str, 0, NULL, 0); regfree( &re ); -#ifdef NEW_LOGGING - LDAP_LOG( ACL, DETAIL2, "regex_matches: string: %s\n", str, 0, 0 ); - LDAP_LOG( ACL, DETAIL2, "regex_matches: rc: %d %s\n", - rc, rc ? "matches" : "no matches", 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> regex_matches: string: %s\n", str, 0, 0 ); Debug( LDAP_DEBUG_TRACE, "=> regex_matches: rc: %d %s\n", rc, !rc ? "matches" : "no matches", 0 ); -#endif return( !rc ); } diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 0d9d6e200d..370ebb22c4 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -880,15 +880,9 @@ ad_define_option( const char *name, const char *fname, int lineno ) optlen = 0; do { if ( !DESC_CHAR( name[optlen] ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: illegal option name \"%s\"\n", - fname, lineno, name ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: illegal option name \"%s\"\n", fname, lineno, name ); -#endif return 1; } } while ( name[++optlen] ); @@ -898,15 +892,9 @@ ad_define_option( const char *name, const char *fname, int lineno ) if ( strcasecmp( name, "binary" ) == 0 || ad_find_option_definition( name, optlen ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: option \"%s\" is already defined\n", - fname, lineno, name ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: option \"%s\" is already defined\n", fname, lineno, name ); -#endif return 1; } @@ -924,15 +912,9 @@ ad_define_option( const char *name, const char *fname, int lineno ) options[i].prefix && optlen < options[i+1].name.bv_len && strncasecmp( name, options[i+1].name.bv_val, optlen ) == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: option \"%s\" overrides previous option\n", - fname, lineno, name ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: option \"%s\" overrides previous option\n", fname, lineno, name ); -#endif return 1; } diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 1e856c8921..f3ad1d62c4 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -55,11 +55,7 @@ do_add( Operation *op, SlapReply *rs ) Modifications **modtail = &modlist; Modifications tmp; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "do_add: conn %d enter\n", op->o_connid,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 ); -#endif /* * Parse the add request. It looks like this: * @@ -74,12 +70,7 @@ do_add( Operation *op, SlapReply *rs ) /* get the name */ if ( ber_scanf( ber, "{m", /*}*/ &dn ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_add: conn %d ber_scanf failed\n", op->o_connid,0,0 ); -#else Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); return SLAPD_DISCONNECT; } @@ -90,12 +81,7 @@ do_add( Operation *op, SlapReply *rs ) op->o_tmpmemctx ); if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_add: conn %d invalid dn (%s)\n", op->o_connid, dn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_add: invalid dn (%s)\n", dn.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" ); goto done; } @@ -103,12 +89,7 @@ do_add( Operation *op, SlapReply *rs ) ber_dupbv( &e->e_name, &op->o_req_dn ); ber_dupbv( &e->e_nname, &op->o_req_ndn ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "do_add: conn %d dn (%s)\n", op->o_connid, e->e_dn, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "do_add: dn (%s)\n", e->e_dn, 0, 0 ); -#endif /* get the attrs */ for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT; @@ -122,26 +103,15 @@ do_add( Operation *op, SlapReply *rs ) rtag = ber_scanf( ber, "{m{W}}", &tmp.sml_type, &tmp.sml_values ); if ( rtag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_add: conn %d decoding error \n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_add: decoding error\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); rs->sr_err = SLAPD_DISCONNECT; goto done; } if ( tmp.sml_values == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_add: conn %d no values for type %s\n", - op->o_connid, tmp.sml_type.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "no values for type %s\n", tmp.sml_type.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "no values for attribute type" ); goto done; @@ -160,24 +130,14 @@ do_add( Operation *op, SlapReply *rs ) } if ( ber_scanf( ber, /*{*/ "}") == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_add: conn %d ber_scanf failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); rs->sr_err = SLAPD_DISCONNECT; goto done; } if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_add: conn %d get_ctrls failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 ); -#endif goto done; } @@ -400,12 +360,7 @@ fe_op_add( Operation *op, SlapReply *rs ) } } #endif -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_add: conn %d no backend support\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, " do_add: no backend support\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, "operation not supported within namingContext" ); } @@ -687,15 +642,9 @@ static int call_add_preop_plugins( Operation *op ) * A preoperation plugin failure will abort the * entire operation. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_add: add preoperation plugin failed\n", - 0, 0, 0); -#else Debug(LDAP_DEBUG_TRACE, "do_add: add preoperation plugin failed.\n", 0, 0, 0); -#endif if (( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 ) || rc == LDAP_SUCCESS ) @@ -715,15 +664,9 @@ static void call_add_postop_plugins( Operation *op ) rc = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_ADD_FN, op->o_pb ); if ( rc < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_add: add postoperation plugin failed\n", - 0, 0, 0); -#else Debug(LDAP_DEBUG_TRACE, "do_add: add postoperation plugin failed\n", 0, 0, 0); -#endif } } #endif /* LDAP_SLAPI */ diff --git a/servers/slapd/ava.c b/servers/slapd/ava.c index 9e071408f5..5b8665f67d 100644 --- a/servers/slapd/ava.c +++ b/servers/slapd/ava.c @@ -60,11 +60,7 @@ get_ava( rtag = ber_scanf( ber, "{mm}", &type, &value ); if( rtag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, "get_ava: ber_scanf failure\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " get_ava ber_scanf\n", 0, 0, 0 ); -#endif *text = "Error decoding attribute value assertion"; return SLAPD_DISCONNECT; } @@ -76,13 +72,8 @@ get_ava( rc = slap_bv2ad( &type, &aa->aa_desc, text ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "get_ava: unknown attributeType %s\n", type.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "get_ava: unknown attributeType %s\n", type.bv_val, 0, 0 ); -#endif op->o_tmpfree( aa, op->o_tmpmemctx ); return rc; } @@ -92,13 +83,8 @@ get_ava( usage, &value, &aa->aa_value, text, op->o_tmpmemctx ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "get_ava: illegal value for attributeType %s\n", type.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "get_ava: illegal value for attributeType %s\n", type.bv_val, 0, 0 ); -#endif op->o_tmpfree( aa, op->o_tmpmemctx ); return rc; } diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 6174a51616..651281ece8 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -53,13 +53,8 @@ bdb_add(Operation *op, SlapReply *rs ) LDAPControl *ctrls[SLAP_MAX_RESPONSE_CONTROLS]; int num_ctrls = 0; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "==> bdb_add: %s\n", - op->oq_add.rs_e->e_name.bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "==> bdb_add: %s\n", op->oq_add.rs_e->e_name.bv_val, 0, 0); -#endif ctrls[num_ctrls] = 0; @@ -67,15 +62,9 @@ bdb_add(Operation *op, SlapReply *rs ) rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL, &rs->sr_text, textbuf, textlen ); if ( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_add: entry failed schema check: %s (%d)\n", - rs->sr_text, rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: entry failed schema check: %s (%d)\n", rs->sr_text, rs->sr_err, 0 ); -#endif goto return_results; } @@ -89,13 +78,8 @@ bdb_add(Operation *op, SlapReply *rs ) */ rs->sr_err = bdb_next_id( op->o_bd, NULL, &op->oq_add.rs_e->e_id ); if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_add: next_id failed (%d)\n", rs->sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: next_id failed (%d)\n", rs->sr_err, 0, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -126,15 +110,9 @@ retry: /* transaction retry */ bdb->bi_db_opflags ); rs->sr_text = NULL; if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_add: txn_begin failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: txn_begin failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -189,13 +167,8 @@ retry: /* transaction retry */ : NULL; bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p ); p = NULL; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, "bdb_add: parent does not exist\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: parent does not exist\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL; send_ldap_result( op, rs ); @@ -218,13 +191,8 @@ retry: /* transaction retry */ goto retry; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_add: no write access to parent\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: no write access to parent\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_INSUFFICIENT_ACCESS; rs->sr_text = "no write access to parent"; goto return_results;; @@ -233,13 +201,8 @@ retry: /* transaction retry */ #ifdef BDB_SUBENTRIES if ( is_entry_subentry( p ) ) { /* parent is a subentry, don't allow add */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_add: parent is subentry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is subentry\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_OBJECT_CLASS_VIOLATION; rs->sr_text = "parent is a subentry"; goto return_results;; @@ -248,13 +211,8 @@ retry: /* transaction retry */ #ifdef BDB_ALIASES if ( is_entry_alias( p ) ) { /* parent is an alias, don't allow add */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_add: parent is alias\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is alias\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_ALIAS_PROBLEM; rs->sr_text = "parent is an alias"; goto return_results;; @@ -266,13 +224,8 @@ retry: /* transaction retry */ rs->sr_matched = p->e_name.bv_val; rs->sr_ref = get_entry_referrals( op, p ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_add: parent is referral\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is referral\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL; send_ldap_result( op, rs ); @@ -304,14 +257,9 @@ retry: /* transaction retry */ if ((( !be_isroot( op ) && !be_shadow_update(op) ) || pdn.bv_len > 0 ) && !is_entry_glue( op->oq_add.rs_e )) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, "bdb_add: %s denied\n", - pdn.bv_len == 0 ? "suffix" : "entry at root", 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: %s denied\n", pdn.bv_len == 0 ? "suffix" : "entry at root", 0, 0 ); -#endif rs->sr_err = LDAP_NO_SUCH_OBJECT; goto return_results; } @@ -335,13 +283,8 @@ retry: /* transaction retry */ goto retry; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_add: no write access to entry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: no write access to entry\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_INSUFFICIENT_ACCESS; rs->sr_text = "no write access to entry"; goto return_results;; @@ -352,15 +295,9 @@ retry: /* transaction retry */ bdb->bi_db_opflags ); rs->sr_text = NULL; if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_add: txn_begin(2) failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: txn_begin(2) failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -369,14 +306,8 @@ retry: /* transaction retry */ /* dn2id index */ rs->sr_err = bdb_dn2id_add( op, lt2, ei, op->oq_add.rs_e ); if ( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_add: dn2id_add failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: dn2id_add failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: @@ -394,12 +325,8 @@ retry: /* transaction retry */ /* id2entry index */ rs->sr_err = bdb_id2entry_add( op->o_bd, lt2, op->oq_add.rs_e ); if ( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "bdb_add: id2entry_add failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: id2entry_add failed\n", 0, 0, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -414,13 +341,8 @@ retry: /* transaction retry */ /* attribute indexes */ rs->sr_err = bdb_index_entry_add( op, lt2, op->oq_add.rs_e ); if ( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_add: index_entry_add failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: index_entry_add failed\n", 0, 0, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -457,13 +379,8 @@ retry: /* transaction retry */ if ( slap_read_controls( op, rs, op->oq_add.rs_e, &slap_post_read_bv, postread_ctrl ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_add: post-read failed!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_add: post-read failed!\n", 0, 0, 0 ); -#endif goto return_results; } } @@ -506,15 +423,9 @@ retry: /* transaction retry */ LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) { rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_ADD ); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_add: persistent search failed (%d,%d)\n", - rc, rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: persistent search failed (%d,%d)\n", rc, rs->sr_err, 0 ); -#endif } } ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock ); @@ -531,27 +442,15 @@ retry: /* transaction retry */ op->o_private = NULL; if ( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "bdb_add: %s : %s (%d)\n", - rs->sr_text, db_strerror(rs->sr_err), rs->sr_err ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n", rs->sr_text, db_strerror(rs->sr_err), rs->sr_err ); -#endif rs->sr_err = LDAP_OTHER; goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_add: added%s id=%08lx dn=\"%s\"\n", - op->o_noop ? " (no-op)" : "", - op->oq_add.rs_e->e_id, op->oq_add.rs_e->e_dn ); -#else Debug(LDAP_DEBUG_TRACE, "bdb_add: added%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", op->oq_add.rs_e->e_id, op->oq_add.rs_e->e_dn ); -#endif rs->sr_text = NULL; if( num_ctrls ) rs->sr_ctrls = ctrls; diff --git a/servers/slapd/back-bdb/attr.c b/servers/slapd/back-bdb/attr.c index dd545d2602..216f628eef 100644 --- a/servers/slapd/back-bdb/attr.c +++ b/servers/slapd/back-bdb/attr.c @@ -188,14 +188,8 @@ bdb_attr_index_config( return LDAP_INAPPROPRIATE_MATCHING; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, DETAIL1, - "attr_index_config: index %s 0x%04lx\n", - ad->ad_cname.bv_val, mask, 0 ); -#else Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04lx\n", ad->ad_cname.bv_val, mask, 0 ); -#endif a->ai_desc = ad; diff --git a/servers/slapd/back-bdb/bind.c b/servers/slapd/back-bdb/bind.c index 9739773aea..5b1df1b9ce 100644 --- a/servers/slapd/back-bdb/bind.c +++ b/servers/slapd/back-bdb/bind.c @@ -43,13 +43,8 @@ bdb_bind( Operation *op, SlapReply *rs ) u_int32_t locker; DB_LOCK lock; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "==> bdb_bind: dn: %s\n", op->o_req_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "==> bdb_bind: dn: %s\n", op->o_req_dn.bv_val, 0, 0); -#endif /* allow noauth binds */ if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op )) { @@ -112,13 +107,8 @@ dn2entry_retry: #ifdef BDB_SUBENTRIES if ( is_entry_subentry( e ) ) { /* entry is an subentry, don't allow bind */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_bind: entry is subentry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry is subentry\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_INVALID_CREDENTIALS; goto done; } @@ -127,12 +117,7 @@ dn2entry_retry: #ifdef BDB_ALIASES if ( is_entry_alias( e ) ) { /* entry is an alias, don't allow bind */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_bind: entry is alias\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0, 0, 0 ); -#endif #if 1 rs->sr_err = LDAP_INVALID_CREDENTIALS; @@ -145,13 +130,8 @@ dn2entry_retry: #endif if ( is_entry_referral( e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_bind: entry is referral\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_INVALID_CREDENTIALS; goto done; } diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index d306add2a5..5f928279c3 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -89,15 +89,9 @@ bdb_cache_entry_db_relock( list, 2, NULL ); if (rc && !tryOnly) { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "bdb_cache_entry_db_relock: entry %ld, rw %d, rc %d\n", - ei->bei_id, rw, rc ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_cache_entry_db_relock: entry %ld, rw %d, rc %d\n", ei->bei_id, rw, rc ); -#endif } else { *lock = list[1].lock; } @@ -129,15 +123,9 @@ bdb_cache_entry_db_lock( DB_ENV *env, u_int32_t locker, EntryInfo *ei, rc = LOCK_GET(env, locker, tryOnly ? DB_LOCK_NOWAIT : 0, &lockobj, db_rw, lock); if (rc && !tryOnly) { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "bdb_cache_entry_db_lock: entry %ld, rw %d, rc %d\n", - ei->bei_id, rw, rc ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_cache_entry_db_lock: entry %ld, rw %d, rc %d\n", ei->bei_id, rw, rc ); -#endif } return rc; #endif /* NO_THREADS */ @@ -1002,13 +990,8 @@ bdb_cache_delete( /* Lock the parent's kids tree */ bdb_cache_entryinfo_lock( ei->bei_parent ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, ENTRY, - "bdb_cache_delete: delete %ld.\n", e->e_id, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_delete( %ld )\n", e->e_id, 0, 0 ); -#endif /* set lru mutex */ ldap_pvt_thread_mutex_lock( &cache->lru_mutex ); @@ -1117,11 +1100,7 @@ bdb_cache_release_all( Cache *cache ) /* set lru mutex */ ldap_pvt_thread_mutex_lock( &cache->lru_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, ENTRY, "bdb_cache_release_all: enter\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_release_all\n", 0, 0, 0 ); -#endif avl_free( cache->c_dntree.bei_kids, NULL ); avl_free( cache->c_idtree, bdb_entryinfo_release ); @@ -1195,13 +1174,8 @@ bdb_txn_get( Operation *op, DB_ENV *env, DB_TXN **txn ) if ( ( rc = ldap_pvt_thread_pool_setkey( ctx, ((char *)env)+1, *txn, bdb_txn_free ) ) ) { TXN_ABORT( *txn ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, "bdb_txn_get: err %s(%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_txn_get: err %s(%d)\n", db_strerror(rc), rc, 0 ); -#endif return rc; } @@ -1222,15 +1196,9 @@ bdb_locker_id_free( void *key, void *data ) rc = XLOCK_ID_FREE( env, lockid ); if ( rc == EINVAL ) { DB_LOCKREQ lr; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_locker_id_free: %d err %s(%d)\n", - lockid, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "bdb_locker_id_free: %d err %s(%d)\n", lockid, db_strerror(rc), rc ); -#endif /* release all locks held by this locker. */ lr.op = DB_LOCK_PUT_ALL; lr.obj = NULL; @@ -1273,13 +1241,8 @@ bdb_locker_id( Operation *op, DB_ENV *env, int *locker ) if ( ( rc = ldap_pvt_thread_pool_setkey( ctx, env, data, bdb_locker_id_free ) ) ) { XLOCK_ID_FREE( env, lockid ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, "bdb_locker_id: err %s(%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_locker_id: err %s(%d)\n", db_strerror(rc), rc, 0 ); -#endif return rc; } diff --git a/servers/slapd/back-bdb/compare.c b/servers/slapd/back-bdb/compare.c index 6cc97f8546..7a3b279bf0 100644 --- a/servers/slapd/back-bdb/compare.c +++ b/servers/slapd/back-bdb/compare.c @@ -93,13 +93,8 @@ dn2entry_retry: /* entry is a referral, don't allow add */ rs->sr_ref = get_entry_referrals( op, e ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_compare: entry is referral\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL; rs->sr_matched = e->e_name.bv_val; diff --git a/servers/slapd/back-bdb/config.c b/servers/slapd/back-bdb/config.c index 725ad4418d..e417e713c2 100644 --- a/servers/slapd/back-bdb/config.c +++ b/servers/slapd/back-bdb/config.c @@ -195,58 +195,34 @@ bdb_db_config( int se_id = 0, se_size = 0; struct slap_session_entry *sent; if ( argc < 3 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing arguments in \"sessionlog \"" - " line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing arguments in \"sessionlog \"" " line\n", fname, lineno, 0 ); -#endif return( 1 ); } se_id = atoi( argv[1] ); if ( se_id < 0 || se_id > 999 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: session log id %d is out of range [0..999]\n", - fname, lineno , se_id ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: session log id %d is out of range [0..999]\n", fname, lineno , se_id ); -#endif return( 1 ); } se_size = atoi( argv[2] ); if ( se_size < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: session log size %d is negative\n", - fname, lineno , se_size ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: session log size %d is negative\n", fname, lineno , se_size ); -#endif return( 1 ); } LDAP_LIST_FOREACH( sent, &bdb->bi_session_list, se_link ) { if ( sent->se_id == se_id ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: session %d already exists\n", - fname, lineno , se_id ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: session %d already exists\n", fname, lineno , se_id ); -#endif return( 1 ); } } diff --git a/servers/slapd/back-bdb/ctxcsn.c b/servers/slapd/back-bdb/ctxcsn.c index 1127995de3..dbb6492896 100644 --- a/servers/slapd/back-bdb/ctxcsn.c +++ b/servers/slapd/back-bdb/ctxcsn.c @@ -107,13 +107,8 @@ bdb_csn_commit( &rs->sr_text, textbuf, textlen ); op->o_tmpfree( max_committed_csn.bv_val, op->o_tmpmemctx ); if ( ret != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_csn_commit: modify failed (%d)\n", rs->sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_csn_commit: modify failed (%d)\n", rs->sr_err, 0, 0 ); -#endif switch( ret ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -151,13 +146,8 @@ bdb_csn_commit( /* This serializes add. But this case is very rare : only once. */ rs->sr_err = bdb_next_id( op->o_bd, tid, &ctxcsn_id ); if ( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_add: next_id failed (%d)\n", rs->sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: next_id failed (%d)\n", rs->sr_err, 0, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; return BDB_CSN_ABORT; @@ -216,13 +206,8 @@ bdb_csn_commit( break; case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "bdb_csn_commit : bdb_dn2entry retry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_csn_commit : bdb_dn2entry retry\n", 0, 0, 0 ); -#endif goto rewind; case LDAP_BUSY: rs->sr_err = rc; diff --git a/servers/slapd/back-bdb/dbcache.c b/servers/slapd/back-bdb/dbcache.c index 23d964deaa..38d7b9ef0b 100644 --- a/servers/slapd/back-bdb/dbcache.c +++ b/servers/slapd/back-bdb/dbcache.c @@ -100,15 +100,9 @@ bdb_db_cache( rc = db_create( &db->bdi_db, bdb->bi_dbenv, 0 ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( CACHE, ERR, - "bdb_db_cache: db_create(%s) failed: %s (%d)\n", - bdb->bi_dbenv_home, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_cache: db_create(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc ); -#endif ldap_pvt_thread_mutex_unlock( &bdb->bi_database_mutex ); return rc; } @@ -134,15 +128,9 @@ bdb_db_cache( ch_free( file ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( CACHE, ERR, - "bdb_db_cache: db_open(%s) failed: %s (%d)\n", - name, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_cache: db_open(%s) failed: %s (%d)\n", name, db_strerror(rc), rc ); -#endif ldap_pvt_thread_mutex_unlock( &bdb->bi_database_mutex ); return rc; } diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 18b0c0b1b9..80452ddd1f 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -57,13 +57,8 @@ bdb_delete( Operation *op, SlapReply *rs ) ctrls[num_ctrls] = 0; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, "==> bdb_delete: %s\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "==> bdb_delete: %s\n", op->o_req_dn.bv_val, 0, 0 ); -#endif if( 0 ) { retry: /* transaction retry */ @@ -75,13 +70,8 @@ retry: /* transaction retry */ bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p); p = NULL; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==> bdb_delete: retrying...\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "==> bdb_delete: retrying...\n", 0, 0, 0 ); -#endif rs->sr_err = TXN_ABORT( ltid ); ltid = NULL; op->o_private = NULL; @@ -102,15 +92,9 @@ retry: /* transaction retry */ bdb->bi_db_opflags ); rs->sr_text = NULL; if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "==> bdb_delete: txn_begin failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_delete: txn_begin failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -158,14 +142,9 @@ retry: /* transaction retry */ /* FIXME : dn2entry() should return non-glue entry */ if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "<=- bdb_delete: no such object %s\n", op->o_req_dn.bv_val, 0, 0); -#else Debug( LDAP_DEBUG_ARGS, "<=- bdb_delete: no such object %s\n", op->o_req_dn.bv_val, 0, 0); -#endif if ( matched != NULL ) { rs->sr_matched = ch_strdup( matched->e_dn ); @@ -222,14 +201,9 @@ retry: /* transaction retry */ if ( pdn.bv_len != 0 ) { if( p == NULL || !bvmatch( &pdn, &p->e_nname )) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_delete: parent does not exist\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_delete: parent does not exist\n", 0, 0, 0); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "could not locate parent of entry"; goto return_results; @@ -246,14 +220,9 @@ retry: /* transaction retry */ goto retry; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_delete: no write access to parent\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_delete: no write access to parent\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_INSUFFICIENT_ACCESS; rs->sr_text = "no write access to parent"; goto return_results; @@ -279,28 +248,18 @@ retry: /* transaction retry */ goto retry; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_delete: no access to parent\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_delete: no access " "to parent\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_INSUFFICIENT_ACCESS; rs->sr_text = "no write access to parent"; goto return_results; } } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_delete: no parent and not root\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_delete: no parent " "and not root\n", 0, 0, 0); -#endif rs->sr_err = LDAP_INSUFFICIENT_ACCESS; goto return_results; } @@ -324,14 +283,9 @@ retry: /* transaction retry */ goto retry; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_delete: no write access to entry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_delete: no write access to entry\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_INSUFFICIENT_ACCESS; rs->sr_text = "no write access to entry"; goto return_results; @@ -341,13 +295,8 @@ retry: /* transaction retry */ /* entry is a referral, don't allow delete */ rs->sr_ref = get_entry_referrals( op, e ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_delete: entry is referral\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_delete: entry is referral\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL; rs->sr_matched = e->e_name.bv_val; @@ -370,13 +319,8 @@ retry: /* transaction retry */ if( slap_read_controls( op, rs, e, &slap_pre_read_bv, preread_ctrl ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_delete: pre-read failed!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_delete: pre-read failed!\n", 0, 0, 0 ); -#endif goto return_results; } } @@ -386,14 +330,9 @@ retry: /* transaction retry */ bdb->bi_db_opflags ); rs->sr_text = NULL; if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_delete: txn_begin(2) failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_delete: txn_begin(2) failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -407,27 +346,16 @@ retry: /* transaction retry */ case DB_LOCK_NOTGRANTED: goto retry; case 0: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_delete: non-leaf %s\n", op->o_req_dn.bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "<=- bdb_delete: non-leaf %s\n", op->o_req_dn.bv_val, 0, 0); -#endif rs->sr_err = LDAP_NOT_ALLOWED_ON_NONLEAF; rs->sr_text = "subtree delete not supported"; break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_delete: has_children failed %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "<=- bdb_delete: has_children failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; } @@ -437,15 +365,9 @@ retry: /* transaction retry */ /* delete from dn2id */ rs->sr_err = bdb_dn2id_delete( op, lt2, eip, e ); if ( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_delete: dn2id failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "<=- bdb_delete: dn2id failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -459,15 +381,9 @@ retry: /* transaction retry */ /* delete from id2entry */ rs->sr_err = bdb_id2entry_delete( op->o_bd, lt2, e ); if ( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_delete: id2entry failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "<=- bdb_delete: id2entry failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -481,15 +397,9 @@ retry: /* transaction retry */ /* delete indices for old attributes */ rs->sr_err = bdb_index_entry_del( op, lt2, e ); if ( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_delete: index failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_delete: index failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -511,15 +421,9 @@ retry: /* transaction retry */ case 0: break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_delete: has_children failed %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "<=- bdb_delete: has_children failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -596,15 +500,9 @@ retry: /* transaction retry */ LDAP_LIST_FOREACH( ps_list, &bdb->bi_psearch_list, o_ps_link ) { rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_DELETE ); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_delete: persistent search failed (%d,%d)\n", - rc, rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_delete: persistent search failed (%d,%d)\n", rc, rs->sr_err, 0 ); -#endif } } ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock ); @@ -616,34 +514,20 @@ retry: /* transaction retry */ op->o_private = NULL; if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_delete: txn_%s failed: %s (%d)\n", - op->o_noop ? "abort (no-op)" : "commit", - db_strerror(rs->sr_err), rs->sr_err ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_delete: txn_%s failed: %s (%d)\n", op->o_noop ? "abort (no-op)" : "commit", db_strerror(rs->sr_err), rs->sr_err ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "commit failed"; goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_delete: deleted%s id=%08lx db=\"%s\"\n", - op->o_noop ? " (no-op)" : "", - e->e_id, e->e_dn ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_delete: deleted%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn ); -#endif rs->sr_err = LDAP_SUCCESS; rs->sr_text = NULL; if( num_ctrls ) rs->sr_ctrls = ctrls; diff --git a/servers/slapd/back-bdb/dn2entry.c b/servers/slapd/back-bdb/dn2entry.c index c221edaa08..397b5f276f 100644 --- a/servers/slapd/back-bdb/dn2entry.c +++ b/servers/slapd/back-bdb/dn2entry.c @@ -40,12 +40,8 @@ bdb_dn2entry( EntryInfo *ei = NULL; int rc, rc2; -#ifdef NEW_LOGGING - LDAP_LOG ( CACHE, ARGS, "bdb_dn2entry(\"%s\")\n", dn->bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "bdb_dn2entry(\"%s\")\n", dn->bv_val, 0, 0 ); -#endif *e = NULL; diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index 2bb31dcd46..e2135af7ef 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -38,13 +38,8 @@ bdb_dn2id_add( char *buf; struct berval ptr, pdn; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "bdb_dn2id_add( \"%s\", 0x%08lx )\n", - e->e_ndn, (long) e->e_id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_add( \"%s\", 0x%08lx )\n", e->e_ndn, (long) e->e_id, 0 ); -#endif assert( e->e_id != NOID ); DBTzero( &key ); @@ -66,13 +61,8 @@ bdb_dn2id_add( /* store it -- don't override */ rc = db->put( db, txn, &key, &data, DB_NOOVERWRITE ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, "bdb_dn2id_add: put failed: %s %d\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_add: put failed: %s %d\n", db_strerror(rc), rc, 0 ); -#endif goto done; } @@ -83,15 +73,9 @@ bdb_dn2id_add( buf[0] = DN_SUBTREE_PREFIX; rc = db->put( db, txn, &key, &data, DB_NOOVERWRITE ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, - "=> bdb_dn2id_add: subtree (%s) put failed: %d\n", - ptr.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_add: subtree (%s) put failed: %d\n", ptr.bv_val, rc, 0 ); -#endif goto done; } @@ -110,15 +94,9 @@ bdb_dn2id_add( rc = bdb_idl_insert_key( op->o_bd, db, txn, &key, e->e_id ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, - "=> bdb_dn2id_add: parent (%s) insert failed: %d\n", - ptr.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_add: parent (%s) insert failed: %d\n", ptr.bv_val, rc, 0 ); -#endif goto done; } } @@ -134,15 +112,9 @@ bdb_dn2id_add( rc = bdb_idl_insert_key( op->o_bd, db, txn, &key, e->e_id ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, - "=> bdb_dn2id_add: subtree (%s) insert failed: %d\n", - ptr.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_add: subtree (%s) insert failed: %d\n", ptr.bv_val, rc, 0 ); -#endif break; } #ifdef BDB_MULTIPLE_SUFFIXES @@ -159,11 +131,7 @@ bdb_dn2id_add( done: op->o_tmpfree( buf, op->o_tmpmemctx ); -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, "<= bdb_dn2id_add: %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_add: %d\n", rc, 0, 0 ); -#endif return rc; } @@ -181,13 +149,8 @@ bdb_dn2id_delete( char *buf; struct berval pdn, ptr; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, - "=> bdb_dn2id_delete ( \"%s\", 0x%08lx )\n", e->e_ndn, e->e_id, 0); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_delete( \"%s\", 0x%08lx )\n", e->e_ndn, e->e_id, 0 ); -#endif DBTzero( &key ); key.size = e->e_nname.bv_len + 2; @@ -203,14 +166,8 @@ bdb_dn2id_delete( /* delete it */ rc = db->del( db, txn, &key, 0 ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, - "=> bdb_dn2id_delete: delete failed: %s %d\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_delete: delete failed: %s %d\n", db_strerror(rc), rc, 0 ); -#endif goto done; } @@ -221,15 +178,9 @@ bdb_dn2id_delete( buf[0] = DN_SUBTREE_PREFIX; rc = db->del( db, txn, &key, 0 ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, - "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n", - ptr.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n", ptr.bv_val, rc, 0 ); -#endif goto done; } @@ -248,15 +199,9 @@ bdb_dn2id_delete( rc = bdb_idl_delete_key( op->o_bd, db, txn, &key, e->e_id ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, - "=> bdb_dn2id_delete: parent (%s) delete failed: %d\n", - ptr.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_delete: parent (%s) delete failed: %d\n", ptr.bv_val, rc, 0 ); -#endif goto done; } } @@ -271,15 +216,9 @@ bdb_dn2id_delete( rc = bdb_idl_delete_key( op->o_bd, db, txn, &key, e->e_id ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, - "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n", - ptr.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n", ptr.bv_val, rc, 0 ); -#endif goto done; } #ifdef BDB_MULTIPLE_SUFFIXES @@ -296,11 +235,7 @@ bdb_dn2id_delete( done: op->o_tmpfree( buf, op->o_tmpmemctx ); -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, "<= bdb_dn2id_delete %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_delete %d\n", rc, 0, 0 ); -#endif return rc; } @@ -316,11 +251,7 @@ bdb_dn2id( struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private; DB *db = bdb->bi_dn2id->bdi_db; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_dn2id( \"%s\" )\n", dn->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id( \"%s\" )\n", dn->bv_val, 0, 0 ); -#endif DBTzero( &key ); key.size = dn->bv_len + 2; key.data = op->o_tmpalloc( key.size, op->o_tmpmemctx ); @@ -337,21 +268,11 @@ bdb_dn2id( rc = db->get( db, txn, &key, &data, bdb->bi_db_opflags ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, "<= bdb_dn2id: get failed %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: get failed: %s (%d)\n", db_strerror( rc ), rc, 0 ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_dn2id: got id=0x%08lx\n", ei->bei_id, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: got id=0x%08lx\n", ei->bei_id, 0, 0 ); -#endif } op->o_tmpfree( key.data, op->o_tmpmemctx ); @@ -370,13 +291,8 @@ bdb_dn2id_children( ID id; int rc; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, - "=> bdb_dn2id_children( %s )\n", e->e_nname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_children( %s )\n", e->e_nname.bv_val, 0, 0 ); -#endif DBTzero( &key ); key.size = e->e_nname.bv_len + 2; key.data = op->o_tmpalloc( key.size, op->o_tmpmemctx ); @@ -401,17 +317,10 @@ bdb_dn2id_children( rc = db->get( db, txn, &key, &data, bdb->bi_db_opflags ); op->o_tmpfree( key.data, op->o_tmpmemctx ); -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, DETAIL1, - "<= bdb_dn2id_children( %s ): %s (%d)\n", - e->e_nname.bv_val, rc == 0 ? "" : ( rc == DB_NOTFOUND ? "no " : - db_strerror(rc)), rc ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_children( %s ): %s (%d)\n", e->e_nname.bv_val, rc == 0 ? "" : ( rc == DB_NOTFOUND ? "no " : db_strerror(rc) ), rc ); -#endif return rc; } @@ -430,13 +339,8 @@ bdb_dn2idl( int prefix = ( op->ors_scope == LDAP_SCOPE_ONELEVEL ) ? DN_ONE_PREFIX : DN_SUBTREE_PREFIX; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_dn2ididl( \"%s\" )\n", - e->e_nname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2idl( \"%s\" )\n", e->e_nname.bv_val, 0, 0 ); -#endif #ifndef BDB_MULTIPLE_SUFFIXES if ( prefix == DN_SUBTREE_PREFIX && BEI(e)->bei_parent->bei_id == 0 ) { @@ -456,27 +360,15 @@ bdb_dn2idl( rc = bdb_idl_fetch_key( op->o_bd, db, NULL, &key, ids ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, - "<= bdb_dn2ididl: get failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2idl: get failed: %s (%d)\n", db_strerror( rc ), rc, 0 ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_dn2ididl: id=%ld first=%ld last=%ld\n", - (long) ids[0], (long) BDB_IDL_FIRST( ids ), - (long) BDB_IDL_LAST( ids ) ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2idl: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) ); -#endif } op->o_tmpfree( key.data, op->o_tmpmemctx ); @@ -1085,13 +977,8 @@ hdb_dn2idl( struct bdb_info *bdb = (struct bdb_info *)op->o_bd->be_private; struct dn2id_cookie cx; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, - "=> hdb_dn2ididl( \"%s\" )\n", e->e_nname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> hdb_dn2idl( \"%s\" )\n", e->e_nname.bv_val, 0, 0 ); -#endif #ifndef BDB_MULTIPLE_SUFFIXES if ( op->ors_scope != LDAP_SCOPE_ONELEVEL && diff --git a/servers/slapd/back-bdb/error.c b/servers/slapd/back-bdb/error.c index 4b58c834c2..cbb457929a 100644 --- a/servers/slapd/back-bdb/error.c +++ b/servers/slapd/back-bdb/error.c @@ -28,11 +28,7 @@ void bdb_errcall( const char *pfx, char * msg ) if ( msg[0] > 0x7f ) __etoa( msg ); #endif -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, INFO, "bdb(%s): %s\n", pfx, msg, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 ); -#endif } #ifdef HAVE_EBCDIC diff --git a/servers/slapd/back-bdb/filterindex.c b/servers/slapd/back-bdb/filterindex.c index 2dbb326e32..ff04cd3e2a 100644 --- a/servers/slapd/back-bdb/filterindex.c +++ b/servers/slapd/back-bdb/filterindex.c @@ -60,11 +60,7 @@ bdb_filter_candidates( ID *stack ) { int rc = 0; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ENTRY, "=> bdb_filter_candidates\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "=> bdb_filter_candidates\n", 0, 0, 0 ); -#endif #if 0 char *subtree="SUBTREE"; #endif @@ -91,12 +87,7 @@ bdb_filter_candidates( break; #if 0 /* Not used any more, search calls bdb_dn2idl directly */ case SLAPD_FILTER_DN_ONE: -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN ONE\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tDN ONE\n", 0, 0, 0 ); -#endif rc = bdb_dn2idl( op->o_bd, f->f_dn, DN_ONE_PREFIX, ids, stack, op->o_tmpmemctx ); if( rc == DB_NOTFOUND ) { @@ -109,139 +100,78 @@ bdb_filter_candidates( subtree="CHILDREN"; /* Fall Thru */ case SLAPD_FILTER_DN_SUBTREE: -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN %s\n", - subtree, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tDN %s\n", subtree, 0, 0 ); -#endif rc = bdb_dn2idl( op->o_bd, f->f_dn, DN_SUBTREE_PREFIX, ids, stack, op->o_tmpmemctx ); break; #endif case LDAP_FILTER_PRESENT: -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tPRESENT\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 ); -#endif rc = presence_candidates( op, f->f_desc, ids ); break; case LDAP_FILTER_EQUALITY: -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tEQUALITY\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 ); -#endif rc = equality_candidates( op, f->f_ava, ids, tmp ); break; case LDAP_FILTER_APPROX: -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAPPROX\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 ); -#endif rc = approx_candidates( op, f->f_ava, ids, tmp ); break; case LDAP_FILTER_SUBSTRINGS: -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tSUBSTRINGS\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 ); -#endif rc = substring_candidates( op, f->f_sub, ids, tmp ); break; case LDAP_FILTER_GE: /* no GE index, use pres */ -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tGE\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 ); -#endif rc = presence_candidates( op, f->f_ava->aa_desc, ids ); break; case LDAP_FILTER_LE: /* no LE index, use pres */ -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tLE\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 ); -#endif rc = presence_candidates( op, f->f_ava->aa_desc, ids ); break; case LDAP_FILTER_NOT: /* no indexing to support NOT filters */ -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tNOT\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 ); -#endif { struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private; BDB_IDL_ALL( bdb, ids ); } break; case LDAP_FILTER_AND: -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAND\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 ); -#endif rc = list_candidates( op, f->f_and, LDAP_FILTER_AND, ids, tmp, stack ); break; case LDAP_FILTER_OR: -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tOR\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 ); -#endif rc = list_candidates( op, f->f_or, LDAP_FILTER_OR, ids, tmp, stack ); break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tUNKNOWN\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tUNKNOWN %lu\n", (unsigned long) f->f_choice, 0, 0 ); -#endif /* Must not return NULL, otherwise extended filters break */ { struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private; BDB_IDL_ALL( bdb, ids ); } } -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_filter_candidates: id=%ld first=%ld last=%ld\n", - (long)ids[0], (long)BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids )); -#else Debug( LDAP_DEBUG_FILTER, "<= bdb_filter_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) ); -#endif return rc; } @@ -259,11 +189,7 @@ list_candidates( int rc = 0; Filter *f; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "=> bdb_list_candidates: 0x%x\n", ftype, 0 , 0 ); -#else Debug( LDAP_DEBUG_FILTER, "=> bdb_list_candidates 0x%x\n", ftype, 0, 0 ); -#endif for ( f = flist; f != NULL; f = f->f_next ) { /* ignore precomputed scopes */ if ( f->f_choice == SLAPD_FILTER_COMPUTED && @@ -301,27 +227,16 @@ list_candidates( } if( rc == LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_list_candidates: id=%ld first=%ld last=%ld\n", - (long) ids[0], (long) BDB_IDL_FIRST( ids ), - (long) BDB_IDL_LAST( ids ) ); -#else Debug( LDAP_DEBUG_FILTER, "<= bdb_list_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST(ids), (long) BDB_IDL_LAST(ids) ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ARGS, "<= bdb_list_candidates: rc=%d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "<= bdb_list_candidates: undefined rc=%d\n", rc, 0, 0 ); -#endif } return rc; @@ -339,13 +254,8 @@ presence_candidates( slap_mask_t mask; struct berval prefix = {0, NULL}; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ENTRY, "=> bdb_presence_candidates (%s)\n", - desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_presence_candidates (%s)\n", desc->ad_cname.bv_val, 0, 0 ); -#endif BDB_IDL_ALL( bdb, ids ); @@ -357,44 +267,25 @@ presence_candidates( &db, &mask, &prefix ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_presence_candidates: (%s) index_param " - "returned=%d\n", - desc->ad_cname.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_presence_candidates: (%s) index_param " "returned=%d\n", desc->ad_cname.bv_val, rc, 0 ); -#endif return 0; } if( db == NULL ) { /* not indexed */ -#ifdef NEW_LOGGING - LDAP_LOG(INDEX, RESULTS, - "<= bdb_presence_candidates: (%s) not indexed\n", - desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_presence_candidates: (%s) not indexed\n", desc->ad_cname.bv_val, 0, 0 ); -#endif return 0; } if( prefix.bv_val == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG(INDEX, RESULTS, - "<= bdb_presence_candidates: (%s) no prefix\n", - desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_presence_candidates: (%s) no prefix\n", desc->ad_cname.bv_val, 0, 0 ); -#endif return -1; } @@ -404,31 +295,18 @@ presence_candidates( BDB_IDL_ZERO( ids ); rc = 0; } else if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_presence_candidates: (%s) " - "key read failed (%d)\n", - desc->ad_cname.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_presense_candidates: (%s) " "key read failed (%d)\n", desc->ad_cname.bv_val, rc, 0 ); -#endif goto done; } -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n", - (long)ids[0], (long)BDB_IDL_FIRST( ids ), (long)BDB_IDL_LAST( ids ) ); -#else Debug(LDAP_DEBUG_TRACE, "<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST(ids), (long) BDB_IDL_LAST(ids) ); -#endif done: return rc; @@ -450,13 +328,8 @@ equality_candidates( struct berval *keys = NULL; MatchingRule *mr; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ENTRY, "=> bdb_equality_candidates (%s)\n", - ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_equality_candidates (%s)\n", ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#endif BDB_IDL_ALL( bdb, ids ); @@ -464,30 +337,17 @@ equality_candidates( &db, &mask, &prefix ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_equality_candidates: (%s) " - "index_param failed (%d)\n", - ava->aa_desc->ad_cname.bv_val, rc, 0); -#else Debug( LDAP_DEBUG_ANY, "<= bdb_equality_candidates: (%s) " "index_param failed (%d)\n", ava->aa_desc->ad_cname.bv_val, rc, 0 ); -#endif return 0; } if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG(INDEX, RESULTS, - "<= bdb_equality_candidates: (%s) not indexed\n", - ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= bdb_equality_candidates: (%s) not indexed\n", ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#endif return 0; } @@ -510,30 +370,17 @@ equality_candidates( &keys, op->o_tmpmemctx ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_equality_candidates: (%s, %s) " - "MR filter failed (%d)\n", - prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_equality_candidates: (%s, %s) " "MR filter failed (%d)\n", prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc ); -#endif return 0; } if( keys == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_equality_candidates: (%s) no keys\n", - ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_equality_candidates: (%s) no keys\n", ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#endif return 0; } @@ -545,30 +392,17 @@ equality_candidates( rc = 0; break; } else if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_equality_candidates: (%s) " - "key read failed (%d)\n", - ava->aa_desc->ad_cname.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_equality_candidates: (%s) " "key read failed (%d)\n", ava->aa_desc->ad_cname.bv_val, rc, 0 ); -#endif break; } if( BDB_IDL_IS_ZERO( tmp ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_equality_candidates: (%s) NULL\n", - ava->aa_desc->ad_cname.bv_val, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_equality_candidates: (%s) NULL\n", ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#endif BDB_IDL_ZERO( ids ); break; } @@ -585,18 +419,11 @@ equality_candidates( ber_bvarray_free_x( keys, op->o_tmpmemctx ); -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_equality_candidates: id=%ld first=%ld last=%ld\n", - (long) ids[0], (long) BDB_IDL_FIRST( ids ), - (long) BDB_IDL_LAST( ids ) ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_equality_candidates: id=%ld, first=%ld, last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST(ids), (long) BDB_IDL_LAST(ids) ); -#endif return( rc ); } @@ -617,13 +444,8 @@ approx_candidates( struct berval *keys = NULL; MatchingRule *mr; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ENTRY, "=> bdb_approx_candidates (%s)\n", - ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_approx_candidates (%s)\n", ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#endif BDB_IDL_ALL( bdb, ids ); @@ -631,30 +453,17 @@ approx_candidates( &db, &mask, &prefix ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_approx_candidates: (%s) " - "index_param failed (%d)\n", - ava->aa_desc->ad_cname.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= bdb_approx_candidates: (%s) " "index_param failed (%d)\n", ava->aa_desc->ad_cname.bv_val, rc, 0 ); -#endif return 0; } if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG(INDEX, RESULTS, - "<= bdb_approx_candidates: (%s) not indexed\n", - ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= bdb_approx_candidates: (%s) not indexed\n", ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#endif return 0; } @@ -682,30 +491,17 @@ approx_candidates( &keys, op->o_tmpmemctx ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_approx_candidates: (%s, %s) " - "MR filter failed (%d)\n", - prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates: (%s, %s) " "MR filter failed (%d)\n", prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc ); -#endif return 0; } if( keys == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_approx_candidates: (%s) no keys (%s)\n", - prefix.bv_val, ava->aa_desc->ad_cname.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates: (%s) no keys (%s)\n", prefix.bv_val, ava->aa_desc->ad_cname.bv_val, 0 ); -#endif return 0; } @@ -717,30 +513,17 @@ approx_candidates( rc = 0; break; } else if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_approx_candidates: (%s) " - "key read failed (%d)\n", - ava->aa_desc->ad_cname.bv_val, rc, 0); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates: (%s) " "key read failed (%d)\n", ava->aa_desc->ad_cname.bv_val, rc, 0 ); -#endif break; } if( BDB_IDL_IS_ZERO( tmp ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_approx_candidates: (%s) NULL\n", - ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates: (%s) NULL\n", ava->aa_desc->ad_cname.bv_val, 0, 0 ); -#endif BDB_IDL_ZERO( ids ); break; } @@ -757,17 +540,10 @@ approx_candidates( ber_bvarray_free_x( keys, op->o_tmpmemctx ); -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_approx_candidates: id=%ld first=%ld last=%ld\n", - (long) ids[0], (long) BDB_IDL_FIRST( ids ), - (long) BDB_IDL_LAST( ids ) ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates %ld, first=%ld, last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST(ids), (long) BDB_IDL_LAST(ids) ); -#endif return( rc ); } @@ -787,13 +563,8 @@ substring_candidates( struct berval *keys = NULL; MatchingRule *mr; -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ENTRY, "=> bdb_substring_candidates (%s)\n", - sub->sa_desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_substring_candidates (%s)\n", sub->sa_desc->ad_cname.bv_val, 0, 0 ); -#endif BDB_IDL_ALL( bdb, ids ); @@ -801,30 +572,17 @@ substring_candidates( &db, &mask, &prefix ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_substring_candidates: (%s) " - "index_param failed (%d)\n", - sub->sa_desc->ad_cname.bv_val, rc, 0); -#else Debug( LDAP_DEBUG_ANY, "<= bdb_substring_candidates: (%s) " "index_param failed (%d)\n", sub->sa_desc->ad_cname.bv_val, rc, 0 ); -#endif return 0; } if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_substring_candidates: (%s) not indexed\n", - sub->sa_desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= bdb_substring_candidates: (%s) not indexed\n", sub->sa_desc->ad_cname.bv_val, 0, 0 ); -#endif return 0; } @@ -848,30 +606,17 @@ substring_candidates( &keys, op->o_tmpmemctx ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_substring_candidates: (%s) " - "MR filter failed (%d)\n", - sub->sa_desc->ad_cname.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates: (%s) " "MR filter failed (%d)\n", sub->sa_desc->ad_cname.bv_val, rc, 0 ); -#endif return 0; } if( keys == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_substring_candidates: (0x%04lx) no keys (%s)\n", - mask, sub->sa_desc->ad_cname.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates: (0x%04lx) no keys (%s)\n", mask, sub->sa_desc->ad_cname.bv_val, 0 ); -#endif return 0; } @@ -883,30 +628,17 @@ substring_candidates( rc = 0; break; } else if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_substring_candidates: (%s) " - "key read failed (%d)\n", - sub->sa_desc->ad_cname.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates: (%s) " "key read failed (%d)\n", sub->sa_desc->ad_cname.bv_val, rc, 0 ); -#endif break; } if( BDB_IDL_IS_ZERO( tmp ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_substring_candidates: (%s) NULL\n", - sub->sa_desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates: (%s) NULL\n", sub->sa_desc->ad_cname.bv_val, 0, 0 ); -#endif BDB_IDL_ZERO( ids ); break; } @@ -923,17 +655,10 @@ substring_candidates( ber_bvarray_free_x( keys, op->o_tmpmemctx ); -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, RESULTS, - "<= bdb_substring_candidates: id=%ld first=%ld last=%ld\n", - (long) ids[0], (long) BDB_IDL_FIRST( ids ), - (long) BDB_IDL_LAST( ids ) ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates: %ld, first=%ld, last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST(ids), (long) BDB_IDL_LAST(ids) ); -#endif return( rc ); } diff --git a/servers/slapd/back-bdb/id2entry.c b/servers/slapd/back-bdb/id2entry.c index 05501b0e42..c27f631089 100644 --- a/servers/slapd/back-bdb/id2entry.c +++ b/servers/slapd/back-bdb/id2entry.c @@ -250,19 +250,11 @@ int bdb_entry_get( DB_LOCK lock; int free_lock_id = 0; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ARGS, - "bdb_entry_get: ndn: \"%s\"\n", ndn->bv_val, 0, 0 ); - LDAP_LOG( BACK_BDB, ARGS, - "bdb_entry_get: oc: \"%s\", at: \"%s\"\n", - oc ? oc->soc_cname.bv_val : "(null)", at_name, 0); -#else Debug( LDAP_DEBUG_ARGS, "=> bdb_entry_get: ndn: \"%s\"\n", ndn->bv_val, 0, 0 ); Debug( LDAP_DEBUG_ARGS, "=> bdb_entry_get: oc: \"%s\", at: \"%s\"\n", oc ? oc->soc_cname.bv_val : "(null)", at_name, 0); -#endif if( op ) boi = (struct bdb_op_info *) op->o_private; if( boi != NULL && op->o_bd->be_private == boi->boi_bdb->be_private ) { @@ -308,66 +300,40 @@ dn2entry_retry: } if (ei) e = ei->bei_e; if (e == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, INFO, - "bdb_entry_get: cannot find entry (%s)\n", - ndn->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "=> bdb_entry_get: cannot find entry: \"%s\"\n", ndn->bv_val, 0, 0 ); -#endif if ( free_lock_id ) { LOCK_ID_FREE( bdb->bi_dbenv, locker ); } return LDAP_NO_SUCH_OBJECT; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, DETAIL1, "bdb_entry_get: found entry (%s)\n", - ndn->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "=> bdb_entry_get: found entry: \"%s\"\n", ndn->bv_val, 0, 0 ); -#endif #ifdef BDB_ALIASES /* find attribute values */ if( is_entry_alias( e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, INFO, - "bdb_entry_get: entry (%s) is an alias\n", e->e_name.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= bdb_entry_get: entry is an alias\n", 0, 0, 0 ); -#endif rc = LDAP_ALIAS_PROBLEM; goto return_results; } #endif if( is_entry_referral( e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, INFO, - "bdb_entry_get: entry (%s) is a referral.\n", e->e_name.bv_val, 0, 0); -#else Debug( LDAP_DEBUG_ACL, "<= bdb_entry_get: entry is a referral\n", 0, 0, 0 ); -#endif rc = LDAP_REFERRAL; goto return_results; } if ( oc && !is_entry_objectclass( e, oc, 0 )) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, INFO, - "bdb_entry_get: failed to find objectClass.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= bdb_entry_get: failed to find objectClass\n", 0, 0, 0 ); -#endif rc = LDAP_NO_SUCH_ATTRIBUTE; goto return_results; } @@ -400,12 +366,8 @@ return_results: LOCK_ID_FREE( bdb->bi_dbenv, locker ); } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ENTRY, "bdb_entry_get: rc=%d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_entry_get: rc=%d\n", rc, 0, 0 ); -#endif return(rc); } diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index a7980a3f7a..71779baa40 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -80,34 +80,20 @@ static void idl_check( ID *ids ) static void idl_dump( ID *ids ) { if( BDB_IDL_IS_RANGE( ids ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, INFO, "IDL: range (%ld - %ld)\n", - (long) BDB_IDL_RANGE_FIRST( ids ), - (long) BDB_IDL_RANGE_LAST( ids ), 0 ); -#else Debug( LDAP_DEBUG_ANY, "IDL: range ( %ld - %ld )\n", (long) BDB_IDL_RANGE_FIRST( ids ), (long) BDB_IDL_RANGE_LAST( ids ) ); -#endif } else { ID i; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, INFO, "IDL: size %ld", (long) ids[0], 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "IDL: size %ld", (long) ids[0], 0, 0 ); -#endif for( i=1; i<=ids[0]; i++ ) { if( i % 16 == 1 ) { Debug( LDAP_DEBUG_ANY, "\n", 0, 0, 0 ); } -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, INFO, "%02lx",(long)ids[i], 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " %02lx", (long) ids[i], 0, 0 ); -#endif } Debug( LDAP_DEBUG_ANY, "\n", 0, 0, 0 ); @@ -182,12 +168,8 @@ int bdb_idl_insert( ID *ids, ID id ) unsigned x; #if IDL_DEBUG > 1 -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, DETAIL1, "insert: %04lx at %d\n", (long) id, x, 0 ); -#else Debug( LDAP_DEBUG_ANY, "insert: %04lx at %d\n", (long) id, x, 0 ); idl_dump( ids ); -#endif #elif IDL_DEBUG > 0 idl_check( ids ); #endif @@ -248,12 +230,8 @@ static int idl_delete( ID *ids, ID id ) unsigned x = bdb_idl_search( ids, id ); #if IDL_DEBUG > 1 -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, DETAIL1, "delete: %04lx at %d\n", (long) id, x, 0 ); -#else Debug( LDAP_DEBUG_ANY, "delete: %04lx at %d\n", (long) id, x, 0 ); idl_dump( ids ); -#endif #elif IDL_DEBUG > 0 idl_check( ids ); #endif @@ -381,15 +359,9 @@ bdb_idl_cache_put( ee = bdb->bi_idl_lru_tail; if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) ee, bdb_idl_entry_cmp ) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_cache_put: AVL delete failed\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_cache_put: " "AVL delete failed\n", 0, 0, 0 ); -#endif } IDL_LRU_DELETE( bdb, ee ); i++; @@ -419,15 +391,9 @@ bdb_idl_cache_del( if ( matched_idl_entry != NULL ) { if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry, bdb_idl_entry_cmp ) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_cache_del: AVL delete failed\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_cache_del: " "AVL delete failed\n", 0, 0, 0 ); -#endif } --bdb->bi_idl_cache_size; ldap_pvt_thread_mutex_lock( &bdb->bi_idl_tree_lrulock ); @@ -478,15 +444,9 @@ bdb_idl_fetch_key( char keybuf[16]; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ARGS, - "bdb_idl_fetch_key: %s\n", - bdb_show_key( key, keybuf ), 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "bdb_idl_fetch_key: %s\n", bdb_show_key( key, keybuf ), 0, 0 ); -#endif assert( ids != NULL ); @@ -505,14 +465,8 @@ bdb_idl_fetch_key( rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_fetch_key: cursor failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: " "cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif return rc; } @@ -537,16 +491,9 @@ bdb_idl_fetch_key( /* On disk, a range is denoted by 0 in the first element */ if (ids[1] == 0) { if (ids[0] != BDB_IDL_RANGE_SIZE) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "=> bdb_idl_fetch_key: range size mismatch: " - "expected %ld, got %ld\n", - BDB_IDL_RANGE_SIZE, ids[0], 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: " "range size mismatch: expected %d, got %ld\n", BDB_IDL_RANGE_SIZE, ids[0], 0 ); -#endif cursor->c_close( cursor ); return -1; } @@ -557,14 +504,8 @@ bdb_idl_fetch_key( rc2 = cursor->c_close( cursor ); if (rc2) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_fetch_key: close failed: %s (%d)\n", - db_strerror(rc2), rc2, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: " "close failed: %s (%d)\n", db_strerror(rc2), rc2, 0 ); -#endif return rc2; } @@ -572,41 +513,23 @@ bdb_idl_fetch_key( return rc; } else if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_fetch_key: get failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: " "get failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif return rc; } else if ( data.size == 0 || data.size % sizeof( ID ) ) { /* size not multiple of ID size */ -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_fetch_key: odd size: expected %ld multiple, got %ld\n", - (long) sizeof( ID ), (long) data.size, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: " "odd size: expected %ld multiple, got %ld\n", (long) sizeof( ID ), (long) data.size, 0 ); -#endif return -1; } else if ( data.size != BDB_IDL_SIZEOF(ids) ) { /* size mismatch */ -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_fetch_key: get size mismatch: expected %ld, got %ld\n", - (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: " "get size mismatch: expected %ld, got %ld\n", (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 ); -#endif return -1; } @@ -635,15 +558,9 @@ bdb_idl_insert_key( { char buf[16]; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ARGS, - "bdb_idl_insert_key: %lx %s\n", - (long) id, bdb_show_key( key, buf ), 0 ); -#else Debug( LDAP_DEBUG_ARGS, "bdb_idl_insert_key: %lx %s\n", (long) id, bdb_show_key( key, buf ), 0 ); -#endif } assert( id != NOID ); @@ -659,14 +576,8 @@ bdb_idl_insert_key( rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags ); if ( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_insert_key: cursor failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: " "cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif return rc; } data.data = &tmp; @@ -788,28 +699,16 @@ put1: data.data = &id; } else { /* initial c_get failed, nothing was done */ fail: -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_insert_key: %s failed: %s (%d)\n", - err, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: " "%s failed: %s (%d)\n", err, db_strerror(rc), rc ); -#endif cursor->c_close( cursor ); return rc; } rc = cursor->c_close( cursor ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_insert_key: c_close failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: " "c_close failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif } return rc; } @@ -831,15 +730,9 @@ bdb_idl_delete_key( { char buf[16]; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ARGS, - "bdb_idl_delete_key: %lx %s\n", - (long) id, bdb_show_key( key, buf ), 0 ); -#else Debug( LDAP_DEBUG_ARGS, "bdb_idl_delete_key: %lx %s\n", (long) id, bdb_show_key( key, buf ), 0 ); -#endif } assert( id != NOID ); @@ -855,14 +748,8 @@ bdb_idl_delete_key( rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags ); if ( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_delete_key: cursor failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: " "cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif return rc; } /* Fetch the first data item for this key, to see if it @@ -946,28 +833,17 @@ bdb_idl_delete_key( /* initial c_get failed, nothing was done */ fail: if ( rc != DB_NOTFOUND ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_idl_delete_key: %s failed: %s (%d)\n", - err, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: " "%s failed: %s (%d)\n", err, db_strerror(rc), rc ); -#endif } cursor->c_close( cursor ); return rc; } rc = cursor->c_close( cursor ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, "bdb_idl_delete_key: c_close failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: c_close failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif } return rc; diff --git a/servers/slapd/back-bdb/index.c b/servers/slapd/back-bdb/index.c index e1f09f6fdc..6889565618 100644 --- a/servers/slapd/back-bdb/index.c +++ b/servers/slapd/back-bdb/index.c @@ -175,15 +175,9 @@ static int indexer( rc = bdb_db_cache( op->o_bd, atname->bv_val, &db ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "bdb_index_read: Could not open DB %s\n", - atname->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_index_read: Could not open DB %s\n", atname->bv_val, 0, 0 ); -#endif return LDAP_OTHER; } @@ -350,14 +344,9 @@ bdb_index_entry( int rc; Attribute *ap = e->e_attrs; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "index_entry: %s (%s) %ld\n", - opid == SLAP_INDEX_ADD_OP ? "add" : "del", e->e_dn, (long) e->e_id ); -#else Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n", opid == SLAP_INDEX_ADD_OP ? "add" : "del", (long) e->e_id, e->e_dn ); -#endif /* add each attribute to the indexes */ for ( ; ap != NULL; ap = ap->a_next ) { @@ -365,26 +354,17 @@ bdb_index_entry( ap->a_nvals, e->e_id, opid ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, - "index_entry: failure (%d)\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) failure\n", opid == SLAP_INDEX_ADD_OP ? "add" : "del", (long) e->e_id, e->e_dn ); -#endif return rc; } } -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n", opid == SLAP_INDEX_ADD_OP ? "add" : "del", (long) e->e_id, e->e_dn ); -#endif return LDAP_SUCCESS; } diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index e9f616c602..fa3e2ca632 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -67,13 +67,9 @@ bdb_db_init( BackendDB *be ) { struct bdb_info *bdb; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ENTRY, "bdb_db_init", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_init: Initializing %s database\n", be->bd_info->bi_type, 0, 0 ); -#endif /* allocate backend-database-specific stuff */ bdb = (struct bdb_info *) ch_calloc( 1, sizeof(struct bdb_info) ); @@ -138,24 +134,14 @@ bdb_db_open( BackendDB *be ) char path[MAXPATHLEN]; #endif -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ARGS, - "bdb_db_open: %s\n", be->be_suffix[0].bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "bdb_db_open: %s\n", be->be_suffix[0].bv_val, 0, 0 ); -#endif #ifndef BDB_MULTIPLE_SUFFIXES if ( be->be_suffix[1].bv_val ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_open: only one suffix allowed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_open: only one suffix allowed\n", 0, 0, 0 ); -#endif return -1; } #endif @@ -163,15 +149,9 @@ bdb_db_open( BackendDB *be ) rc = db_env_create( &bdb->bi_dbenv, 0 ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_open: db_env_create failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_open: db_env_create failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif return rc; } @@ -231,15 +211,9 @@ bdb_db_open( BackendDB *be ) #endif rc = bdb->bi_dbenv->set_tmp_dir( bdb->bi_dbenv, dir ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_open: set_tmp_dir(%s) failed: %s (%d)\n", - dir, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_open: set_tmp_dir(%s) failed: %s (%d)\n", dir, db_strerror(rc), rc ); -#endif return rc; } @@ -249,15 +223,9 @@ bdb_db_open( BackendDB *be ) #endif rc = bdb->bi_dbenv->set_lg_dir( bdb->bi_dbenv, dir ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_open: set_lg_dir(%s) failed: %s (%d)\n", - dir, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_open: set_lg_dir(%s) failed: %s (%d)\n", dir, db_strerror(rc), rc ); -#endif return rc; } @@ -267,28 +235,17 @@ bdb_db_open( BackendDB *be ) #endif rc = bdb->bi_dbenv->set_data_dir( bdb->bi_dbenv, dir ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_open: set_data_dir(%s) failed: %s (%d)\n", - dir, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_open: set_data_dir(%s) failed: %s (%d)\n", dir, db_strerror(rc), rc ); -#endif return rc; } } #endif -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, DETAIL1, - "bdb_db_open: dbenv_open %s\n", bdb->bi_dbenv_home, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_db_open: dbenv_open(%s)\n", bdb->bi_dbenv_home, 0, 0); -#endif #ifdef HAVE_EBCDIC strcpy( path, bdb->bi_dbenv_home ); @@ -304,15 +261,9 @@ bdb_db_open( BackendDB *be ) bdb->bi_dbenv_mode ); #endif if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_open: dbenv_open failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_open: dbenv_open failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif return rc; } @@ -320,15 +271,9 @@ bdb_db_open( BackendDB *be ) rc = bdb->bi_dbenv->set_flags( bdb->bi_dbenv, bdb->bi_dbenv_xflags, 1); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_open: dbenv_set_flags failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_open: dbenv_set_flags failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif return rc; } } @@ -346,15 +291,9 @@ bdb_db_open( BackendDB *be ) rc = db_create( &db->bdi_db, bdb->bi_dbenv, 0 ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_open: db_create(%s) failed: %s (%d)\n", - bdb->bi_dbenv_home, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_open: db_create(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc ); -#endif return rc; } @@ -413,15 +352,9 @@ bdb_db_open( BackendDB *be ) #endif if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_open: db_create(%s) failed: %s (%d)\n", - bdb->bi_dbenv_home, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_open: db_open(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc ); -#endif return rc; } @@ -436,15 +369,9 @@ bdb_db_open( BackendDB *be ) /* get nextid */ rc = bdb_last_id( be, NULL ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_open: last_id(%s) failed: %s (%d)\n", - bdb->bi_dbenv_home, db_strerror(rc), rc ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_open: last_id(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc ); -#endif return rc; } @@ -506,29 +433,17 @@ bdb_db_destroy( BackendDB *be ) /* force a checkpoint */ rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif } rc = bdb->bi_dbenv->close( bdb->bi_dbenv, 0 ); bdb->bi_dbenv = NULL; if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_db_destroy: close failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_db_destroy: close failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif return rc; } } @@ -587,12 +502,8 @@ bdb_initialize( }; /* initialize the underlying database system */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ENTRY, "bdb_db_initialize\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_initialize: initialize BDB backend\n", 0, 0, 0 ); -#endif bi->bi_flags |= SLAP_BFLAG_INCREMENT | @@ -625,26 +536,14 @@ bdb_initialize( minor != DB_VERSION_MINOR || patch < DB_VERSION_PATCH ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, ERR, - "bdb_initialize: BDB library version mismatch:" - " expected " DB_VERSION_STRING "," - " got %s\n", version, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_initialize: BDB library version mismatch:" " expected " DB_VERSION_STRING "," " got %s\n", version, 0, 0 ); -#endif } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, DETAIL1, - "bdb_db_initialize: %s\n", version, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_initialize: %s\n", version, 0, 0 ); -#endif } db_env_set_func_free( ber_memfree ); diff --git a/servers/slapd/back-bdb/key.c b/servers/slapd/back-bdb/key.c index 9eae0affdf..c84028542d 100644 --- a/servers/slapd/back-bdb/key.c +++ b/servers/slapd/back-bdb/key.c @@ -38,11 +38,7 @@ bdb_key_read( int rc; DBT key; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "key_read: enter\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 ); -#endif DBTzero( &key ); bv2DBT(k,&key); @@ -52,20 +48,11 @@ bdb_key_read( rc = bdb_idl_fetch_key( be, db, txn, &key, ids ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, "bdb_key_read: failed (%d)\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_index_read: failed (%d)\n", rc, 0, 0 ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, DETAIL1, - "bdb_key_read: %ld candidates\n", (long)BDB_IDL_N(ids), 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "<= bdb_index_read %ld candidates\n", (long) BDB_IDL_N(ids), 0, 0 ); -#endif } return rc; @@ -85,13 +72,8 @@ bdb_key_change( int rc; DBT key; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "key_change: %s ID %lx\n", - op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long) id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> key_change(%s,%lx)\n", op == SLAP_INDEX_ADD_OP ? "ADD":"DELETE", (long) id, 0 ); -#endif DBTzero( &key ); bv2DBT(k,&key); @@ -108,11 +90,7 @@ bdb_key_change( if ( rc == DB_NOTFOUND ) rc = 0; } -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, RESULTS, "key_change: return %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= key_change %d\n", rc, 0, 0 ); -#endif return rc; } diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 45d2efeb11..1115cdd7c9 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -44,13 +44,8 @@ int bdb_modify_internal( Attribute *ap; int glue_attr_delete = 0; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "bdb_modify_internal: 0x%08lx: %s\n", - e->e_id, e->e_dn, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify_internal: 0x%08lx: %s\n", e->e_id, e->e_dn, 0); -#endif if ( !acl_check_modlist( op, e, modlist )) { return LDAP_INSUFFICIENT_ACCESS; @@ -97,21 +92,12 @@ int bdb_modify_internal( switch ( mod->sm_op ) { case LDAP_MOD_ADD: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, "bdb_modify_internal: add\n", 0,0,0); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: add\n", 0, 0, 0); -#endif err = modify_add_values( e, mod, get_permissiveModify(op), text, textbuf, textlen ); if( err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify_internal: %d %s\n", err, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n", err, *text, 0); -#endif } break; @@ -121,75 +107,40 @@ int bdb_modify_internal( break; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modify_internal: delete\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: delete\n", 0, 0, 0); -#endif err = modify_delete_values( e, mod, get_permissiveModify(op), text, textbuf, textlen ); assert( err != LDAP_TYPE_OR_VALUE_EXISTS ); if( err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify_internal: %d %s\n", err, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n", err, *text, 0); -#endif } break; case LDAP_MOD_REPLACE: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modify_internal: replace\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: replace\n", 0, 0, 0); -#endif err = modify_replace_values( e, mod, get_permissiveModify(op), text, textbuf, textlen ); if( err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify_internal: %d %s\n", err, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n", err, *text, 0); -#endif } break; case LDAP_MOD_INCREMENT: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modify_internal: increment\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: increment\n", 0, 0, 0); -#endif err = modify_increment_values( e, mod, get_permissiveModify(op), text, textbuf, textlen ); if( err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify_internal: %d %s\n", err, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n", err, *text, 0); -#endif } break; case SLAP_MOD_SOFTADD: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modify_internal: softadd\n",0,0,0 ); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: softadd\n", 0, 0, 0); -#endif /* Avoid problems in index_add_mods() * We need to add index if necessary. */ @@ -205,33 +156,18 @@ int bdb_modify_internal( } if( err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify_internal: %d %s\n", err, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n", err, *text, 0); -#endif } break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify_internal: invalid op %d\n", mod->sm_op, 0, 0 ); -#else Debug(LDAP_DEBUG_ANY, "bdb_modify_internal: invalid op %d\n", mod->sm_op, 0, 0); -#endif *text = "Invalid modify operation"; err = LDAP_OTHER; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify_internal: %d %s\n", err, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n", err, *text, 0); -#endif } if ( err != LDAP_SUCCESS ) { @@ -273,15 +209,9 @@ int bdb_modify_internal( e->e_attrs = save_attrs; if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "bdb_modify_internal: " - "entry failed schema check %s\n", - *text, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "entry failed schema check: %s\n", *text, 0, 0 ); -#endif } /* if NOOP then silently revert to saved attrs */ @@ -299,15 +229,9 @@ int bdb_modify_internal( if ( rc != LDAP_SUCCESS ) { attrs_free( e->e_attrs ); e->e_attrs = save_attrs; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify_internal: attribute index delete failure\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Attribute index delete failure", 0, 0, 0 ); -#endif return rc; } ap->a_flags &= ~SLAP_ATTR_IXDEL; @@ -323,15 +247,9 @@ int bdb_modify_internal( if ( rc != LDAP_SUCCESS ) { attrs_free( e->e_attrs ); e->e_attrs = save_attrs; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify_internal: attribute index add failure\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Attribute index add failure", 0, 0, 0 ); -#endif return rc; } ap->a_flags &= ~SLAP_ATTR_IXADD; @@ -372,13 +290,8 @@ bdb_modify( Operation *op, SlapReply *rs ) Entry *ctxcsn_e; int ctxcsn_added = 0; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "bdb_modify: %s\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "bdb_modify: %s\n", op->o_req_dn.bv_val, 0, 0 ); -#endif ctrls[num_ctrls] = NULL; @@ -392,12 +305,8 @@ retry: /* transaction retry */ bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e); e = NULL; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, "bdb_modify: retrying...\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "bdb_modify: retrying...\n", 0, 0, 0); -#endif pm_list = LDAP_LIST_FIRST(&op->o_pm_list); while ( pm_list != NULL ) { @@ -425,14 +334,9 @@ retry: /* transaction retry */ bdb->bi_db_opflags ); rs->sr_text = NULL; if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modify: txn_begin failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: txn_begin failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -452,14 +356,9 @@ retry: /* transaction retry */ locker, &lock ); if ( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modify: dn2entry failed: (%d)\n", rs->sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: dn2entry failed (%d)\n", rs->sr_err, 0, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -523,15 +422,9 @@ retry: /* transaction retry */ /* entry is a referral, don't allow modify */ rs->sr_ref = get_entry_referrals( op, e ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modify: entry is referral\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: entry is referral\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL; rs->sr_matched = e->e_name.bv_val; @@ -555,15 +448,9 @@ retry: /* transaction retry */ LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) { rc = bdb_psearch(op, rs, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY ); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify: persistent search failed (%d,%d)\n", - rc, rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: persistent search failed (%d,%d)\n", rc, rs->sr_err, 0 ); -#endif } } ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock ); @@ -577,13 +464,8 @@ retry: /* transaction retry */ if ( slap_read_controls( op, rs, e, &slap_pre_read_bv, preread_ctrl ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_modify: pre-read failed!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_modify: pre-read failed!\n", 0, 0, 0 ); -#endif goto return_results; } } @@ -593,15 +475,9 @@ retry: /* transaction retry */ bdb->bi_db_opflags ); rs->sr_text = NULL; if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify: txn_begin(2) failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: txn_begin(2) failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -612,14 +488,9 @@ retry: /* transaction retry */ &dummy, &rs->sr_text, textbuf, textlen ); if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify: modify failed (%d)\n", rs->sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: modify failed (%d)\n", rs->sr_err, 0, 0 ); -#endif if ( (rs->sr_err == LDAP_INSUFFICIENT_ACCESS) && opinfo.boi_err ) { rs->sr_err = opinfo.boi_err; } @@ -636,14 +507,9 @@ retry: /* transaction retry */ /* change the entry itself */ rs->sr_err = bdb_id2entry_update( op->o_bd, lt2, &dummy ); if ( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify: id2entry update failed (%d)\n", rs->sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: id2entry update failed (%d)\n", rs->sr_err, 0, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -678,13 +544,8 @@ retry: /* transaction retry */ if( slap_read_controls( op, rs, &dummy, &slap_post_read_bv, postread_ctrl ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_modify: post-read failed!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_modify: post-read failed!\n", 0, 0, 0 ); -#endif goto return_results; } } @@ -718,15 +579,9 @@ retry: /* transaction retry */ LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) { rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_MODIFY ); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify: persistent search failed (%d,%d)\n", - rc, rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: persistent search failed (%d,%d)\n", rc, rs->sr_err, 0 ); -#endif } } pm_list = LDAP_LIST_FIRST(&op->o_pm_list); @@ -734,15 +589,9 @@ retry: /* transaction retry */ rc = bdb_psearch(op, rs, pm_list->ps_op, e, LDAP_PSEARCH_BY_SCOPEOUT); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify: persistent search failed (%d,%d)\n", - rc, rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: persistent search failed (%d,%d)\n", rc, rs->sr_err, 0 ); -#endif } LDAP_LIST_REMOVE ( pm_list, ps_link ); pm_prev = pm_list; @@ -758,33 +607,20 @@ retry: /* transaction retry */ op->o_private = NULL; if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modify: txn_%s failed %s (%d)\n", - op->o_noop ? "abort (no_op)" : "commit", - db_strerror(rs->sr_err), rs->sr_err ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: txn_%s failed: %s (%d)\n", op->o_noop ? "abort (no-op)" : "commit", db_strerror(rs->sr_err), rs->sr_err ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "commit failed"; goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modify: updated%s id=%08lx dn=\"%s\"\n", - op->o_noop ? " (no_op)" : "", e->e_id, e->e_dn ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modify: updated%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn ); -#endif rs->sr_err = LDAP_SUCCESS; rs->sr_text = NULL; diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 0956d8cdfd..59dcc88b7a 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -77,15 +77,9 @@ bdb_modrdn( Operation *op, SlapReply *rs ) ctrls[num_ctrls] = NULL; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, "==>bdb_modrdn(%s,%s,%s)\n", - op->o_req_dn.bv_val,op->oq_modrdn.rs_newrdn.bv_val, - op->oq_modrdn.rs_newSup ? op->oq_modrdn.rs_newSup->bv_val : "NULL" ); -#else Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn(%s,%s,%s)\n", op->o_req_dn.bv_val,op->oq_modrdn.rs_newrdn.bv_val, op->oq_modrdn.rs_newSup ? op->oq_modrdn.rs_newSup->bv_val : "NULL" ); -#endif if( 0 ) { retry: /* transaction retry */ @@ -105,11 +99,7 @@ retry: /* transaction retry */ bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np); np = NULL; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, "==>bdb_modrdn: retrying...\n", 0, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn: retrying...\n", 0, 0, 0 ); -#endif pm_list = LDAP_LIST_FIRST(&op->o_pm_list); while ( pm_list != NULL ) { LDAP_LIST_REMOVE ( pm_list, ps_link ); @@ -138,15 +128,9 @@ retry: /* transaction retry */ bdb->bi_db_opflags ); rs->sr_text = NULL; if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "==>bdb_modrdn: txn_begin failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_delete: txn_begin failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -237,13 +221,8 @@ retry: /* transaction retry */ goto retry; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "==>bdb_modrdn: no access to entry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "no access to entry\n", 0, 0, 0 ); -#endif rs->sr_text = "no write access to old entry"; rs->sr_err = LDAP_INSUFFICIENT_ACCESS; goto return_results; @@ -257,27 +236,16 @@ retry: /* transaction retry */ case DB_LOCK_NOTGRANTED: goto retry; case 0: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_modrdn: non-leaf %s\n", op->o_req_dn.bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "<=- bdb_modrdn: non-leaf %s\n", op->o_req_dn.bv_val, 0, 0); -#endif rs->sr_err = LDAP_NOT_ALLOWED_ON_NONLEAF; rs->sr_text = "subtree rename not supported"; break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_modrdn: has_children failed %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "<=- bdb_modrdn: has_children failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; } @@ -290,13 +258,8 @@ retry: /* transaction retry */ /* parent is a referral, don't allow add */ rs->sr_ref = get_entry_referrals( op, e ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: entry %s is referral \n", e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry %s is referral\n", e->e_dn, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL, rs->sr_matched = e->e_name.bv_val; @@ -340,13 +303,8 @@ retry: /* transaction retry */ p = eip->bei_e; if( p == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "==>bdb_modrdn: parent does not exist\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: parent does not exist\n", 0, 0, 0); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "old entry's parent does not exist"; goto return_results; @@ -364,25 +322,15 @@ retry: /* transaction retry */ } rs->sr_err = LDAP_INSUFFICIENT_ACCESS; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "==>bdb_modrdn: no access to parent\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0, 0, 0 ); -#endif rs->sr_text = "no write access to old parent's children"; goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: wr to children %s is OK\n", p_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: wr to children of entry %s OK\n", p_ndn.bv_val, 0, 0 ); -#endif if ( p_ndn.bv_val == slap_empty_bv.bv_val ) { p_dn = slap_empty_bv; @@ -390,14 +338,9 @@ retry: /* transaction retry */ dnParent( &e->e_name, &p_dn ); } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: parent dn=%s\n", p_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: parent dn=%s\n", p_dn.bv_val, 0, 0 ); -#endif } else { /* no parent, modrdn entry directly under root */ @@ -422,51 +365,29 @@ retry: /* transaction retry */ } rs->sr_err = LDAP_INSUFFICIENT_ACCESS; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "==>bdb_modrdn: no access to parent\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0, 0, 0 ); -#endif rs->sr_text = "no write access to old parent"; goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: wr to children of entry \"%s\" OK\n", - p_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: wr to children of entry \"\" OK\n", 0, 0, 0 ); -#endif p_dn.bv_val = ""; p_dn.bv_len = 0; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: parent dn=\"\" \n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: parent dn=\"\"\n", 0, 0, 0 ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "==>bdb_modrdn: no parent, not root &\"\" is not " - "suffix\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: no parent, not root " "& \"\" is not suffix\n", 0, 0, 0); -#endif rs->sr_text = "no write access to old parent"; rs->sr_err = LDAP_INSUFFICIENT_ACCESS; goto return_results; @@ -477,27 +398,15 @@ retry: /* transaction retry */ new_parent_dn = &p_dn; /* New Parent unless newSuperior given */ if ( op->oq_modrdn.rs_newSup != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: new parent \"%s\" requested...\n", - op->oq_modrdn.rs_newSup->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new parent \"%s\" requested...\n", op->oq_modrdn.rs_newSup->bv_val, 0, 0 ); -#endif /* newSuperior == oldParent? */ if( dn_match( &p_ndn, op->oq_modrdn.rs_nnewSup ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_BDB, INFO, "bdb_back_modrdn: " - "new parent \"%s\" same as the old parent \"%s\"\n", - op->oq_modrdn.rs_newSup->bv_val, p_dn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_back_modrdn: " "new parent \"%s\" same as the old parent \"%s\"\n", op->oq_modrdn.rs_newSup->bv_val, p_dn.bv_val, 0 ); -#endif op->oq_modrdn.rs_newSup = NULL; /* ignore newSuperior */ } } @@ -531,29 +440,17 @@ retry: /* transaction retry */ } if( np == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: newSup(ndn=%s) not here!\n", - np_ndn->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: newSup(ndn=%s) not here!\n", np_ndn->bv_val, 0, 0); -#endif rs->sr_text = "new superior not found"; rs->sr_err = LDAP_OTHER; goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: wr to new parent OK np=%p, id=%ld\n", - (void *) np, (long) np->e_id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: wr to new parent OK np=%p, id=%ld\n", (void *) np, (long) np->e_id, 0 ); -#endif /* check newSuperior for "children" acl */ rs->sr_err = access_allowed( op, np, children, @@ -566,14 +463,9 @@ retry: /* transaction retry */ goto retry; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: no wr to newSup children\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: no wr to newSup children\n", 0, 0, 0 ); -#endif rs->sr_text = "no write access to new superior's children"; rs->sr_err = LDAP_INSUFFICIENT_ACCESS; goto return_results; @@ -582,13 +474,8 @@ retry: /* transaction retry */ #ifdef BDB_ALIASES if ( is_entry_alias( np ) ) { /* parent is an alias, don't allow add */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: entry is alias\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is alias\n", 0, 0, 0 ); -#endif rs->sr_text = "new superior is an alias"; rs->sr_err = LDAP_ALIAS_PROBLEM; goto return_results; @@ -597,13 +484,8 @@ retry: /* transaction retry */ if ( is_entry_referral( np ) ) { /* parent is a referral, don't allow add */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "==>bdb_modrdn: entry is referral\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is referral\n", 0, 0, 0 ); -#endif rs->sr_text = "new superior is a referral"; rs->sr_err = LDAP_OTHER; goto return_results; @@ -636,63 +518,37 @@ retry: /* transaction retry */ } rs->sr_err = LDAP_INSUFFICIENT_ACCESS; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "==>bdb_modrdn: no access to superior\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "no access to new superior\n", 0, 0, 0 ); -#endif rs->sr_text = "no write access to new superior's children"; goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modrdn: wr to children entry \"\" OK\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: wr to children of entry \"\" OK\n", 0, 0, 0 ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modrdn: new superior=\"\", not root & \"\" " - "is not suffix\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new superior=\"\", not root " "& \"\" is not suffix\n", 0, 0, 0); -#endif rs->sr_text = "no write access to new superior's children"; rs->sr_err = LDAP_INSUFFICIENT_ACCESS; goto return_results; } } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modrdn: new superior=\"\"\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new superior=\"\"\n", 0, 0, 0 ); -#endif } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_modrdn: wr to new parent's children OK\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: wr to new parent's children OK\n", 0, 0, 0 ); -#endif new_parent_dn = np_dn; } @@ -708,13 +564,8 @@ retry: /* transaction retry */ ber_dupbv( &new_ndn, &bv ); } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_modrdn: new ndn=%s\n", new_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new ndn=%s\n", new_ndn.bv_val, 0, 0 ); -#endif /* Shortcut the search */ nei = neip ? neip : eip; @@ -741,47 +592,27 @@ retry: /* transaction retry */ if ( !new_rdn && ldap_bv2rdn_x( &op->oq_modrdn.rs_newrdn, &new_rdn, (char **)&rs->sr_text, LDAP_DN_FORMAT_LDAP, op->o_tmpmemctx ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modrdn: can't figure out " - "type(s)/values(s) of newrdn\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: can't figure out " "type(s)/values(s) of newrdn\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_INVALID_DN_SYNTAX; rs->sr_text = "unknown type(s) used in RDN"; goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n", - new_rdn[ 0 ]->la_attr.bv_val, new_rdn[ 0 ]->la_value.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n", new_rdn[ 0 ]->la_attr.bv_val, new_rdn[ 0 ]->la_value.bv_val, 0 ); -#endif if ( op->oq_modrdn.rs_deleteoldrdn ) { if ( !old_rdn && ldap_bv2rdn_x( &op->o_req_dn, &old_rdn, (char **)&rs->sr_text, LDAP_DN_FORMAT_LDAP, op->o_tmpmemctx ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modrdn: can't figure out " - "type(s)/values(s) of old_rdn\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: can't figure out " "the old_rdn type(s)/value(s)\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "cannot parse RDN from old DN"; goto return_results; @@ -804,13 +635,8 @@ retry: /* transaction retry */ if( slap_read_controls( op, rs, e, &slap_pre_read_bv, preread_ctrl ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 ); -#endif goto return_results; } } @@ -819,15 +645,9 @@ retry: /* transaction retry */ rs->sr_err = TXN_BEGIN( bdb->bi_dbenv, ltid, <2, bdb->bi_db_opflags ); rs->sr_text = NULL; if( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modrdn: txn_begin(2) failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: txn_begin(2) failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -836,15 +656,9 @@ retry: /* transaction retry */ /* delete old DN */ rs->sr_err = bdb_dn2id_delete( op, lt2, eip, e ); if ( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_modrdn: dn2id del failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "<=- bdb_modrdn: dn2id del failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -864,15 +678,9 @@ retry: /* transaction retry */ /* add new DN */ rs->sr_err = bdb_dn2id_add( op, lt2, neip ? neip : eip, &dummy ); if ( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_modrdn: dn2id add failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "<=- bdb_modrdn: dn2id add failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -890,15 +698,9 @@ retry: /* transaction retry */ LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) { rc = bdb_psearch( op, rs, ps_list, &dummy, LDAP_PSEARCH_BY_PREMODIFY ); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modrdn: persistent search failed (%d,%d)\n", - rc, rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: persistent search failed (%d,%d)\n", rc, rs->sr_err, 0 ); -#endif } } ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock ); @@ -909,15 +711,9 @@ retry: /* transaction retry */ rs->sr_err = bdb_modify_internal( op, lt2, &mod[0], &dummy, &rs->sr_text, textbuf, textlen ); if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_modrdn: modify failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "<=- bdb_modrdn: modify failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif if ( ( rs->sr_err == LDAP_INSUFFICIENT_ACCESS ) && opinfo.boi_err ) { rs->sr_err = opinfo.boi_err; } @@ -933,15 +729,9 @@ retry: /* transaction retry */ /* id2entry index */ rs->sr_err = bdb_id2entry_update( op->o_bd, lt2, &dummy ); if ( rs->sr_err != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_modrdn: id2entry failed: %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "<=- bdb_modrdn: id2entry failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif switch( rs->sr_err ) { case DB_LOCK_DEADLOCK: case DB_LOCK_NOTGRANTED: @@ -963,15 +753,9 @@ retry: /* transaction retry */ case 0: break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "<=- bdb_modrdn: has_children failed %s (%d)\n", - db_strerror(rs->sr_err), rs->sr_err, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "<=- bdb_modrdn: has_children failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 ); -#endif rs->sr_err = LDAP_OTHER; rs->sr_text = "internal error"; goto return_results; @@ -1007,13 +791,8 @@ retry: /* transaction retry */ if( slap_read_controls( op, rs, &dummy, &slap_post_read_bv, postread_ctrl ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 ); -#endif goto return_results; } } @@ -1051,15 +830,9 @@ retry: /* transaction retry */ LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) { rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_MODIFY ); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modrdn: persistent search failed (%d,%d)\n", - rc, rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: persistent search failed (%d,%d)\n", rc, rs->sr_err, 0 ); -#endif } } pm_list = LDAP_LIST_FIRST(&op->o_pm_list); @@ -1067,15 +840,9 @@ retry: /* transaction retry */ rc = bdb_psearch(op, rs, pm_list->ps_op, e, LDAP_PSEARCH_BY_SCOPEOUT); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_modrdn: persistent search failed (%d,%d)\n", - rc, rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: persistent search failed (%d,%d)\n", rc, rs->sr_err, 0 ); -#endif } pm_prev = pm_list; LDAP_LIST_REMOVE ( pm_list, ps_link ); @@ -1096,29 +863,17 @@ retry: /* transaction retry */ op->o_private = NULL; if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, "bdb_modrdn: %s : %s (%d)\n", - rs->sr_text, db_strerror(rs->sr_err), rs->sr_err ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n", rs->sr_text, db_strerror(rs->sr_err), rs->sr_err ); -#endif rs->sr_err = LDAP_OTHER; goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n", - op->o_noop ? " (no-op)" : "", - e->e_id, e->e_dn ); -#else Debug(LDAP_DEBUG_TRACE, "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn ); -#endif rs->sr_text = NULL; if( num_ctrls ) rs->sr_ctrls = ctrls; diff --git a/servers/slapd/back-bdb/nextid.c b/servers/slapd/back-bdb/nextid.c index 3ec1e36c6f..5737f0f9c9 100644 --- a/servers/slapd/back-bdb/nextid.c +++ b/servers/slapd/back-bdb/nextid.c @@ -66,14 +66,9 @@ int bdb_last_id( BackendDB *be, DB_TXN *tid ) break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, "bdb_last_id: get failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_last_id: get failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif goto done; } diff --git a/servers/slapd/back-bdb/operational.c b/servers/slapd/back-bdb/operational.c index 3ff7aa2bc9..8eabfc9233 100644 --- a/servers/slapd/back-bdb/operational.c +++ b/servers/slapd/back-bdb/operational.c @@ -70,15 +70,9 @@ retry: break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "=> bdb_hasSubordinates: has_children failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "<=- bdb_hasSubordinates: has_children failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif rc = LDAP_OTHER; } diff --git a/servers/slapd/back-bdb/referral.c b/servers/slapd/back-bdb/referral.c index d69c35a7d9..9b8d434deb 100644 --- a/servers/slapd/back-bdb/referral.c +++ b/servers/slapd/back-bdb/referral.c @@ -67,15 +67,9 @@ dn2entry_retry: case DB_LOCK_NOTGRANTED: goto dn2entry_retry; default: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "bdb_referrals: dn2entry failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_referrals: dn2entry failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif send_ldap_error( op, rs, LDAP_OTHER, "internal error" ); LOCK_ID_FREE ( bdb->bi_dbenv, locker ); return rs->sr_err; @@ -85,15 +79,9 @@ dn2entry_retry: rc = 0; rs->sr_matched = NULL; if ( e != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - (long) op->o_tag, op->o_req_dn.bv_val, e->e_name.bv_val ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", (long) op->o_tag, op->o_req_dn.bv_val, e->e_name.bv_val ); -#endif if( is_entry_referral( e ) ) { rc = LDAP_OTHER; @@ -138,15 +126,9 @@ dn2entry_retry: rs->sr_ref = referral_rewrite( refs, &e->e_name, &op->o_req_dn, LDAP_SCOPE_DEFAULT ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - (long) op->o_tag, op->o_req_dn.bv_val, e->e_name.bv_val ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", (long) op->o_tag, op->o_req_dn.bv_val, e->e_name.bv_val ); -#endif rs->sr_matched = e->e_name.bv_val; if( rs->sr_ref != NULL ) { diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 0b6714be23..d8885f0ecb 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -434,11 +434,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop, struct bdb_op_info *opinfo = NULL; DB_TXN *ltid = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "bdb_search\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_search\n", 0, 0, 0); -#endif attrs = sop->oq_search.rs_attrs; opinfo = (struct bdb_op_info *) op->o_private; @@ -654,13 +650,8 @@ dn2entry_retry: ber_bvarray_free( erefs ); } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_search: entry is referral\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_search: entry is referral\n", 0, 0, 0 ); -#endif if (!rs->sr_ref) rs->sr_text = "bad_referral object"; rs->sr_err = LDAP_REFERRAL; @@ -760,13 +751,8 @@ dn2entry_retry: } if ( candidates[0] == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_search: no candidates\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_search: no candidates\n", 0, 0, 0 ); -#endif goto nochange; } @@ -816,15 +802,9 @@ dn2entry_retry: } if ( cursor == NOID ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_search: no paged results candidates\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_search: no paged results candidates\n", 0, 0, 0 ); -#endif send_paged_response( sop, rs, &lastid, 0 ); rs->sr_err = LDAP_OTHER; @@ -959,15 +939,9 @@ id2entry_retry: if ( e == NULL ) { if( !BDB_IDL_IS_RANGE(candidates) ) { /* only complain for non-range IDLs */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_search: candidate %ld not found\n", - (long) id, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "bdb_search: candidate %ld not found\n", (long) id, 0, 0 ); -#endif } goto loop_continue; @@ -1077,15 +1051,9 @@ id2entry_retry: /* Not in scope, ignore it */ if ( !scopeok ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_search: %ld scope not okay\n", - (long) id, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "bdb_search: %ld scope not okay\n", (long) id, 0, 0 ); -#endif goto loop_continue; } @@ -1130,15 +1098,9 @@ id2entry_retry: if ( rs->sr_err == LDAP_COMPARE_TRUE ) { if ( rc_sync == LDAP_COMPARE_TRUE ) { if ( no_sync_state_change ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_search: error in context csn management\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_search: error in context csn management\n", 0, 0, 0 ); -#endif } entry_sync_state = LDAP_SYNC_ADD; @@ -1266,15 +1228,9 @@ id2entry_retry: psid_e, ps_link ); } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_search: invalid ps_type (%d) \n", - ps_type, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "bdb_search: invalid ps_type (%d) \n", ps_type, 0, 0); -#endif } } else { @@ -1357,14 +1313,9 @@ id2entry_retry: } } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "bdb_search: %ld does not match filter\n", (long) id, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "bdb_search: %ld does not match filter\n", (long) id, 0, 0 ); -#endif } loop_continue: @@ -1536,14 +1487,8 @@ static int base_candidate( Entry *e, ID *ids ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, - "base_candidate: base: \"%s\" (0x%08lx)\n", - e->e_nname.bv_val, (long) e->e_id, 0); -#else Debug(LDAP_DEBUG_ARGS, "base_candidates: base: \"%s\" (0x%08lx)\n", e->e_nname.bv_val, (long) e->e_id, 0); -#endif ids[0] = 1; ids[1] = e->e_id; @@ -1641,15 +1586,9 @@ static int search_candidates( * (|[(objectClass=referral)(objectClass=alias)](user-filter)) */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, - "search_candidates: base=\"%s\" (0x%08lx) scope=%d\n", - e->e_nname.bv_val, (long) e->e_id, op->oq_search.rs_scope); -#else Debug(LDAP_DEBUG_TRACE, "search_candidates: base=\"%s\" (0x%08lx) scope=%d\n", e->e_nname.bv_val, (long) e->e_id, op->oq_search.rs_scope ); -#endif xf.f_or = op->oq_search.rs_filter; xf.f_choice = LDAP_FILTER_OR; @@ -1721,28 +1660,16 @@ static int search_candidates( } if( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_search_candidates: failed (rc=%d)\n", rc, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "bdb_search_candidates: failed (rc=%d)\n", rc, NULL, NULL ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_search_candidates: id=%ld first=%ld last=%ld\n", - (long) ids[0], (long) BDB_IDL_FIRST(ids), - (long) BDB_IDL_LAST(ids)); -#else Debug(LDAP_DEBUG_TRACE, "bdb_search_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST(ids), (long) BDB_IDL_LAST(ids) ); -#endif } return rc; @@ -1880,15 +1807,9 @@ send_paged_response( PagedResultsCookie respcookie; struct berval cookie; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, - "send_paged_response: lastid=0x%08lx nentries=%d\n", - lastid ? *lastid : 0, rs->sr_nentries, NULL ); -#else Debug(LDAP_DEBUG_ARGS, "send_paged_response: lastid=0x%08lx nentries=%d\n", lastid ? *lastid : 0, rs->sr_nentries, NULL ); -#endif BER_BVZERO( &ctrl.ldctl_value ); ctrls[0] = &ctrl; diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index 8898017156..ddf92e751c 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -159,13 +159,8 @@ ID bdb_tool_dn2id_get( rc = db->get( db, NULL, &key, &data, bdb->bi_db_opflags ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( INDEX, ERR, "bdb_tool_dn2id_get: get failed %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_tool_dn2id_get: get failed: %s (%d)\n", db_strerror( rc ), rc, 0 ); -#endif id = NOID; } @@ -253,13 +248,8 @@ static int bdb_tool_next_id( snprintf( text->bv_val, text->bv_len, "next_id failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_next_id: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_next_id: %s\n", text->bv_val, 0, 0 ); -#endif return rc; } rc = bdb_dn2id_add( op, tid, ei, e ); @@ -267,13 +257,8 @@ static int bdb_tool_next_id( snprintf( text->bv_val, text->bv_len, "dn2id_add failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_next_id: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_next_id: %s\n", text->bv_val, 0, 0 ); -#endif } else if ( hole ) { if ( nholes == nhmax - 1 ) { if ( holes == hbuf ) { @@ -325,13 +310,8 @@ ID bdb_tool_entry_put( assert( text->bv_val ); assert( text->bv_val[0] == '\0' ); /* overconservative? */ -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ARGS, "=> bdb_tool_entry_put( %ld, \"%s\" )\n", - (long) e->e_id, e->e_dn, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_put( %ld, \"%s\" )\n", (long) e->e_id, e->e_dn, 0 ); -#endif rc = TXN_BEGIN( bdb->bi_dbenv, NULL, &tid, bdb->bi_db_opflags ); @@ -339,13 +319,9 @@ ID bdb_tool_entry_put( snprintf( text->bv_val, text->bv_len, "txn_begin failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif return NOID; } @@ -365,13 +341,8 @@ ID bdb_tool_entry_put( snprintf( text->bv_val, text->bv_len, "id2entry_add failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif goto done; } @@ -381,13 +352,8 @@ ID bdb_tool_entry_put( snprintf( text->bv_val, text->bv_len, "index_entry_add failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif goto done; } @@ -398,14 +364,9 @@ done: snprintf( text->bv_val, text->bv_len, "txn_commit failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif e->e_id = NOID; } @@ -414,14 +375,9 @@ done: snprintf( text->bv_val, text->bv_len, "txn_aborted! %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif e->e_id = NOID; } @@ -438,13 +394,8 @@ int bdb_tool_entry_reindex( DB_TXN *tid = NULL; Operation op = {0}; -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ARGS, - "=> bdb_tool_entry_reindex( %ld )\n", (long) id, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "=> bdb_tool_entry_reindex( %ld )\n", (long) id, 0, 0 ); -#endif /* No indexes configured, nothing to do. Could return an * error here to shortcut things. @@ -463,29 +414,17 @@ int bdb_tool_entry_reindex( e = bdb_tool_entry_get( be, id ); if( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, DETAIL1, - "bdb_tool_entry_reindex:: could not locate id=%ld\n", - (long) id, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bdb_tool_entry_reindex:: could not locate id=%ld\n", (long) id, 0, 0 ); -#endif return -1; } rc = TXN_BEGIN( bi->bi_dbenv, NULL, &tid, bi->bi_db_opflags ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_reindex: txn_begin failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_reindex: txn_begin failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif goto done; } @@ -496,13 +435,8 @@ int bdb_tool_entry_reindex( * */ -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_reindex( %ld, \"%s\" )\n", (long) id, e->e_dn, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_reindex( %ld, \"%s\" )\n", (long) id, e->e_dn, 0 ); -#endif op.o_bd = be; op.o_tmpmemctx = NULL; @@ -512,15 +446,9 @@ int bdb_tool_entry_reindex( /* add dn2id indices */ rc = bdb_dn2id_add( &op, tid, NULL, e ); if( rc != 0 && rc != DB_KEYEXIST ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_reindex: dn2id_add failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_reindex: dn2id_add failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif goto done; } #endif @@ -531,29 +459,17 @@ done: if( rc == 0 ) { rc = TXN_COMMIT( tid, 0 ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_reindex: txn_commit failed: %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_reindex: txn_commit failed: %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif e->e_id = NOID; } } else { TXN_ABORT( tid ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, DETAIL1, - "=> bdb_tool_entry_reindex: txn_aborted! %s (%d)\n", - db_strerror(rc), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_reindex: txn_aborted! %s (%d)\n", db_strerror(rc), rc, 0 ); -#endif e->e_id = NOID; } bdb_entry_release( &op, e, 0 ); @@ -581,13 +497,8 @@ ID bdb_tool_entry_modify( assert ( e->e_id != NOID ); assert ( e->e_id != 0 ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ARGS, "=> bdb_tool_entry_put( %ld, \"%s\" )\n", - (long) e->e_id, e->e_dn, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_put( %ld, \"%s\" )\n", (long) e->e_id, e->e_dn, 0 ); -#endif rc = TXN_BEGIN( bdb->bi_dbenv, NULL, &tid, bdb->bi_db_opflags ); @@ -595,13 +506,9 @@ ID bdb_tool_entry_modify( snprintf( text->bv_val, text->bv_len, "txn_begin failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif return NOID; } @@ -615,13 +522,8 @@ ID bdb_tool_entry_modify( snprintf( text->bv_val, text->bv_len, "id2entry_add failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif goto done; } @@ -630,13 +532,8 @@ ID bdb_tool_entry_modify( snprintf( text->bv_val, text->bv_len, "index_entry_del failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif goto done; } @@ -645,13 +542,8 @@ ID bdb_tool_entry_modify( snprintf( text->bv_val, text->bv_len, "index_entry_add failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif goto done; } @@ -662,14 +554,9 @@ done: snprintf( text->bv_val, text->bv_len, "txn_commit failed: %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif e->e_id = NOID; } @@ -678,14 +565,9 @@ done: snprintf( text->bv_val, text->bv_len, "txn_aborted! %s (%d)", db_strerror(rc), rc ); -#ifdef NEW_LOGGING - LDAP_LOG ( TOOLS, ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 ); -#endif e->e_id = NOID; } diff --git a/servers/slapd/back-bdb/trans.c b/servers/slapd/back-bdb/trans.c index d13196b26e..b10906a21b 100644 --- a/servers/slapd/back-bdb/trans.c +++ b/servers/slapd/back-bdb/trans.c @@ -49,11 +49,7 @@ bdb_trans_backoff( int num_retries ) delay = 16384 * (key * (double) pow_retries / (double) max_key); delay = delay ? delay : 1; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "delay = %d, num_retries = %d\n", delay, num_retries, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "delay = %d, num_retries = %d\n", delay, num_retries, 0 ); -#endif timeout.tv_sec = delay / 1000000; timeout.tv_usec = delay % 1000000; diff --git a/servers/slapd/back-ldap/add.c b/servers/slapd/back-ldap/add.c index 699503aca8..d508c20bad 100644 --- a/servers/slapd/back-ldap/add.c +++ b/servers/slapd/back-ldap/add.c @@ -51,11 +51,7 @@ ldap_back_add( int rc = LDAP_SUCCESS; #endif /* LDAP_BACK_PROXY_AUTHZ */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, ENTRY, "ldap_back_add: %s\n", op->o_req_dn.bv_val, 0, 0 ); -#else /* !NEW_LOGGING */ Debug(LDAP_DEBUG_ARGS, "==> ldap_back_add: %s\n", op->o_req_dn.bv_val, 0, 0); -#endif /* !NEW_LOGGING */ lc = ldap_back_getconn(op, rs); if ( !lc || !ldap_back_dobind( lc, op, rs ) ) { diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index ccfdedc484..3d8092d784 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -349,13 +349,8 @@ ldap_back_getconn(Operation *op, SlapReply *rs) ldap_pvt_thread_mutex_unlock( &li->conn_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, INFO, - "ldap_back_getconn: conn %p inserted\n", (void *) lc, 0, 0); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>ldap_back_getconn: conn %p inserted\n", (void *) lc, 0, 0 ); -#endif /* !NEW_LOGGING */ /* Err could be -1 in case a duplicate ldapconn is inserted */ if ( rs->sr_err != 0 ) { @@ -367,14 +362,8 @@ ldap_back_getconn(Operation *op, SlapReply *rs) return( NULL ); } } else { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, INFO, - "ldap_back_getconn: conn %p fetched\n", - (void *) lc, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>ldap_back_getconn: conn %p fetched\n", (void *) lc, 0, 0 ); -#endif /* !NEW_LOGGING */ } return( lc ); diff --git a/servers/slapd/back-ldap/config.c b/servers/slapd/back-ldap/config.c index 7edbd19915..95a3f26500 100644 --- a/servers/slapd/back-ldap/config.c +++ b/servers/slapd/back-ldap/config.c @@ -733,15 +733,9 @@ parse_idassert( /* identity assertion mode */ if ( strcasecmp( argv[0], "idassert-mode" ) == 0 ) { if ( argc != 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: illegal args number %d in \"idassert-mode \" line.\n", - fname, lineno, argc ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: illegal args number %d in \"idassert-mode \" line.\n", fname, lineno, argc ); -#endif return 1; } @@ -785,15 +779,9 @@ parse_idassert( rc = dnNormalize( 0, NULL, NULL, &id, &dn, NULL ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: idassert ID \"%s\" is not a valid DN.\n", - fname, lineno, argv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: idassert ID \"%s\" is not a valid DN\n", fname, lineno, argv[1] ); -#endif return 1; } @@ -834,15 +822,9 @@ parse_idassert( ber_str2bv( argv[1], 0, 0, &dn ); rc = dnNormalize( 0, NULL, NULL, &dn, &li->idassert_authcDN, NULL ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: idassert ID \"%s\" is not a valid DN.\n", - fname, lineno, argv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: idassert ID \"%s\" is not a valid DN\n", fname, lineno, argv[1] ); -#endif return 1; } @@ -949,15 +931,9 @@ parse_idassert( ber_str2bv( val, 0, 0, &dn ); rc = dnNormalize( 0, NULL, NULL, &dn, &li->idassert_authcDN, NULL ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: SASL authcdn \"%s\" is not a valid DN.\n", - fname, lineno, val ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: SASL authcdn \"%s\" is not a valid DN\n", fname, lineno, val ); -#endif return 1; } diff --git a/servers/slapd/back-ldap/extended.c b/servers/slapd/back-ldap/extended.c index ecd6f4dcaf..2661150224 100644 --- a/servers/slapd/back-ldap/extended.c +++ b/servers/slapd/back-ldap/extended.c @@ -109,13 +109,8 @@ ldap_back_exop_passwd( isproxy = ber_bvcmp( &op->o_req_ndn, &op->o_ndn ); -#ifdef NEW_LOGGING - LDAP_LOG ( ACL, DETAIL1, "ldap_back_exop_passwd: \"%s\"%s\"\n", - op->o_req_dn.bv_val, isproxy ? " (proxy)" : "", 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_back_exop_passwd: \"%s\"%s\n", op->o_req_dn.bv_val, isproxy ? " (proxy)" : "", 0 ); -#endif if ( isproxy ) { dc.rwmap = &li->rwmap; diff --git a/servers/slapd/back-ldap/init.c b/servers/slapd/back-ldap/init.c index d8240b6ca8..13a4fc57fc 100644 --- a/servers/slapd/back-ldap/init.c +++ b/servers/slapd/back-ldap/init.c @@ -174,13 +174,8 @@ ldap_back_db_open( BackendDB *be ) { struct ldapinfo *li = (struct ldapinfo *)be->be_private; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, DETAIL1, - "ldap_back_db_open: URI=%s\n", li->url, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldap_back_db_open: URI=%s\n", li->url, 0, 0 ); -#endif #ifdef LDAP_BACK_PROXY_AUTHZ /* by default, use proxyAuthz control on each operation */ diff --git a/servers/slapd/back-ldap/map.c b/servers/slapd/back-ldap/map.c index 4c28a56bfa..4301dc7873 100644 --- a/servers/slapd/back-ldap/map.c +++ b/servers/slapd/back-ldap/map.c @@ -492,15 +492,9 @@ ldap_back_filter_map_rewrite( *fstr = ftmp; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, DETAIL1, - "[rw] %s: \"%s\" -> \"%s\"\n", - fdc.ctx, ftmp.bv_val, fstr->bv_val ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "[rw] %s: \"%s\" -> \"%s\"\n", fdc.ctx, ftmp.bv_val, fstr->bv_val ); -#endif /* !NEW_LOGGING */ rc = LDAP_SUCCESS; break; diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index 6711fab063..e3dfa2e1df 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -420,13 +420,8 @@ ldap_build_entry( if ( slap_bv2undef_ad( &mapped, &attr->a_desc, &text ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, DETAIL1, - "slap_bv2undef_ad(%s): %s\n", mapped.bv_val, text, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "slap_bv2undef_ad(%s): %s\n", mapped.bv_val, text, 0 ); -#endif /* !NEW_LOGGING */ ch_free( attr ); continue; } diff --git a/servers/slapd/back-ldap/suffixmassage.c b/servers/slapd/back-ldap/suffixmassage.c index c1c94a8a97..1152fd38e3 100644 --- a/servers/slapd/back-ldap/suffixmassage.c +++ b/servers/slapd/back-ldap/suffixmassage.c @@ -53,15 +53,9 @@ ldap_back_dn_massage( } else { *res = *dn; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, DETAIL1, - "[rw] %s: \"%s\" -> \"%s\"\n", - dc->ctx, dn->bv_val, res->bv_val ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "[rw] %s: \"%s\" -> \"%s\"\n", dc->ctx, dn->bv_val, res->bv_val ); -#endif /* !NEW_LOGGING */ rc = LDAP_SUCCESS; break; @@ -147,16 +141,10 @@ ldap_back_dn_massage( res->bv_val = ch_malloc( res->bv_len + 1 ); strncpy( res->bv_val, dn->bv_val, diff ); strcpy( &res->bv_val[diff], dc->rwmap->rwm_suffix_massage[i+dst].bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG ( BACK_LDAP, ARGS, - "ldap_back_dn_massage: converted \"%s\" to \"%s\"\n", - dn->bv_val, res->bv_val, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "ldap_back_dn_massage:" " converted \"%s\" to \"%s\"\n", dn->bv_val, res->bv_val, 0 ); -#endif break; } } diff --git a/servers/slapd/back-ldap/unbind.c b/servers/slapd/back-ldap/unbind.c index 66e7139409..8217ce6ef6 100644 --- a/servers/slapd/back-ldap/unbind.c +++ b/servers/slapd/back-ldap/unbind.c @@ -40,14 +40,9 @@ ldap_back_conn_destroy( struct ldapinfo *li = (struct ldapinfo *) be->be_private; struct ldapconn *lc = NULL, lc_curr; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, INFO, - "ldap_back_conn_destroy: fetching conn %ld\n", conn->c_connid, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>ldap_back_conn_destroy: fetching conn %ld\n", conn->c_connid, 0, 0 ); -#endif /* !NEW_LOGGING */ lc_curr.conn = conn; lc_curr.local_dn = conn->c_ndn; @@ -64,15 +59,9 @@ ldap_back_conn_destroy( #endif /* ENABLE_REWRITE */ if (lc) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, DETAIL1, - "ldap_back_conn_destroy: destroying conn %ld\n", - conn->c_connid, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>ldap_back_conn_destroy: destroying conn %ld\n", lc->conn->c_connid, 0, 0 ); -#endif /* * Needs a test because the handler may be corrupted, diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index e1dfbbbb8f..9bb32cd762 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -42,26 +42,15 @@ ldbm_back_add( int subentry; #endif -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_add: %s\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", op->o_req_dn.bv_val, 0, 0); -#endif rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL, &rs->sr_text, textbuf, textlen ); if ( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: entry (%s) failed schema check.\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry failed schema check: %s\n", rs->sr_text, 0, 0 ); -#endif send_ldap_result( op, rs ); return rs->sr_err; @@ -74,14 +63,8 @@ ldbm_back_add( if ( !access_allowed( op, op->oq_add.rs_e, entry, NULL, ACL_WRITE, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: No write access to entry (%s).\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "no write access to entry\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, "no write access to entry" ); @@ -132,14 +115,8 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: Parent of (%s) does not exist.\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "parent does not exist\n", 0, 0, 0 ); -#endif rs->sr_text = rs->sr_ref ? "parent is referral" : "parent does not exist"; @@ -158,14 +135,8 @@ ldbm_back_add( cache_return_entry_w( &li->li_cache, p ); ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: No write access to parent (%s).\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "no write access to parent\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, "no write access to parent" ); @@ -175,13 +146,8 @@ ldbm_back_add( #ifdef LDBM_SUBENTRIES if ( is_entry_subentry( p )) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "bdb_add: parent is subentry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is subentry\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_OBJECT_CLASS_VIOLATION; rs->sr_text = "parent is a subentry"; goto return_results; @@ -195,13 +161,8 @@ ldbm_back_add( cache_return_entry_w( &li->li_cache, p ); ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); -#ifdef NEW_LOGGING - LDAP_LOG(BACK_LDBM, ERR, - "ldbm_back_add: Parent is an alias.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "parent is alias\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_ALIAS_PROBLEM, "parent is an alias" ); @@ -220,13 +181,8 @@ ldbm_back_add( cache_return_entry_w( &li->li_cache, p ); ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: Parent is referral.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "parent is referral\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL; send_ldap_result( op, rs ); @@ -252,14 +208,8 @@ ldbm_back_add( { ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: %s add denied.\n", - pdn.bv_val == NULL ? "suffix" : "entry at root", 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "%s add denied\n", pdn.bv_val == NULL ? "suffix" : "entry at root", 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_NO_SUCH_OBJECT, NULL ); return LDAP_NO_SUCH_OBJECT; @@ -274,13 +224,8 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: next_id failed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ldbm_add: next_id failed\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_OTHER, "next_id add failed" ); @@ -302,13 +247,8 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: cache_add_entry_lock failed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "cache_add_entry_lock failed\n", 0, 0, 0 ); -#endif rs->sr_text = rs->sr_err > 0 ? NULL : "cache add failed"; rs->sr_err = rs->sr_err > 0 ? LDAP_ALREADY_EXISTS : LDAP_OTHER; @@ -321,13 +261,8 @@ ldbm_back_add( /* attribute indexes */ if ( index_entry_add( op, op->oq_add.rs_e ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: index_entry_add failed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "index_entry_add failed\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_OTHER, "index generation failed" ); @@ -339,13 +274,8 @@ ldbm_back_add( if ( dn2id_add( op->o_bd, &op->oq_add.rs_e->e_nname, op->oq_add.rs_e->e_id ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: dn2id_add failed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "dn2id_add failed\n", 0, 0, 0 ); -#endif /* FIXME: delete attr indices? */ send_ldap_error( op, rs, LDAP_OTHER, @@ -356,13 +286,8 @@ ldbm_back_add( /* id2entry index */ if ( id2entry_add( op->o_bd, op->oq_add.rs_e ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_add: id2entry_add failed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "id2entry_add failed\n", 0, 0, 0 ); -#endif /* FIXME: delete attr indices? */ (void) dn2id_delete( op->o_bd, &op->oq_add.rs_e->e_nname, diff --git a/servers/slapd/back-ldbm/attr.c b/servers/slapd/back-ldbm/attr.c index bb49d279c2..621e1d7bdd 100644 --- a/servers/slapd/back-ldbm/attr.c +++ b/servers/slapd/back-ldbm/attr.c @@ -188,14 +188,8 @@ attr_index_config( return LDAP_INAPPROPRIATE_MATCHING; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "attr_index_config: index %s 0x%04lx\n", - ad->ad_cname.bv_val, mask, 0 ); -#else Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04lx\n", ad->ad_cname.bv_val, mask, 0 ); -#endif a->ai_desc = ad; diff --git a/servers/slapd/back-ldbm/bind.c b/servers/slapd/back-ldbm/bind.c index 02ca82df89..7397f1f17d 100644 --- a/servers/slapd/back-ldbm/bind.c +++ b/servers/slapd/back-ldbm/bind.c @@ -45,13 +45,8 @@ ldbm_back_bind( AttributeDescription *password = slap_schema.si_ad_userPassword; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, - "ldbm_back_bind: dn: %s.\n", op->o_req_dn.bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_bind: dn: %s\n", op->o_req_dn.bv_val, 0, 0); -#endif if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op ) ) { ber_dupbv( &op->oq_bind.rb_edn, be_root_dn( op->o_bd ) ); @@ -80,13 +75,8 @@ ldbm_back_bind( #ifdef LDBM_SUBENTRIES if ( is_entry_subentry( e ) ) { /* entry is an subentry, don't allow bind */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "bdb_bind: entry is subentry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry is subentry\n", 0, 0, 0 ); -#endif rc = LDAP_INVALID_CREDENTIALS; goto return_results; } @@ -94,13 +84,7 @@ ldbm_back_bind( if ( is_entry_alias( e ) ) { /* entry is an alias, don't allow bind */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_bind: entry (%s) is an alias.\n", - e->e_name.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0, 0, 0 ); -#endif #if 1 rc = LDAP_INVALID_CREDENTIALS; @@ -113,12 +97,7 @@ ldbm_back_bind( if ( is_entry_referral( e ) ) { /* entry is a referral, don't allow bind */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_bind: entry(%s) is a referral.\n", e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0, 0, 0 ); -#endif rc = LDAP_INVALID_CREDENTIALS; goto return_results; diff --git a/servers/slapd/back-ldbm/cache.c b/servers/slapd/back-ldbm/cache.c index b4477927d5..702a0f4532 100644 --- a/servers/slapd/back-ldbm/cache.c +++ b/servers/slapd/back-ldbm/cache.c @@ -128,30 +128,18 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw ) /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "cache_return_entry_rw: return (%ld):%s, refcnt=%d\n", - id, rw ? "w" : "r", refcnt ); -#else Debug( LDAP_DEBUG_TRACE, "====> cache_return_entry_%s( %ld ): created (%d)\n", rw ? "w" : "r", id, refcnt ); -#endif } else if ( LEI(e)->lei_state == CACHE_ENTRY_DELETED ) { if( refcnt > 0 ) { /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "cache_return_entry_rw: %ld, delete pending (%d).\n", - id, refcnt, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "====> cache_return_entry_%s( %ld ): delete pending (%d)\n", rw ? "w" : "r", id, refcnt ); -#endif } else { cache_entry_private_destroy( e ); @@ -162,29 +150,18 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw ) /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "cache_return_entry_rw: (%ld): deleted (%d)\n", id, refcnt, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "====> cache_return_entry_%s( %ld ): deleted (%d)\n", rw ? "w" : "r", id, refcnt ); -#endif } } else { /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "cache_return_entry_rw: ID %ld:%s returned (%d)\n", - id, rw ? "w": "r", refcnt ); -#else Debug( LDAP_DEBUG_TRACE, "====> cache_return_entry_%s( %ld ): returned (%d)\n", rw ? "w" : "r", id, refcnt); -#endif } } @@ -229,11 +206,6 @@ cache_add_entry_rw( int i, rc; Entry *ee; -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, ENTRY, - "cache_add_entry_rw: add (%s):%s to cache\n", - e->e_dn, rw ? "w" : "r", 0 ); -#endif /* set cache mutex */ ldap_pvt_thread_mutex_lock( &cache->c_mutex ); @@ -243,15 +215,9 @@ cache_add_entry_rw( /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, ERR, - "cache_add_entry_rw: add (%s):%ld private init failed!\n", - e->e_dn, e->e_id, 0 ); -#else Debug( LDAP_DEBUG_ANY, "====> cache_add_entry( %ld ): \"%s\": private init failed!\n", e->e_id, e->e_dn, 0 ); -#endif return( -1 ); } @@ -262,15 +228,9 @@ cache_add_entry_rw( /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "cache_add_entry: (%s):%ld already in cache.\n", - e->e_dn, e->e_id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "====> cache_add_entry( %ld ): \"%s\": already in dn cache\n", e->e_id, e->e_dn, 0 ); -#endif cache_entry_private_destroy(e); @@ -281,28 +241,16 @@ cache_add_entry_rw( if ( avl_insert( &cache->c_idtree, (caddr_t) e, entry_id_cmp, avl_dup_error ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "cache_add_entry: (%s):%ls already in cache.\n", - e->e_dn, e->e_id, 0 ); -#else Debug( LDAP_DEBUG_ANY, "====> cache_add_entry( %ld ): \"%s\": already in id cache\n", e->e_id, e->e_dn, 0 ); -#endif /* delete from dn tree inserted above */ if ( avl_delete( &cache->c_dntree, (caddr_t) e, entry_dn_cmp ) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, INFO, - "cache_add_entry: can't delete (%s) from cache.\n", - e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "====> can't delete from dn cache\n", 0, 0, 0 ); -#endif } cache_entry_private_destroy(e); @@ -383,15 +331,9 @@ cache_update_entry( if ( avl_insert( &cache->c_dntree, (caddr_t) e, entry_dn_cmp, avl_dup_error ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "cache_update_entry: (%s):%ld already in dn cache\n", - e->e_dn, e->e_id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "====> cache_update_entry( %ld ): \"%s\": already in dn cache\n", e->e_id, e->e_dn, 0 ); -#endif /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); @@ -402,28 +344,16 @@ cache_update_entry( if ( avl_insert( &cache->c_idtree, (caddr_t) e, entry_id_cmp, avl_dup_error ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "cache_update_entry: (%s)%ld already in id cache\n", - e->e_dn, e->e_id, 0 ); -#else Debug( LDAP_DEBUG_ANY, "====> cache_update_entry( %ld ): \"%s\": already in id cache\n", e->e_id, e->e_dn, 0 ); -#endif /* delete from dn tree inserted above */ if ( avl_delete( &cache->c_dntree, (caddr_t) e, entry_dn_cmp ) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, INFO, - "cache_update_entry: can't delete (%s)%ld from dn cache.\n", - e->e_dn, e->e_id, 0 ); -#else Debug( LDAP_DEBUG_ANY, "====> can't delete from dn cache\n", 0, 0, 0 ); -#endif } /* free cache mutex */ @@ -522,15 +452,9 @@ try_again: /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, INFO, - "cache_find_entry_ndn2id: (%s) %ld not ready: %d\n", - ndn->bv_val, id, state ); -#else Debug(LDAP_DEBUG_TRACE, "====> cache_find_entry_ndn2id(\"%s\"): %ld (not ready) %d\n", ndn->bv_val, id, state); -#endif ldap_pvt_thread_yield(); goto try_again; @@ -543,15 +467,9 @@ try_again: /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "cache_find_entry_ndn2id: (%s): %ld %d tries\n", - ndn->bv_val, id, count ); -#else Debug(LDAP_DEBUG_TRACE, "====> cache_find_entry_ndn2id(\"%s\"): %ld (%d tries)\n", ndn->bv_val, id, count); -#endif } else { /* free cache mutex */ @@ -605,16 +523,9 @@ try_again: /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, INFO, - "cache_find_entry_id: (%ld)->%ld not ready (%d).\n", - id, ep_id, state ); - -#else Debug(LDAP_DEBUG_TRACE, "====> cache_find_entry_id( %ld ): %ld (not ready) %d\n", id, ep_id, state); -#endif ldap_pvt_thread_yield(); goto try_again; @@ -629,15 +540,9 @@ try_again: /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "cache_find_entry_id: %ld -> %s found %d tries.\n", - ep_id, ep->e_dn, count ); -#else Debug(LDAP_DEBUG_TRACE, "====> cache_find_entry_id( %ld ) \"%s\" (found) (%d tries)\n", ep_id, ep->e_dn, count); -#endif return( ep ); } @@ -672,13 +577,8 @@ cache_delete_entry( assert( e->e_private ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, ENTRY, - "cache_delete_entry: delete %ld.\n", e->e_id, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "====> cache_delete_entry( %ld )\n", e->e_id, 0, 0 ); -#endif rc = cache_delete_entry_internal( cache, e ); @@ -732,11 +632,7 @@ cache_release_all( Cache *cache ) /* set cache mutex */ ldap_pvt_thread_mutex_lock( &cache->c_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, ENTRY, "cache_release_all: enter\n" , 0, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "====> cache_release_all\n", 0, 0, 0 ); -#endif while ( (e = cache->c_lrutail) != NULL && LEI(e)->lei_refcnt == 0 ) { @@ -748,12 +644,7 @@ cache_release_all( Cache *cache ) } if ( cache->c_cursize ) { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, INFO, - "cache_release_all: Entry cache could not be emptied.\n", 0, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "Entry-cache could not be emptied\n", 0, 0, 0 ); -#endif } /* free cache mutex */ diff --git a/servers/slapd/back-ldbm/close.c b/servers/slapd/back-ldbm/close.c index 35f367204e..67d8965baa 100644 --- a/servers/slapd/back-ldbm/close.c +++ b/servers/slapd/back-ldbm/close.c @@ -32,20 +32,10 @@ ldbm_back_db_close( Backend *be ) li->li_dbshutdown++; ldap_pvt_thread_join( li->li_dbsynctid, (void *) NULL ); } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, CRIT, - "ldbm_back_db_close: ldbm backend syncing\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm backend syncing\n", 0, 0, 0 ); -#endif ldbm_cache_flush_all( be ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, CRIT, - "ldbm_back_db_close: ldbm backend synch'ed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm backend done syncing\n", 0, 0, 0 ); -#endif cache_release_all( &((struct ldbminfo *) be->be_private)->li_cache ); diff --git a/servers/slapd/back-ldbm/compare.c b/servers/slapd/back-ldbm/compare.c index 43465aacf3..936d26c244 100644 --- a/servers/slapd/back-ldbm/compare.c +++ b/servers/slapd/back-ldbm/compare.c @@ -68,13 +68,8 @@ ldbm_back_compare( /* entry is a referral, don't allow add */ rs->sr_ref = get_entry_referrals( op, e ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_compare: entry (%s) is a referral.\n", e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL; diff --git a/servers/slapd/back-ldbm/config.c b/servers/slapd/back-ldbm/config.c index 7b55450c1f..cf92272b74 100644 --- a/servers/slapd/back-ldbm/config.c +++ b/servers/slapd/back-ldbm/config.c @@ -115,32 +115,18 @@ ldbm_back_db_config( #ifndef NO_THREADS int i; if ( argc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, ERR, "ldbm_back_db_config: %s: " - "line %d: missing frequency value in \"dbsync " - "[ [wait-interval]]\" line\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing frquency value in \"dbsync [ [wait-interval]]\" line\n", fname, lineno, 0 ); -#endif return 1; } i = atoi( argv[1] ); if( i < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, ERR, - "ldbm_back_db_config: %s: " - "line %d: frequency value (%d) invalid \"dbsync " - " [ [wait-interval]]\" line\n", - fname, lineno, i ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: frquency value (%d) invalid \"dbsync [ [wait-interval]]\" line\n", fname, lineno, i ); -#endif return 1; } @@ -149,16 +135,9 @@ ldbm_back_db_config( if ( argc > 2 ) { i = atoi( argv[2] ); if ( i < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG,ERR, "ldbm_back_db_config: %s: " - "line %d: frequency value (%d) invalid \"dbsync " - " [ [wait-interval]]\" line\n", - fname, lineno, i ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: frquency value (%d) invalid \"dbsync [ [wait-interval]]\" line\n", fname, lineno, i ); -#endif return 1; } li ->li_dbsyncwaitn = i; @@ -167,16 +146,9 @@ ldbm_back_db_config( if ( argc > 3 ) { i = atoi( argv[3] ); if ( i <= 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG,ERR, "ldbm_back_db_config: %s: " - "line %d: frequency value (%d) invalid \"dbsync " - " [ [wait-interval]]\" line\n", - fname, lineno, i ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: frquency value (%d) invalid \"dbsync [ [wait-interval]]\" line\n", fname, lineno, i ); -#endif return 1; } li ->li_dbsyncwaitinterval = i; @@ -186,13 +158,8 @@ ldbm_back_db_config( li->li_dbwritesync = 0; #else -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, ERR, "ldbm_back_db_config: \"dbsync\"" - " policies not supported in non-threaded environments\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "\"dbsync\" policies not supported in non-threaded environments\n", 0, 0, 0); -#endif return 1; #endif diff --git a/servers/slapd/back-ldbm/dbcache.c b/servers/slapd/back-ldbm/dbcache.c index 04c21cf3f0..e8cce87234 100644 --- a/servers/slapd/back-ldbm/dbcache.c +++ b/servers/slapd/back-ldbm/dbcache.c @@ -62,13 +62,8 @@ ldbm_cache_open( flags |= LDBM_NOSYNC; } -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, ENTRY, - "ldbm_cache_open: \"%s\", %d, %o\n", buf, flags, li->li_mode ); -#else Debug( LDAP_DEBUG_TRACE, "=> ldbm_cache_open( \"%s\", %d, %o )\n", buf, flags, li->li_mode ); -#endif empty = MAXDBCACHE; @@ -109,13 +104,8 @@ ldbm_cache_open( break; } li->li_dbcache[i].dbc_refcnt++; -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "ldbm_cache_open: cache %d\n", i, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= ldbm_cache_open (cache %d)\n", i, 0, 0 ); -#endif ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex ); return( &li->li_dbcache[i] ); @@ -140,15 +130,9 @@ ldbm_cache_open( free( li->li_dbcache[i].dbc_name ); li->li_dbcache[i].dbc_name = NULL; } else { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, INFO, - "ldbm_cache_open: no unused db to close - waiting\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ldbm_cache_open no unused db to close - waiting\n", 0, 0, 0 ); -#endif ldap_pvt_thread_cond_wait( &li->li_dbcache_cv, &li->li_dbcache_mutex ); @@ -164,17 +148,10 @@ ldbm_cache_open( li->li_dbcachesize )) == NULL ) { int err = errno; -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, ERR, - "ldbm_cache_open: \"%s\" failed, errono=%d, reason=%s\n", - buf, err, err > -1 && err < sys_nerr ? sys_errlist[err] : - "unknown" ); -#else Debug( LDAP_DEBUG_TRACE, "<= ldbm_cache_open NULL \"%s\" errno=%d reason=\"%s\")\n", buf, err, err > -1 && err < sys_nerr ? sys_errlist[err] : "unknown" ); -#endif ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex ); return( NULL ); @@ -199,23 +176,12 @@ ldbm_cache_open( assert( li->li_dbcache[i].dbc_maxindirect < 256 ); -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, ARGS, - "ldbm_cache_open: blksize:%ld maxids:%d maxindirect:%d\n", - li->li_dbcache[i].dbc_blksize, li->li_dbcache[i].dbc_maxids, - li->li_dbcache[i].dbc_maxindirect ); -#else Debug( LDAP_DEBUG_ARGS, "ldbm_cache_open (blksize %ld) (maxids %d) (maxindirect %d)\n", li->li_dbcache[i].dbc_blksize, li->li_dbcache[i].dbc_maxids, li->li_dbcache[i].dbc_maxindirect ); -#endif -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, "<= ldbm_cache_open: (opened %d)\n", i, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= ldbm_cache_open (opened %d)\n", i, 0, 0 ); -#endif ldap_pvt_thread_mutex_init( &li->li_dbcache[i].dbc_write_mutex ); @@ -267,39 +233,21 @@ ldbm_cache_flush_all( Backend *be ) ldap_pvt_thread_mutex_lock( &li->li_dbcache_mutex ); for ( i = 0; i < MAXDBCACHE; i++ ) { if ( li->li_dbcache[i].dbc_name != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "ldbm_cache_flush_all: flushing db (%s)\n", - li->li_dbcache[i].dbc_name, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm flushing db (%s)\n", li->li_dbcache[i].dbc_name, 0, 0 ); -#endif ldbm_sync( li->li_dbcache[i].dbc_db ); li->li_dbcache[i].dbc_dirty = 0; if ( li->li_dbcache[i].dbc_refcnt != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, INFO, - "ldbm_cache_flush_all: couldn't close db (%s), refcnt=%d\n", - li->li_dbcache[i].dbc_name, li->li_dbcache[i].dbc_refcnt,0); -#else Debug( LDAP_DEBUG_TRACE, "refcnt = %d, couldn't close db (%s)\n", li->li_dbcache[i].dbc_refcnt, li->li_dbcache[i].dbc_name, 0 ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG( CACHE, DETAIL1, - "ldbm_cache_flush_all: ldbm closing db (%s)\n", - li->li_dbcache[i].dbc_name, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm closing db (%s)\n", li->li_dbcache[i].dbc_name, 0, 0 ); -#endif ldap_pvt_thread_cond_signal( &li->li_dbcache_cv ); ldbm_close( li->li_dbcache[i].dbc_db ); @@ -320,13 +268,8 @@ ldbm_cache_sync( Backend *be ) ldap_pvt_thread_mutex_lock( &li->li_dbcache_mutex ); for ( i = 0; i < MAXDBCACHE; i++ ) { if ( li->li_dbcache[i].dbc_name != NULL && li->li_dbcache[i].dbc_dirty ) { -#ifdef NEW_LOGGING - LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync: " - "ldbm syncing db (%s)\n", li->li_dbcache[i].dbc_name, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm syncing db (%s)\n", li->li_dbcache[i].dbc_name, 0, 0 ); -#endif ldbm_sync( li->li_dbcache[i].dbc_db ); li->li_dbcache[i].dbc_dirty = 0; } @@ -383,12 +326,7 @@ ldbm_cache_sync_daemon( Backend *be = (Backend *)be_ptr; struct ldbminfo *li = (struct ldbminfo *) be->be_private; -#ifdef NEW_LOGGING - LDAP_LOG ( CACHE, ARGS, "ldbm_cache_sync_daemon:" - " synchronizer starting for %s\n", li->li_directory, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "synchronizer starting for %s\n", li->li_directory, 0, 0 ); -#endif while (!li->li_dbshutdown) { int i = li->li_dbsyncwaitn; @@ -396,33 +334,18 @@ ldbm_cache_sync_daemon( sleep( li->li_dbsyncfreq ); while (i && ldap_pvt_thread_pool_backload(&connection_pool) != 0) { -#ifdef NEW_LOGGING - LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync_daemon:" - " delay syncing %s\n", li->li_directory, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "delay syncing %s\n", li->li_directory, 0, 0 ); -#endif sleep(li->li_dbsyncwaitinterval); i--; } if (!li->li_dbshutdown) { -#ifdef NEW_LOGGING - LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync_daemon:" - " syncing %s\n", li->li_directory, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "syncing %s\n", li->li_directory, 0, 0 ); -#endif ldbm_cache_sync( be ); } } -#ifdef NEW_LOGGING - LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync_daemon:" - " synchronizer stopping\n", 0, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "synchronizer stopping\n", 0, 0, 0 ); -#endif return NULL; } diff --git a/servers/slapd/back-ldbm/delete.c b/servers/slapd/back-ldbm/delete.c index 234b30a3ab..6199191855 100644 --- a/servers/slapd/back-ldbm/delete.c +++ b/servers/slapd/back-ldbm/delete.c @@ -39,11 +39,7 @@ ldbm_back_delete( AttributeDescription *children = slap_schema.si_ad_children; AttributeDescription *entry = slap_schema.si_ad_entry; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_delete: %s\n", op->o_req_dn.bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_delete: %s\n", op->o_req_dn.bv_val, 0, 0); -#endif /* grab giant lock for writing */ ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock); @@ -53,13 +49,8 @@ ldbm_back_delete( /* FIXME : dn2entry() should return non-glue entry */ if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_delete: no such object %s\n", op->o_req_dn.bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: no such object %s\n", op->o_req_dn.bv_val, 0, 0); -#endif if ( matched != NULL ) { rs->sr_matched = ch_strdup( matched->e_dn ); @@ -100,15 +91,9 @@ ldbm_back_delete( if ( ! access_allowed( op, e, entry, NULL, ACL_WRITE, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_delete: no write access to entry of (%s)\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_delete: no write access to entry\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, "no write access to entry" ); @@ -122,13 +107,8 @@ ldbm_back_delete( /* parent is an alias, don't allow add */ rs->sr_ref = get_entry_referrals( op, e ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_delete: entry (%s) is a referral.\n", e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL; rs->sr_matched = e->e_name.bv_val; @@ -142,13 +122,8 @@ ldbm_back_delete( } if ( has_children( op->o_bd, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_delete: (%s) is a non-leaf node.\n", op->o_req_dn.bv_val, 0,0); -#else Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: non leaf %s\n", op->o_req_dn.bv_val, 0, 0); -#endif send_ldap_error( op, rs, LDAP_NOT_ALLOWED_ON_NONLEAF, "subtree delete not supported" ); @@ -159,14 +134,9 @@ ldbm_back_delete( if( !be_issuffix( op->o_bd, &e->e_nname ) && (dnParent( &e->e_nname, &pdn ), pdn.bv_len) ) { if( (p = dn2entry_w( op->o_bd, &pdn, NULL )) == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_delete: parent of (%s) does not exist\n", op->o_req_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_delete: parent does not exist\n", 0, 0, 0); -#endif send_ldap_error( op, rs, LDAP_OTHER, "could not locate parent of entry" ); @@ -177,15 +147,9 @@ ldbm_back_delete( if ( ! access_allowed( op, p, children, NULL, ACL_WRITE, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_delete: no access to parent of (%s)\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_delete: no access to parent\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, "no write access to parent" ); @@ -205,15 +169,9 @@ ldbm_back_delete( /* check parent for "children" acl */ if ( ! rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_delete: no access " - "to parent of ("")\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_delete: no " "access to parent\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, "no write access to parent" ); @@ -221,15 +179,9 @@ ldbm_back_delete( } } else { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_delete: (%s) has no " - "parent & not a root.\n", op->o_ndn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_delete: no parent & " "not root\n", 0, 0, 0); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, @@ -241,14 +193,9 @@ ldbm_back_delete( /* delete from dn2id mapping */ if ( dn2id_delete( op->o_bd, &e->e_nname, e->e_id ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_delete: (%s) operations error\n", op->o_req_dn.bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: operations error %s\n", op->o_req_dn.bv_val, 0, 0); -#endif send_ldap_error( op, rs, LDAP_OTHER, "DN index delete failed" ); @@ -257,14 +204,9 @@ ldbm_back_delete( /* delete from disk and cache */ if ( id2entry_delete( op->o_bd, e ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_delete: (%s) operations error\n", op->o_req_dn.bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: operations error %s\n", op->o_req_dn.bv_val, 0, 0); -#endif send_ldap_error( op, rs, LDAP_OTHER, "entry delete failed" ); diff --git a/servers/slapd/back-ldbm/dn2id.c b/servers/slapd/back-ldbm/dn2id.c index 4166ad8af2..49ed98a994 100644 --- a/servers/slapd/back-ldbm/dn2id.c +++ b/servers/slapd/back-ldbm/dn2id.c @@ -38,23 +38,14 @@ dn2id_add( char *buf; struct berval ptr, pdn; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "dn2id_add: (%s):%ld\n", dn->bv_val, id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> dn2id_add( \"%s\", %ld )\n", dn->bv_val, id, 0 ); -#endif assert( id != NOID ); db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ); if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "dn2id_add: couldn't open/create dn2id%s\n", LDBM_SUFFIX, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Could not open/create dn2id%s\n", LDBM_SUFFIX, 0, 0 ); -#endif return( -1 ); } @@ -112,11 +103,7 @@ dn2id_add( free( buf ); ldbm_cache_close( be, db ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "dn2id_add: return %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= dn2id_add %d\n", rc, 0, 0 ); -#endif return( rc ); } @@ -133,36 +120,23 @@ dn2id( Datum key, data; unsigned char *tmp; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "dn2id: (%s)\n", dn->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn->bv_val, 0, 0 ); -#endif assert( idp ); /* first check the cache */ *idp = cache_find_entry_ndn2id( be, &li->li_cache, dn ); if ( *idp != NOID ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, "dn2id: (%s)%ld in cache.\n", dn, *idp, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld (in cache)\n", *idp, 0, 0 ); -#endif return( 0 ); } db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ); if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "dn2id: couldn't open dn2id%s\n", LDBM_SUFFIX, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= dn2id could not open dn2id%s\n", LDBM_SUFFIX, 0, 0 ); -#endif /* * return code !0 if ldbm cache open failed; * callers should handle this @@ -188,11 +162,7 @@ dn2id( free( key.dptr ); if ( data.dptr == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, "dn2id: (%s) NOID\n", dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= dn2id NOID\n", 0, 0, 0 ); -#endif *idp = NOID; return( 0 ); @@ -204,11 +174,7 @@ dn2id( ldbm_datum_free( db->dbc_db, data ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "dn2id: %ld\n", *idp, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld\n", *idp, 0, 0 ); -#endif return( 0 ); } @@ -225,11 +191,7 @@ dn2idl( Datum key; unsigned char *tmp; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "dn2idl: \"%c%s\"\n", prefix, dn->bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> dn2idl( \"%c%s\" )\n", prefix, dn->bv_val, 0 ); -#endif assert( idlp != NULL ); *idlp = NULL; @@ -241,13 +203,8 @@ dn2idl( db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ); if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "dn2idl: could not open dn2id%s\n", LDBM_SUFFIX, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= dn2idl could not open dn2id%s\n", LDBM_SUFFIX, 0, 0 ); -#endif return -1; } @@ -285,26 +242,16 @@ dn2id_delete( char *buf; struct berval ptr, pdn; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, - "dn2id_delete: (%s)%ld\n", dn->bv_val, id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> dn2id_delete( \"%s\", %ld )\n", dn->bv_val, id, 0 ); -#endif assert( id != NOID ); db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ); if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "dn2id_delete: couldn't open db2id%s\n", LDBM_SUFFIX, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= dn2id_delete could not open dn2id%s\n", LDBM_SUFFIX, 0, 0 ); -#endif return( -1 ); } @@ -356,11 +303,7 @@ dn2id_delete( ldbm_cache_close( be, db ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "dn2id_delete: return %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= dn2id_delete %d\n", rc, 0, 0 ); -#endif return( rc ); } @@ -382,13 +325,8 @@ dn2entry_rw( Entry *e = NULL; struct berval pdn; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, - "dn2entry_rw: %s entry %s\n", rw ? "w" : "r", dn->bv_val, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "dn2entry_%s: dn: \"%s\"\n", rw ? "w" : "r", dn->bv_val, 0); -#endif if( matched != NULL ) { @@ -408,15 +346,9 @@ dn2entry_rw( return( e ); } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "dn2entry_rw: no entry for valid id (%ld), dn (%s)\n", - id, dn->bv_val, 0 ); -#else Debug(LDAP_DEBUG_ANY, "dn2entry_%s: no entry for valid id (%ld), dn \"%s\"\n", rw ? "w" : "r", id, dn->bv_val); -#endif /* must have been deleted from underneath us */ /* treat as if NOID was found */ diff --git a/servers/slapd/back-ldbm/entry.c b/servers/slapd/back-ldbm/entry.c index f4d732d24d..1f89e890dc 100644 --- a/servers/slapd/back-ldbm/entry.c +++ b/servers/slapd/back-ldbm/entry.c @@ -77,82 +77,48 @@ int ldbm_back_entry_get( int rc; const char *at_name = at ? at->ad_cname.bv_val : "(null)"; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ARGS, - "ldbm_back_entry_get: ndn: \"%s\"\n", ndn->bv_val, 0, 0 ); - LDAP_LOG( BACK_LDBM, ARGS, - "ldbm_back_entry_get: oc: \"%s\", at: \"%s\"\n", - oc ? oc->soc_cname.bv_val : "(null)", at_name, 0); -#else Debug( LDAP_DEBUG_ARGS, "=> ldbm_back_entry_get: ndn: \"%s\"\n", ndn->bv_val, 0, 0 ); Debug( LDAP_DEBUG_ARGS, "=> ldbm_back_entry_get: oc: \"%s\", at: \"%s\"\n", oc ? oc->soc_cname.bv_val : "(null)", at_name, 0); -#endif /* don't grab the giant lock - our caller has already gotten it. */ /* can we find entry */ e = dn2entry_rw( op->o_bd, ndn, NULL, rw ); if (e == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_entry_get: cannot find entry (%s)\n", - ndn->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "=> ldbm_back_entry_get: cannot find entry: \"%s\"\n", ndn->bv_val, 0, 0 ); -#endif return LDAP_NO_SUCH_OBJECT; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_entry_get: found entry (%s)\n", - ndn->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "=> ldbm_back_entry_get: found entry: \"%s\"\n", ndn->bv_val, 0, 0 ); -#endif #ifdef BDB_ALIASES /* find attribute values */ if( is_entry_alias( e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_entry_get: entry (%s) is an alias\n", e->e_name.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_entry_get: entry is an alias\n", 0, 0, 0 ); -#endif rc = LDAP_ALIAS_PROBLEM; goto return_results; } #endif if( is_entry_referral( e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_entry_get: entry (%s) is a referral.\n", e->e_name.bv_val, 0, 0); -#else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_entry_get: entry is a referral\n", 0, 0, 0 ); -#endif rc = LDAP_REFERRAL; goto return_results; } if ( oc && !is_entry_objectclass( e, oc, 0 )) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_entry_get: failed to find objectClass.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_entry_get: failed to find objectClass\n", 0, 0, 0 ); -#endif rc = LDAP_NO_SUCH_ATTRIBUTE; goto return_results; } @@ -167,12 +133,8 @@ return_results: *ent = e; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_entry_get: rc=%d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_entry_get: rc=%d\n", rc, 0, 0 ); -#endif return(rc); } diff --git a/servers/slapd/back-ldbm/filterindex.c b/servers/slapd/back-ldbm/filterindex.c index 1b5d86b1cc..74311bb8ec 100644 --- a/servers/slapd/back-ldbm/filterindex.c +++ b/servers/slapd/back-ldbm/filterindex.c @@ -48,11 +48,7 @@ filter_candidates( char *sub = "SUBTREE"; ID_BLOCK *result; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "filter_candidates: enter\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> filter_candidates\n", 0, 0, 0 ); -#endif result = NULL; @@ -74,12 +70,7 @@ filter_candidates( break; case SLAPD_FILTER_DN_ONE: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "filter_candidates: DN ONE (%s)\n", f->f_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tDN ONE\n", 0, 0, 0 ); -#endif /* an error is treated as an empty list */ if ( dn2idl( op->o_bd, f->f_dn, DN_ONE_PREFIX, &result ) != 0 @@ -94,13 +85,8 @@ filter_candidates( sub = "CHILDREN"; #endif case SLAPD_FILTER_DN_SUBTREE: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "filter_candidates: DN %s (%s)\n", sub, f->f_dn, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tDN %s\n", sub, 0, 0 ); -#endif /* an error is treated as an empty list */ if ( dn2idl( op->o_bd, f->f_dn, DN_SUBTREE_PREFIX, &result ) != 0 @@ -111,100 +97,55 @@ filter_candidates( break; case LDAP_FILTER_PRESENT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "filter_candidates: Present (%s)\n", - f->f_desc->ad_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 ); -#endif result = presence_candidates( op, f->f_desc ); break; case LDAP_FILTER_EQUALITY: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "filter_candidates: EQUALITY (%s),(%s)\n", - f->f_ava->aa_desc->ad_cname.bv_val, - f->f_ava->aa_value.bv_val, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 ); -#endif result = equality_candidates( op, f->f_ava ); break; case LDAP_FILTER_APPROX: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "filter_candidates: APPROX (%s), (%s)\n", - f->f_ava->aa_desc->ad_cname.bv_val, - f->f_ava->aa_value.bv_val, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 ); -#endif result = approx_candidates( op, f->f_ava ); break; case LDAP_FILTER_SUBSTRINGS: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "filter_candidates: SUBSTRINGS\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 ); -#endif result = substring_candidates( op, f->f_sub ); break; case LDAP_FILTER_GE: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "filter_candidates: GE\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 ); -#endif result = presence_candidates( op, f->f_ava->aa_desc ); break; case LDAP_FILTER_LE: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "filter_candidates: LE\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 ); -#endif result = presence_candidates( op, f->f_ava->aa_desc ); break; case LDAP_FILTER_AND: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "filter_candidates: AND\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 ); -#endif result = list_candidates( op, f->f_and, LDAP_FILTER_AND ); break; case LDAP_FILTER_OR: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "filter_candidates: OR\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 ); -#endif result = list_candidates( op, f->f_or, LDAP_FILTER_OR ); break; case LDAP_FILTER_NOT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "filter_candidates: NOT\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 ); -#endif /* * As candidates lists may contain entries which do @@ -215,11 +156,7 @@ filter_candidates( result = idl_allids( op->o_bd ); break; default: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "filter_candidates: UNKNOWN\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "\tUNKNOWN\n", 0, 0, 0 ); -#endif /* unknown filters must not return NULL, to allow * extended filter processing to be done later. */ @@ -227,14 +164,8 @@ filter_candidates( break; } -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "filter_candidates: return %ld\n", - result ? ID_BLOCK_NIDS(result) : 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= filter_candidates %ld\n", result ? ID_BLOCK_NIDS(result) : 0, 0, 0 ); -#endif return( result ); } @@ -252,11 +183,7 @@ presence_candidates( slap_mask_t mask; struct berval prefix = {0, NULL}; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "presence_candidates: enter\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> presence_candidates\n", 0, 0, 0 ); -#endif idl = idl_allids( op->o_bd ); @@ -268,27 +195,18 @@ presence_candidates( &dbname, &mask, &prefix ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, - "presence_candidates: index_param returned %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= presence_candidates: index_param returned=%d\n", rc, 0, 0 ); -#endif return idl; } if( dbname == NULL ) { /* not indexed */ -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, "presence_candidates: not indexed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= presense_candidates: not indexed\n", 0, 0, 0 ); -#endif return idl; } @@ -296,15 +214,9 @@ presence_candidates( db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT ); if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, - "presence_candidates: db open failed (%s%s)\n", - dbname, LDBM_SUFFIX, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= presense_candidates db open failed (%s%s)\n", dbname, LDBM_SUFFIX, 0 ); -#endif return idl; } @@ -316,38 +228,23 @@ presence_candidates( rc = key_read( op->o_bd, db, &prefix, &idl ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "presence_candidates: key read failed (%d)\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= presense_candidates key read failed (%d)\n", rc, 0, 0 ); -#endif } else if( idl == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "presence_candidates: NULL\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= presense_candidates NULL\n", 0, 0, 0 ); -#endif } } ldbm_cache_close( op->o_bd, db ); -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "presence_candidates: return %ld\n", - idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= presence_candidates %ld\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#endif return( idl ); } @@ -368,11 +265,7 @@ equality_candidates( struct berval *keys = NULL; MatchingRule *mr; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "equality_candidates: enter\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> equality_candidates\n", 0, 0, 0 ); -#endif idl = idl_allids( op->o_bd ); @@ -381,27 +274,18 @@ equality_candidates( &dbname, &mask, &prefix ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "equality_candidates: index_param returned %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= equality_candidates: index_param returned=%d\n", rc, 0, 0 ); -#endif return idl; } if( dbname == NULL ) { /* not indexed */ -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, "equality_candidates: not indexed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= equality_candidates: not indexed\n", 0, 0, 0 ); -#endif return idl; } @@ -425,28 +309,17 @@ equality_candidates( &keys, op->o_tmpmemctx ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "equality_candidates: (%s%s) MR filter failed (%d\n", - dbname, LDBM_SUFFIX, rc ); -#else Debug( LDAP_DEBUG_TRACE, "<= equality_candidates: (%s%s) MR filter failed (%d)\n", dbname, LDBM_SUFFIX, rc ); -#endif return idl; } if( keys == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "equality_candidates: no keys (%s%s)\n", dbname, LDBM_SUFFIX, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= equality_candidates: no keys (%s%s)\n", dbname, LDBM_SUFFIX, 0 ); -#endif return idl; } @@ -454,14 +327,9 @@ equality_candidates( db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT ); if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, "equality_candidates: db open failed (%s%s)\n", - dbname, LDBM_SUFFIX, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= equality_candidates db open failed (%s%s)\n", dbname, LDBM_SUFFIX, 0 ); -#endif return idl; } @@ -475,14 +343,9 @@ equality_candidates( if( rc != LDAP_SUCCESS ) { idl_free( idl ); idl = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "equality_candidates: key read failed (%d)\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= equality_candidates key read failed (%d)\n", rc, 0, 0 ); -#endif break; } @@ -490,13 +353,9 @@ equality_candidates( if( tmp == NULL ) { idl_free( idl ); idl = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, "equality_candidates NULL\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= equality_candidates NULL\n", 0, 0, 0 ); -#endif break; } @@ -514,14 +373,8 @@ equality_candidates( ldbm_cache_close( op->o_bd, db ); -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "equality_candidates: return %ld\n", - idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= equality_candidates %ld\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#endif return( idl ); } @@ -542,11 +395,7 @@ approx_candidates( struct berval *keys = NULL; MatchingRule *mr; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "approx_candidates: enter\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> approx_candidates\n", 0, 0, 0 ); -#endif idl = idl_allids( op->o_bd ); @@ -555,27 +404,18 @@ approx_candidates( &dbname, &mask, &prefix ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "approx_candidates: index_param returned %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= approx_candidates: index_param returned=%d\n", rc, 0, 0 ); -#endif return idl; } if( dbname == NULL ) { /* not indexed */ -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, "approx_candidates: not indexed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= approx_candidates: not indexed\n", 0, 0, 0 ); -#endif return idl; } @@ -604,29 +444,17 @@ approx_candidates( &keys, op->o_tmpmemctx ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "approx_candidates: (%s%s) MR filter failed (%d)\n", - dbname, LDBM_SUFFIX, rc ); -#else Debug( LDAP_DEBUG_TRACE, "<= approx_candidates: (%s%s) MR filter failed (%d)\n", dbname, LDBM_SUFFIX, rc ); -#endif return idl; } if( keys == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, - "approx_candidates: no keys (%s%s)\n", - dbname, LDBM_SUFFIX, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= approx_candidates: no keys (%s%s)\n", dbname, LDBM_SUFFIX, 0 ); -#endif return idl; } @@ -634,15 +462,9 @@ approx_candidates( db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT ); if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "approx_candidates db open failed (%s%s)\n", - dbname, LDBM_SUFFIX, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= approx_candidates db open failed (%s%s)\n", dbname, LDBM_SUFFIX, 0 ); -#endif return idl; } @@ -656,13 +478,8 @@ approx_candidates( if( rc != LDAP_SUCCESS ) { idl_free( idl ); idl = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "approx_candidates: key read failed (%d)\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= approx_candidates key read failed (%d)\n", rc, 0, 0 ); -#endif break; } @@ -670,12 +487,8 @@ approx_candidates( if( tmp == NULL ) { idl_free( idl ); idl = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, "approx_candidates: NULL\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= approx_candidates NULL\n", 0, 0, 0 ); -#endif break; } @@ -692,14 +505,8 @@ approx_candidates( ldbm_cache_close( op->o_bd, db ); -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "approx_candidates: return %ld\n", - idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= approx_candidates %ld\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#endif return( idl ); } @@ -714,23 +521,15 @@ list_candidates( ID_BLOCK *idl, *tmp, *tmp2; Filter *f; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "list_candidates: 0x%x\n", ftype, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> list_candidates 0x%x\n", ftype, 0, 0 ); -#endif idl = NULL; for ( f = flist; f != NULL; f = f->f_next ) { if ( (tmp = filter_candidates( op, f )) == NULL && ftype == LDAP_FILTER_AND ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, "list_candidates: NULL\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= list_candidates NULL\n", 0, 0, 0 ); -#endif idl_free( idl ); return( NULL ); @@ -750,13 +549,8 @@ list_candidates( } } -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "list_candidates: return %ld\n", - idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= list_candidates %ld\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#endif return( idl ); } @@ -777,11 +571,7 @@ substring_candidates( struct berval *keys = NULL; MatchingRule *mr; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "substrings_candidates: enter\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> substrings_candidates\n", 0, 0, 0 ); -#endif idl = idl_allids( op->o_bd ); @@ -790,27 +580,18 @@ substring_candidates( &dbname, &mask, &prefix ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "substrings_candidates: index_param returned %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates: index_param returned=%d\n", rc, 0, 0 ); -#endif return idl; } if( dbname == NULL ) { /* not indexed */ -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, "substrings_candidates: not indexed\n", 0, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "<= substrings_candidates: not indexed\n", 0, 0, 0 ); -#endif return idl; } @@ -835,29 +616,17 @@ substring_candidates( &keys, op->o_tmpmemctx ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "substrings_candidates: (%s%s) MR filter failed (%d)\n", - dbname, LDBM_SUFFIX, rc ); -#else Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates: (%s%s) MR filter failed (%d)\n", dbname, LDBM_SUFFIX, rc ); -#endif return idl; } if( keys == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "substrings_candidates: (0x%04lx) no keys (%s%s)\n", - mask, dbname, LDBM_SUFFIX ); -#else Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates: (0x%04lx) no keys (%s%s)\n", mask, dbname, LDBM_SUFFIX ); -#endif return idl; } @@ -865,15 +634,9 @@ substring_candidates( db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT ); if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "substrings_candidates: db open failed (%s%s)\n", - dbname, LDBM_SUFFIX, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= substrings_candidates db open failed (%s%s)\n", dbname, LDBM_SUFFIX, 0 ); -#endif return idl; } @@ -887,13 +650,8 @@ substring_candidates( if( rc != LDAP_SUCCESS ) { idl_free( idl ); idl = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "substrings_candidates: key read failed (%d)\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates key read failed (%d)\n", rc, 0, 0 ); -#endif break; } @@ -901,12 +659,8 @@ substring_candidates( if( tmp == NULL ) { idl_free( idl ); idl = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, "substrings_candidates: NULL\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates NULL\n", 0, 0, 0 ); -#endif break; } @@ -923,14 +677,8 @@ substring_candidates( ldbm_cache_close( op->o_bd, db ); -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "substrings_candidates: return %ld\n", - idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates %ld\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#endif return( idl ); } diff --git a/servers/slapd/back-ldbm/id2children.c b/servers/slapd/back-ldbm/id2children.c index 0e6cc8934c..d9b24a6114 100644 --- a/servers/slapd/back-ldbm/id2children.c +++ b/servers/slapd/back-ldbm/id2children.c @@ -37,23 +37,14 @@ has_children( ldbm_datum_init( key ); -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "has_children: enter %ld\n", p->e_id, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> has_children( %ld )\n", p->e_id , 0, 0 ); -#endif if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "has_children: could not open \"dn2id%s\"\n", LDBM_SUFFIX, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= has_children -1 could not open \"dn2id%s\"\n", LDBM_SUFFIX, 0, 0 ); -#endif return( 0 ); } @@ -73,14 +64,8 @@ has_children( rc = 1; } -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, - "has_children: id (%ld) %s children.\n", - p->e_id, rc ? "has" : "doesn't have", 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= has_children( %ld ): %s\n", p->e_id, rc ? "yes" : "no", 0 ); -#endif return( rc ); } diff --git a/servers/slapd/back-ldbm/id2entry.c b/servers/slapd/back-ldbm/id2entry.c index 0f680fe460..f63de5be92 100644 --- a/servers/slapd/back-ldbm/id2entry.c +++ b/servers/slapd/back-ldbm/id2entry.c @@ -41,24 +41,14 @@ id2entry_add( Backend *be, Entry *e ) ldbm_datum_init( key ); ldbm_datum_init( data ); -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "id2entry_add: (%s)%ld\n", e->e_dn, e->e_id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> id2entry_add( %ld, \"%s\" )\n", e->e_id, e->e_dn, 0 ); -#endif if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "id2entry_add: could not open/create id2entry%s\n", - LDBM_SUFFIX, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry%s\n", LDBM_SUFFIX, 0, 0 ); -#endif return( -1 ); } @@ -83,11 +73,7 @@ id2entry_add( Backend *be, Entry *e ) ldbm_cache_close( be, db ); -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "id2entry_add: return %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= id2entry_add %d\n", rc, 0, 0 ); -#endif return( rc ); @@ -104,12 +90,8 @@ id2entry_delete( Backend *be, Entry *e ) ID id; #endif -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "id2entry_delete: (%s)%ld\n", e->e_dn, e->e_id, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "=> id2entry_delete( %ld, \"%s\" )\n", e->e_id, e->e_dn, 0 ); -#endif #ifdef notdef @@ -123,27 +105,15 @@ id2entry_delete( Backend *be, Entry *e ) if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "id2entry_delete: could not open/create id2entry%s\n", - LDBM_SUFFIX, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry%s\n", LDBM_SUFFIX, 0, 0 ); -#endif return( -1 ); } if ( cache_delete_entry( &li->li_cache, e ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "id2entry_delete: Could not delete (%s)%ld from cache\n", - e->e_dn, e->e_id, 0 ); -#else Debug(LDAP_DEBUG_ANY, "could not delete %ld (%s) from cache\n", e->e_id, e->e_dn, 0 ); -#endif } @@ -159,11 +129,7 @@ id2entry_delete( Backend *be, Entry *e ) ldbm_cache_close( be, db ); -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "id2entry_delete: return %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= id2entry_delete %d\n", rc, 0, 0 ); -#endif return( rc ); } @@ -183,37 +149,21 @@ id2entry_rw( Backend *be, ID id, int rw ) ldbm_datum_init( key ); ldbm_datum_init( data ); -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, - "id2entry_rw: %s (%ld)\n", rw ? "write" : "read", id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> id2entry_%s( %ld )\n", rw ? "w" : "r", id, 0 ); -#endif if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, DETAIL1, - "id2entry_rw: %s (%ld) 0x%lx (cache).\n", - rw ? "write" : "read", id, (unsigned long)e ); -#else Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (cache)\n", rw ? "w" : "r", id, (unsigned long) e ); -#endif return( e ); } if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "id2entry_rw: could not open id2entry%s\n", LDBM_SUFFIX, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Could not open id2entry%s\n", LDBM_SUFFIX, 0, 0 ); -#endif return( NULL ); } @@ -229,13 +179,8 @@ id2entry_rw( Backend *be, ID id, int rw ) data = ldbm_cache_fetch( db, key ); if ( data.dptr == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "id2entry_rw: (%ld) not found\n", id, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) not found\n", rw ? "w" : "r", id, 0 ); -#endif ldbm_cache_close( be, db ); return( NULL ); @@ -246,13 +191,8 @@ id2entry_rw( Backend *be, ID id, int rw ) ldbm_cache_close( be, db ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "id2entry_rw: %s of %ld failed\n", rw ? "write" : "read", id, 0); -#else Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) (failed)\n", rw ? "w" : "r", id, 0 ); -#endif return( NULL ); } @@ -269,38 +209,20 @@ id2entry_rw( Backend *be, ID id, int rw ) * There are many underlying race condtions in the cache/disk code. */ if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, DETAIL1, - "id2entry_rw: %s of %ld 0x%lx (cache)\n", - rw ? "write" : "read", id, (unsigned long)e ); -#else Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (cache)\n", rw ? "w" : "r", id, (unsigned long) e ); -#endif return( e ); } -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "id2entry_rw: %s of %ld (cache add failed)\n", - rw ? "write" : "read", id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) (cache add failed)\n", rw ? "w" : "r", id, 0 ); -#endif return NULL; } -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, - "id2entry_rw: %s of %ld 0x%lx (disk)\n", - rw ? "write" : "read", id, (unsigned long)e ); -#else Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (disk)\n", rw ? "w" : "r", id, (unsigned long) e ); -#endif if ( slapMode == SLAP_SERVER_MODE ) { /* marks the entry as committed, so it will get added to the cache diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index f19ece31d0..a5725c7220 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -124,13 +124,9 @@ void idl_free( ID_BLOCK *idl ) { if ( idl == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, INFO, "idl_free: called with NULL pointer\n" , 0,0,0); -#else Debug( LDAP_DEBUG_TRACE, "idl_free: called with NULL pointer\n", 0, 0, 0 ); -#endif return; } @@ -231,13 +227,8 @@ idl_fetch( cont_id( &data, ID_BLOCK_ID(idl, i) ); if ( (tmp[i] = idl_fetch_one( be, db, data )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, INFO, - "idl_fetch: idl_fetch_one returned NULL\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_ANY, "idl_fetch: one returned NULL\n", 0, 0, 0 ); -#endif continue; } @@ -274,14 +265,8 @@ idl_fetch( idl_check(idl); #endif -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, - "idl_fetch: %ld ids (%ld max)\n", - ID_BLOCK_NIDS(idl), ID_BLOCK_NMAXN(idl), 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= idl_fetch %ld ids (%ld max)\n", ID_BLOCK_NIDS(idl), ID_BLOCK_NMAXN(idl), 0 ); -#endif return( idl ); } @@ -418,14 +403,9 @@ idl_change_first( /* delete old key block */ if ( (rc = ldbm_cache_delete( db, bkey )) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, INFO, - "idl_change_first: ldbm_cache_delete returned %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "idl_change_first: ldbm_cache_delete returned %d\n", rc, 0, 0 ); -#endif return( rc ); } @@ -434,13 +414,8 @@ idl_change_first( cont_id( &bkey, ID_BLOCK_ID(b, 0) ); if ( (rc = idl_store( be, db, bkey, b )) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, INFO, - "idl_change_first: idl_store returned %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "idl_change_first: idl_store returned %d\n", rc, 0, 0 ); -#endif return( rc ); } @@ -448,13 +423,8 @@ idl_change_first( /* update + write indirect header block */ ID_BLOCK_ID(h, pos) = ID_BLOCK_ID(b, 0); if ( (rc = idl_store( be, db, hkey, h )) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, INFO, - "idl_change_first: idl_store returned %s\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "idl_change_first: idl_store returned %d\n", rc, 0, 0 ); -#endif return( rc ); } @@ -586,13 +556,8 @@ idl_insert_key( cont_id( &k2, ID_BLOCK_ID(idl, i) ); if ( (tmp = idl_fetch_one( be, db, k2 )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "idl_insert_key: nonexistent continuation block\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "idl_insert_key: nonexistent continuation block\n", 0, 0, 0 ); -#endif cont_free( &k2 ); idl_free( idl ); @@ -603,13 +568,8 @@ idl_insert_key( switch ( idl_insert( &tmp, id, db->dbc_maxids ) ) { case 0: /* id inserted ok */ if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "ids_insert_key: idl_store returned %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "idl_insert_key: idl_store returned %d\n", rc, 0, 0 ); -#endif } break; @@ -647,14 +607,9 @@ idl_insert_key( cont_alloc( &k3, &key ); cont_id( &k3, ID_BLOCK_ID(idl, i + 1) ); if ( (tmp2 = idl_fetch_one( be, db, k3 )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "idl_insert_key: idl_fetch_one returned NULL\n", 0, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "idl_insert_key: idl_fetch_one returned NULL\n", 0, 0, 0 ); -#endif /* split the original block */ cont_free( &k3 ); @@ -676,13 +631,8 @@ idl_insert_key( rc = idl_insert( &tmp, id, db->dbc_maxids ); if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "idl_insert_key: idl_store returned %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "idl_insert_key: idl_store returned %d\n", rc, 0, 0 ); -#endif } @@ -707,15 +657,9 @@ idl_insert_key( * will always be called. */ if ( rc == 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, INFO, - "idl_insert_key: id %ld is already in next block\n", - id, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "idl_insert_key: id %ld already in next block\n", id, 0, 0 ); -#endif } @@ -968,13 +912,8 @@ idl_delete_key ( cont_id( &data, ID_BLOCK_ID(idl, j) ); if ( (tmp = idl_fetch_one( be, db, data )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, INFO, - "idl_delete_key: idl_fetch_one returned NULL\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "idl_delete_key: idl_fetch of returned NULL\n", 0, 0, 0 ); -#endif continue; } diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 90911d36ad..a0406fa3ec 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -173,14 +173,9 @@ static int indexer( db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT ); if ( db == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ERR, - "index_read: Could not open db %s%s\n", dbname, LDBM_SUFFIX, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= index_read NULL (could not open %s%s)\n", dbname, LDBM_SUFFIX, 0 ); -#endif return LDAP_OTHER; } @@ -312,15 +307,9 @@ index_entry( Entry *e ) { Attribute *ap = e->e_attrs; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, - "index_entry: %s (%s)%ld\n", opid == SLAP_INDEX_ADD_OP ? "add" : "del", - e->e_dn, e->e_id ); -#else Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n", opid == SLAP_INDEX_ADD_OP ? "add" : "del", e->e_id, e->e_dn ); -#endif /* add each attribute to the indexes */ for ( ; ap != NULL; ap = ap->a_next ) { @@ -329,13 +318,9 @@ index_entry( e->e_id, opid ); } -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n", opid == SLAP_INDEX_ADD_OP ? "add" : "del", e->e_id, e->e_dn ); -#endif return LDAP_SUCCESS; } diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index eb5a5afc58..4e18fcf78a 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -219,13 +219,8 @@ ldbm_back_db_open( if ( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( BACK_LDBM, ERR, "ldbm_back_db_open: sync " - "ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "sync ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 ); -#endif return 1; } } diff --git a/servers/slapd/back-ldbm/key.c b/servers/slapd/back-ldbm/key.c index bff334441f..1dd8aa4fa0 100644 --- a/servers/slapd/back-ldbm/key.c +++ b/servers/slapd/back-ldbm/key.c @@ -36,11 +36,7 @@ key_read( Datum key; ID_BLOCK *idl; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "key_read: enter\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 ); -#endif ldbm_datum_init( key ); @@ -49,13 +45,8 @@ key_read( idl = idl_fetch( be, db, key ); -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, - "key_read: %ld candidates\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= index_read %ld candidates\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); -#endif *idout = idl; @@ -75,13 +66,8 @@ key_change( int rc; Datum key; -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "key_change: %s ID %lx\n", - op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long)id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> key_change(%s,%lx)\n", op == SLAP_INDEX_ADD_OP ? "ADD":"DELETE", (long) id, 0 ); -#endif ldbm_datum_init( key ); @@ -100,11 +86,7 @@ key_change( ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( INDEX, ENTRY, "key_change: return %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= key_change %d\n", rc, 0, 0 ); -#endif ldap_pvt_thread_yield(); diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 3382356e5a..4f9a79706a 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -45,19 +45,11 @@ int ldbm_modify_internal( Attribute *save_attrs; Attribute *ap; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, - "ldbm_modify_internal: %s\n", - e->e_name.bv_val, - get_permissiveModify(op) ? " (permissive)" : "", - 0 ); -#else Debug(LDAP_DEBUG_TRACE, "ldbm_modify_internal: %s\n", e->e_name.bv_val, get_permissiveModify(op) ? " (permissive)" : "", 0 ); -#endif if ( !acl_check_modlist( op, e, modlist )) { return LDAP_INSUFFICIENT_ACCESS; @@ -71,102 +63,57 @@ int ldbm_modify_internal( switch ( mod->sm_op ) { case LDAP_MOD_ADD: -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_modify_internal: add\n", 0, 0, 0); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: add\n", 0, 0, 0); -#endif rc = modify_add_values( e, mod, get_permissiveModify( op ), text, textbuf, textlen ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", rc, *text, 0); -#endif } break; case LDAP_MOD_DELETE: -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_modify_internal: delete\n", 0,0,0); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: delete\n", 0, 0, 0); -#endif rc = modify_delete_values( e, mod, get_permissiveModify( op ), text, textbuf, textlen ); assert( rc != LDAP_TYPE_OR_VALUE_EXISTS ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", rc, *text, 0); -#endif } break; case LDAP_MOD_REPLACE: -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_modify_internal: replace\n",0,0,0); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: replace\n", 0, 0, 0); -#endif rc = modify_replace_values( e, mod, get_permissiveModify( op ), text, textbuf, textlen ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", rc, *text, 0); -#endif } break; case LDAP_MOD_INCREMENT: -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_modify_internal: increment\n",0,0,0); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: increment\n",0,0,0); -#endif rc = modify_increment_values( e, mod, get_permissiveModify( op ), text, textbuf, textlen ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", rc, *text, 0); -#endif } break; case SLAP_MOD_SOFTADD: -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_modify_internal: softadd\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: softadd\n", 0, 0, 0); -#endif /* Avoid problems in index_add_mods() * We need to add index if necessary. @@ -181,34 +128,19 @@ int ldbm_modify_internal( } if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", rc, *text, 0); -#endif } break; default: -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_modify_internal: invalid op %d\n", mod->sm_op, 0, 0 ); -#else Debug(LDAP_DEBUG_ANY, "ldbm_modify_internal: invalid op %d\n", mod->sm_op, 0, 0); -#endif rc = LDAP_OTHER; *text = "Invalid modify operation"; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_modify_internal: %d (%s)\n", rc, *text, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n", rc, *text, 0); -#endif } if ( rc != LDAP_SUCCESS ) { @@ -235,14 +167,8 @@ int ldbm_modify_internal( rc = entry_schema_check( op->o_bd, e, save_attrs, text, textbuf, textlen ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_modify_internal: entry failed schema check: %s\n", - *text, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "entry failed schema check: %s\n", *text, 0, 0 ); -#endif goto exit; } @@ -262,15 +188,9 @@ int ldbm_modify_internal( ap->a_nvals, e->e_id, SLAP_INDEX_DELETE_OP ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_modify_internal: Attribute index delete failure\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ldbm_modify_internal: Attribute index delete failure\n", 0, 0, 0 ); -#endif goto exit; } ap->a_flags &= ~SLAP_ATTR_IXDEL; @@ -284,15 +204,9 @@ int ldbm_modify_internal( ap->a_nvals, e->e_id, SLAP_INDEX_ADD_OP ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_modify_internal: Attribute index add failure\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ldbm_modify_internal: Attribute index add failure\n", 0, 0, 0 ); -#endif goto exit; } ap->a_flags &= ~SLAP_ATTR_IXADD; @@ -325,11 +239,7 @@ ldbm_back_modify( char textbuf[SLAP_TEXT_BUFLEN]; size_t textlen = sizeof textbuf; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_modify: enter\n", 0, 0, 0); -#else Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0); -#endif /* grab giant lock for writing */ ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock); @@ -379,13 +289,8 @@ ldbm_back_modify( /* parent is an alias, don't allow add */ rs->sr_ref = get_entry_referrals( op, e ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_modify: entry (%s) is referral\n", op->o_req_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL; rs->sr_matched = e->e_name.bv_val; diff --git a/servers/slapd/back-ldbm/modrdn.c b/servers/slapd/back-ldbm/modrdn.c index ccc7bf9233..a76c7874d3 100644 --- a/servers/slapd/back-ldbm/modrdn.c +++ b/servers/slapd/back-ldbm/modrdn.c @@ -63,18 +63,11 @@ ldbm_back_modrdn( Modifications *mod = NULL; /* Used to delete old/add new rdn */ int manageDSAit = get_manageDSAit( op ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, - "ldbm_back_modrdn: dn: %s newSuperior=%s\n", - op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "NULL", - ( op->oq_modrdn.rs_newSup && op->oq_modrdn.rs_newSup->bv_len ) ? op->oq_modrdn.rs_newSup->bv_val : "NULL",0 ); -#else Debug( LDAP_DEBUG_TRACE, "==>ldbm_back_modrdn: dn: %s newSuperior=%s\n", op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "NULL", ( op->oq_modrdn.rs_newSup && op->oq_modrdn.rs_newSup->bv_len ) ? op->oq_modrdn.rs_newSup->bv_val : "NULL", 0 ); -#endif /* grab giant lock for writing */ ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock); @@ -122,15 +115,9 @@ ldbm_back_modrdn( if ( ! access_allowed( op, e, entry, NULL, ACL_WRITE, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_modrdn: no write access to entry of (%s)\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_modrdn: no write access to entry\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, "no write access to entry" ); @@ -143,13 +130,8 @@ ldbm_back_modrdn( /* parent is an alias, don't allow add */ rs->sr_ref = get_entry_referrals( op, e ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_modrdn: entry %s is a referral\n", e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry %s is referral\n", e->e_dn, 0, 0 ); -#endif rs->sr_err = LDAP_REFERRAL; rs->sr_matched = e->e_name.bv_val; @@ -162,13 +144,8 @@ ldbm_back_modrdn( } if ( has_children( op->o_bd, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_modrdn: entry %s has children\n", e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry %s has children\n", e->e_dn, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_NOT_ALLOWED_ON_NONLEAF, "subtree rename not supported" ); @@ -187,14 +164,8 @@ ldbm_back_modrdn( */ if( (p = dn2entry_w( op->o_bd, &p_ndn, NULL )) == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_modrdn: parent of %s does not exist\n", - e->e_ndn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "parent does not exist\n", 0, 0, 0); -#endif send_ldap_error( op, rs, LDAP_OTHER, "parent entry does not exist" ); @@ -206,29 +177,17 @@ ldbm_back_modrdn( if ( ! access_allowed( op, p, children, NULL, ACL_WRITE, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_modrdn: no access to parent of (%s)\n", - e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, NULL ); goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_back_modrdn: wr to children of entry %s OK\n", - p_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: wr to children of entry %s OK\n", p_ndn.bv_val, 0, 0 ); -#endif if ( p_ndn.bv_val == slap_empty_bv.bv_val ) { p_dn = slap_empty_bv; @@ -236,13 +195,8 @@ ldbm_back_modrdn( dnParent( &e->e_name, &p_dn ); } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_back_modrdn: parent dn=%s\n", p_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: parent dn=%s\n", p_dn.bv_val, 0, 0 ); -#endif } else { /* no parent, must be root to modify rdn */ @@ -259,14 +213,9 @@ ldbm_back_modrdn( /* check parent for "children" acl */ if ( ! can_access ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_modrdn: no access to parent \"\"\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_modrdn: no " "access to parent\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, @@ -275,15 +224,9 @@ ldbm_back_modrdn( } } else { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_modrdn: (%s) has no parent & not a root.\n", - op->o_ndn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_modrdn: no parent & " "not root\n", 0, 0, 0); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, @@ -292,43 +235,26 @@ ldbm_back_modrdn( } } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_modrdn: (%s) no parent, locked root.\n", e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: no parent, locked root\n", 0, 0, 0 ); -#endif } new_parent_dn = &p_dn; /* New Parent unless newSuperior given */ if ( op->oq_modrdn.rs_newSup != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_back_modrdn: new parent \"%s\" requested\n", - op->oq_modrdn.rs_newSup->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: new parent \"%s\" requested...\n", op->oq_modrdn.rs_newSup->bv_val, 0, 0 ); -#endif np_ndn = op->oq_modrdn.rs_nnewSup; /* newSuperior == oldParent? */ if ( dn_match( &p_ndn, np_ndn ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, "ldbm_back_modrdn: " - "new parent\"%s\" seems to be the same as the " - "old parent \"%s\"\n", op->oq_modrdn.rs_newSup->bv_val, p_dn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: " "new parent\"%s\" seems to be the same as the " "old parent \"%s\"\n", op->oq_modrdn.rs_newSup->bv_val, p_dn.bv_val, 0 ); -#endif op->oq_modrdn.rs_newSup = NULL; /* ignore newSuperior */ } @@ -340,43 +266,26 @@ ldbm_back_modrdn( if ( op->oq_modrdn.rs_nnewSup->bv_len ) { if( (np = dn2entry_w( op->o_bd, np_ndn, NULL )) == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_modrdn: newSup(ndn=%s) not found.\n", - np_ndn->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: newSup(ndn=%s) not here!\n", np_ndn->bv_val, 0, 0); -#endif send_ldap_error( op, rs, LDAP_OTHER, "newSuperior not found" ); goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_back_modrdn: wr to new parent OK np=%p, id=%ld\n", - (void *) np, np->e_id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: wr to new parent OK np=%p, id=%ld\n", (void *) np, np->e_id, 0 ); -#endif /* check newSuperior for "children" acl */ if ( !access_allowed( op, np, children, NULL, ACL_WRITE, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_modrdn: no wr to newSup children.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: no wr to newSup children\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, NULL ); goto return_results; @@ -384,12 +293,7 @@ ldbm_back_modrdn( if ( is_entry_alias( np ) ) { /* parent is an alias, don't allow add */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_modrdn: entry (%s) is an alias.\n", np->e_dn,0,0); -#else Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_ALIAS_PROBLEM, @@ -400,14 +304,8 @@ ldbm_back_modrdn( if ( is_entry_referral( np ) ) { /* parent is a referral, don't allow add */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_back_modrdn: entry (%s) is a referral\n", - np->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry (%s) is referral\n", np->e_dn, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_OTHER, "newSuperior is a referral" ); @@ -434,15 +332,9 @@ ldbm_back_modrdn( /* check parent for "children" acl */ if ( ! can_access ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_modrdn: no access " - "to new superior \"\"\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_modrdn: no " "access to new superior\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, @@ -451,16 +343,10 @@ ldbm_back_modrdn( } } else { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ERR, - "ldbm_back_modrdn: \"\" not allowed as new superior\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_modrdn: \"\" " "not allowed as new superior\n", 0, 0, 0); -#endif send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, @@ -470,14 +356,9 @@ ldbm_back_modrdn( } } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_back_modrdn: wr to new parent's children OK.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: wr to new parent's children OK\n", 0, 0, 0 ); -#endif new_parent_dn = op->oq_modrdn.rs_newSup; } @@ -486,13 +367,8 @@ ldbm_back_modrdn( build_new_dn( &new_dn, new_parent_dn, &op->oq_modrdn.rs_newrdn, NULL ); dnNormalize( 0, NULL, NULL, &new_dn, &new_ndn, NULL ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_modrdn: new ndn=%s\n", - new_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: new ndn=%s\n", new_ndn.bv_val, 0, 0 ); -#endif /* check for abandon */ if ( op->o_abandon ) { @@ -506,14 +382,9 @@ ldbm_back_modrdn( goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, "ldbm_back_modrdn: new ndn (%s) does not exist\n", - new_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: new ndn=%s does not exist\n", new_ndn.bv_val, 0, 0 ); -#endif /* Get attribute type and attribute value of our new rdn, we will * need to add that to our new entry @@ -521,63 +392,37 @@ ldbm_back_modrdn( if ( ldap_bv2rdn( &op->oq_modrdn.rs_newrdn, &new_rdn, (char **)&rs->sr_text, LDAP_DN_FORMAT_LDAP ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "ldbm_back_modrdn: can't figure out " - "type(s)/values(s) of newrdn\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: can't figure out " "type(s)/values(s) of newrdn\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "unknown type(s) used in RDN" ); goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "ldbm_back_modrdn: new_rdn_type=\"%s\", " - "new_rdn_val=\"%s\"\n", - new_rdn[ 0 ]->la_attr.bv_val, - new_rdn[ 0 ]->la_value.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: new_rdn_type=\"%s\", " "new_rdn_val=\"%s\"\n", new_rdn[ 0 ]->la_attr.bv_val, new_rdn[ 0 ]->la_value.bv_val, 0 ); -#endif if ( op->oq_modrdn.rs_deleteoldrdn ) { if ( ldap_bv2rdn( &op->o_req_dn, &old_rdn, (char **)&rs->sr_text, LDAP_DN_FORMAT_LDAP ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "ldbm_back_modrdn: can't figure out " - "type(s)/values(s) of old_rdn\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: can't figure out " "the old_rdn type(s)/value(s)\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_OTHER, "cannot parse RDN from old DN" ); goto return_results; } } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_modrdn: DN_X500\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: DN_X500\n", 0, 0, 0 ); -#endif if ( slap_modrdn2mods( op, rs, e, old_rdn, new_rdn, &mod ) != LDAP_SUCCESS ) { send_ldap_result( op, rs ); diff --git a/servers/slapd/back-ldbm/nextid.c b/servers/slapd/back-ldbm/nextid.c index cb6707ca76..723276db8a 100644 --- a/servers/slapd/back-ldbm/nextid.c +++ b/servers/slapd/back-ldbm/nextid.c @@ -35,13 +35,8 @@ next_id_read( Backend *be, ID *idp ) if ( (db = ldbm_cache_open( be, "nextid", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, CRIT, - "next_id_read: could not open/create nextid%s\n", LDBM_SUFFIX, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Could not open/create nextid" LDBM_SUFFIX "\n", 0, 0, 0 ); -#endif return( -1 ); } @@ -74,13 +69,8 @@ next_id_write( Backend *be, ID id ) if ( (db = ldbm_cache_open( be, "nextid", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, CRIT, - "next_id_write: Could not open/create nextid%s\n", LDBM_SUFFIX, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Could not open/create nextid" LDBM_SUFFIX "\n", 0, 0, 0 ); -#endif return( -1 ); } diff --git a/servers/slapd/back-ldbm/referral.c b/servers/slapd/back-ldbm/referral.c index 4a9b7b2f1a..8f01f958dc 100644 --- a/servers/slapd/back-ldbm/referral.c +++ b/servers/slapd/back-ldbm/referral.c @@ -51,15 +51,9 @@ ldbm_back_referrals( if ( matched != NULL ) { rs->sr_matched = ch_strdup( matched->e_dn ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_back_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - op->o_tag, op->o_req_dn.bv_val, rs->sr_matched ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", op->o_tag, op->o_req_dn.bv_val, rs->sr_matched ); -#endif if( is_entry_referral( matched ) ) { rs->sr_err = LDAP_OTHER; @@ -99,15 +93,9 @@ ldbm_back_referrals( rs->sr_ref = referral_rewrite( refs, &e->e_name, &op->o_req_dn, LDAP_SCOPE_DEFAULT ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - op->o_tag, op->o_req_dn.bv_val, e->e_dn ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", op->o_tag, op->o_req_dn.bv_val, e->e_dn ); -#endif rs->sr_matched = e->e_name.bv_val; if( rs->sr_ref != NULL ) { diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index e9b5f5c44a..2b09370615 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -49,11 +49,7 @@ ldbm_back_search( struct berval realbase = BER_BVNULL; int manageDSAit = get_manageDSAit( op ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_search: enter\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "=> ldbm_back_search\n", 0, 0, 0); -#endif /* grab giant lock for reading */ ldap_pvt_thread_rdwr_rlock(&li->li_giant_rwlock); @@ -134,15 +130,9 @@ ldbm_back_search( cache_return_entry_r( &li->li_cache, e ); ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_search: entry (%s) is a referral.\n", - e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_search: entry is referral\n", 0, 0, 0 ); -#endif if( erefs ) { rs->sr_ref = referral_rewrite( erefs, &matched_dn, @@ -189,13 +179,8 @@ ldbm_back_search( searchit: if ( candidates == NULL ) { /* no candidates */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_search: no candidates\n" , 0, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_search: no candidates\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_SUCCESS; send_ldap_result( op, rs ); @@ -244,14 +229,9 @@ searchit: e = id2entry_r( op->o_bd, id ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_search: candidate %ld not found.\n", id, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_search: candidate %ld not found\n", id, 0, 0 ); -#endif goto loop_continue; } @@ -306,15 +286,9 @@ searchit: } else if ( dnIsSuffix( &e->e_nname, &realbase ) ) { /* alias is within scope */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "ldbm_search: alias \"%s\" in subtree\n", - e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_search: alias \"%s\" in subtree\n", e->e_dn, 0, 0 ); -#endif goto loop_continue; } @@ -375,15 +349,9 @@ searchit: rs->sr_ref = NULL; } else { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL2, - "ldbm_search: candidate referral %ld scope not okay\n", - id, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_search: candidate referral %ld scope not okay\n", id, 0, 0 ); -#endif } goto loop_continue; @@ -453,27 +421,15 @@ searchit: } } else { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL2, - "ldbm_search: candidate entry %ld scope not okay\n", - id, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_search: candidate entry %ld scope not okay\n", id, 0, 0 ); -#endif } } else { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL2, - "ldbm_search: candidate entry %ld does not match filter\n", - id, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ldbm_search: candidate entry %ld does not match filter\n", id, 0, 0 ); -#endif } loop_continue: @@ -510,12 +466,8 @@ base_candidate( { ID_BLOCK *idl; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "base_candidate: base (%s)\n", e->e_dn, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "base_candidates: base: \"%s\"\n", e->e_dn, 0, 0); -#endif idl = idl_alloc( 1 ); @@ -543,15 +495,9 @@ search_candidates( AttributeAssertion aa_subentry; #endif -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, DETAIL1, - "search_candidates: base (%s) scope %d deref %d\n", - e->e_ndn, scope, deref ); -#else Debug(LDAP_DEBUG_TRACE, "search_candidates: base=\"%s\" s=%d d=%d\n", e->e_ndn, scope, deref ); -#endif xf.f_or = filter; diff --git a/servers/slapd/back-ldbm/tools.c b/servers/slapd/back-ldbm/tools.c index d8d72acf57..2f0b42c830 100644 --- a/servers/slapd/back-ldbm/tools.c +++ b/servers/slapd/back-ldbm/tools.c @@ -55,13 +55,8 @@ int ldbm_tool_entry_open( if ( (id2entry = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, flags )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, CRIT, - "Could not open/create id2entry%s\n", LDBM_SUFFIX, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry" LDBM_SUFFIX "\n", 0, 0, 0 ); -#endif return( -1 ); } @@ -198,13 +193,8 @@ ID ldbm_tool_entry_put( e->e_id = li->li_nextid++; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, - "ldbm_tool_entry_put: (%s)%ld\n", e->e_dn, e->e_id ,0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> ldbm_tool_entry_put( %ld, \"%s\" )\n", e->e_id, e->e_dn, 0 ); -#endif if ( dn2id( be, &e->e_nname, &id ) ) { /* something bad happened to ldbm cache */ @@ -213,15 +203,9 @@ ID ldbm_tool_entry_put( } if( id != NOID ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, - "ldbm_tool_entry_put: \"%s\" already exists (id=%ld)\n", - e->e_dn, id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= ldbm_tool_entry_put: \"%s\" already exists (id=%ld)\n", e->e_ndn, id, 0 ); -#endif strncpy( text->bv_val, "already exists", text->bv_len ); return NOID; } @@ -276,27 +260,16 @@ int ldbm_tool_entry_reindex( Entry *e; Operation op = {0}; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_tool_entry_reindex: ID=%ld\n", - (long)id, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "=> ldbm_tool_entry_reindex( %ld )\n", (long) id, 0, 0 ); -#endif e = ldbm_tool_entry_get( be, id ); if( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, INFO, - "ldbm_tool_entry_reindex: could not locate id %ld\n", - (long)id, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ldbm_tool_entry_reindex:: could not locate id=%ld\n", (long) id, 0, 0 ); -#endif return -1; } @@ -308,13 +281,8 @@ int ldbm_tool_entry_reindex( * */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDBM, ENTRY, - "ldbm_tool_entry_reindex: (%s) %ld\n", e->e_dn, id, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> ldbm_tool_entry_reindex( %ld, \"%s\" )\n", id, e->e_dn, 0 ); -#endif dn2id_add( be, &e->e_nname, e->e_id ); diff --git a/servers/slapd/back-meta/add.c b/servers/slapd/back-meta/add.c index 02ef16770d..0de1f0ba89 100644 --- a/servers/slapd/back-meta/add.c +++ b/servers/slapd/back-meta/add.c @@ -43,13 +43,8 @@ meta_back_add( Operation *op, SlapReply *rs ) struct berval mdn = BER_BVNULL, mapped; dncookie dc; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, ENTRY, "meta_back_add: %s\n", - op->o_req_dn.bv_val, 0, 0 ); -#else /* !NEW_LOGGING */ Debug(LDAP_DEBUG_ARGS, "==> meta_back_add: %s\n", op->o_req_dn.bv_val, 0, 0 ); -#endif /* !NEW_LOGGING */ /* * get the current connection diff --git a/servers/slapd/back-meta/bind.c b/servers/slapd/back-meta/bind.c index d828ff0a62..c6aaa87cf3 100644 --- a/servers/slapd/back-meta/bind.c +++ b/servers/slapd/back-meta/bind.c @@ -54,13 +54,8 @@ meta_back_bind( Operation *op, SlapReply *rs ) rs->sr_err = LDAP_SUCCESS; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, ENTRY, "meta_back_bind: dn: %s.\n", - op->o_req_dn.bv_val, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "meta_back_bind: dn: %s.\n%s%s", op->o_req_dn.bv_val, "", "" ); -#endif /* !NEW_LOGGING */ if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op ) ) { isroot = 1; @@ -70,15 +65,9 @@ meta_back_bind( Operation *op, SlapReply *rs ) lc = meta_back_getconn( op, rs, op_type, &op->o_req_ndn, NULL ); if ( !lc ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, NOTICE, - "meta_back_bind: no target for dn %s.\n", - op->o_req_dn.bv_val, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "meta_back_bind: no target for dn %s.\n%s%s", op->o_req_dn.bv_val, "", ""); -#endif /* !NEW_LOGGING */ send_ldap_result( op, rs ); return -1; @@ -111,18 +100,11 @@ meta_back_bind( Operation *op, SlapReply *rs ) * A bind operation is expected to have * ONE CANDIDATE ONLY! */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, WARNING, - "==>meta_back_bind: more than one" - " candidate is attempting to bind" - " ...\n" , 0, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "==>meta_back_bind: more than one" " candidate is attempting to bind" " ...\n%s%s%s", "", "", "" ); -#endif /* !NEW_LOGGING */ } if ( isroot && li->targets[ i ]->pseudorootdn.bv_val != NULL ) { @@ -333,19 +315,11 @@ meta_back_dobind( struct metaconn *lc, Operation *op ) op->o_ctrls, NULL, NULL); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, WARNING, - "meta_back_dobind: (anonymous)" - " bind failed" - " with error %d (%s)\n", - rc, ldap_err2string( rc ), 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "==>meta_back_dobind: (anonymous)" " bind failed" " with error %d (%s)\n", rc, ldap_err2string( rc ), 0 ); -#endif /* !NEW_LOGGING */ /* * null cred bind should always succeed @@ -438,21 +412,12 @@ meta_back_op_result( struct metaconn *lc, Operation *op, SlapReply *rs ) LDAP_OPT_MATCHED_DN, &match ); rs->sr_err = slap_map_api2result( rs ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, RESULTS, - "meta_back_op_result: target" - " <%d> sending msg \"%s\"" - " (matched \"%s\")\n", - i, ( msg ? msg : "" ), - ( match ? match : "" ) ); -#else /* !NEW_LOGGING */ Debug(LDAP_DEBUG_ANY, "==> meta_back_op_result: target" " <%d> sending msg \"%s\"" " (matched \"%s\")\n", i, ( msg ? msg : "" ), ( match ? match : "" ) ); -#endif /* !NEW_LOGGING */ /* * FIXME: need to rewrite "match" (need rwinfo) diff --git a/servers/slapd/back-meta/conn.c b/servers/slapd/back-meta/conn.c index 9b8ba83b95..00f1d9e961 100644 --- a/servers/slapd/back-meta/conn.c +++ b/servers/slapd/back-meta/conn.c @@ -342,15 +342,9 @@ meta_back_getconn( return NULL; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, INFO, - "meta_back_getconn: got target %d for ndn=\"%s\" from cache\n", - i, ndn->bv_val, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_CACHE, "==>meta_back_getconn: got target %d for ndn=\"%s\" from cache\n%s", i, ndn->bv_val, "" ); -#endif /* !NEW_LOGGING */ /* * Clear all other candidates @@ -456,14 +450,9 @@ meta_back_getconn( ldap_pvt_thread_mutex_unlock( &li->conn_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, INFO, - "meta_back_getconn: conn %ld inserted\n", lc->conn->c_connid, 0, 0); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>meta_back_getconn: conn %ld inserted\n%s%s", lc->conn->c_connid, "", "" ); -#endif /* !NEW_LOGGING */ /* * Err could be -1 in case a duplicate metaconn is inserted @@ -475,14 +464,9 @@ meta_back_getconn( return NULL; } } else { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, INFO, - "meta_back_getconn: conn %ld fetched\n", lc->conn->c_connid, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>meta_back_getconn: conn %ld fetched\n%s%s", lc->conn->c_connid, "", "" ); -#endif /* !NEW_LOGGING */ } return lc; diff --git a/servers/slapd/back-meta/group.c b/servers/slapd/back-meta/group.c index 7c4f357814..c32bf61427 100644 --- a/servers/slapd/back-meta/group.c +++ b/servers/slapd/back-meta/group.c @@ -127,16 +127,10 @@ meta_back_group( } else { mop_ndn = *op_ndn; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "[rw] bindDn (op ndn in group): \"%s\" -> \"%s\"\n", - op_ndn->bv_val, mop_ndn.bv_val, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> bindDn (op ndn in group):" " \"%s\" -> \"%s\"\n%s", op_ndn->bv_val, mop_ndn.bv_val, "" ); -#endif /* !NEW_LOGGING */ break; case REWRITE_REGEXEC_UNWILLING: @@ -158,16 +152,10 @@ meta_back_group( } else { mgr_ndn = *gr_ndn; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "[rw] searchBase (gr ndn in group): \"%s\" -> \"%s\"\n", - gr_ndn->bv_val, mgr_ndn.bv_val, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> searchBase (gr ndn in group):" " \"%s\" -> \"%s\"\n%s", gr_ndn->bv_val, mgr_ndn.bv_val, "" ); -#endif /* !NEW_LOGGING */ break; case REWRITE_REGEXEC_UNWILLING: diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index b118680126..b3266084a4 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -438,17 +438,10 @@ new_candidate:; ldap_get_option( lsc->ld, LDAP_OPT_MATCHED_DN, &match.bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, ERR, - "meta_back_search [%d] " - "match=\"%s\" err=\"%s\"\n", - i, match.bv_val, err ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "=>meta_back_search [%d] " "match=\"%s\" err=\"%s\"\n", i, match.bv_val, err ); -#endif /* !NEW_LOGGING */ candidate_match++; last = i; rc = 0; @@ -618,14 +611,9 @@ meta_send_entry( != LDAP_SUCCESS) { if ( slap_bv2undef_ad( &mapped, &attr->a_desc, &text ) != LDAP_SUCCESS) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "slap_bv2undef_ad(%s): %s\n", mapped.bv_val, text, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "slap_bv2undef_ad(%s): " "%s\n%s", mapped.bv_val, text, "" ); -#endif /* !NEW_LOGGING */ ch_free( attr ); continue; } diff --git a/servers/slapd/back-meta/unbind.c b/servers/slapd/back-meta/unbind.c index f322956530..8f219c7640 100644 --- a/servers/slapd/back-meta/unbind.c +++ b/servers/slapd/back-meta/unbind.c @@ -40,14 +40,9 @@ meta_back_conn_destroy( struct metainfo *li = ( struct metainfo * )be->be_private; struct metaconn *lc, lc_curr; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, ENTRY, - "meta_back_conn_destroy: fetching conn %ld\n", conn->c_connid, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>meta_back_conn_destroy: fetching conn %ld\n%s%s", conn->c_connid, "", "" ); -#endif /* !NEW_LOGGING */ lc_curr.conn = conn; @@ -59,15 +54,9 @@ meta_back_conn_destroy( if ( lc ) { int i; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, INFO, - "meta_back_conn_destroy: destroying conn %ld\n", - lc->conn->c_connid, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>meta_back_conn_destroy: destroying conn %ld\n%s%s", lc->conn->c_connid, "", "" ); -#endif /* !NEW_LOGGING */ /* * Cleanup rewrite session diff --git a/servers/slapd/back-monitor/backend.c b/servers/slapd/back-monitor/backend.c index 3a65745f90..8b1fe4d1c9 100644 --- a/servers/slapd/back-monitor/backend.c +++ b/servers/slapd/back-monitor/backend.c @@ -46,18 +46,11 @@ monitor_subsys_backend_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn, &e_backend ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_backend_init: " - "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_backend_init: " "unable to get entry '%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -91,19 +84,12 @@ monitor_subsys_backend_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_backend_init: " - "unable to create entry 'cn=Backend %d,%s'\n", - i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_backend_init: " "unable to create entry 'cn=Backend %d,%s'\n%s", i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, "" ); -#endif return( -1 ); } @@ -152,19 +138,12 @@ monitor_subsys_backend_init( | MONITOR_F_SUB; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_backend_init: " - "unable to add entry 'cn=Backend %d,%s'\n", - i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_backend_init: " "unable to add entry 'cn=Backend %d,%s'\n%s", i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, "" ); -#endif return( -1 ); } diff --git a/servers/slapd/back-monitor/bind.c b/servers/slapd/back-monitor/bind.c index 995d0bcc47..304397f645 100644 --- a/servers/slapd/back-monitor/bind.c +++ b/servers/slapd/back-monitor/bind.c @@ -38,13 +38,8 @@ monitor_back_bind( Operation *op, SlapReply *rs ) = (struct monitorinfo *) op->o_bd->be_private; #endif -#ifdef NEW_LOGGING - LDAP_LOG( BACK_MON, ENTRY, "monitor_back_bind: dn: %s.\n", - op->o_req_dn.bv_val, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "==> monitor_back_bind: dn: %s\n", op->o_req_dn.bv_val, 0, 0 ); -#endif if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op ) ) { diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index 8c5a2a8cca..64076993fe 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -48,18 +48,11 @@ monitor_subsys_conn_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn, &e_conn ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_conn_init: " - "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_init: " "unable to get entry '%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -87,18 +80,11 @@ monitor_subsys_conn_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_conn_init: " - "unable to create entry 'cn=Total,%s'\n", - monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_init: " "unable to create entry 'cn=Total,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -116,18 +102,11 @@ monitor_subsys_conn_init( mp->mp_flags &= ~MONITOR_F_VOLATILE_CH; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_conn_init: " - "unable to add entry 'cn=Total,%s'\n", - monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_init: " "unable to add entry 'cn=Total,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -155,18 +134,11 @@ monitor_subsys_conn_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_conn_init: " - "unable to create entry 'cn=Current,%s'\n", - monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_init: " "unable to create entry 'cn=Current,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -184,18 +156,11 @@ monitor_subsys_conn_init( mp->mp_flags &= ~MONITOR_F_VOLATILE_CH; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_conn_init: " - "unable to add entry 'cn=Current,%s'\n", - monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_init: " "unable to add entry 'cn=Current,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -336,20 +301,12 @@ conn_create( e = str2entry( buf ); if ( e == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_conn_create: " - "unable to create entry " - "'cn=" CONN_CN_PREFIX " %ld,%s' entry\n", - c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_create: " "unable to create entry " "'cn=" CONN_CN_PREFIX " %ld,%s' entry\n", c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, 0 ); -#endif return( -1 ); } diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 0b25c306e1..ffe4308bc5 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -111,18 +111,11 @@ monitor_subsys_database_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn, &e_database ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_database_init: " - "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_database_init: " "unable to get entry '%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -175,19 +168,12 @@ monitor_subsys_database_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_database_init: " - "unable to create entry 'cn=Database %d,%s'\n", - i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_database_init: " "unable to create entry 'cn=Database %d,%s'\n%s", i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, "" ); -#endif return( -1 ); } @@ -273,19 +259,12 @@ monitor_subsys_database_init( | MONITOR_F_SUB; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_database_init: " - "unable to add entry 'cn=Database %d,%s'\n", - i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_database_init: " "unable to add entry 'cn=Database %d,%s'\n", i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 ); -#endif return( -1 ); } diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index 6a68be5401..0be50d800b 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -436,13 +436,8 @@ monitor_back_db_init( * database monitor can be defined once only */ if ( be_monitor ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "only one monitor backend is allowed\n", 0, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "only one monitor backend is allowed\n", 0, 0, 0 ); -#endif return( -1 ); } be_monitor = be; @@ -455,15 +450,9 @@ monitor_back_db_init( rc = dnNormalize( 0, NULL, NULL, &dn, &ndn, NULL ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "unable to normalize monitor DN \"%s\"\n", - SLAPD_MONITOR_DN, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "unable to normalize monitor DN \"%s\"\n", SLAPD_MONITOR_DN, 0, 0 ); -#endif return -1; } @@ -473,13 +462,8 @@ monitor_back_db_init( mi = ( struct monitorinfo * )ch_calloc( sizeof( struct monitorinfo ), 1 ); if ( mi == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "unable to initialize monitor backend\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "unable to initialize monitor backend\n", 0, 0, 0 ); -#endif return -1; } @@ -513,15 +497,9 @@ monitor_back_db_init( #endif /* INTEGRATE_CORE_SCHEMA */ default: -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_back_db_init: %s: %s\n", - mat_core[i].name, text, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: %s: %s\n", mat_core[i].name, text, 0 ); -#endif return( -1 ); } } @@ -536,42 +514,24 @@ monitor_back_db_init( at = ldap_str2attributetype( mat[i].schema, &code, &err, LDAP_SCHEMA_ALLOW_ALL ); if ( !at ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "monitor_back_db_init: " - "in AttributeType '%s' %s before %s\n", - mat[i].name, ldap_scherr2str(code), err ); -#else Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: " "in AttributeType '%s' %s before %s\n", mat[i].name, ldap_scherr2str(code), err ); -#endif return -1; } if ( at->at_oid == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "monitor_back_db_init: " - "null OID for attributeType '%s'\n", - mat[i].name, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: " "null OID for attributeType '%s'\n", mat[i].name, 0, 0 ); -#endif return -1; } code = at_add(at, &err); if ( code ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "monitor_back_db_init: " - "%s in attributeType '%s'\n", - scherr2str(code), mat[i].name, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: " "%s in attributeType '%s'\n", scherr2str(code), mat[i].name, 0 ); -#endif return -1; } ldap_memfree(at); @@ -579,13 +539,8 @@ monitor_back_db_init( ad = ((AttributeDescription **)&(((char *)mi)[mat[i].offset])); ad[0] = NULL; if ( slap_str2ad( mat[i].name, ad, &text ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_back_db_init: %s\n", text, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: %s\n", text, 0, 0 ); -#endif return -1; } @@ -601,44 +556,25 @@ monitor_back_db_init( oc = ldap_str2objectclass(moc[i].schema, &code, &err, LDAP_SCHEMA_ALLOW_ALL ); if ( !oc ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "unable to parse monitor objectclass '%s': " - "%s before %s\n" , moc[i].name, - ldap_scherr2str(code), err ); -#else Debug( LDAP_DEBUG_ANY, "unable to parse monitor objectclass '%s': " "%s before %s\n" , moc[i].name, ldap_scherr2str(code), err ); -#endif return -1; } if ( oc->oc_oid == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "objectclass '%s' has no OID\n" , - moc[i].name, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "objectclass '%s' has no OID\n" , moc[i].name, 0, 0 ); -#endif return -1; } code = oc_add(oc, 0, &err); if ( code ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "objectclass '%s': %s \"%s\"\n" , - moc[i].name, scherr2str(code), err ); -#else Debug( LDAP_DEBUG_ANY, "objectclass '%s': %s \"%s\"\n" , moc[i].name, scherr2str(code), err ); -#endif return -1; } @@ -646,15 +582,9 @@ monitor_back_db_init( Oc = oc_find( moc[i].name ); if ( Oc == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "monitor_back_db_init: " - "unable to find objectClass %s " - "(just added)\n", moc[i].name, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: " "unable to find objectClass %s " "(just added)\n", moc[i].name, 0, 0 ); -#endif return -1; } @@ -734,15 +664,9 @@ monitor_back_db_open( rc = dnPretty( NULL, &dn, &monitor_subsys[ i ].mss_rdn, NULL ); free( dn.bv_val ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor RDN \"%s\" is invalid\n", - dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor RDN \"%s\" is invalid\n", dn.bv_val, 0, 0 ); -#endif return( -1 ); } @@ -754,15 +678,9 @@ monitor_back_db_open( &monitor_subsys[ i ].mss_ndn, NULL ); free( dn.bv_val ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor DN \"%s\" is invalid\n", - dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor DN \"%s\" is invalid\n", dn.bv_val, 0, 0 ); -#endif return( -1 ); } @@ -787,15 +705,9 @@ monitor_back_db_open( e = str2entry( buf ); if ( e == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "unable to create '%s' entry\n", - monitor_subsys[ i ].mss_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "unable to create '%s' entry\n", monitor_subsys[ i ].mss_dn.bv_val, 0, 0 ); -#endif return( -1 ); } @@ -807,15 +719,9 @@ monitor_back_db_open( mp->mp_flags = monitor_subsys[ i ].mss_flags; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "unable to add entry '%s' to cache\n", - monitor_subsys[ i ].mss_dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "unable to add entry '%s' to cache\n", monitor_subsys[ i ].mss_dn.bv_val, 0, 0 ); -#endif return -1; } @@ -856,15 +762,9 @@ monitor_back_db_open( e = str2entry( buf ); if ( e == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "unable to create '%s' entry\n", - SLAPD_MONITOR_DN, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "unable to create '%s' entry\n", SLAPD_MONITOR_DN, 0, 0 ); -#endif return( -1 ); } @@ -878,29 +778,17 @@ monitor_back_db_open( if ( attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo, &bv, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "unable to add monitoredInfo to '%s' entry\n", - SLAPD_MONITOR_DN, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "unable to add monitoredInfo to '%s' entry\n", SLAPD_MONITOR_DN, 0, 0 ); -#endif return( -1 ); } if ( mi->mi_l.bv_len ) { if ( attr_merge_normalize_one( e, mi->mi_ad_l, &mi->mi_l, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "unable to add locality to '%s' entry\n", - SLAPD_MONITOR_DN, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "unable to add locality to '%s' entry\n", SLAPD_MONITOR_DN, 0, 0 ); -#endif return( -1 ); } } @@ -913,15 +801,9 @@ monitor_back_db_open( mp->mp_next = NULL; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "unable to add entry '%s' to cache\n", - SLAPD_MONITOR_DN, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "unable to add entry '%s' to cache\n", SLAPD_MONITOR_DN, 0, 0 ); -#endif return -1; } diff --git a/servers/slapd/back-monitor/listener.c b/servers/slapd/back-monitor/listener.c index 707cd06631..bb241020bd 100644 --- a/servers/slapd/back-monitor/listener.c +++ b/servers/slapd/back-monitor/listener.c @@ -44,15 +44,9 @@ monitor_subsys_listener_init( return 0; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_listener_init: " - "unable to get listeners\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_listener_init: " "unable to get listeners\n", 0, 0, 0 ); -#endif return( -1 ); } @@ -61,18 +55,11 @@ monitor_subsys_listener_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn, &e_listener ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_listener_init: " - "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_listener_init: " "unable to get entry '%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -107,19 +94,12 @@ monitor_subsys_listener_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_listener_init: " - "unable to create entry 'cn=Listener, %d,%s'\n", - i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_listener_init: " "unable to create entry 'cn=Listener %d,%s'\n%s", i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, "" ); -#endif return( -1 ); } @@ -155,19 +135,12 @@ monitor_subsys_listener_init( | MONITOR_F_SUB; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_listener_init: " - "unable to add entry 'cn=Listener %d,%s'\n", - i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_listener_init: " "unable to add entry 'cn=Listener %d,%s'\n", i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 ); -#endif return( -1 ); } diff --git a/servers/slapd/back-monitor/log.c b/servers/slapd/back-monitor/log.c index 9e99fb1eed..50c1181e2e 100644 --- a/servers/slapd/back-monitor/log.c +++ b/servers/slapd/back-monitor/log.c @@ -88,18 +88,11 @@ monitor_subsys_log_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn, &e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_log_init: " - "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_log_init: " "unable to get entry '%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } diff --git a/servers/slapd/back-monitor/modify.c b/servers/slapd/back-monitor/modify.c index f6f62f5ad4..026d2e55ae 100644 --- a/servers/slapd/back-monitor/modify.c +++ b/servers/slapd/back-monitor/modify.c @@ -47,11 +47,7 @@ monitor_back_modify( Operation *op, SlapReply *rs ) Entry *matched; Entry *e; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_MON, ENTRY, "monitor_back_modify: enter\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_ARGS, "monitor_back_modify:\n", 0, 0, 0); -#endif /* acquire and lock entry */ monitor_cache_dn2entry( op, &op->o_req_ndn, &e, &matched ); diff --git a/servers/slapd/back-monitor/operation.c b/servers/slapd/back-monitor/operation.c index 284224d378..1427104520 100644 --- a/servers/slapd/back-monitor/operation.c +++ b/servers/slapd/back-monitor/operation.c @@ -62,18 +62,11 @@ monitor_subsys_ops_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn, &e_op ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_ops_init: " - "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " "unable to get entry '%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -112,19 +105,11 @@ monitor_subsys_ops_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_ops_init: " - "unable to create entry 'cn=%s,%s'\n", - bv_op[ i ].bv_val, - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " "unable to create entry 'cn=%s,%s'\n", bv_op[ i ].bv_val, monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 ); -#endif return( -1 ); } @@ -137,19 +122,11 @@ monitor_subsys_ops_init( | MONITOR_F_SUB | MONITOR_F_PERSISTENT; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_ops_init: " - "unable to add entry 'cn=%s,%s'\n", - bv_op[ i ].bv_val, - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " "unable to add entry 'cn=%s,%s'\n", bv_op[ i ].bv_val, monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 ); -#endif return( -1 ); } diff --git a/servers/slapd/back-monitor/overlay.c b/servers/slapd/back-monitor/overlay.c index 7f557e6938..73f9c34d17 100644 --- a/servers/slapd/back-monitor/overlay.c +++ b/servers/slapd/back-monitor/overlay.c @@ -46,18 +46,11 @@ monitor_subsys_overlay_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn, &e_overlay ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_overlay_init: " - "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_overlay_init: " "unable to get entry '%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -88,19 +81,12 @@ monitor_subsys_overlay_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_overlay_init: " - "unable to create entry 'cn=Overlay %d,%s'\n", - i, monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_overlay_init: " "unable to create entry 'cn=Overlay %d,%s'\n%s", i, monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, "" ); -#endif return( -1 ); } @@ -151,19 +137,12 @@ monitor_subsys_overlay_init( | MONITOR_F_SUB; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_overlay_init: " - "unable to add entry 'cn=Overlay %d,%s'\n", - i, monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_overlay_init: " "unable to add entry 'cn=Overlay %d,%s'\n%s", i, monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, "" ); -#endif return( -1 ); } diff --git a/servers/slapd/back-monitor/rww.c b/servers/slapd/back-monitor/rww.c index 0bc517c3e7..e6818c6bc2 100644 --- a/servers/slapd/back-monitor/rww.c +++ b/servers/slapd/back-monitor/rww.c @@ -46,18 +46,11 @@ monitor_subsys_rww_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn, &e_conn ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_rww_init: " - "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_rww_init: " "unable to get entry '%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -85,17 +78,10 @@ monitor_subsys_rww_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_rww_init: " - "unable to create entry 'cn=Read,%s'\n", - monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_rww_init: " "unable to create entry 'cn=Read,%s'\n", monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 ); -#endif return( -1 ); } @@ -112,17 +98,10 @@ monitor_subsys_rww_init( | MONITOR_F_SUB | MONITOR_F_PERSISTENT; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_rww_init: " - "unable to add entry 'cn=Read,%s'\n", - monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_rww_init: " "unable to add entry 'cn=Read,%s'\n", monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 ); -#endif return( -1 ); } @@ -150,17 +129,10 @@ monitor_subsys_rww_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_rww_init: " - "unable to create entry 'cn=Write,%s'\n", - monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_rww_init: " "unable to create entry 'cn=Write,%s'\n", monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 ); -#endif return( -1 ); } @@ -177,17 +149,10 @@ monitor_subsys_rww_init( | MONITOR_F_SUB | MONITOR_F_PERSISTENT; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_rww_init: " - "unable to add entry 'cn=Write,%s'\n", - monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_rww_init: " "unable to add entry 'cn=Write,%s'\n", monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 ); -#endif return( -1 ); } diff --git a/servers/slapd/back-monitor/search.c b/servers/slapd/back-monitor/search.c index e2d7ef63cc..5a87b10815 100644 --- a/servers/slapd/back-monitor/search.c +++ b/servers/slapd/back-monitor/search.c @@ -124,12 +124,7 @@ monitor_back_search( Operation *op, SlapReply *rs ) int rc = LDAP_SUCCESS; Entry *e, *matched = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_MON, ENTRY, - "monitor_back_search: enter\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "=> monitor_back_search\n%s%s%s", "", "", ""); -#endif /* get entry with reader lock */ diff --git a/servers/slapd/back-monitor/sent.c b/servers/slapd/back-monitor/sent.c index a548c851fc..5e4698ca52 100644 --- a/servers/slapd/back-monitor/sent.c +++ b/servers/slapd/back-monitor/sent.c @@ -45,18 +45,11 @@ monitor_subsys_sent_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn, &e_sent ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_sent_init: " - "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " "unable to get entry '%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -84,18 +77,11 @@ monitor_subsys_sent_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_sent_init: " - "unable to create entry 'cn=Entries,%s'\n", - monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " "unable to create entry 'cn=Entries,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -112,18 +98,11 @@ monitor_subsys_sent_init( | MONITOR_F_SUB | MONITOR_F_PERSISTENT; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_sent_init: " - "unable to add entry 'cn=Entries,%s'\n", - monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " "unable to add entry 'cn=Entries,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -151,18 +130,11 @@ monitor_subsys_sent_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_sent_init: " - "unable to create entry 'cn=Referrals,%s'\n", - monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " "unable to create entry 'cn=Referrals,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -179,18 +151,11 @@ monitor_subsys_sent_init( | MONITOR_F_SUB | MONITOR_F_PERSISTENT; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_sent_init: " - "unable to add entry 'cn=Referrals,%s'\n", - monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " "unable to add entry 'cn=Referrals,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -218,18 +183,11 @@ monitor_subsys_sent_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_sent_init: " - "unable to create entry 'cn=PDU,%s'\n", - monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " "unable to create entry 'cn=PDU,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -246,18 +204,11 @@ monitor_subsys_sent_init( | MONITOR_F_SUB | MONITOR_F_PERSISTENT; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_sent_init: " - "unable to add entry 'cn=PDU,%s'\n", - monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " "unable to add entry 'cn=PDU,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -285,18 +236,11 @@ monitor_subsys_sent_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_sent_init: " - "unable to create entry 'cn=Bytes,%s'\n", - monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " "unable to create entry 'cn=Bytes,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -313,18 +257,11 @@ monitor_subsys_sent_init( | MONITOR_F_SUB | MONITOR_F_PERSISTENT; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_sent_init: " - "unable to add entry 'cn=Bytes,%s'\n", - monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " "unable to add entry 'cn=Bytes,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } diff --git a/servers/slapd/back-monitor/thread.c b/servers/slapd/back-monitor/thread.c index 7e3ad62119..dd5ead33ae 100644 --- a/servers/slapd/back-monitor/thread.c +++ b/servers/slapd/back-monitor/thread.c @@ -45,16 +45,10 @@ monitor_subsys_thread_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn, &e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_thread_init: unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_thread_init: unable to get entry '%s'\n", monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val, 0, 0 ); -#endif return( -1 ); } diff --git a/servers/slapd/back-monitor/time.c b/servers/slapd/back-monitor/time.c index de03017e99..70ac84d127 100644 --- a/servers/slapd/back-monitor/time.c +++ b/servers/slapd/back-monitor/time.c @@ -48,18 +48,11 @@ monitor_subsys_time_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn, &e_time ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_time_init: " - "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_time_init: " "unable to get entry '%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -87,18 +80,11 @@ monitor_subsys_time_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_time_init: " - "unable to create entry 'cn=Start,%s'\n", - monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_time_init: " "unable to create entry 'cn=Start,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -111,18 +97,11 @@ monitor_subsys_time_init( | MONITOR_F_SUB | MONITOR_F_PERSISTENT; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_time_init: " - "unable to add entry 'cn=Start,%s'\n", - monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_time_init: " "unable to add entry 'cn=Start,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -153,18 +132,11 @@ monitor_subsys_time_init( e = str2entry( buf ); if ( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_time_init: " - "unable to create entry 'cn=Current,%s'\n", - monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_time_init: " "unable to create entry 'cn=Current,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } @@ -177,18 +149,11 @@ monitor_subsys_time_init( | MONITOR_F_SUB | MONITOR_F_PERSISTENT; if ( monitor_cache_add( mi, e ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_time_init: " - "unable to add entry 'cn=Current,%s'\n", - monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "monitor_subsys_time_init: " "unable to add entry 'cn=Current,%s'\n%s%s", monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, "", "" ); -#endif return( -1 ); } diff --git a/servers/slapd/back-sql/modrdn.c b/servers/slapd/back-sql/modrdn.c index c79d6cb5ce..c17f90415b 100644 --- a/servers/slapd/back-sql/modrdn.c +++ b/servers/slapd/back-sql/modrdn.c @@ -318,50 +318,28 @@ backsql_modrdn( Operation *op, SlapReply *rs ) if ( ldap_bv2rdn( &op->oq_modrdn.rs_newrdn, &new_rdn, &next, LDAP_DN_FORMAT_LDAP ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - " backsql_modrdn: can't figure out " - "type(s)/values(s) of newrdn\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, " backsql_modrdn: can't figure out " "type(s)/values(s) of newrdn\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_INVALID_DN_SYNTAX; goto done; } -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - " backsql_modrdn: new_rdn_type=\"%s\", " - "new_rdn_val=\"%s\"\n", - new_rdn[ 0 ]->la_attr.bv_val, - new_rdn[ 0 ]->la_value.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, " backsql_modrdn: new_rdn_type=\"%s\", " "new_rdn_val=\"%s\"\n", new_rdn[ 0 ]->la_attr.bv_val, new_rdn[ 0 ]->la_value.bv_val, 0 ); -#endif if ( op->oq_modrdn.rs_deleteoldrdn ) { if ( ldap_bv2rdn( &op->o_req_dn, &old_rdn, &next, LDAP_DN_FORMAT_LDAP ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - " backsql_modrdn: can't figure out " - "type(s)/values(s) of old_rdn\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, " backsql_modrdn: can't figure out " "the old_rdn type(s)/value(s)\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_OTHER; goto done; } diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index cde050092a..50478f33e8 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -169,13 +169,8 @@ int backend_init(void) if((nBackendInfo != 0) || (backendInfo != NULL)) { /* already initialized */ -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, ERR, - "backend_init: backend already initialized\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_init: already initialized.\n", 0, 0, 0 ); -#endif return -1; } @@ -188,15 +183,9 @@ int backend_init(void) rc = binfo[nBackendInfo].bi_init( &binfo[nBackendInfo] ); if(rc != 0) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, INFO, - "backend_init: initialized for type \"%s\"\n", - binfo[nBackendInfo].bi_type, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_init: initialized for type \"%s\"\n", binfo[nBackendInfo].bi_type, 0, 0 ); -#endif /* destroy those we've already inited */ for( nBackendInfo--; nBackendInfo >= 0 ; @@ -220,13 +209,9 @@ int backend_init(void) return 0; #else -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, ERR, "backend_init: failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_init: failed\n", 0, 0, 0 ); -#endif return rc; #endif /* SLAPD_MODULES */ @@ -237,28 +222,16 @@ int backend_add(BackendInfo *aBackendInfo) int rc = 0; if ( aBackendInfo->bi_init == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, ERR, "backend_add: " - "backend type \"%s\" does not have the (mandatory)init function\n", - aBackendInfo->bi_type, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_add: " "backend type \"%s\" does not have the (mandatory)init function\n", aBackendInfo->bi_type, 0, 0 ); -#endif return -1; } if ((rc = aBackendInfo->bi_init(aBackendInfo)) != 0) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, ERR, - "backend_add: initialization for type \"%s\" failed\n", - aBackendInfo->bi_type, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_add: initialization for type \"%s\" failed\n", aBackendInfo->bi_type, 0, 0 ); -#endif return rc; } @@ -298,27 +271,16 @@ int backend_startup_one(Backend *be) LDAP_TAILQ_INIT( be->be_pending_csn_list ); -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, DETAIL1, "backend_startup: starting \"%s\"\n", - be->be_suffix ? be->be_suffix[0].bv_val : "(unknown)", - 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "backend_startup: starting \"%s\"\n", be->be_suffix ? be->be_suffix[0].bv_val : "(unknown)", 0, 0 ); -#endif if ( be->bd_info->bi_db_open ) { rc = be->bd_info->bi_db_open( be ); if ( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, CRIT, - "backend_startup: bi_db_open failed! (%d)\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_startup: bi_db_open failed! (%d)\n", rc, 0, 0 ); -#endif } } return rc; @@ -331,14 +293,9 @@ int backend_startup(Backend *be) if( ! ( nBackendDB > 0 ) ) { /* no databases */ -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, INFO, - "backend_startup: %d databases to startup. \n", nBackendDB, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_startup: %d databases to startup.\n", nBackendDB, 0, 0 ); -#endif return 1; } @@ -346,14 +303,9 @@ int backend_startup(Backend *be) if ( be->bd_info->bi_open ) { rc = be->bd_info->bi_open( be->bd_info ); if ( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, CRIT, - "backend_startup: bi_open failed!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_startup: bi_open failed!\n", 0, 0, 0 ); -#endif return rc; } @@ -366,15 +318,9 @@ int backend_startup(Backend *be) if ( frontendDB->bd_info->bi_db_open ) { rc = frontendDB->bd_info->bi_db_open( frontendDB ); if ( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, CRIT, - "backend_startup: bi_db_open(frontend) failed! (%d)\n", - rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_startup: bi_db_open(frontend) failed! (%d)\n", rc, 0, 0 ); -#endif return rc; } } @@ -390,14 +336,9 @@ int backend_startup(Backend *be) rc = backendInfo[i].bi_open( &backendInfo[i] ); if ( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, CRIT, - "backend_startup: bi_open %d failed!\n", i, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_startup: bi_open %d failed!\n", i, 0, 0 ); -#endif return rc; } } @@ -410,17 +351,10 @@ int backend_startup(Backend *be) /* open each backend database */ for( i = 0; i < nBackendDB; i++ ) { if ( backendDB[i].be_suffix == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, CRIT, - "backend_startup: warning, database %d (%s) " - "has no suffix\n", - i, backendDB[i].bd_info->bi_type, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_startup: warning, database %d (%s) " "has no suffix\n", i, backendDB[i].bd_info->bi_type, 0 ); -#endif } /* append global access controls */ acl_append( &backendDB[i].be_acl, frontendDB->be_acl ); @@ -435,15 +369,9 @@ int backend_startup(Backend *be) if ( !( backendDB[i].be_search && backendDB[i].be_add && backendDB[i].be_modify && backendDB[i].be_delete )) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, CRIT, - "backend_startup: database(%d) does not support " - "operations required for syncrepl", i, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_startup: database(%d) does not support " "operations required for syncrepl", i, 0, 0 ); -#endif continue; } @@ -505,15 +433,9 @@ int backend_shutdown( Backend *be ) } if(rc != 0) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, NOTICE, - "backend_shutdown: bi_db_close %s failed!\n", - backendDB[i].be_type, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_close: bi_db_close %s failed!\n", backendDB[i].be_type, 0, 0 ); -#endif } } @@ -534,15 +456,9 @@ int backend_shutdown( Backend *be ) if ( frontendDB->bd_info->bi_db_close ) { rc = frontendDB->bd_info->bi_db_close ( frontendDB ); if ( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, CRIT, - "backend_startup: bi_db_close(frontend) failed! (%d)\n", - rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend_startup: bi_db_close(frontend) failed! (%d)\n", rc, 0, 0 ); -#endif } } @@ -896,15 +812,9 @@ backend_unbind( Operation *op, SlapReply *rs ) * A preoperation plugin failure will abort the * entire operation. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_bind: Unbind preoperation plugin failed\n", - 0, 0, 0); -#else Debug(LDAP_DEBUG_TRACE, "do_bind: Unbind preoperation plugin failed\n", 0, 0, 0); -#endif return 0; } } @@ -919,15 +829,9 @@ backend_unbind( Operation *op, SlapReply *rs ) if ( op->o_pb != NULL && slapi_int_call_plugins( &backends[i], SLAPI_PLUGIN_POST_UNBIND_FN, (Slapi_PBlock *)op->o_pb ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_unbind: Unbind postoperation plugins failed\n", - 0, 0, 0); -#else Debug(LDAP_DEBUG_TRACE, "do_unbind: Unbind postoperation plugins failed\n", 0, 0, 0); -#endif } #endif /* defined( LDAP_SLAPI ) */ } diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index dc0cefe8e4..c9d200bfba 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -51,11 +51,7 @@ do_bind( ber_tag_t tag; Backend *be = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "do_bind: conn %d\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_bind\n", 0, 0, 0 ); -#endif /* * Force to connection to "anonymous" until bind succeeds. @@ -109,12 +105,7 @@ do_bind( tag = ber_scanf( ber, "{imt" /*}*/, &version, &dn, &method ); if ( tag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_bind: conn %d ber_scanf failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bind: ber_scanf failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); rs->sr_err = SLAPD_DISCONNECT; goto cleanup; @@ -153,12 +144,7 @@ do_bind( } if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_bind: conn %d get_ctrls failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_bind: get_ctrls failed\n", 0, 0, 0 ); -#endif goto cleanup; } @@ -169,40 +155,21 @@ do_bind( rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx ); if ( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_bind: conn %d invalid dn (%s)\n", - op->o_connid, dn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "bind: invalid dn (%s)\n", dn.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" ); goto cleanup; } if( op->orb_method == LDAP_AUTH_SASL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "do_sasl_bind: conn %d dn (%s) mech %s\n", - op->o_connid, op->o_req_dn.bv_val, mech.bv_val ); -#else Debug( LDAP_DEBUG_TRACE, "do_sasl_bind: dn (%s) mech %s\n", op->o_req_dn.bv_val, mech.bv_val, NULL ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "do_bind: version=%ld dn=\"%s\" method=%ld\n", - (unsigned long) version, op->o_req_dn.bv_val, - (unsigned long) op->orb_method ); -#else Debug( LDAP_DEBUG_TRACE, "do_bind: version=%ld dn=\"%s\" method=%ld\n", (unsigned long) version, op->o_req_dn.bv_val, (unsigned long) op->orb_method ); -#endif } Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu BIND dn=\"%s\" method=%ld\n", @@ -210,14 +177,8 @@ do_bind( (unsigned long) op->orb_method, 0 ); if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_bind: conn %d unknown version = %ld\n", - op->o_connid, (unsigned long)version, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_bind: unknown version=%ld\n", (unsigned long) version, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "requested protocol version not supported" ); goto cleanup; @@ -282,14 +243,8 @@ fe_op_bind( Operation *op, SlapReply *rs ) if ( op->orb_method == LDAP_AUTH_SASL ) { if ( op->o_protocol < LDAP_VERSION3 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_bind: conn %d sasl with LDAPv%ld\n", - op->o_connid, (unsigned long)op->o_protocol, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_bind: sasl with LDAPv%ld\n", (unsigned long)op->o_protocol, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "SASL bind requires LDAPv3" ); rs->sr_err = SLAPD_DISCONNECT; @@ -297,15 +252,9 @@ fe_op_bind( Operation *op, SlapReply *rs ) } if( mech.bv_len == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_bind: conn %d no SASL mechanism provided\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_bind: no sasl mechanism provided\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_AUTH_METHOD_NOT_SUPPORTED, "no SASL mechanism provided" ); goto cleanup; @@ -361,19 +310,11 @@ fe_op_bind( Operation *op, SlapReply *rs ) op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "", op->o_conn->c_authmech.bv_val, op->orb_ssf ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "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 : "", - op->orb_ssf ); -#else 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 : "", op->orb_ssf ); -#endif } else if ( rs->sr_err == LDAP_SASL_BIND_IN_PROGRESS ) { op->o_conn->c_sasl_bind_in_progress = 1; @@ -459,14 +400,8 @@ fe_op_bind( Operation *op, SlapReply *rs ) * just need to send success */ send_ldap_result( op, rs ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "do_bind: conn %d v%d anonymous bind\n", - op->o_connid, op->o_protocol, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d anonymous bind\n", op->o_protocol, 0, 0 ); -#endif goto cleanup; } else if ( global_disallows & SLAP_DISALLOW_BIND_SIMPLE ) { @@ -475,15 +410,9 @@ fe_op_bind( Operation *op, SlapReply *rs ) rs->sr_text = "unwilling to perform simple authentication"; send_ldap_result( op, rs ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_bind: conn %d v%d simple bind(%s) disallowed\n", - op->o_connid, op->o_protocol, op->o_req_ndn.bv_val ); -#else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d simple bind(%s) disallowed\n", op->o_protocol, op->o_req_ndn.bv_val, 0 ); -#endif goto cleanup; } @@ -496,15 +425,9 @@ fe_op_bind( Operation *op, SlapReply *rs ) send_ldap_result( op, rs ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "do_bind: conn %d v%d Kerberos V4 (step 1) bind refused\n", - op->o_connid, op->o_protocol, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d Kerberos V4 (step 1) bind refused\n", op->o_protocol, 0, 0 ); -#endif goto cleanup; } ber_str2bv( "KRBV4", sizeof("KRBV4")-1, 0, &mech ); @@ -514,15 +437,9 @@ fe_op_bind( Operation *op, SlapReply *rs ) rs->sr_text = "Kerberos V4 (step 2) bind not supported"; send_ldap_result( op, rs ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "do_bind: conn %d v%d Kerberos V4 (step 2) bind refused\n", - op->o_connid, op->o_protocol, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d Kerberos V4 (step 2) bind refused\n", op->o_protocol, 0, 0 ); -#endif goto cleanup; #endif @@ -531,15 +448,9 @@ fe_op_bind( Operation *op, SlapReply *rs ) rs->sr_text = "unknown authentication method"; send_ldap_result( op, rs ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_bind: conn %ld v%d unknown authentication method (%ld)\n", - op->o_connid, op->o_protocol, op->orb_method ); -#else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d unknown authentication method (%ld)\n", op->o_protocol, op->orb_method, 0 ); -#endif goto cleanup; } @@ -575,15 +486,9 @@ fe_op_bind( Operation *op, SlapReply *rs ) rc = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_BIND_FN, pb ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_bind: Bind preoperation plugin returned %d\n", - rs->sr_err, 0, 0); -#else Debug(LDAP_DEBUG_TRACE, "do_bind: Bind preoperation plugin returned %d.\n", rs->sr_err, 0, 0); -#endif switch ( rc ) { case SLAPI_BIND_SUCCESS: @@ -678,15 +583,9 @@ fe_op_bind( Operation *op, SlapReply *rs ) op->o_connid, op->o_opid, op->o_conn->c_dn.bv_val, mech.bv_val, 0 ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "do_bind: v%d bind: \"%s\" to \"%s\" \n", - op->o_protocol, op->o_conn->c_dn.bv_val, op->o_conn->c_dn.bv_val ); -#else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d bind: \"%s\" to \"%s\"\n", op->o_protocol, op->o_req_dn.bv_val, op->o_conn->c_dn.bv_val ); -#endif ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex ); @@ -706,15 +605,9 @@ fe_op_bind( Operation *op, SlapReply *rs ) if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_bind: Bind postoperation plugins failed\n", - 0, 0, 0); -#else Debug(LDAP_DEBUG_TRACE, "do_bind: Bind postoperation plugins failed.\n", 0, 0, 0); -#endif } #endif /* LDAP_SLAPI */ diff --git a/servers/slapd/ch_malloc.c b/servers/slapd/ch_malloc.c index 8bfedb803e..7128c25831 100644 --- a/servers/slapd/ch_malloc.c +++ b/servers/slapd/ch_malloc.c @@ -52,13 +52,8 @@ ch_malloc( void *new; if ( (new = (void *) ber_memalloc_x( size, NULL )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "ch_malloc: allocation of %lu bytes failed\n", (long)size, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "ch_malloc of %lu bytes failed\n", (long) size, 0, 0 ); -#endif assert( 0 ); exit( EXIT_FAILURE ); } @@ -88,13 +83,8 @@ ch_realloc( } if ( (new = (void *) ber_memrealloc_x( block, size, NULL )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "ch_realloc: reallocation of %lu bytes failed\n", (long)size, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "ch_realloc of %lu bytes failed\n", (long) size, 0, 0 ); -#endif assert( 0 ); exit( EXIT_FAILURE ); } @@ -111,14 +101,8 @@ ch_calloc( void *new; if ( (new = (void *) ber_memcalloc_x( nelem, size, NULL )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "ch_calloc: allocation of %lu elements of %lu bytes faild\n", - (long)nelem, (long)size, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ch_calloc of %lu elems of %lu bytes failed\n", (long) nelem, (long) size, 0 ); -#endif assert( 0 ); exit( EXIT_FAILURE ); } @@ -134,12 +118,7 @@ ch_strdup( char *new; if ( (new = ber_strdup_x( string, NULL )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "chr_strdup: duplication of \"%s\" failed\n", string, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ch_strdup(%s) failed\n", string, 0, 0 ); -#endif assert( 0 ); exit( EXIT_FAILURE ); } diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index cc55d1da54..47fff95598 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -52,11 +52,7 @@ do_compare( ava.aa_desc = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "do_compare: conn %d\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_compare\n", 0, 0, 0 ); -#endif /* * Parse the compare request. It looks like this: * @@ -70,59 +66,33 @@ do_compare( */ if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_compare: conn %d ber_scanf failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); return SLAPD_DISCONNECT; } if ( ber_scanf( op->o_ber, "{mm}", &desc, &value ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_compare: conn %d get ava failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_compare: get ava failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); return SLAPD_DISCONNECT; } if ( ber_scanf( op->o_ber, /*{*/ "}" ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_compare: conn %d ber_scanf failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); return SLAPD_DISCONNECT; } if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_compare: conn %d get_ctrls failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_compare: get_ctrls failed\n", 0, 0, 0 ); -#endif goto cleanup; } rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx ); if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_compare: conn %d invalid dn (%s)\n", - op->o_connid, dn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_compare: invalid dn (%s)\n", dn.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" ); goto cleanup; } @@ -165,17 +135,10 @@ fe_op_compare( Operation *op, SlapReply *rs ) AttributeAssertion ava = *op->orc_ava; if( strcasecmp( op->o_req_ndn.bv_val, LDAP_ROOT_DSE ) == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "do_compare: dn (%s) attr(%s) value (%s)\n", - op->o_req_dn.bv_val, - ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); -#else Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n", op->o_req_dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); -#endif Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n", @@ -194,16 +157,9 @@ fe_op_compare( Operation *op, SlapReply *rs ) } } else if ( bvmatch( &op->o_req_ndn, &frontendDB->be_schemandn ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "do_compare: dn (%s) attr(%s) value (%s)\n", - op->o_req_dn.bv_val, - ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); -#else Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n", op->o_req_dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); -#endif Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n", @@ -271,16 +227,9 @@ fe_op_compare( Operation *op, SlapReply *rs ) goto cleanup; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "do_compare: dn (%s) attr(%s) value (%s)\n", - op->o_req_dn.bv_val, - ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); -#else Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n", op->o_req_dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); -#endif 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, @@ -302,15 +251,9 @@ fe_op_compare( Operation *op, SlapReply *rs ) * A preoperation plugin failure will abort the * entire operation. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_compare: compare preoperation plugin failed\n", - 0, 0, 0); -#else Debug(LDAP_DEBUG_TRACE, "do_compare: compare preoperation plugin failed\n", 0, 0, 0); -#endif if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 ) || rs->sr_err == LDAP_SUCCESS ) { @@ -366,13 +309,8 @@ fe_op_compare( Operation *op, SlapReply *rs ) if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_COMPARE_FN, pb ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_compare: compare postoperation plugins failed\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "do_compare: compare postoperation plugins failed\n", 0, 0, 0 ); -#endif } #endif /* defined( LDAP_SLAPI ) */ diff --git a/servers/slapd/component.c b/servers/slapd/component.c index 9e006e2198..0a0b22f17e 100644 --- a/servers/slapd/component.c +++ b/servers/slapd/component.c @@ -85,11 +85,7 @@ get_comp_filter ( Operation* op, struct berval* bv, ComponentFilter** filt, { ComponentAssertionValue cav; int len, rc; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "get_comp_filter\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "get_comp_filter\n", 0, 0, 0 ); -#endif slapd_ber2cav(bv, &cav); rc = parse_comp_filter( op, &cav, filt, text ); bv->bv_val = cav.cav_ptr; @@ -155,11 +151,7 @@ get_comp_filter_list( Operation *op, ComponentAssertionValue *cav, ber_len_t len; char *last; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "get_comp_filter_list\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "get_comp_filter_list\n", 0, 0, 0 ); -#endif new = f; for ( tag = comp_first_element( cav ); tag != LDAP_COMP_FILTER_UNDEFINED; tag = comp_next_element( cav ) ) @@ -185,11 +177,7 @@ get_componentId( Operation *op, ComponentAssertionValue* cav, type = peek_componentId_type( cav ); -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "get_compId [%d]\n", type, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "get_compId [%d]\n", type, 0, 0 ); -#endif len = 0; _cid.ci_type = type; _cid.ci_next = NULL; @@ -226,11 +214,7 @@ get_componentId( Operation *op, ComponentAssertionValue* cav, case LDAP_COMPREF_ALL : _cid.ci_val.ci_all = '*'; cav->cav_ptr++; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "get_compId : ALL\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "get_compId : ALL\n", 0, 0, 0 ); -#endif break; default : return LDAP_COMPREF_UNDEFINED; @@ -359,11 +343,7 @@ get_matching_rule( Operation *op, ComponentAssertionValue* cav, rule_text.bv_val = cav->cav_ptr; *mr = mr_bvfind( &rule_text ); cav->cav_ptr += count; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "get_matching_rule: %s\n", (*mr)->smr_mrule.mr_oid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "get_matching_rule: %s\n", (*mr)->smr_mrule.mr_oid, 0, 0 ); -#endif if ( *mr == NULL ) { *text = "component matching rule not recognized"; return LDAP_INAPPROPRIATE_MATCHING; @@ -512,11 +492,7 @@ get_item( Operation *op, ComponentAssertionValue* cav, ComponentAssertion** ca, int rc; ComponentAssertion* _ca; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "get_item: %s\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "get_item: %s\n", 0, 0, 0 ); -#endif _ca = op->o_tmpalloc( sizeof( ComponentAssertion ), op->o_tmpmemctx ); rc = peek_cav_str( cav, "component" ); @@ -610,11 +586,7 @@ parse_comp_filter( Operation* op, ComponentAssertionValue* cav, switch ( f.cf_choice ) { case LDAP_COMP_FILTER_AND: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "LDAP_COMP_FILTER_AND\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "LDAP_COMP_FILTER_AND\n", 0, 0, 0 ); -#endif err = get_comp_filter_list( op, cav, &f.cf_and, text ); if ( err != LDAP_SUCCESS ) { break; @@ -626,11 +598,7 @@ parse_comp_filter( Operation* op, ComponentAssertionValue* cav, break; case LDAP_COMP_FILTER_OR: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "LDAP_COMP_FILTER_OR\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "LDAP_COMP_FILTER_OR\n", 0, 0, 0 ); -#endif err = get_comp_filter_list( op, cav, &f.cf_or, text ); if ( err != LDAP_SUCCESS ) { break; @@ -643,11 +611,7 @@ parse_comp_filter( Operation* op, ComponentAssertionValue* cav, break; case LDAP_COMP_FILTER_NOT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "LDAP_COMP_FILTER_NOT\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "LDAP_COMP_FILTER_NOT\n", 0, 0, 0 ); -#endif err = parse_comp_filter( op, cav, &f.cf_not, text ); if ( err != LDAP_SUCCESS ) { break; @@ -674,11 +638,7 @@ parse_comp_filter( Operation* op, ComponentAssertionValue* cav, break; case LDAP_COMP_FILTER_ITEM: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "LDAP_COMP_FILTER_ITEM\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "LDAP_COMP_FILTER_ITEM\n", 0, 0, 0 ); -#endif err = get_item( op, cav, &f.cf_ca, text ); if ( err != LDAP_SUCCESS ) { break; @@ -807,11 +767,7 @@ test_comp_filter_entry( mra->cf->cf_ca->ca_mra = mra; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "test_comp_filter_entry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "test_comp_filter_entry\n", 0, 0, 0 ); -#endif if ( mra->ma_desc ) { /* * ma_desc is available, so filtering for one attribute @@ -882,11 +838,7 @@ test_comp_filter_attr( { int rc; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "test_comp_filter_attr\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "test_comp_filter_attr\n", 0, 0, 0 ); -#endif switch ( f->cf_choice ) { case SLAPD_FILTER_COMPUTED: rc = f->cf_result; diff --git a/servers/slapd/config.c b/servers/slapd/config.c index c47fcc7b29..787449c694 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -113,24 +113,13 @@ read_config( const char *fname, int depth ) if ( (fp = fopen( fname, "r" )) == NULL ) { ldap_syslog = 1; -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ENTRY, - "read_config: " "could not open config file \"%s\": %s (%d)\n", - fname, strerror(errno), errno ); -#else Debug( LDAP_DEBUG_ANY, "could not open config file \"%s\": %s (%d)\n", fname, strerror(errno), errno ); -#endif return 1; } -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ENTRY, - "read_config: reading config file %s\n", fname, 0, 0 ); -#else Debug( LDAP_DEBUG_CONFIG, "reading config file %s\n", fname, 0, 0 ); -#endif fp_getline_init( &lineno ); @@ -149,43 +138,26 @@ read_config( const char *fname, int depth ) } if ( cargc < 1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: bad config line (ignored)\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: bad config line (ignored)\n", fname, lineno, 0 ); -#endif continue; } if ( strcasecmp( cargv[0], "backend" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s : line %d: missing type in \"backend\" line.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing type in \"backend \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if( be != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: backend line must appear before any " - "database definition.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: backend line must appear before any database definition\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -193,29 +165,17 @@ read_config( const char *fname, int depth ) bi = backend_info( cargv[1] ); if( bi == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "read_config: backend %s initialization failed.\n", - cargv[1], 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "backend %s initialization failed.\n", cargv[1], 0, 0 ); -#endif return( 1 ); } } else if ( strcasecmp( cargv[0], "database" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing type in \"database \" line\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing type in \"database \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -224,14 +184,9 @@ read_config( const char *fname, int depth ) be = backend_db_init( cargv[1] ); if( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "database %s initialization failed.\n", cargv[1], 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "database %s initialization failed.\n", cargv[1], 0, 0 ); -#endif return( 1 ); } @@ -240,43 +195,25 @@ read_config( const char *fname, int depth ) } else if ( strcasecmp( cargv[0], "concurrency" ) == 0 ) { int c; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing level in \"concurrency \" " - " line\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing level in \"concurrency \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } c = strtol( cargv[1], &next, 10 ); if ( next == NULL || next[0] != '\0' ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unable to parse level \"%s\" in \"concurrency \" " - " line\n", fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to parse level \"%s\" in \"concurrency \" line\n", fname, lineno, cargv[1] ); -#endif return( 1 ); } if( c < 1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: invalid level (%d) in " - "\"concurrency \" line.\n", fname, lineno, c ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid level (%d) in \"concurrency \" line\n", fname, lineno, c ); -#endif return( 1 ); } @@ -287,15 +224,9 @@ read_config( const char *fname, int depth ) } else if ( strcasecmp( cargv[0], "sockbuf_max_incoming" ) == 0 ) { long max; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing max in \"sockbuf_max_incoming " - "\" line\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing max in \"sockbuf_max_incoming \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -303,17 +234,10 @@ read_config( const char *fname, int depth ) max = atol( cargv[1] ); if( max < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: invalid max value (%ld) in " - "\"sockbuf_max_incoming \" line.\n", - fname, lineno, max ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid max value (%ld) in " "\"sockbuf_max_incoming \" line.\n", fname, lineno, max ); -#endif return( 1 ); } @@ -324,15 +248,9 @@ read_config( const char *fname, int depth ) } else if ( strcasecmp( cargv[0], "sockbuf_max_incoming_auth" ) == 0 ) { long max; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing max in \"sockbuf_max_incoming_auth " - "\" line\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing max in \"sockbuf_max_incoming_auth \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -340,17 +258,10 @@ read_config( const char *fname, int depth ) max = atol( cargv[1] ); if( max < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: invalid max value (%ld) in " - "\"sockbuf_max_incoming_auth \" line.\n", - fname, lineno, max ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid max value (%ld) in " "\"sockbuf_max_incoming_auth \" line.\n", fname, lineno, max ); -#endif return( 1 ); } @@ -361,15 +272,9 @@ read_config( const char *fname, int depth ) } else if ( strcasecmp( cargv[0], "conn_max_pending" ) == 0 ) { long max; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing max in \"conn_max_pending " - "\" line\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing max in \"conn_max_pending \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -377,17 +282,10 @@ read_config( const char *fname, int depth ) max = atol( cargv[1] ); if( max < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: invalid max value (%ld) in " - "\"conn_max_pending \" line.\n", - fname, lineno, max ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid max value (%ld) in " "\"conn_max_pending \" line.\n", fname, lineno, max ); -#endif return( 1 ); } @@ -398,15 +296,9 @@ read_config( const char *fname, int depth ) } else if ( strcasecmp( cargv[0], "conn_max_pending_auth" ) == 0 ) { long max; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing max in \"conn_max_pending_auth " - "\" line\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing max in \"conn_max_pending_auth \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -414,17 +306,10 @@ read_config( const char *fname, int depth ) max = atol( cargv[1] ); if( max < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: invalid max value (%ld) in " - "\"conn_max_pending_auth \" line.\n", - fname, lineno, max ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid max value (%ld) in " "\"conn_max_pending_auth \" line.\n", fname, lineno, max ); -#endif return( 1 ); } @@ -434,60 +319,33 @@ read_config( const char *fname, int depth ) /* default search base */ } else if ( strcasecmp( cargv[0], "defaultSearchBase" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing dn in \"defaultSearchBase \" line\n", fname, lineno, 0 ); -#endif return 1; } else if ( cargc > 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: extra cruft after in " - "\"defaultSearchBase %s\" line (ignored)\n", - fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "extra cruft after in \"defaultSearchBase %s\", " "line (ignored)\n", fname, lineno, cargv[1] ); -#endif } if ( bi != NULL || be != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: defaultSearchBase line must appear " - "prior to any backend or database definitions\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "defaultSearchBaase line must appear prior to " "any backend or database definition\n", fname, lineno, 0 ); -#endif return 1; } if ( default_search_nbase.bv_len ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, "%s: line %d: " - "default search base \"%s\" already defined " - "(discarding old)\n", fname, lineno, - default_search_base.bv_val ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "default search base \"%s\" already defined " "(discarding old)\n", fname, lineno, default_search_base.bv_val ); -#endif free( default_search_base.bv_val ); free( default_search_nbase.bv_val ); @@ -506,15 +364,9 @@ read_config( const char *fname, int depth ) &default_search_nbase, NULL ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: defaultSearchBase DN is invalid.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: defaultSearchBase DN is invalid\n", fname, lineno, 0 ); -#endif return( 1 ); } } @@ -523,43 +375,25 @@ read_config( const char *fname, int depth ) } else if ( strcasecmp( cargv[0], "threads" ) == 0 ) { int c; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing count in \"threads \" line\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing count in \"threads \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } c = strtol( cargv[1], &next, 10 ); if (next == NULL || next[0] != '\0' ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unable to parse count \"%s\" in \"threads \" line\n", - fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to parse count \"%s\" in \"threads \" line\n", fname, lineno, cargv[1] ); -#endif return( 1 ); } if( c < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: invalid level (%d) in \"threads \"" - "line\n", fname, lineno, c ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid level (%d) in \"threads \" line\n", fname, lineno, c ); -#endif return( 1 ); } @@ -572,15 +406,9 @@ read_config( const char *fname, int depth ) /* get pid file name */ } else if ( strcasecmp( cargv[0], "pidfile" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d missing file name in \"pidfile \" " - "line.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing file name in \"pidfile \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -590,16 +418,9 @@ read_config( const char *fname, int depth ) /* get args file name */ } else if ( strcasecmp( cargv[0], "argsfile" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: %d: missing file name in " - "\"argsfile \" line.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing file name in \"argsfile \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -615,74 +436,42 @@ read_config( const char *fname, int depth ) /* default password hash */ } else if ( strcasecmp( cargv[0], "password-hash" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing hash in " - "\"password-hash \" line.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing hash in \"password-hash \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( default_passwd_hash != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: already set default password_hash!\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: already set default password_hash!\n", fname, lineno, 0 ); -#endif return 1; } for(i = 1; i < cargc; i++) { if ( lutil_passwd_scheme( cargv[i] ) == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: password scheme \"%s\" not available\n", - fname, lineno, cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: password scheme \"%s\" not available\n", fname, lineno, cargv[i] ); -#endif } else { ldap_charray_add( &default_passwd_hash, cargv[i] ); } } if( !default_passwd_hash ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: no valid hashes found\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: no valid hashes found\n", fname, lineno, 0 ); return 1; -#endif } } else if ( strcasecmp( cargv[0], "password-crypt-salt-format" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing format in " - "\"password-crypt-salt-format \" line\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing format in " "\"password-crypt-salt-format \" line\n", fname, lineno, 0 ); -#endif return 1; } @@ -712,15 +501,9 @@ read_config( const char *fname, int depth ) } else if ( strcasecmp( cargv[0], "schemadn" ) == 0 ) { struct berval dn; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing dn in " - "\"schemadn \" line.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing dn in \"schemadn \" line\n", fname, lineno, 0 ); -#endif return 1 ; } ber_str2bv( cargv[1], 0, 0, &dn ); @@ -732,15 +515,9 @@ read_config( const char *fname, int depth ) &frontendDB->be_schemandn, NULL ); } if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: schemadn DN is invalid.\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: schemadn DN is invalid\n", fname, lineno, 0 ); -#endif return 1; } @@ -748,15 +525,9 @@ read_config( const char *fname, int depth ) } else if ( strcasecmp( cargv[0], "ucdata-path" ) == 0 ) { int err; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing path in " - "\"ucdata-path \" line.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing path in \"ucdata-path \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -764,16 +535,9 @@ read_config( const char *fname, int depth ) err = load_ucdata( cargv[1] ); if ( err <= 0 ) { if ( err == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: ucdata already loaded, ucdata-path " - "must be set earlier in the file and/or be " - "specified only once!\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: ucdata already loaded, ucdata-path must be set earlier in the file and/or be specified only once!\n", fname, lineno, 0 ); -#endif } return( 1 ); @@ -785,15 +549,9 @@ read_config( const char *fname, int depth ) struct slap_limits_set *lim; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing limit in \"sizelimit \" " - "line.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing limit in \"sizelimit \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -808,19 +566,12 @@ read_config( const char *fname, int depth ) if ( strncasecmp( cargv[i], "size", 4 ) == 0 ) { rc = limits_parse_one( cargv[i], lim ); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unable " - "to parse value \"%s\" in \"sizelimit " - "\" line.\n", fname, lineno, cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable " "to parse value \"%s\" " "in \"sizelimit " "\" line\n", fname, lineno, cargv[i] ); -#endif return( 1 ); } @@ -830,27 +581,15 @@ read_config( const char *fname, int depth ) } else { lim->lms_s_soft = strtol( cargv[i] , &next, 0 ); if ( next == cargv[i] ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unable to parse limit \"%s\" in \"sizelimit \" " - "line.\n", fname, lineno, cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to parse limit \"%s\" in \"sizelimit \" line\n", fname, lineno, cargv[i] ); -#endif return( 1 ); } else if ( next[0] != '\0' ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: trailing chars \"%s\" in \"sizelimit \" " - "line ignored.\n", fname, lineno, next ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: trailing chars \"%s\" in \"sizelimit \" line ignored\n", fname, lineno, next ); -#endif } } lim->lms_s_hard = 0; @@ -863,15 +602,9 @@ read_config( const char *fname, int depth ) struct slap_limits_set *lim; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d missing limit in \"timelimit \" " - "line.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing limit in \"timelimit \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -886,19 +619,12 @@ read_config( const char *fname, int depth ) if ( strncasecmp( cargv[i], "time", 4 ) == 0 ) { rc = limits_parse_one( cargv[i], lim ); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unable to parse value \"%s\" " - "in \"timelimit \" line.\n", - fname, lineno, cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable " "to parse value \"%s\" " "in \"timelimit " "\" line\n", fname, lineno, cargv[i] ); -#endif return( 1 ); } @@ -908,27 +634,15 @@ read_config( const char *fname, int depth ) } else { lim->lms_t_soft = strtol( cargv[i] , &next, 0 ); if ( next == cargv[i] ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unable to parse limit \"%s\" in \"timelimit \" " - "line.\n", fname, lineno, cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to parse limit \"%s\" in \"timelimit \" line\n", fname, lineno, cargv[i] ); -#endif return( 1 ); } else if ( next[0] != '\0' ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: trailing chars \"%s\" in \"timelimit \" " - "line ignored.\n", fname, lineno, next ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: trailing chars \"%s\" in \"timelimit \" line ignored\n", fname, lineno, next ); -#endif } } lim->lms_t_hard = 0; @@ -938,15 +652,9 @@ read_config( const char *fname, int depth ) /* set regex-based limits */ } else if ( strcasecmp( cargv[0], "limits" ) == 0 ) { if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, WARNING, - "%s: line %d \"limits\" allowed only in database " - "environment.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d \"limits\" allowed only in database environment.\n%s", fname, lineno, "" ); -#endif return( 1 ); } @@ -957,15 +665,9 @@ read_config( const char *fname, int depth ) /* mark this as a subordinate database */ } else if ( strcasecmp( cargv[0], "subordinate" ) == 0 ) { if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, "%s: line %d: " - "subordinate keyword must appear inside a database " - "definition.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: subordinate keyword " "must appear inside a database definition.\n", fname, lineno, 0 ); -#endif return 1; } else { @@ -978,15 +680,9 @@ read_config( const char *fname, int depth ) if ( be == NULL ) { if ( cargv[1][0] == '-' && overlay_config( frontendDB, &cargv[1][1] ) ) { /* log error */ -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, "%s: line %d: " - "(optional) global overlay \"%s\" configuration " - "failed (ignored)\n", fname, lineno, &cargv[1][1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "(optional) global overlay \"%s\" configuration " "failed (ignored)\n", fname, lineno, &cargv[1][1] ); -#endif } else if ( overlay_config( frontendDB, cargv[1] ) ) { return 1; } @@ -994,15 +690,9 @@ read_config( const char *fname, int depth ) } else { if ( cargv[1][0] == '-' && overlay_config( be, &cargv[1][1] ) ) { /* log error */ -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, "%s: line %d: " - "(optional) overlay \"%s\" configuration " - "failed (ignored)\n", fname, lineno, &cargv[1][1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "(optional) overlay \"%s\" configuration " "failed (ignored)\n", fname, lineno, &cargv[1][1] ); -#endif } else if ( overlay_config( be, cargv[1] ) ) { return 1; } @@ -1014,54 +704,30 @@ read_config( const char *fname, int depth ) struct berval dn, pdn, ndn; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing dn in \"suffix \" line.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "missing dn in \"suffix \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } else if ( cargc > 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: extra cruft after in \"suffix %s\"" - " line (ignored).\n", fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: extra cruft " "after in \"suffix %s\" line (ignored)\n", fname, lineno, cargv[1] ); -#endif } if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: suffix line must appear inside a database " - "definition.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix line " "must appear inside a database definition\n", fname, lineno, 0 ); -#endif return( 1 ); #if defined(SLAPD_MONITOR_DN) /* "cn=Monitor" is reserved for monitoring slap */ } else if ( strcasecmp( cargv[1], SLAPD_MONITOR_DN ) == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: \"" - "%s\" is reserved for monitoring slapd\n", - fname, lineno, SLAPD_MONITOR_DN ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: \"" "%s\" is reserved for monitoring slapd\n", fname, lineno, SLAPD_MONITOR_DN ); -#endif return( 1 ); #endif /* SLAPD_MONITOR_DN */ } @@ -1073,59 +739,33 @@ read_config( const char *fname, int depth ) rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn, NULL ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: suffix DN is invalid.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix DN is invalid\n", fname, lineno, 0 ); -#endif return( 1 ); } tmp_be = select_backend( &ndn, 0, 0 ); if ( tmp_be == be ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: suffix already served by this backend " - "(ignored)\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix " "already served by this backend (ignored)\n", fname, lineno, 0 ); -#endif free( pdn.bv_val ); free( ndn.bv_val ); } else if ( tmp_be != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: suffix already served by a preceding " - "backend \"%s\"\n", fname, lineno, - tmp_be->be_suffix[0].bv_val ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix " "already served by a preceeding backend \"%s\"\n", fname, lineno, tmp_be->be_suffix[0].bv_val ); -#endif free( pdn.bv_val ); free( ndn.bv_val ); return( 1 ); } else if( pdn.bv_len == 0 && default_search_nbase.bv_len ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: suffix DN empty and default search " - "base provided \"%s\" (assuming okay).\n", - fname, lineno, default_search_base.bv_val ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "suffix DN empty and default " "search base provided \"%s\" (assuming okay)\n", fname, lineno, default_search_base.bv_val ); -#endif } ber_bvarray_add( &be->be_suffix, &pdn ); @@ -1135,55 +775,31 @@ read_config( const char *fname, int depth ) } else if ( strcasecmp( cargv[0], "maxDerefDepth" ) == 0 ) { int i; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing depth in \"maxDerefDepth \"" - " line\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing depth in \"maxDerefDepth \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: depth line must appear inside a database " - "definition.\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: depth line must appear inside a database definition.\n", fname, lineno, 0 ); -#endif return 1; } i = strtol( cargv[1], &next, 10 ); if ( next == NULL || next[0] != '\0' ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: unable to parse depth \"%s\" in \"maxDerefDepth \" " - "line.\n", fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to parse depth \"%s\" in \"maxDerefDepth \" " "line.\n", fname, lineno, cargv[1] ); -#endif return 1; } if (i < 0) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: depth must be positive.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: depth must be positive.\n", fname, lineno, 0 ); -#endif return 1; @@ -1193,29 +809,17 @@ read_config( const char *fname, int depth ) /* set magic "root" dn for this database */ } else if ( strcasecmp( cargv[0], "rootdn" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: missing dn in \"rootdn \" line.\n", - fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing dn in \"rootdn \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: rootdn line must appear inside a database " - "definition.\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: rootdn line must appear inside a database definition.\n", fname, lineno, 0 ); -#endif return 1; } else { @@ -1231,15 +835,9 @@ read_config( const char *fname, int depth ) &be->be_rootndn, NULL ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: rootdn DN is invalid.\n", - fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: rootdn DN is invalid\n", fname, lineno, 0 ); -#endif return( 1 ); } } @@ -1247,46 +845,27 @@ read_config( const char *fname, int depth ) /* set super-secret magic database password */ } else if ( strcasecmp( cargv[0], "rootpw" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing passwd in \"rootpw \"" - " line\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "missing passwd in \"rootpw \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, "%s: line %d: " - "rootpw line must appear inside a database " - "definition.\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "rootpw line must appear inside a database " "definition.\n", fname, lineno, 0 ); -#endif return 1; } else { Backend *tmp_be = select_backend( &be->be_rootndn, 0, 0 ); if( tmp_be != be ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: " - "rootpw can only be set when rootdn is under suffix\n", - fname, lineno, "" ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "rootpw can only be set when rootdn is under suffix\n", fname, lineno, 0 ); -#endif return 1; } @@ -1297,15 +876,9 @@ read_config( const char *fname, int depth ) /* make this database read-only */ } else if ( strcasecmp( cargv[0], "readonly" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing on|off in \"readonly \" " - "line.\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing on|off in \"readonly \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -1340,15 +913,9 @@ read_config( const char *fname, int depth ) int i; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing in \"restrict \" " - "line.\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing in \"restrict \" " "line.\n", fname, lineno, 0 ); -#endif return 1; } @@ -1416,15 +983,9 @@ read_config( const char *fname, int depth ) } else { restrict_unknown:; -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: " - "unknown operation %s in \"allow \" line.\n", - fname, lineno, cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "unknown operation %s in \"allow \" line\n", fname, lineno, cargv[i] ); -#endif return 1; } } @@ -1442,28 +1003,16 @@ restrict_unknown:; slap_mask_t allows = 0; if ( be != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: allow line must appear prior to " - "database definitions.\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: allow line must appear prior to database definitions\n", fname, lineno, 0 ); -#endif } if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing feature(s) in \"allow \"" - " line\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing feature(s) in \"allow \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -1482,15 +1031,9 @@ restrict_unknown:; allows |= SLAP_ALLOW_UPDATE_ANON; } else { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: " - "unknown feature %s in \"allow \" line.\n", - fname, lineno, cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "unknown feature %s in \"allow \" line\n", fname, lineno, cargv[i] ); -#endif return 1; } @@ -1505,28 +1048,16 @@ restrict_unknown:; slap_mask_t disallows = 0; if ( be != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: disallow line must appear prior to " - "database definitions.\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: disallow line must appear prior to database definitions\n", fname, lineno, 0 ); -#endif } if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing feature(s) in \"disallow \"" - " line.\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing feature(s) in \"disallow \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -1548,16 +1079,9 @@ restrict_unknown:; disallows |= SLAP_DISALLOW_TLS_AUTHC; } else { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unknown feature %s in " - "\"disallow \" line.\n", - fname, lineno, cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown feature %s in \"disallow \" line\n", fname, lineno, cargv[i] ); -#endif return 1; } @@ -1572,15 +1096,9 @@ restrict_unknown:; slap_mask_t requires = 0; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing feature(s) in " - "\"require \" line.\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing feature(s) in \"require \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -1602,16 +1120,9 @@ restrict_unknown:; requires |= SLAP_REQUIRE_STRONG; } else if( strcasecmp( cargv[i], "none" ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unknown feature %s in " - "\"require \" line.\n", - fname, lineno , cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown feature %s in \"require \" line\n", fname, lineno, cargv[i] ); -#endif return( 1 ); } @@ -1628,15 +1139,9 @@ restrict_unknown:; slap_ssf_set_t *set; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing factor(s) in \"security \"" - " line.\n", fname, lineno ,0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing factor(s) in \"security \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -1706,32 +1211,18 @@ restrict_unknown:; src = &cargv[i][STRLENOF("simple_bind=")]; } else { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unknown factor %s in " - "\"security \" line.\n", - fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown factor %s in \"security \" line\n", fname, lineno, cargv[i] ); -#endif return( 1 ); } *tgt = strtol( src, &next, 10 ); if ( next == NULL || next[0] != '\0' ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unable to parse factor \"%s\" in " - "\"security \" line.\n", - fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to parse factor \"%s\" in \"security \" line\n", fname, lineno, cargv[i] ); -#endif return( 1 ); } @@ -1740,29 +1231,17 @@ restrict_unknown:; /* where to send clients when we don't hold it */ } else if ( strcasecmp( cargv[0], "referral" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing URL in \"referral \"" - " line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing URL in \"referral \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if( validate_global_referral( cargv[1] ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: invalid URL (%s) in \"referral\" line.\n", - fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "invalid URL (%s) in \"referral\" line.\n", fname, lineno, cargv[1] ); -#endif return 1; } @@ -1771,52 +1250,20 @@ restrict_unknown:; if( value_add( &default_referral, vals ) ) return LDAP_OTHER; -#ifdef NEW_LOGGING - } else if ( strcasecmp( cargv[0], "logfile" ) == 0 ) { - FILE *logfile; - if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: Error in logfile directive, " - "\"logfile \"\n", fname, lineno , 0 ); -#else - Debug( LDAP_DEBUG_ANY, - "%s: line %d: Error in logfile directive, \"logfile filename\"\n", - fname, lineno, 0 ); -#endif - - return( 1 ); - } - logfile = fopen( cargv[1], "w" ); - if ( logfile != NULL ) lutil_debug_file( logfile ); - -#endif /* start of a new database definition */ } else if ( strcasecmp( cargv[0], "debug" ) == 0 ) { int level; if ( cargc < 3 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: Error in debug directive, " - "\"debug \"\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: Error in debug directive, \"debug subsys level\"\n", fname, lineno, 0 ); -#endif return( 1 ); } level = strtol( cargv[2], &next, 10 ); if ( next == NULL || next[0] != '\0' ){ -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unable to parse level \"%s\" in debug directive, " - "\"debug \"\n", fname, lineno , cargv[2] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to parse level \"%s\" in debug directive, " "\"debug \"\n", fname, lineno , cargv[2] ); -#endif return( 1 ); } @@ -1830,15 +1277,9 @@ restrict_unknown:; /* specify an objectclass */ } else if ( strcasecmp( cargv[0], "objectclass" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: illegal objectclass format.\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: illegal objectclass format.\n", fname, lineno, 0 ); -#endif return( 1 ); } else if ( *cargv[1] == '(' /*')'*/) { @@ -1848,15 +1289,9 @@ restrict_unknown:; if( rc ) return rc; } else { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: old objectclass format not supported\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: old objectclass format not supported.\n", fname, lineno, 0 ); -#endif } } else if ( strcasecmp( cargv[0], "ditcontentrule" ) == 0 ) { @@ -1870,15 +1305,9 @@ restrict_unknown:; || ( strcasecmp( cargv[0], "attribute" ) == 0 )) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, "%s: line %d: " - "illegal attribute type format.\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "illegal attribute type format.\n", fname, lineno, 0 ); -#endif return( 1 ); } else if ( *cargv[1] == '(' /*')'*/) { @@ -1888,15 +1317,9 @@ restrict_unknown:; if( rc ) return rc; } else { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: old attribute type format not supported.\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: old attribute type format not supported.\n", fname, lineno, 0 ); -#endif } @@ -1910,28 +1333,16 @@ restrict_unknown:; /* turn on/off schema checking */ } else if ( strcasecmp( cargv[0], "schemacheck" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing on|off in \"schemacheck \"" - " line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing on|off in \"schemacheck \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( strcasecmp( cargv[1], "off" ) == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: schema checking disabled! your mileage may " - "vary!\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: schema checking disabled! your mileage may vary!\n", fname, lineno, 0 ); -#endif global_schemacheck = 0; } else { global_schemacheck = 1; @@ -1944,15 +1355,9 @@ restrict_unknown:; /* debug level to log things to syslog */ } else if ( strcasecmp( cargv[0], "loglevel" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing level(s) in \"loglevel [...]\"" - " line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing level(s) in \"loglevel [...]\" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -1965,17 +1370,10 @@ restrict_unknown:; if ( isdigit( cargv[i][0] ) ) { level = strtol( cargv[i], &next, 10 ); if ( next == NULL || next[0] != '\0' ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unable to parse level \"%s\" " - "in \"loglevel [...]\" line.\n", - fname, lineno , cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to parse level \"%s\" " "in \"loglevel [...]\" line.\n", fname, lineno , cargv[i] ); -#endif return( 1 ); } @@ -2011,17 +1409,10 @@ restrict_unknown:; } if ( int_2_level[j].s == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: unknown level \"%s\" " - "in \"loglevel [...]\" line.\n", - fname, lineno , cargv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown level \"%s\" " "in \"loglevel [...]\" line.\n", fname, lineno , cargv[i] ); -#endif return( 1 ); } } @@ -2033,27 +1424,15 @@ restrict_unknown:; } else if ( strcasecmp( cargv[0], "syncrepl" ) == 0 ) { if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: syncrepl line must appear inside " - "a database definition.\n", fname, lineno, 0); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: syncrepl line must appear inside " "a database definition.\n", fname, lineno, 0); -#endif return 1; } else if ( SLAP_SHADOW( be )) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: syncrepl: database already shadowed.\n", - fname, lineno, 0); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: syncrepl: database already shadowed.\n", fname, lineno, 0); -#endif return 1; } else if ( add_syncrepl( be, cargv, cargc )) { @@ -2065,28 +1444,16 @@ restrict_unknown:; /* list of replicas of the data in this backend (master only) */ } else if ( strcasecmp( cargv[0], "replica" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing host or uri in \"replica " - " \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: replica line must appear inside " - "a database definition.\n", fname, lineno, 0); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: replica line must appear inside a database definition\n", fname, lineno, 0 ); -#endif return 1; } else { @@ -2102,39 +1469,21 @@ restrict_unknown:; == 0 ) { if ( ldap_url_parse( cargv[ i ] + 4, &ludp ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: replica line contains invalid " - "uri definition.\n", fname, lineno, 0); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: replica line contains invalid " "uri definition.\n", fname, lineno, 0); -#endif return 1; } if (ludp->lud_host == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: replica line contains invalid " - "uri definition - missing hostname.\n", - fname, lineno, 0); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: replica line contains invalid " "uri definition - missing hostname.\n", fname, lineno, 0); -#endif return 1; } replicahost = ch_malloc( strlen( cargv[ i ] ) ); if ( replicahost == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ERR, - "out of memory in read_config\n", 0, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "out of memory in read_config\n", 0, 0, 0 ); -#endif ldap_free_urldesc( ludp ); exit( EXIT_FAILURE ); } @@ -2147,29 +1496,15 @@ restrict_unknown:; } } if ( i == cargc ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: missing host or uri in \"replica\" line\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing host or uri in \"replica\" line\n", fname, lineno, 0 ); -#endif return 1; } else if ( nr == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: unable to add" - " replica \"%s\"\n", - fname, lineno, - cargv[i] + 5 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to add replica \"%s\"\n", fname, lineno, cargv[i] + 5 ); -#endif return 1; } else { for ( i = 1; i < cargc; i++ ) { @@ -2177,29 +1512,15 @@ restrict_unknown:; switch ( add_replica_suffix( be, nr, cargv[i] + 7 ) ) { case 1: -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: suffix \"%s\" in \"replica\"" - " line is not valid for backend(ignored)\n", - fname, lineno, cargv[i] + 7 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix \"%s\" in \"replica\" line is not valid for backend (ignored)\n", fname, lineno, cargv[i] + 7 ); -#endif break; case 2: -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: unable to normalize suffix" - " in \"replica\" line (ignored)\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to normalize suffix in \"replica\" line (ignored)\n", fname, lineno, 0 ); -#endif break; } @@ -2217,16 +1538,9 @@ restrict_unknown:; } if ( add_replica_attrs( be, nr, arg + 1, exclude ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: attribute \"%s\" in " - "\"replica\" line is unknown\n", - fname, lineno, arg + 1 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: attribute \"%s\" in \"replica\" line is unknown\n", fname, lineno, arg + 1 ); -#endif return( 1 ); } } @@ -2240,41 +1554,22 @@ restrict_unknown:; /* dn of slave entity allowed to write to replica */ } else if ( strcasecmp( cargv[0], "updatedn" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing dn in \"updatedn \"" - " line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing dn in \"updatedn \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: updatedn line must appear inside " - "a database definition\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: updatedn line must appear inside a database definition\n", fname, lineno, 0 ); -#endif return 1; } else if ( SLAP_SHADOW(be) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: updatedn: database already shadowed.\n", - fname, lineno, 0); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: updatedn: database already shadowed.\n", fname, lineno, 0); -#endif return 1; } else { @@ -2287,15 +1582,9 @@ restrict_unknown:; rc = dnNormalize( 0, NULL, NULL, &dn, &be->be_update_ndn, NULL ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: updatedn DN is invalid.\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: updatedn DN is invalid\n", fname, lineno, 0 ); -#endif return 1; } @@ -2304,53 +1593,29 @@ restrict_unknown:; } else if ( strcasecmp( cargv[0], "updateref" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: " - "missing url in \"updateref \" line.\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "missing url in \"updateref \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, "%s: line %d: updateref" - " line must appear inside a database definition\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: updateref" " line must appear inside a database definition\n", fname, lineno, 0 ); -#endif return 1; } else if ( !SLAP_SHADOW(be) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, "%s: line %d: " - "updateref line must come after syncrepl or updatedn.\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "updateref line must after syncrepl or updatedn.\n", fname, lineno, 0 ); -#endif return 1; } if( validate_global_referral( cargv[1] ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: " - "invalid URL (%s) in \"updateref\" line.\n", - fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "invalid URL (%s) in \"updateref\" line.\n", fname, lineno, cargv[1] ); -#endif return 1; } @@ -2363,15 +1628,9 @@ restrict_unknown:; /* replication log file to which changes are appended */ } else if ( strcasecmp( cargv[0], "replogfile" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing filename in \"replogfile \"" - " line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing filename in \"replogfile \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -2384,69 +1643,39 @@ restrict_unknown:; /* file from which to read additional rootdse attrs */ } else if ( strcasecmp( cargv[0], "rootDSE" ) == 0) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: " - "missing filename in \"rootDSE \" line.\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "missing filename in \"rootDSE \" line.\n", fname, lineno, 0 ); -#endif return 1; } if( read_root_dse_file( cargv[1] ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: " - "could not read \"rootDSE \" line.\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "could not read \"rootDSE \" line\n", fname, lineno, 0 ); -#endif return 1; } /* maintain lastmodified{by,time} attributes */ } else if ( strcasecmp( cargv[0], "lastmod" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing on|off in \"lastmod \"" - " line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing on|off in \"lastmod \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, "%s: line %d: lastmod" - " line must appear inside a database definition\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: lastmod" " line must appear inside a database definition\n", fname, lineno, 0 ); -#endif return 1; } else if ( SLAP_NOLASTMODCMD(be) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, "%s: line %d: lastmod" - " not available for %s database\n", - fname, lineno , be->bd_info->bi_type ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: lastmod" " not available for %s databases\n", fname, lineno, be->bd_info->bi_type ); -#endif return 1; } @@ -2476,15 +1705,9 @@ restrict_unknown:; } else if ( strcasecmp( cargv[0], "idletimeout" ) == 0 ) { int i; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing timeout value in " - "\"idletimeout \" line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing timeout value in \"idletimeout \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -2492,15 +1715,9 @@ restrict_unknown:; i = atoi( cargv[1] ); if( i < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: timeout value (%d) invalid " - "\"idletimeout \" line.\n", fname, lineno, i ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: timeout value (%d) invalid \"idletimeout \" line\n", fname, lineno, i ); -#endif return( 1 ); } @@ -2510,15 +1727,9 @@ restrict_unknown:; /* include another config file */ } else if ( strcasecmp( cargv[0], "include" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing filename in \"include " - "\" line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing filename in \"include \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -2535,15 +1746,9 @@ restrict_unknown:; /* location of kerberos srvtab file */ } else if ( strcasecmp( cargv[0], "srvtab" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing filename in \"srvtab " - "\" line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing filename in \"srvtab \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -2552,55 +1757,31 @@ restrict_unknown:; #ifdef SLAPD_MODULES } else if (strcasecmp( cargv[0], "moduleload") == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: missing filename in \"moduleload " - "\" line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing filename in \"moduleload \" line\n", fname, lineno, 0 ); -#endif exit( EXIT_FAILURE ); } if (module_load(cargv[1], cargc - 2, (cargc > 2) ? cargv + 2 : NULL)) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: failed to load or initialize module %s\n", - fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: failed to load or initialize module %s\n", fname, lineno, cargv[1]); -#endif exit( EXIT_FAILURE ); } } else if (strcasecmp( cargv[0], "modulepath") == 0 ) { if ( cargc != 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: missing path in \"modulepath \"" - " line\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing path in \"modulepath \" line\n", fname, lineno, 0 ); -#endif exit( EXIT_FAILURE ); } if (module_path( cargv[1] )) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: failed to set module search path to %s.\n", - fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: failed to set module search path to %s\n", fname, lineno, cargv[1]); -#endif exit( EXIT_FAILURE ); } @@ -2669,15 +1850,9 @@ restrict_unknown:; } else if ( !strcasecmp( cargv[0], "reverse-lookup" ) ) { #ifdef SLAPD_RLOOKUPS if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: reverse-lookup: missing \"on\" or \"off\"\n", - fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: reverse-lookup: missing \"on\" or \"off\"\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -2686,28 +1861,16 @@ restrict_unknown:; } else if ( !strcasecmp( cargv[1], "off" ) ) { use_reverse_lookup = 0; } else { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: reverse-lookup: " - "must be \"on\" (default) or \"off\"\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: reverse-lookup: must be \"on\" (default) or \"off\"\n", fname, lineno, 0 ); -#endif return( 1 ); } #else /* !SLAPD_RLOOKUPS */ -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: reverse lookups " - "are not configured (ignored).\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: reverse lookups are not configured (ignored).\n", fname, lineno, 0 ); -#endif #endif /* !SLAPD_RLOOKUPS */ /* Netscape plugins */ @@ -2721,16 +1884,9 @@ restrict_unknown:; * and extended operation plugins */ if ( be == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: plugin line must appear " - "insid a database definition.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: plugin " "line must appear inside a database " "definition\n", fname, lineno, 0 ); -#endif return( 1 ); } #endif /* notdef */ @@ -2738,27 +1894,15 @@ restrict_unknown:; if ( slapi_int_read_config( be, fname, lineno, cargc, cargv ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: SLAPI config read failed.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: SLAPI " "config read failed.\n", fname, lineno, 0 ); -#endif return( 1 ); } slapi_plugins_used++; #else /* !defined( LDAP_SLAPI ) */ -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: SLAPI not supported.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: SLAPI " "not supported.\n", fname, lineno, 0 ); -#endif return( 1 ); #endif /* !defined( LDAP_SLAPI ) */ @@ -2767,17 +1911,10 @@ restrict_unknown:; } else if ( strcasecmp( cargv[0], "pluginlog" ) == 0 ) { #if defined( LDAP_SLAPI ) if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: missing file name " - "in pluginlog line.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing file name " "in pluginlog line.\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -2799,16 +1936,9 @@ restrict_unknown:; break; case SLAP_CONF_UNKNOWN: -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: unknown directive \"%s\" inside " - "backend info definition (ignored).\n", - fname, lineno, cargv[0] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown directive \"%s\" inside backend info definition (ignored)\n", fname, lineno, cargv[0] ); -#endif break; default: @@ -2825,16 +1955,9 @@ restrict_unknown:; break; case SLAP_CONF_UNKNOWN: -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: unknown directive \"%s\" inside " - "backend database definition (ignored).\n", - fname, lineno, cargv[0] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown directive \"%s\" inside backend database definition (ignored)\n", fname, lineno, cargv[0] ); -#endif break; default: @@ -2851,16 +1974,9 @@ restrict_unknown:; break; case SLAP_CONF_UNKNOWN: -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, INFO, - "%s: line %d: unknown directive \"%s\" inside " - "global database definition (ignored).\n", - fname, lineno, cargv[0] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown directive \"%s\" inside global database definition (ignored)\n", fname, lineno, cargv[0] ); -#endif break; default: @@ -2913,11 +2029,7 @@ fp_parse_line( *strtok_quote_ptr = ' '; } -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, DETAIL1, "line %d (%s)\n", lineno, logline , 0 ); -#else Debug( LDAP_DEBUG_CONFIG, "line %d (%s)\n", lineno, logline, 0 ); -#endif if ( strtok_quote_ptr ) { *strtok_quote_ptr = '\0'; @@ -2929,13 +2041,9 @@ fp_parse_line( tmp = ch_realloc( cargv, (cargv_size + ARGS_STEP) * sizeof(*cargv) ); if ( tmp == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ERR, "line %d: out of memory\n", lineno, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "line %d: out of memory\n", lineno, 0, 0 ); -#endif return -1; } cargv = tmp; @@ -3083,13 +2191,8 @@ load_ucdata( char *path ) } err = ucdata_load( path ? path : SLAPD_DEFAULT_UCDATA, UCDATA_ALL ); if ( err ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "load_ucdata: Error %d loading ucdata.\n", err, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "error loading ucdata (error %d)\n", err, 0, 0 ); -#endif return( -1 ); } @@ -3138,11 +2241,7 @@ add_syncrepl( si = (syncinfo_t *) ch_calloc( 1, sizeof( syncinfo_t ) ); if ( si == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ERR, "out of memory in add_syncrepl\n", 0, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "out of memory in add_syncrepl\n", 0, 0, 0 ); -#endif return 1; } @@ -3182,13 +2281,8 @@ add_syncrepl( LDAP_STAILQ_FOREACH( si_entry, &be->be_syncinfo, si_next ) { if ( si->si_rid == si_entry->si_rid ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ERR, - "add_syncrepl: duplicated replica id\n", 0, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "add_syncrepl: duplicated replica id\n",0, 0, 0 ); -#endif duplicated_replica_id = 1; break; } @@ -3197,11 +2291,7 @@ add_syncrepl( if ( rc < 0 || duplicated_replica_id ) { syncinfo_t *si_entry; /* Something bad happened - back out */ -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ERR, "failed to add syncinfo\n", 0, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "failed to add syncinfo\n", 0, 0, 0 ); -#endif /* If error, remove all syncinfo */ LDAP_STAILQ_FOREACH( si_entry, &be->be_syncinfo, si_next ) { @@ -3237,15 +2327,9 @@ add_syncrepl( LDAP_STAILQ_INIT( &be->be_syncinfo ); return 1; } else { -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, RESULTS, - "add_syncrepl: Config: ** successfully added syncrepl \"%s\"\n", - si->si_provideruri == NULL ? "(null)" : si->si_provideruri, 0, 0 ); -#else Debug( LDAP_DEBUG_CONFIG, "Config: ** successfully added syncrepl \"%s\"\n", si->si_provideruri == NULL ? "(null)" : si->si_provideruri, 0, 0 ); -#endif if ( !si->si_schemachecking ) { SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NO_SCHEMA_CHECK; } diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index ca7ad67580..8d353bdb2b 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -99,13 +99,8 @@ int connections_init(void) assert( connections == NULL ); if( connections != NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connections_init: already initialized.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "connections_init: already initialized.\n", 0, 0, 0 ); -#endif return -1; } @@ -116,15 +111,9 @@ int connections_init(void) connections = (Connection *) ch_calloc( dtblsize, sizeof(Connection) ); if( connections == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connections_init: allocation (%d * %ld) of connection " - "array failed\n", dtblsize, (long) sizeof(Connection), 0 ); -#else Debug( LDAP_DEBUG_ANY, "connections_init: allocation (%d*%ld) of connection array failed\n", dtblsize, (long) sizeof(Connection), 0 ); -#endif return -1; } @@ -151,13 +140,8 @@ int connections_destroy(void) /* should check return of every call */ if( connections == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connections_destroy: nothing to destroy.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "connections_destroy: nothing to destroy.\n", 0, 0, 0 ); -#endif return -1; } @@ -253,13 +237,9 @@ static Connection* connection_get( ber_socket_t s ) Connection *c; -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ENTRY, "connection_get: socket %ld\n", (long)s, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "connection_get(%ld)\n", (long) s, 0, 0 ); -#endif assert( connections != NULL ); @@ -317,27 +297,17 @@ static Connection* connection_get( ber_socket_t s ) assert( c->c_conn_state == SLAP_C_INVALID ); assert( sd == AC_SOCKET_INVALID ); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ARGS, - "connection_get: connection %d not used\n", s, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_get(%d): connection not used\n", s, 0, 0 ); -#endif ldap_pvt_thread_mutex_unlock( &c->c_mutex ); return NULL; } -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, RESULTS, - "connection_get: get for %d got connid %lu\n", s, c->c_connid, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_get(%d): got connid=%lu\n", s, c->c_connid, 0 ); -#endif c->c_n_get++; @@ -385,13 +355,8 @@ long connection_init( #endif if( s == AC_SOCKET_INVALID ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connection_init: init of socket %ld invalid.\n", (long)s, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "connection_init: init of socket %ld invalid.\n", (long)s, 0, 0 ); -#endif return -1; } @@ -441,15 +406,9 @@ long connection_init( } if( c == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connection_init(%d): connection table full " - "(%d/%d)\n", s, i, dtblsize ); -#else Debug( LDAP_DEBUG_ANY, "connection_init(%d): connection table full " "(%d/%d)\n", s, i, dtblsize); -#endif ldap_pvt_thread_mutex_unlock( &connections_mutex ); return -1; } @@ -594,15 +553,9 @@ long connection_init( if( ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_NONBLOCK, c /* non-NULL */ ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connection_init: conn %lu set nonblocking failed\n", - c->c_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "connection_init(%d, %s): set nonblocking failed\n", s, c->c_peer_name.bv_val, 0 ); -#endif } ldap_pvt_thread_mutex_lock( &conn_nextid_mutex ); @@ -787,15 +740,9 @@ void connection_closing( Connection *c ) ber_socket_t sd; ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd ); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "connection_closing: conn %lu readying socket %d for close.\n", - c->c_connid, sd, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_closing: readying conn=%lu sd=%d for close\n", c->c_connid, sd, 0 ); -#endif /* update state to closing */ c->c_conn_state = SLAP_C_CLOSING; @@ -824,25 +771,14 @@ static void connection_close( Connection *c ) ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd ); if( !LDAP_STAILQ_EMPTY(&c->c_ops) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "connection_close: conn %lu deferring sd %d\n", - c->c_connid, sd, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_close: deferring conn=%lu sd=%d\n", c->c_connid, sd, 0 ); -#endif return; } -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, RESULTS, - "connection_close: conn %lu sd %d\n", c->c_connid, sd, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_close: conn=%lu sd=%d\n", c->c_connid, sd, 0 ); -#endif connection_destroy( c ); } @@ -973,15 +909,9 @@ connection_operation( void *ctx, void *arg_v ) case LDAP_REQ_EXTENDED: break; default: -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, "connection_operation: " - "conn %lu unknown LDAP request 0x%lx\n", - conn->c_connid, tag, 0 ); -#else Debug( LDAP_DEBUG_ANY, "connection_operation: " "conn %lu unknown LDAP request 0x%lx\n", conn->c_connid, tag, 0 ); -#endif op->o_tag = LBER_ERROR; rs.sr_err = LDAP_PROTOCOL_ERROR; rs.sr_text = "unknown LDAP request"; @@ -991,15 +921,9 @@ connection_operation( void *ctx, void *arg_v ) } if( conn->c_sasl_bind_in_progress && tag != LDAP_REQ_BIND ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_operation: conn %lu SASL bind in progress (tag=%ld).\n", - conn->c_connid, (long)tag, 0 ); -#else Debug( LDAP_DEBUG_ANY, "connection_operation: " "error: SASL bind in progress (tag=%ld).\n", (long) tag, 0, 0 ); -#endif send_ldap_error( op, &rs, LDAP_OPERATIONS_ERROR, "SASL bind in progress" ); rc = LDAP_OPERATIONS_ERROR; @@ -1240,14 +1164,9 @@ int connection_read(ber_socket_t s) c = connection_get( s ); if( c == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connection_read: sock %ld no connection\n", (long)s, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "connection_read(%ld): no connection!\n", (long) s, 0, 0 ); -#endif slapd_remove(s, 1, 0); ldap_pvt_thread_mutex_unlock( &connections_mutex ); @@ -1257,15 +1176,9 @@ int connection_read(ber_socket_t s) c->c_n_read++; if( c->c_conn_state == SLAP_C_CLOSING ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connection_read: conn %lu connection closing, ignoring input\n", - c->c_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_read(%d): closing, ignoring input for id=%lu\n", s, c->c_connid, 0 ); -#endif connection_return( c ); ldap_pvt_thread_mutex_unlock( &connections_mutex ); return 0; @@ -1280,15 +1193,9 @@ int connection_read(ber_socket_t s) return 0; } -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "connection_read: conn %lu checking for input.\n", - c->c_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_read(%d): checking for input on id=%lu\n", s, c->c_connid, 0 ); -#endif #ifdef HAVE_TLS if ( c->c_is_tls && c->c_needs_tls_accept ) { @@ -1299,16 +1206,10 @@ int connection_read(ber_socket_t s) fd_set rfd; #endif -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_read: conn %lu TLS accept error, error %d\n", - c->c_connid, rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_read(%d): TLS accept error " "error=%d id=%lu, closing\n", s, rc, c->c_connid ); -#endif c->c_needs_tls_accept = 0; /* connections_mutex and c_mutex are locked */ connection_closing( c ); @@ -1345,15 +1246,9 @@ int connection_read(ber_socket_t s) rc = dnX509peerNormalize( ssl, &authid ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, "connection_read: " - "conn %lu unable to get TLS client DN, error %d\n", - c->c_connid, rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_read(%d): " "unable to get TLS client DN, error=%d id=%lu\n", s, rc, c->c_connid ); -#endif } slap_sasl_external( c, c->c_tls_ssf, &authid ); if ( authid.bv_val ) free( authid.bv_val ); @@ -1384,16 +1279,10 @@ int connection_read(ber_socket_t s) rc = ldap_pvt_sasl_install( c->c_sb, c->c_sasl_sockctx ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_read: conn %lu SASL install error %d, closing\n", - c->c_connid, rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_read(%d): SASL install error " "error=%d id=%lu, closing\n", s, rc, c->c_connid ); -#endif /* connections_mutex and c_mutex are locked */ connection_closing( c ); connection_close( c ); @@ -1420,15 +1309,9 @@ int connection_read(ber_socket_t s) #endif if( rc < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_read: conn %lu input error %d, closing.\n", - c->c_connid, rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_read(%d): input error=%d id=%lu, closing.\n", s, rc, c->c_connid ); -#endif /* connections_mutex and c_mutex are locked */ connection_closing( c ); connection_close( c ); @@ -1469,13 +1352,7 @@ connection_input( if ( conn->c_currentber == NULL && ( conn->c_currentber = ber_alloc()) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_input: conn %lu ber_alloc failed.\n", - conn->c_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 ); -#endif return -1; } @@ -1503,15 +1380,9 @@ connection_input( ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_GET_FD, &sd ); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_input: conn %lu ber_get_next failed, errno %d (%s).\n", - conn->c_connid, err, sock_errstr(err) ); -#else Debug( LDAP_DEBUG_TRACE, "ber_get_next on fd %d failed errno=%d (%s)\n", sd, err, sock_errstr(err) ); -#endif if ( err != EWOULDBLOCK && err != EAGAIN ) { /* log, close and send error */ ber_free( conn->c_currentber, 1 ); @@ -1527,28 +1398,16 @@ connection_input( if ( (tag = ber_get_int( ber, &msgid )) != LDAP_TAG_MSGID ) { /* log, close and send error */ -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_input: conn %lu ber_get_int returns 0x%lx.\n", - conn->c_connid, tag, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_get_int returns 0x%lx\n", tag, 0, 0 ); -#endif ber_free( ber, 1 ); return -1; } if ( (tag = ber_peek_tag( ber, &len )) == LBER_ERROR ) { /* log, close and send error */ -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_input: conn %lu ber_peek_tag returns 0x%lx.\n", - conn->c_connid, tag, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_peek_tag returns 0x%lx\n", tag, 0, 0 ); -#endif ber_free( ber, 1 ); return -1; @@ -1561,13 +1420,7 @@ connection_input( tag = ber_peek_tag(ber, &len); } if( tag != LDAP_REQ_ABANDON && tag != LDAP_REQ_SEARCH ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_input: conn %lu invalid req for UDP 0x%lx.\n", - conn->c_connid, tag, 0 ); -#else Debug( LDAP_DEBUG_ANY, "invalid req for UDP 0x%lx\n", tag, 0, 0 ); -#endif ber_free( ber, 1 ); return 0; } @@ -1606,26 +1459,14 @@ connection_input( sizeof(struct sockaddr), 0 ); if (rc != sizeof(struct sockaddr)) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connection_input: conn %lu ber_write failed\n", - conn->c_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_write failed\n", 0, 0, 0 ); -#endif return 1; } if (op->o_protocol == LDAP_VERSION2) { rc = ber_printf(op->o_res_ber, "{is{" /*}}*/, op->o_msgid, ""); if (rc == -1) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connection_input: conn %lu put outer sequence failed\n", - conn->c_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_write failed\n", 0, 0, 0 ); -#endif return rc; } } @@ -1658,15 +1499,9 @@ connection_input( ? slap_conn_max_pending_auth : slap_conn_max_pending; -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connection_input: conn %lu deferring operation: %s\n", - conn->c_connid, defer, 0 ); -#else Debug( LDAP_DEBUG_ANY, "connection_input: conn=%lu deferring operation: %s\n", conn->c_connid, defer, 0 ); -#endif conn->c_n_ops_pending++; LDAP_STAILQ_INSERT_TAIL( &conn->c_pending_ops, op, o_next ); if ( conn->c_n_ops_pending > max ) { @@ -1704,15 +1539,9 @@ connection_resched( Connection *conn ) rc = ldap_pvt_thread_mutex_trylock( &connections_mutex ); if( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "connection_resched: conn %lu reaquiring locks.\n", - conn->c_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_resched: reaquiring locks conn=%lu sd=%d\n", conn->c_connid, sd, 0 ); -#endif /* * reaquire locks in the right order... * this may allow another thread to close this connection, @@ -1724,25 +1553,13 @@ connection_resched( Connection *conn ) } if( conn->c_conn_state != SLAP_C_CLOSING ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "connection_resched: conn %lu closed by other thread.\n", - conn->c_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_resched: " "closed by other thread conn=%lu sd=%d\n", conn->c_connid, sd, 0 ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "connection_resched: conn %lu attempting closing.\n", - conn->c_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_resched: " "attempting closing conn=%lu sd=%d\n", conn->c_connid, sd, 0 ); -#endif connection_close( conn ); } @@ -1811,15 +1628,9 @@ static int connection_op_activate( Operation *op ) connection_operation, (void *) op ); if ( status != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_op_activate: conn %lu thread pool submit failed.\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ldap_pvt_thread_pool_submit: failed (%d) for conn=%lu\n", status, op->o_connid, 0 ); -#endif /* should move op to pending list */ } @@ -1839,14 +1650,9 @@ int connection_write(ber_socket_t s) slapd_clr_write( s, 0); if( c == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "connection_write: sock %ld no connection!\n", (long)s, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "connection_write(%ld): no connection!\n", (long)s, 0, 0 ); -#endif slapd_remove(s, 1, 0); ldap_pvt_thread_mutex_unlock( &connections_mutex ); return -1; @@ -1854,14 +1660,9 @@ int connection_write(ber_socket_t s) c->c_n_write++; -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "connection_write conn %lu waking output.\n", c->c_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection_write(%d): waking output for id=%lu\n", s, c->c_connid, 0 ); -#endif ldap_pvt_thread_cond_signal( &c->c_write_cv ); if ( ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_NEEDS_READ, NULL ) ) { diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 0c70f65088..68799812ea 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -395,13 +395,8 @@ int get_ctrls( goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "get_ctrls: conn %lu\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> get_ctrls\n", 0, 0, 0 ); -#endif if( op->o_protocol < LDAP_VERSION3 ) { rs->sr_err = SLAPD_DISCONNECT; @@ -459,13 +454,8 @@ int get_ctrls( c->ldctl_oid = bv.bv_val; if( tag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "get_ctrls: conn %lu get OID failed.\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get oid failed.\n", 0, 0, 0 ); -#endif slap_free_ctrls( op, op->o_ctrls ); op->o_ctrls = NULL; @@ -474,15 +464,9 @@ int get_ctrls( goto return_results; } else if( c->ldctl_oid == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "get_ctrls: conn %lu got emtpy OID.\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "get_ctrls: conn %lu got emtpy OID.\n", op->o_connid, 0, 0 ); -#endif slap_free_ctrls( op, op->o_ctrls ); op->o_ctrls = NULL; @@ -498,14 +482,8 @@ int get_ctrls( tag = ber_scanf( ber, "b", &crit ); if( tag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "get_ctrls: conn %lu get crit failed.\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get crit failed.\n", 0, 0, 0 ); -#endif slap_free_ctrls( op, op->o_ctrls ); op->o_ctrls = NULL; rs->sr_err = SLAPD_DISCONNECT; @@ -521,17 +499,10 @@ int get_ctrls( tag = ber_scanf( ber, "m", &c->ldctl_value ); if( tag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "get_ctrls: conn %lu: " - "%s (%scritical): get value failed.\n", - op->o_connid, c->ldctl_oid, - c->ldctl_iscritical ? "" : "non" ); -#else Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: conn %lu: " "%s (%scritical): get value failed.\n", op->o_connid, c->ldctl_oid, c->ldctl_iscritical ? "" : "non" ); -#endif slap_free_ctrls( op, op->o_ctrls ); op->o_ctrls = NULL; rs->sr_err = SLAPD_DISCONNECT; @@ -540,15 +511,9 @@ int get_ctrls( } } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "get_ctrls: conn %lu oid=\"%s\" (%scritical)\n", - op->o_connid, c->ldctl_oid, c->ldctl_iscritical ? "" : "non" ); -#else Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: oid=\"%s\" (%scritical)\n", c->ldctl_oid, c->ldctl_iscritical ? "" : "non", 0 ); -#endif sc = find_ctrl( c->ldctl_oid ); if( sc != NULL ) { @@ -648,15 +613,9 @@ next_ctrl:; } return_results: -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, RESULTS, - "get_ctrls: n=%d rc=%d err=\"%s\"\n", - nctrls, rs->sr_err, rs->sr_text ? rs->sr_text : "" ); -#else Debug( LDAP_DEBUG_TRACE, "<= get_ctrls: n=%d rc=%d err=\"%s\"\n", nctrls, rs->sr_err, rs->sr_text ? rs->sr_text : ""); -#endif if( sendres && rs->sr_err != LDAP_SUCCESS ) { if( rs->sr_err == SLAPD_DISCONNECT ) { @@ -736,30 +695,16 @@ static int parseProxyAuthz ( ? SLAP_CRITICAL_CONTROL : SLAP_NONCRITICAL_CONTROL; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "parseProxyAuthz: conn %lu authzid=\"%s\"\n", - op->o_connid, - ctrl->ldctl_value.bv_len ? ctrl->ldctl_value.bv_val : "anonymous", - 0 ); -#else Debug( LDAP_DEBUG_ARGS, "parseProxyAuthz: conn %lu authzid=\"%s\"\n", op->o_connid, ctrl->ldctl_value.bv_len ? ctrl->ldctl_value.bv_val : "anonymous", 0 ); -#endif if( ctrl->ldctl_value.bv_len == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, RESULTS, - "parseProxyAuthz: conn=%lu anonymous\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "parseProxyAuthz: conn=%lu anonymous\n", op->o_connid, 0, 0 ); -#endif /* anonymous */ free( op->o_dn.bv_val ); @@ -785,17 +730,10 @@ static int parseProxyAuthz ( return LDAP_PROXY_AUTHZ_FAILURE; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, RESULTS, - "parseProxyAuthz: conn=%lu \"%s\"\n", - op->o_connid, - dn.bv_len ? dn.bv_val : "(NULL)", 0 ); -#else Debug( LDAP_DEBUG_TRACE, "parseProxyAuthz: conn=%lu \"%s\"\n", op->o_connid, dn.bv_len ? dn.bv_val : "(NULL)", 0 ); -#endif rc = slap_sasl_authorized( op, &op->o_ndn, &dn ); @@ -1011,14 +949,8 @@ static int parseAssert ( #ifdef LDAP_DEBUG filter2bv_x( op, op->o_assertion, &fstr ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "parseAssert: conn %ld assert: %s\n", - op->o_connid, fstr.bv_len ? fstr.bv_val : "empty" , 0 ); -#else Debug( LDAP_DEBUG_ARGS, "parseAssert: conn %ld assert: %s\n", op->o_connid, fstr.bv_len ? fstr.bv_val : "empty" , 0 ); -#endif op->o_tmpfree( fstr.bv_val, op->o_tmpmemctx ); #endif @@ -1184,14 +1116,8 @@ int parseValuesReturnFilter ( vrFilter2bv( op, op->o_vrFilter, &fstr ); } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "parseValuesReturnFilter: conn %d vrFilter: %s\n", - op->o_connid, fstr.bv_len ? fstr.bv_val : "empty" , 0 ); -#else Debug( LDAP_DEBUG_ARGS, " vrFilter: %s\n", fstr.bv_len ? fstr.bv_val : "empty", 0, 0 ); -#endif op->o_tmpfree( fstr.bv_val, op->o_tmpmemctx ); #endif diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index fe85302d60..02acfae17f 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -238,17 +238,10 @@ static void slapd_add(ber_socket_t s, int isactive) { FD_SET( s, &slap_daemon.sd_actives ); FD_SET( s, &slap_daemon.sd_readers ); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "slapd_add: added %ld%s%s\n", (long)s, - FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "", - FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" ); -#else Debug( LDAP_DEBUG_CONNS, "daemon: added %ld%s%s\n", (long) s, FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "", FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" ); -#endif ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex ); } @@ -262,17 +255,10 @@ void slapd_remove(ber_socket_t s, int wasactive, int wake) { slap_daemon.sd_nactives--; } -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "slapd_remove: removing %ld%s%s\n", (long) s, - FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "", - FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" ); -#else Debug( LDAP_DEBUG_CONNS, "daemon: removing %ld%s%s\n", (long) s, FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "", FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" ); -#endif FD_CLR( s, &slap_daemon.sd_actives ); FD_CLR( s, &slap_daemon.sd_readers ); FD_CLR( s, &slap_daemon.sd_writers ); @@ -346,12 +332,8 @@ void slapd_set_read(ber_socket_t s, int wake) { } static void slapd_close(ber_socket_t s) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, "slapd_close: closing %ld\n", (long)s, 0, 0); -#else Debug( LDAP_DEBUG_CONNS, "daemon: closing %ld\n", (long) s, 0, 0 ); -#endif tcp_close(s); } @@ -476,15 +458,9 @@ static int slap_get_listener_addresses( if ( strlen(host) > (sizeof(((struct sockaddr_un *)*sap)->sun_path) - 1) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_get_listener_addresses: domain socket path (%s) " - "too long in URL\n", host, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon: domain socket path (%s) too long in URL", host, 0, 0); -#endif goto errexit; } @@ -506,14 +482,8 @@ static int slap_get_listener_addresses( snprintf(serv, sizeof serv, "%d", port); if ( (err = getaddrinfo(host, serv, &hints, &res)) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_get_listener_addresses: getaddrinfo failed: %s\n", - AC_GAI_STRERROR(err), 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon: getaddrinfo failed: %s\n", AC_GAI_STRERROR(err), 0, 0); -#endif return -1; } @@ -531,14 +501,8 @@ static int slap_get_listener_addresses( for ( sai=res; sai; sai=sai->ai_next ) { if( sai->ai_addr == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_get_listener_addresses: " - "getaddrinfo ai_addr is NULL?\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slap_get_listener_addresses: " "getaddrinfo ai_addr is NULL?\n", 0, 0, 0 ); -#endif freeaddrinfo(res); goto errexit; } @@ -588,13 +552,8 @@ static int slap_get_listener_addresses( } else if ( !inet_aton( host, &in ) ) { he = gethostbyname( host ); if( he == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_get_listener_addresses: invalid host %s\n", host, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon: invalid host %s", host, 0, 0); -#endif return -1; } for (n = 0; he->h_addr_list[n]; n++) ; @@ -656,15 +615,9 @@ static int slap_open_listener( rc = ldap_url_parse( url, &lud ); if( rc != LDAP_URL_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slap_open_listener: listen URL \"%s\" parse error %d\n", - url, rc , 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon: listen URL \"%s\" parse error=%d\n", url, rc, 0 ); -#endif return rc; } @@ -673,14 +626,9 @@ static int slap_open_listener( #ifndef HAVE_TLS if( ldap_pvt_url_scheme2tls( lud->lud_scheme ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_open_listener: TLS is not supported (%s)\n", url, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon: TLS not supported (%s)\n", url, 0, 0 ); -#endif ldap_free_urldesc( lud ); return -1; } @@ -709,13 +657,8 @@ static int slap_open_listener( } #else -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_open_listener: URL scheme is not supported: %s\n", url, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon: URL scheme not supported: %s", url, 0, 0); -#endif ldap_free_urldesc( lud ); return -1; #endif @@ -781,29 +724,17 @@ static int slap_open_listener( l.sl_sd = socket( (*sal)->sa_family, socktype, 0); if ( l.sl_sd == AC_SOCKET_INVALID ) { int err = sock_errno(); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slap_open_listener: %s socket() failed errno=%d (%s)\n", - af, err, sock_errstr(err) ); -#else Debug( LDAP_DEBUG_ANY, "daemon: %s socket() failed errno=%d (%s)\n", af, err, sock_errstr(err) ); -#endif sal++; continue; } #ifndef HAVE_WINSOCK if ( l.sl_sd >= dtblsize ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slap_open_listener: listener descriptor %ld is too " - "great %ld\n", (long)l.sl_sd, (long)dtblsize, 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon: listener descriptor %ld is too great %ld\n", (long) l.sl_sd, (long) dtblsize, 0 ); -#endif tcp_close( l.sl_sd ); sal++; continue; @@ -822,16 +753,9 @@ static int slap_open_listener( (char *) &tmp, sizeof(tmp) ); if ( rc == AC_SOCKET_ERROR ) { int err = sock_errno(); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_open_listener: setsockopt( %ld, SO_REUSEADDR ) " - "failed errno %d (%s)\n", (long)l.sl_sd, err, - sock_errstr(err) ); -#else Debug( LDAP_DEBUG_ANY, "slapd(%ld): setsockopt(SO_REUSEADDR) failed errno=%d (%s)\n", (long) l.sl_sd, err, sock_errstr(err) ); -#endif } #endif } @@ -849,15 +773,9 @@ static int slap_open_listener( (char *) &tmp, sizeof(tmp) ); if ( rc == AC_SOCKET_ERROR ) { int err = sock_errno(); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_open_listener: setsockopt( %ld, IPV6_V6ONLY ) failed errno %d (%s)\n", - (long)l.sl_sd, err, sock_errstr(err) ); -#else Debug( LDAP_DEBUG_ANY, "slapd(%ld): setsockopt(IPV6_V6ONLY) failed errno=%d (%s)\n", (long) l.sl_sd, err, sock_errstr(err) ); -#endif } #endif addrlen = sizeof(struct sockaddr_in6); @@ -872,14 +790,8 @@ static int slap_open_listener( if (bind(l.sl_sd, *sal, addrlen)) { err = sock_errno(); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_open_listener: bind(%ld) failed errno=%d (%s)\n", - (long)l.sl_sd, err, sock_errstr(err) ); -#else Debug( LDAP_DEBUG_ANY, "daemon: bind(%ld) failed errno=%d (%s)\n", (long) l.sl_sd, err, sock_errstr(err) ); -#endif tcp_close( l.sl_sd ); sal++; continue; @@ -892,14 +804,8 @@ static int slap_open_listener( #if 0 /* don't muck with socket perms */ if ( chmod( addr, l.sl_perms ) < 0 && crit ) { int err = sock_errno(); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_open_listener: fchmod(%ld) failed errno=%d (%s)\n", - (long)l.sl_sd, err, sock_errstr(err) ); -#else Debug( LDAP_DEBUG_ANY, "daemon: fchmod(%ld) failed errno=%d (%s)", (long) l.sl_sd, err, sock_errstr(err) ); -#endif tcp_close( l.sl_sd ); slap_free_listener_addresses(psal); return -1; @@ -945,14 +851,8 @@ static int slap_open_listener( #endif /* LDAP_PF_INET6 */ default: -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_open_listener: unsupported address family (%d)\n", - (int)(*sal)->sa_family, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon: unsupported address family (%d)\n", (int) (*sal)->sa_family, 0, 0 ); -#endif break; } @@ -970,24 +870,13 @@ static int slap_open_listener( if ( l.sl_url.bv_val == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, RESULTS, - "slap_open_listener: failed on %s\n", url, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_open_listener: failed on %s\n", url, 0, 0 ); -#endif return -1; } -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, RESULTS, - "slap_open_listener: daemon initialized %s\n", - l.sl_url.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "daemon: initialized %s\n", l.sl_url.bv_val, 0, 0 ); -#endif return 0; } @@ -999,13 +888,8 @@ int slapd_daemon_init( const char *urls ) int i, j, n, rc; char **u; -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ARGS, - "slapd_daemon_init: %s\n", urls ? urls : "", 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "daemon_init: %s\n", urls ? urls : "", 0, 0 ); -#endif if( (rc = sockinit()) != 0 ) { return rc; } @@ -1030,13 +914,8 @@ int slapd_daemon_init( const char *urls ) * this byte arrives. */ if( (rc = lutil_pair( wake_sds )) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slap_daemon_init: lutil_pair() failed rc=%d\n", rc, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "daemon: lutil_pair() failed rc=%d\n", rc, 0, 0 ); -#endif return rc; } @@ -1050,45 +929,25 @@ int slapd_daemon_init( const char *urls ) u = ldap_str2charray( urls, " " ); if( u == NULL || u[0] == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slap_daemon_init: no urls (%s) provided.\n", urls, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon_init: no urls (%s) provided.\n", urls, 0, 0 ); -#endif return -1; } for( i=0; u[i] != NULL; i++ ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "slap_daemon_init: listen on %s\n", u[i], 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "daemon_init: listen on %s\n", u[i], 0, 0 ); -#endif } if( i == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_daemon_init: no listeners to open (%s)\n", urls, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon_init: no listeners to open (%s)\n", urls, 0, 0 ); -#endif ldap_charray_free( u ); return -1; } -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slap_daemon_init: %d listeners to open...\n", i, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners to open...\n", i, 0, 0 ); -#endif slap_listeners = ch_malloc( (i+1)*sizeof(Listener *) ); for(n = 0, j = 0; u[n]; n++ ) { @@ -1099,13 +958,8 @@ int slapd_daemon_init( const char *urls ) } slap_listeners[j] = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "slap_daemon_init: %d listeners opened\n", i, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners opened\n", i, 0, 0 ); -#endif #ifdef HAVE_SLP if( slapd_register_slp ) { @@ -1230,14 +1084,9 @@ slapd_daemon_task( if ( i < l ) { /* We are already listening to in6addr_any */ -#ifdef NEW_LOGGING - LDAP_LOG(CONNECTION, WARNING, - "slapd_daemon_task: Attempt to listen to 0.0.0.0 failed, already listening on ::, assuming IPv4 included\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_CONNS, "daemon: Attempt to listen to 0.0.0.0 failed, already listening on ::, assuming IPv4 included\n", 0, 0, 0 ); -#endif slapd_close( slap_listeners[l]->sl_sd ); slap_listeners[l]->sl_sd = AC_SOCKET_INVALID; continue; @@ -1245,16 +1094,10 @@ slapd_daemon_task( } } #endif -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slapd_daemon_task: listen( %s, 5 ) failed errno=%d (%s)\n", - slap_listeners[l]->sl_url.bv_val, err, sock_errstr(err) ); -#else Debug( LDAP_DEBUG_ANY, "daemon: listen(%s, 5) failed errno=%d (%s)\n", slap_listeners[l]->sl_url.bv_val, err, sock_errstr(err) ); -#endif return( (void*)-1 ); } @@ -1404,17 +1247,10 @@ slapd_daemon_task( slap_listeners[l]->sl_is_mute ) continue; -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "slapd_daemon_task: select: listen=%d " - "active_threads=%d tvp=%s\n", - slap_listeners[l]->sl_sd, at, tvp == NULL ? "NULL" : "zero" ); -#else Debug( LDAP_DEBUG_CONNS, "daemon: select: listen=%d active_threads=%d tvp=%s\n", slap_listeners[l]->sl_sd, at, tvp == NULL ? "NULL" : "zero" ); -#endif } switch(ns = select( nfds, &readfds, @@ -1440,15 +1276,9 @@ slapd_daemon_task( } if( err != EINTR ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slapd_daemon_task: select failed (%d): %s\n", - err, sock_errstr(err), 0 ); -#else Debug( LDAP_DEBUG_CONNS, "daemon: select failed (%d): %s\n", err, sock_errstr(err), 0 ); -#endif slapd_shutdown = 2; } } @@ -1456,13 +1286,8 @@ slapd_daemon_task( case 0: /* timeout - let threads run */ ebadf = 0; -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL2, - "slapd_daemon_task: select timeout - yielding\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_CONNS, "daemon: select timeout - yielding\n", 0, 0, 0 ); -#endif ldap_pvt_thread_yield(); continue; @@ -1471,13 +1296,8 @@ slapd_daemon_task( if( slapd_shutdown ) continue; ebadf = 0; -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL2, - "slapd_daemon_task: activity on %d descriptors\n", ns, 0, 0 ); -#else Debug( LDAP_DEBUG_CONNS, "daemon: activity on %d descriptors\n", ns, 0, 0 ); -#endif /* FALL THRU */ } @@ -1566,17 +1386,10 @@ slapd_daemon_task( ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex ); } -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slapd_daemon_task: accept(%ld) failed errno=%d (%s)\n", - (long)slap_listeners[l]->sl_sd, - err, sock_errstr(err) ); -#else Debug( LDAP_DEBUG_ANY, "daemon: accept(%ld) failed errno=%d (%s)\n", (long) slap_listeners[l]->sl_sd, err, sock_errstr(err) ); -#endif ldap_pvt_thread_yield(); continue; } @@ -1584,15 +1397,9 @@ slapd_daemon_task( #ifndef HAVE_WINSOCK /* make sure descriptor number isn't too great */ if ( s >= dtblsize ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slapd_daemon_task: %ld beyond descriptor table size %ld\n", - (long)s, (long)dtblsize, 0 ); -#else Debug( LDAP_DEBUG_ANY, "daemon: %ld beyond descriptor table size %ld\n", (long) s, (long) dtblsize, 0 ); -#endif slapd_close(s); ldap_pvt_thread_yield(); @@ -1626,16 +1433,9 @@ slapd_daemon_task( (char *) &tmp, sizeof(tmp) ); if ( rc == AC_SOCKET_ERROR ) { int err = sock_errno(); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slapd_daemon_task: setsockopt( %ld, SO_KEEPALIVE)" - " failed errno=%d (%s)\n", - (long)s, err, sock_errstr(err) ); -#else Debug( LDAP_DEBUG_ANY, "slapd(%ld): setsockopt(SO_KEEPALIVE) failed " "errno=%d (%s)\n", (long) s, err, sock_errstr(err) ); -#endif } #endif #ifdef TCP_NODELAY @@ -1645,28 +1445,16 @@ slapd_daemon_task( (char *)&tmp, sizeof(tmp) ); if ( rc == AC_SOCKET_ERROR ) { int err = sock_errno(); -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slapd_daemon_task: setsockopt( %ld, " - "TCP_NODELAY) failed errno=%d (%s)\n", - (long)s, err, sock_errstr(err) ); -#else Debug( LDAP_DEBUG_ANY, "slapd(%ld): setsockopt(TCP_NODELAY) failed " "errno=%d (%s)\n", (long) s, err, sock_errstr(err) ); -#endif } #endif } #endif -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL1, - "slapd_daemon_task: new connection on %ld\n", (long)s, 0, 0 ); -#else Debug( LDAP_DEBUG_CONNS, "daemon: new connection on %ld\n", (long) s, 0, 0 ); -#endif switch ( from.sa_addr.sa_family ) { # ifdef LDAP_PF_LOCAL case AF_LOCAL: @@ -1783,21 +1571,12 @@ slapd_daemon_task( if( authid.bv_val ) ch_free(authid.bv_val); if( id < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, INFO, - "slapd_daemon_task: " - "connection_init(%ld, %s, %s) " - "failed.\n", - (long)s, peername, - slap_listeners[l]->sl_name.bv_val ); -#else Debug( LDAP_DEBUG_ANY, "daemon: connection_init(%ld, %s, %s) " "failed.\n", (long) s, peername, slap_listeners[l]->sl_name.bv_val ); -#endif slapd_close(s); continue; } @@ -1814,30 +1593,15 @@ slapd_daemon_task( } #ifdef LDAP_DEBUG -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL2, - "slapd_daemon_task: activity on ", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_CONNS, "daemon: activity on:", 0, 0, 0 ); -#endif #ifdef HAVE_WINSOCK for ( i = 0; i < readfds.fd_count; i++ ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL2, - " %d%s", readfds.fd_array[i], "r", 0, 0 ); -#else Debug( LDAP_DEBUG_CONNS, " %d%s", readfds.fd_array[i], "r", 0 ); -#endif } for ( i = 0; i < writefds.fd_count; i++ ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL2, - " %d%s", writefds.fd_array[i], "w" , 0 ); -#else Debug( LDAP_DEBUG_CONNS, " %d%s", writefds.fd_array[i], "w", 0 ); -#endif } #else @@ -1847,21 +1611,12 @@ slapd_daemon_task( r = FD_ISSET( i, &readfds ); w = FD_ISSET( i, &writefds ); if ( r || w ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL2, - " %d%s%s", i, r ? "r" : "", w ? "w" : "" ); -#else Debug( LDAP_DEBUG_CONNS, " %d%s%s", i, r ? "r" : "", w ? "w" : "" ); -#endif } } #endif -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL2, "\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 ); -#endif #endif @@ -1882,14 +1637,9 @@ slapd_daemon_task( wd = i; #endif -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL2, - "slapd_daemon_task: write active on %d\n", wd, 0, 0 ); -#else Debug( LDAP_DEBUG_CONNS, "daemon: write active on %d\n", wd, 0, 0 ); -#endif /* * NOTE: it is possible that the connection was closed * and that the stream is now inactive. @@ -1919,13 +1669,8 @@ slapd_daemon_task( rd = i; #endif -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, DETAIL2, - "slapd_daemon_task: read activity on %d\n", rd, 0, 0 ); -#else Debug ( LDAP_DEBUG_CONNS, "daemon: read activity on %d\n", rd, 0, 0 ); -#endif /* * NOTE: it is possible that the connection was closed * and that the stream is now inactive. @@ -1941,47 +1686,24 @@ slapd_daemon_task( } if( slapd_shutdown == 1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, CRIT, - "slapd_daemon_task: shutdown requested and initiated.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "daemon: shutdown requested and initiated.\n", 0, 0, 0 ); -#endif } else if ( slapd_shutdown == 2 ) { #ifdef HAVE_NT_SERVICE_MANAGER -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, CRIT, - "slapd_daemon_task: shutdown initiated by Service Manager.\n", - 0, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "daemon: shutdown initiated by Service Manager.\n", 0, 0, 0); -#endif #else /* !HAVE_NT_SERVICE_MANAGER */ -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, CRIT, - "slapd_daemon_task: abnormal condition, " - "shutdown initiated.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "daemon: abnormal condition, shutdown initiated.\n", 0, 0, 0 ); -#endif #endif /* !HAVE_NT_SERVICE_MANAGER */ } else { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, CRIT, - "slapd_daemon_task: no active streams, shutdown initiated.\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "daemon: no active streams, shutdown initiated.\n", 0, 0, 0 ); -#endif } if( slapd_gentle_shutdown != 2 ) { @@ -1996,15 +1718,9 @@ slapd_daemon_task( connections_shutdown(); } -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, CRIT, - "slapd_daemon_task: shutdown waiting for %d threads to terminate.\n", - ldap_pvt_thread_pool_backload(&connection_pool), 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slapd shutdown: waiting for %d threads to terminate\n", ldap_pvt_thread_pool_backload(&connection_pool), 0, 0 ); -#endif ldap_pvt_thread_pool_destroy(&connection_pool, 1); return NULL; @@ -2027,14 +1743,8 @@ int slapd_daemon( void ) 0, slapd_daemon_task, NULL ); if ( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, ERR, - "slapd_daemon: listener ldap_pvt_thread_create failed (%d).\n", - rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "listener ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 ); -#endif return rc; } @@ -2103,12 +1813,7 @@ RETSIGTYPE slap_sig_shutdown( int sig ) { #if 0 -#ifdef NEW_LOGGING - LDAP_LOG( CONNECTION, CRIT, - "slap_sig_shutdown: signal %d\n", sig, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "slap_sig_shutdown: signal %d\n", sig, 0, 0); -#endif #endif /* diff --git a/servers/slapd/delete.c b/servers/slapd/delete.c index 1cd435201d..bc502ebf0e 100644 --- a/servers/slapd/delete.c +++ b/servers/slapd/delete.c @@ -46,12 +46,7 @@ do_delete( { struct berval dn = BER_BVNULL; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "do_delete: conn %d\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 ); -#endif /* * Parse the delete request. It looks like this: @@ -60,61 +55,34 @@ do_delete( */ if ( ber_scanf( op->o_ber, "m", &dn ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_delete: conn: %d ber_scanf failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); return SLAPD_DISCONNECT; } if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_delete: conn %d get_ctrls failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_delete: get_ctrls failed\n", 0, 0, 0 ); -#endif goto cleanup; } rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx ); if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_delete: conn %d invalid dn (%s)\n", - op->o_connid, dn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_delete: invalid dn (%s)\n", dn.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" ); goto cleanup; } if( op->o_req_ndn.bv_len == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_delete: conn %d: Attempt to delete root DSE.\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_delete: root dse!\n", 0, 0, 0 ); -#endif /* protocolError would likely be a more appropriate error */ send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, "cannot delete the root DSE" ); goto cleanup; } else if ( bvmatch( &op->o_req_ndn, &frontendDB->be_schemandn ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "do_delete: conn %d: " - "Attempt to delete subschema subentry.\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_delete: subschema subentry!\n", 0, 0, 0 ); -#endif /* protocolError would likely be a more appropriate error */ send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, "cannot delete the root DSE" ); @@ -192,13 +160,8 @@ fe_op_delete( Operation *op, SlapReply *rs ) * A preoperation plugin failure will abort the * entire operation. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "do_delete: " - "delete preoperation plugin failed\n", 0, 0, 0 ); -#else Debug (LDAP_DEBUG_TRACE, "do_delete: " "delete preoperation plugin failed.\n", 0, 0, 0); -#endif if ( ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 ) || rs->sr_err == LDAP_SUCCESS ) @@ -310,15 +273,9 @@ fe_op_delete( Operation *op, SlapReply *rs ) if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_DELETE_FN, pb ) < 0) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_delete: delete postoperation plugins failed\n", - 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "do_delete: delete postoperation plugins failed\n", 0, 0, 0 ); -#endif } #endif /* defined( LDAP_SLAPI ) */ diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index 388ea12366..a74aa42832 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -686,11 +686,7 @@ dnPretty( assert( val ); assert( out ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 ); -#endif if ( val->bv_len == 0 ) { ber_dupbv_x( out, val, ctx ); @@ -732,11 +728,7 @@ dnPretty( } } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, "<<< dnPretty: <%s>\n", out->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<<< dnPretty: <%s>\n", out->bv_val, 0, 0 ); -#endif return LDAP_SUCCESS; } @@ -751,11 +743,7 @@ rdnPretty( assert( val ); assert( out ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 ); -#endif if ( val->bv_len == 0 ) { ber_dupbv_x( out, val, ctx ); @@ -799,11 +787,7 @@ rdnPretty( } } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, "<<< dnPretty: <%s>\n", out->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<<< dnPretty: <%s>\n", out->bv_val, 0, 0 ); -#endif return LDAP_SUCCESS; } @@ -820,15 +804,9 @@ dnPrettyNormalDN( assert( val ); assert( dn ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, ">>> dn%sDN: <%s>\n", - flags == SLAP_LDAPDN_PRETTY ? "Pretty" : "Normal", - val->bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, ">>> dn%sDN: <%s>\n", flags == SLAP_LDAPDN_PRETTY ? "Pretty" : "Normal", val->bv_val, 0 ); -#endif if ( val->bv_len == 0 ) { return LDAP_SUCCESS; @@ -875,11 +853,7 @@ dnPrettyNormal( struct berval *normal, void *ctx) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ENTRY, ">>> dnPrettyNormal: <%s>\n", val->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, ">>> dnPrettyNormal: <%s>\n", val->bv_val, 0, 0 ); -#endif assert( val ); assert( pretty ); @@ -946,13 +920,8 @@ dnPrettyNormal( } } -#ifdef NEW_LOGGING - LDAP_LOG (OPERATION, RESULTS, "<<< dnPrettyNormal: <%s>, <%s>\n", - pretty->bv_val, normal->bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<<< dnPrettyNormal: <%s>, <%s>\n", pretty->bv_val, normal->bv_val, 0 ); -#endif return LDAP_SUCCESS; } @@ -985,13 +954,8 @@ dnMatch( value->bv_len ); } -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ENTRY, "dnMatch: %d\n %s\n %s\n", - match, value->bv_val, asserted->bv_val ); -#else Debug( LDAP_DEBUG_ARGS, "dnMatch %d\n\t\"%s\"\n\t\"%s\"\n", match, value->bv_val, asserted->bv_val ); -#endif *matchp = match; return( LDAP_SUCCESS ); @@ -1020,13 +984,8 @@ rdnMatch( value->bv_len ); } -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ENTRY, "rdnMatch: %d\n %s\n %s\n", - match, value->bv_val, asserted->bv_val ); -#else Debug( LDAP_DEBUG_ARGS, "rdnMatch %d\n\t\"%s\"\n\t\"%s\"\n", match, value->bv_val, asserted->bv_val ); -#endif *matchp = match; diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index a513f85927..45d4f98e33 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -85,25 +85,16 @@ str2entry( char *s ) * or newline. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, "str2entry: \"%s\"\n", - s ? s : "NULL", 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> str2entry: \"%s\"\n", s ? s : "NULL", 0, 0 ); -#endif /* initialize reader/writer lock */ e = (Entry *) ch_calloc( 1, sizeof(Entry) ); if( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "str2entry: entry allocation failed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= str2entry NULL (entry allocation failed)\n", 0, 0, 0 ); -#endif return( NULL ); } @@ -124,12 +115,8 @@ str2entry( char *s ) } if ( ldif_parse_line( s, &type, &vals[0].bv_val, &vals[0].bv_len ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, "str2entry: NULL (parse_line)\n",0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= str2entry NULL (parse_line)\n", 0, 0, 0 ); -#endif continue; } @@ -137,15 +124,9 @@ str2entry( char *s ) free( type ); if ( e->e_dn != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, "str2entry: " - "entry %ld has multiple DNs \"%s\" and \"%s\"\n", - (long) e->e_id, e->e_dn, vals[0].bv_val ); -#else Debug( LDAP_DEBUG_ANY, "str2entry: " "entry %ld has multiple DNs \"%s\" and \"%s\"\n", (long) e->e_id, e->e_dn, vals[0].bv_val ); -#endif free( vals[0].bv_val ); entry_free( e ); return NULL; @@ -153,15 +134,9 @@ str2entry( char *s ) rc = dnPrettyNormal( NULL, &vals[0], &e->e_name, &e->e_nname, NULL ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "str2entry: entry %ld has invalid DN \"%s\"\n", - (long) e->e_id, vals[0].bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "str2entry: " "entry %ld has invalid DN \"%s\"\n", (long) e->e_id, vals[0].bv_val, 0 ); -#endif entry_free( e ); free( vals[0].bv_val ); return NULL; @@ -175,14 +150,9 @@ str2entry( char *s ) rc = slap_str2ad( type, &ad, &text ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "str2entry: str2ad(%s): %s\n", type, text, 0 ); -#else Debug( slapMode & SLAP_TOOL_MODE ? LDAP_DEBUG_ANY : LDAP_DEBUG_TRACE, "<= str2entry: str2ad(%s): %s\n", type, text, 0 ); -#endif if( slapMode & SLAP_TOOL_MODE ) { entry_free( e ); free( vals[0].bv_val ); @@ -192,14 +162,9 @@ str2entry( char *s ) rc = slap_str2undef_ad( type, &ad, &text ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "str2entry: str2undef_ad(%s): %s\n", type, text, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= str2entry: str2undef_ad(%s): %s\n", type, text, 0 ); -#endif entry_free( e ); free( vals[0].bv_val ); free( type ); @@ -229,19 +194,11 @@ str2entry( char *s ) rc = validate( ad->ad_type->sat_syntax, &vals[0] ); } else { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "str2entry: attributeType %s #%d: " - "no validator for syntax %s\n", - ad->ad_cname.bv_val, attr_cnt, - ad->ad_type->sat_syntax->ssyn_oid ); -#else Debug( LDAP_DEBUG_ANY, "str2entry: attributeType %s #%d: " "no validator for syntax %s\n", ad->ad_cname.bv_val, attr_cnt, ad->ad_type->sat_syntax->ssyn_oid ); -#endif entry_free( e ); free( vals[0].bv_val ); free( type ); @@ -249,19 +206,11 @@ str2entry( char *s ) } if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "str2entry: invalid value " - "for attributeType %s #%d (syntax %s)\n", - ad->ad_cname.bv_val, attr_cnt, - ad->ad_type->sat_syntax->ssyn_oid ); -#else Debug( LDAP_DEBUG_ANY, "str2entry: invalid value " "for attributeType %s #%d (syntax %s)\n", ad->ad_cname.bv_val, attr_cnt, ad->ad_type->sat_syntax->ssyn_oid ); -#endif entry_free( e ); free( vals[0].bv_val ); free( type ); @@ -287,13 +236,8 @@ str2entry( char *s ) &vals[0], &nvals[0], NULL ); if( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "str2entry: NULL (smr_normalize %d)\n" , rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= str2entry NULL (smr_normalize %d)\n", rc, 0, 0 ); -#endif entry_free( e ); free( vals[0].bv_val ); @@ -309,13 +253,8 @@ str2entry( char *s ) rc = attr_merge( e, ad, vals, nvalsp ); if( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "str2entry: NULL (attr_merge)\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= str2entry NULL (attr_merge)\n", 0, 0, 0 ); -#endif entry_free( e ); free( vals[0].bv_val ); free( type ); @@ -331,24 +270,14 @@ str2entry( char *s ) /* check to make sure there was a dn: line */ if ( e->e_dn == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "str2entry: entry %ld has no dn.\n", (long) e->e_id, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "str2entry: entry %ld has no dn\n", (long) e->e_id, 0, 0 ); -#endif entry_free( e ); return NULL; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL2, - "str2entry(%s) -> 0x%lx\n", e->e_dn, (unsigned long)e, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "<= str2entry(%s) -> 0x%lx\n", e->e_dn, (unsigned long) e, 0 ); -#endif return( e ); } @@ -602,13 +531,8 @@ int entry_encode(Entry *e, struct berval *bv) Attribute *a; unsigned char *ptr; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, "entry_encode: id: 0x%08lx \"%s\"\n", - (long) e->e_id, e->e_dn, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> entry_encode(0x%08lx): %s\n", (long) e->e_id, e->e_dn, 0 ); -#endif dnlen = e->e_name.bv_len; ndnlen = e->e_nname.bv_len; @@ -685,13 +609,8 @@ int entry_decode(struct berval *bv, Entry **e) i = entry_getlen(&ptr); if (!i) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_decode: entry length was zero\n", 0, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "entry_decode: entry length was zero\n", 0, 0, 0); -#endif return LDAP_OTHER; } x = ch_calloc(1, i); @@ -703,13 +622,9 @@ int entry_decode(struct berval *bv, Entry **e) x->e_nname.bv_val = (char *) ptr; x->e_nname.bv_len = i; ptr += i+1; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL2, "entry_decode: \"%s\"\n", x->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "entry_decode: \"%s\"\n", x->e_dn, 0, 0 ); -#endif x->e_bv = *bv; /* A valid entry must have at least one attr, so this @@ -731,24 +646,14 @@ int entry_decode(struct berval *bv, Entry **e) rc = slap_bv2ad( &bv, &ad, &text ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_decode: str2ad(%s): %s\n", ptr, text, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= entry_decode: str2ad(%s): %s\n", ptr, text, 0 ); -#endif rc = slap_bv2undef_ad( &bv, &ad, &text ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_decode: str2undef_ad(%s): %s\n", ptr, text, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= entry_decode: str2undef_ad(%s): %s\n", ptr, text, 0 ); -#endif return rc; } } @@ -791,12 +696,8 @@ int entry_decode(struct berval *bv, Entry **e) } if (a) a->a_next = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, "entry_decode: %s\n", x->e_dn, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "<= entry_decode(%s)\n", x->e_dn, 0, 0 ); -#endif *e = x; return 0; } diff --git a/servers/slapd/extended.c b/servers/slapd/extended.c index 96990337d4..e77f7c6a4e 100644 --- a/servers/slapd/extended.c +++ b/servers/slapd/extended.c @@ -139,33 +139,19 @@ do_extended( ber_tag_t tag; ber_len_t len; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "do_extended: conn %d\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_extended\n", 0, 0, 0 ); -#endif if( op->o_protocol < LDAP_VERSION3 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_extended: protocol version (%d) too low.\n", op->o_protocol, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_extended: protocol version (%d) too low\n", op->o_protocol, 0 ,0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "requires LDAPv3" ); rs->sr_err = SLAPD_DISCONNECT; goto done; } if ( ber_scanf( op->o_ber, "{m" /*}*/, &op->ore_reqoid ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "do_extended: conn %d ber_scanf failed\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_extended: ber_scanf failed\n", 0, 0 ,0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); rs->sr_err = SLAPD_DISCONNECT; goto done; @@ -175,13 +161,7 @@ do_extended( if( ber_peek_tag( op->o_ber, &len ) == LDAP_TAG_EXOP_REQ_VALUE ) { if( ber_scanf( op->o_ber, "m", &reqdata ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_extended: conn %d ber_scanf failed\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_extended: ber_scanf failed\n", 0, 0 ,0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); rs->sr_err = SLAPD_DISCONNECT; goto done; @@ -189,12 +169,7 @@ do_extended( } if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_extended: conn %d get_ctrls failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_extended: get_ctrls failed\n", 0, 0 ,0 ); -#endif return rs->sr_err; } @@ -243,27 +218,15 @@ fe_extended( Operation *op, SlapReply *rs ) if( !(ext = find_extop(supp_ext_list, &op->ore_reqoid ))) #endif { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_extended: conn %d unsupported operation \"%s\"\n", - op->o_connid, op->ore_reqoid.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_extended: unsupported operation \"%s\"\n", op->ore_reqoid.bv_val, 0 ,0 ); -#endif send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "unsupported extended operation" ); goto done; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "do_extended: conn %d oid=%s\n.", - op->o_connid, op->ore_reqoid.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n", op->ore_reqoid.bv_val, 0 ,0 ); -#endif #if defined(LDAP_SLAPI) if ( funcAddr != NULL ) { diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index cd55923f82..d1cc7da88f 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -73,11 +73,7 @@ get_filter( int err; Filter f; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "get_filter: conn %d\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "begin get_filter\n", 0, 0, 0 ); -#endif /* * A filter looks like this coming in: * Filter ::= CHOICE { @@ -125,12 +121,7 @@ get_filter( switch ( f.f_choice ) { case LDAP_FILTER_EQUALITY: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL2, - "get_filter: conn %d EQUALITY\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 ); -#endif err = get_ava( op, ber, &f.f_ava, SLAP_MR_EQUALITY, text ); if ( err != LDAP_SUCCESS ) { break; @@ -140,12 +131,7 @@ get_filter( break; case LDAP_FILTER_SUBSTRINGS: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_filter: conn %d SUBSTRINGS\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "SUBSTRINGS\n", 0, 0, 0 ); -#endif err = get_ssa( op, ber, &f.f_sub, text ); if( err != LDAP_SUCCESS ) { break; @@ -154,12 +140,7 @@ get_filter( break; case LDAP_FILTER_GE: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_filter: conn %d GE\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "GE\n", 0, 0, 0 ); -#endif err = get_ava( op, ber, &f.f_ava, SLAP_MR_ORDERING, text ); if ( err != LDAP_SUCCESS ) { break; @@ -168,12 +149,7 @@ get_filter( break; case LDAP_FILTER_LE: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_filter: conn %d LE\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "LE\n", 0, 0, 0 ); -#endif err = get_ava( op, ber, &f.f_ava, SLAP_MR_ORDERING, text ); if ( err != LDAP_SUCCESS ) { break; @@ -184,12 +160,7 @@ get_filter( case LDAP_FILTER_PRESENT: { struct berval type; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_filter: conn %d PRESENT\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 ); -#endif if ( ber_scanf( ber, "m", &type ) == LBER_ERROR ) { err = SLAPD_DISCONNECT; *text = "error decoding filter"; @@ -201,17 +172,10 @@ get_filter( if( err != LDAP_SUCCESS ) { /* unrecognized attribute description or other error */ -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "get_filter: conn %d unknown attribute " - "type=%s (%d)\n", - op->o_connid, type.bv_val, err ); -#else Debug( LDAP_DEBUG_ANY, "get_filter: conn %d unknown attribute " "type=%s (%d)\n", op->o_connid, type.bv_val, err ); -#endif f.f_choice = SLAPD_FILTER_COMPUTED; f.f_result = LDAP_COMPARE_FALSE; @@ -224,12 +188,7 @@ get_filter( } break; case LDAP_FILTER_APPROX: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_filter: conn %d APPROX\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "APPROX\n", 0, 0, 0 ); -#endif err = get_ava( op, ber, &f.f_ava, SLAP_MR_EQUALITY_APPROX, text ); if ( err != LDAP_SUCCESS ) { break; @@ -238,12 +197,7 @@ get_filter( break; case LDAP_FILTER_AND: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_filter: conn %d AND\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 ); -#endif err = get_filter_list( op, ber, &f.f_and, text ); if ( err != LDAP_SUCCESS ) { break; @@ -256,12 +210,7 @@ get_filter( break; case LDAP_FILTER_OR: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_filter: conn %d OR\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 ); -#endif err = get_filter_list( op, ber, &f.f_or, text ); if ( err != LDAP_SUCCESS ) { break; @@ -274,12 +223,7 @@ get_filter( break; case LDAP_FILTER_NOT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_filter: conn %d NOT\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 ); -#endif (void) ber_skip_tag( ber, &len ); err = get_filter( op, ber, &f.f_not, text ); if ( err != LDAP_SUCCESS ) { @@ -307,12 +251,7 @@ get_filter( break; case LDAP_FILTER_EXT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_filter: conn %d EXTENSIBLE\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "EXTENSIBLE\n", 0, 0, 0 ); -#endif err = get_mra( op, ber, &f.f_mra, text ); if ( err != LDAP_SUCCESS ) { @@ -324,14 +263,8 @@ get_filter( default: (void) ber_scanf( ber, "x" ); /* skip the element */ -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "get_filter: conn %d unknown filter type=%lu\n", - op->o_connid, f.f_choice, 0 ); -#else Debug( LDAP_DEBUG_ANY, "get_filter: unknown filter type=%lu\n", f.f_choice, 0, 0 ); -#endif f.f_choice = SLAPD_FILTER_COMPUTED; f.f_result = SLAPD_COMPARE_UNDEFINED; break; @@ -350,12 +283,7 @@ get_filter( **filt = f; } -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL2, - "get_filter: conn %d exit\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "end get_filter %d\n", err, 0, 0 ); -#endif return( err ); } @@ -371,12 +299,7 @@ get_filter_list( Operation *op, BerElement *ber, ber_len_t len; char *last; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "get_filter_list: conn %d start\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "begin get_filter_list\n", 0, 0, 0 ); -#endif new = f; for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT; @@ -389,12 +312,7 @@ get_filter_list( Operation *op, BerElement *ber, } *new = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "get_filter_list: conn %d exit\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "end get_filter_list\n", 0, 0, 0 ); -#endif return( LDAP_SUCCESS ); } @@ -415,12 +333,7 @@ get_ssa( *text = "error decoding filter"; *out = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "get_ssa: conn %d begin\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "begin get_ssa\n", 0, 0, 0 ); -#endif if ( ber_scanf( ber, "{m" /*}*/, &desc ) == LBER_ERROR ) { return SLAPD_DISCONNECT; } @@ -435,15 +348,9 @@ get_ssa( rc = slap_bv2ad( &desc, &ssa.sa_desc, text ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "get_ssa: conn %d d unknown attribute type=%s (%d)\n", - op->o_connid, desc.bv_val, rc ); -#else Debug( LDAP_DEBUG_ANY, "get_ssa: conn %d unknown attribute type=%s (%d)\n", op->o_connid, desc.bv_val, rc ); -#endif /* skip over the rest of this filter */ for ( tag = ber_first_element( ber, &len, &last ); @@ -489,15 +396,9 @@ get_ssa( default: rc = LDAP_PROTOCOL_ERROR; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "get_filter_substring: conn %d unknown substring choice=%ld\n", - op->o_connid, (long)tag, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " unknown substring choice=%ld\n", (long) tag, 0, 0 ); -#endif goto return_error; } @@ -515,13 +416,7 @@ get_ssa( switch ( tag ) { case LDAP_SUBSTRING_INITIAL: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_ssa: conn %d INITIAL\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " INITIAL\n", 0, 0, 0 ); -#endif if ( ssa.sa_initial.bv_val != NULL || ssa.sa_any != NULL @@ -535,13 +430,7 @@ get_ssa( break; case LDAP_SUBSTRING_ANY: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_ssa: conn %d ANY\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " ANY\n", 0, 0, 0 ); -#endif if ( ssa.sa_final.bv_val != NULL ) { slap_sl_free( nvalue.bv_val, op->o_tmpmemctx ); @@ -552,13 +441,7 @@ get_ssa( break; case LDAP_SUBSTRING_FINAL: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_ssa: conn %d FINAL\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " FINAL\n", 0, 0, 0 ); -#endif if ( ssa.sa_final.bv_val != NULL ) { slap_sl_free( nvalue.bv_val, op->o_tmpmemctx ); @@ -569,28 +452,16 @@ get_ssa( break; default: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, - "get_ssa: conn %d unknown substring type %ld\n", - op->o_connid, (long)tag, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " unknown substring type=%ld\n", (long) tag, 0, 0 ); -#endif assert( 0 ); slap_sl_free( nvalue.bv_val, op->o_tmpmemctx ); return_error: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, - "get_ssa: conn %d error %ld\n", - op->o_connid, (long)rc, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " error=%ld\n", (long) rc, 0, 0 ); -#endif slap_sl_free( ssa.sa_initial.bv_val, op->o_tmpmemctx ); ber_bvarray_free_x( ssa.sa_any, op->o_tmpmemctx ); slap_sl_free( ssa.sa_final.bv_val, op->o_tmpmemctx ); @@ -605,12 +476,7 @@ return_error: **out = ssa; } -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "get_ssa: conn %d exit\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "end get_ssa\n", 0, 0, 0 ); -#endif return rc /* LDAP_SUCCESS */ ; } @@ -663,13 +529,8 @@ filter_free_x( Operation *op, Filter *f ) break; default: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "filter_free: unknown filter type %lu\n", f->f_choice, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "filter_free: unknown filter type=%lu\n", f->f_choice, 0, 0 ); -#endif break; } @@ -969,12 +830,7 @@ get_simple_vrFilter( int err; ValuesReturnFilter vrf; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "get_simple_vrFilter: conn %d\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "begin get_simple_vrFilter\n", 0, 0, 0 ); -#endif tag = ber_peek_tag( ber, &len ); @@ -990,12 +846,7 @@ get_simple_vrFilter( switch ( vrf.vrf_choice ) { case LDAP_FILTER_EQUALITY: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL2, - "get_simple_vrFilter: conn %d EQUALITY\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 ); -#endif err = get_ava( op, ber, &vrf.vrf_ava, SLAP_MR_EQUALITY, text ); if ( err != LDAP_SUCCESS ) { break; @@ -1005,22 +856,12 @@ get_simple_vrFilter( break; case LDAP_FILTER_SUBSTRINGS: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_simple_vrFilter: conn %d SUBSTRINGS\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "SUBSTRINGS\n", 0, 0, 0 ); -#endif err = get_ssa( op, ber, &vrf.vrf_sub, text ); break; case LDAP_FILTER_GE: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_simple_vrFilter: conn %d GE\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "GE\n", 0, 0, 0 ); -#endif err = get_ava( op, ber, &vrf.vrf_ava, SLAP_MR_ORDERING, text ); if ( err != LDAP_SUCCESS ) { break; @@ -1028,12 +869,7 @@ get_simple_vrFilter( break; case LDAP_FILTER_LE: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_simple_vrFilter: conn %d LE\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "LE\n", 0, 0, 0 ); -#endif err = get_ava( op, ber, &vrf.vrf_ava, SLAP_MR_ORDERING, text ); if ( err != LDAP_SUCCESS ) { break; @@ -1043,12 +879,7 @@ get_simple_vrFilter( case LDAP_FILTER_PRESENT: { struct berval type; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_simple_vrFilter: conn %d PRESENT\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 ); -#endif if ( ber_scanf( ber, "m", &type ) == LBER_ERROR ) { err = SLAPD_DISCONNECT; *text = "error decoding filter"; @@ -1060,17 +891,10 @@ get_simple_vrFilter( if( err != LDAP_SUCCESS ) { /* unrecognized attribute description or other error */ -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "get_simple_vrFilter: conn %d unknown " - "attribute type=%s (%d)\n", - op->o_connid, type.bv_val, err ); -#else Debug( LDAP_DEBUG_ANY, "get_simple_vrFilter: conn %d unknown " "attribute type=%s (%d)\n", op->o_connid, type.bv_val, err ); -#endif vrf.vrf_choice = SLAPD_FILTER_COMPUTED; vrf.vrf_result = LDAP_COMPARE_FALSE; @@ -1080,12 +904,7 @@ get_simple_vrFilter( } break; case LDAP_FILTER_APPROX: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_simple_vrFilter: conn %d APPROX\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "APPROX\n", 0, 0, 0 ); -#endif err = get_ava( op, ber, &vrf.vrf_ava, SLAP_MR_EQUALITY_APPROX, text ); if ( err != LDAP_SUCCESS ) { break; @@ -1093,12 +912,7 @@ get_simple_vrFilter( break; case LDAP_FILTER_EXT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "get_simple_vrFilter: conn %d EXTENSIBLE\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "EXTENSIBLE\n", 0, 0, 0 ); -#endif err = get_mra( op, ber, &vrf.vrf_mra, text ); if ( err != LDAP_SUCCESS ) { @@ -1110,14 +924,8 @@ get_simple_vrFilter( default: (void) ber_scanf( ber, "x" ); /* skip the element */ -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, - "get_simple_vrFilter: conn %d unknown filter type=%lu\n", - op->o_connid, vrf.vrf_choice, 0 ); -#else Debug( LDAP_DEBUG_ANY, "get_simple_vrFilter: unknown filter type=%lu\n", vrf.vrf_choice, 0, 0 ); -#endif vrf.vrf_choice = SLAPD_FILTER_COMPUTED; vrf.vrf_result = SLAPD_COMPARE_UNDEFINED; break; @@ -1135,12 +943,7 @@ get_simple_vrFilter( **filt = vrf; } -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL2, - "get_simple_vrFilter: conn %d exit\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "end get_simple_vrFilter %d\n", err, 0, 0 ); -#endif return err; } @@ -1184,12 +987,7 @@ get_vrFilter( Operation *op, BerElement *ber, ber_len_t len; char *last; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "get_vrFilter: conn %d start\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "begin get_vrFilter\n", 0, 0, 0 ); -#endif tag = ber_peek_tag( ber, &len ); @@ -1216,12 +1014,7 @@ get_vrFilter( Operation *op, BerElement *ber, } *n = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, - "get_vrFilter: conn %d exit\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "end get_vrFilter\n", 0, 0, 0 ); -#endif return( LDAP_SUCCESS ); } @@ -1267,13 +1060,8 @@ vrFilter_free( Operation *op, ValuesReturnFilter *vrf ) break; default: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ERR, "filter_free: unknown filter type %lu\n", - vrf->vrf_choice, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "filter_free: unknown filter type=%lu\n", vrf->vrf_choice, 0, 0 ); -#endif break; } diff --git a/servers/slapd/filterentry.c b/servers/slapd/filterentry.c index 8f9c34539d..d881e28c1f 100644 --- a/servers/slapd/filterentry.c +++ b/servers/slapd/filterentry.c @@ -58,48 +58,27 @@ test_filter( Filter *f ) { int rc; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "test_filter: begin\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "=> test_filter\n", 0, 0, 0 ); -#endif switch ( f->f_choice ) { case SLAPD_FILTER_COMPUTED: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "test_filter: COMPUTED %s (%d)\n", - f->f_result == LDAP_COMPARE_FALSE ? "false" : - f->f_result == LDAP_COMPARE_TRUE ? "true" : - f->f_result == SLAPD_COMPARE_UNDEFINED ? "undefined" : - "error", f->f_result, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " COMPUTED %s (%d)\n", f->f_result == LDAP_COMPARE_FALSE ? "false" : f->f_result == LDAP_COMPARE_TRUE ? "true" : f->f_result == SLAPD_COMPARE_UNDEFINED ? "undefined" : "error", f->f_result, 0 ); -#endif rc = f->f_result; break; case LDAP_FILTER_EQUALITY: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_filter: EQUALITY\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " EQUALITY\n", 0, 0, 0 ); -#endif rc = test_ava_filter( op, e, f->f_ava, LDAP_FILTER_EQUALITY ); break; case LDAP_FILTER_SUBSTRINGS: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_filter SUBSTRINGS\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " SUBSTRINGS\n", 0, 0, 0 ); -#endif rc = test_substrings_filter( op, e, f ); break; @@ -113,47 +92,27 @@ test_filter( break; case LDAP_FILTER_PRESENT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_filter: PRESENT\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " PRESENT\n", 0, 0, 0 ); -#endif rc = test_presence_filter( op, e, f->f_desc ); break; case LDAP_FILTER_APPROX: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_filter: APPROX\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " APPROX\n", 0, 0, 0 ); -#endif rc = test_ava_filter( op, e, f->f_ava, LDAP_FILTER_APPROX ); break; case LDAP_FILTER_AND: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_filter: AND\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " AND\n", 0, 0, 0 ); -#endif rc = test_filter_and( op, e, f->f_and ); break; case LDAP_FILTER_OR: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_filter: OR\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " OR\n", 0, 0, 0 ); -#endif rc = test_filter_or( op, e, f->f_or ); break; case LDAP_FILTER_NOT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_filter: NOT\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " NOT\n", 0, 0, 0 ); -#endif rc = test_filter( op, e, f->f_not ); /* Flip true to false and false to true @@ -170,30 +129,17 @@ test_filter( break; case LDAP_FILTER_EXT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_filter: EXT\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " EXT\n", 0, 0, 0 ); -#endif rc = test_mra_filter( op, e, f->f_mra ); break; default: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, - "test_filter: unknown filter type %lu\n", f->f_choice, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " unknown filter type %lu\n", f->f_choice, 0, 0 ); -#endif rc = LDAP_PROTOCOL_ERROR; } -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, RESULTS, "test_filter: return=%d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "<= test_filter %d\n", rc, 0, 0 ); -#endif return( rc ); } @@ -540,11 +486,7 @@ test_filter_and( Filter *f; int rtn = LDAP_COMPARE_TRUE; /* True if empty */ -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "test_filter_and: begin\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "=> test_filter_and\n", 0, 0, 0 ); -#endif for ( f = flist; f != NULL; f = f->f_next ) { @@ -562,11 +504,7 @@ test_filter_and( } } -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, RESULTS, "test_filter_and: rc=%d\n", rtn, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "<= test_filter_and %d\n", rtn, 0, 0 ); -#endif return rtn; } @@ -581,11 +519,7 @@ test_filter_or( Filter *f; int rtn = LDAP_COMPARE_FALSE; /* False if empty */ -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "test_filter_or: begin\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "=> test_filter_or\n", 0, 0, 0 ); -#endif for ( f = flist; f != NULL; f = f->f_next ) { int rc = test_filter( op, e, f ); @@ -602,11 +536,7 @@ test_filter_or( } } -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "test_filter_or: result=%d\n", rtn, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "<= test_filter_or %d\n", rtn, 0, 0 ); -#endif return rtn; } @@ -619,11 +549,7 @@ test_substrings_filter( { Attribute *a; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "test_substrings_filter: begin\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "begin test_substrings_filter\n", 0, 0, 0 ); -#endif if ( !access_allowed( op, e, f->f_sub_desc, NULL, ACL_SEARCH, NULL ) ) @@ -653,12 +579,7 @@ test_substrings_filter( } } -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "test_substrings_filter: return FALSE\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "end test_substrings_filter 1\n", 0, 0, 0 ); -#endif return LDAP_COMPARE_FALSE; } diff --git a/servers/slapd/init.c b/servers/slapd/init.c index a8a8e812ea..8ec751a958 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -103,15 +103,9 @@ slap_init( int mode, const char *name ) assert( mode ); if( slapMode != SLAP_UNDEFINED_MODE ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "init: %s init called twice (old=%d, new=%d)\n", - name, slapMode, mode ); -#else Debug( LDAP_DEBUG_ANY, "%s init: init called twice (old=%d, new=%d)\n", name, slapMode, mode ); -#endif return 1; } @@ -121,17 +115,10 @@ slap_init( int mode, const char *name ) switch ( slapMode & SLAP_MODE ) { case SLAP_SERVER_MODE: case SLAP_TOOL_MODE: -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "init: %s initiation, initiated %s.\n", - name, (mode & SLAP_MODE) == SLAP_TOOL_MODE ? - "tool" : "server", 0 ); -#else Debug( LDAP_DEBUG_TRACE, "%s init: initiated %s.\n", name, (mode & SLAP_MODE) == SLAP_TOOL_MODE ? "tool" : "server", 0 ); -#endif slap_name = name; @@ -172,13 +159,8 @@ slap_init( int mode, const char *name ) break; default: -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "init: %s init, undefined mode (%d).\n", name, mode, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s init: undefined mode (%d).\n", name, mode, 0 ); -#endif rc = 1; break; @@ -191,13 +173,9 @@ int slap_startup( Backend *be ) { int rc; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "slap_startup: %s started\n", slap_name, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "%s startup: initiated.\n", slap_name, 0, 0 ); -#endif rc = backend_startup( be ); @@ -223,14 +201,9 @@ int slap_shutdown( Backend *be ) Slapi_PBlock *pb; #endif -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "slap_shutdown: %s shutdown initiated.\n", slap_name, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "%s shutdown: initiated\n", slap_name, 0, 0 ); -#endif /* let backends do whatever cleanup they need to do */ rc = backend_shutdown( be ); @@ -248,14 +221,9 @@ int slap_destroy(void) { int rc; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "slap_destroy: %s freeing system resources.\n", slap_name, 0, 0); -#else Debug( LDAP_DEBUG_TRACE, "%s shutdown: freeing system resources.\n", slap_name, 0, 0 ); -#endif rc = backend_destroy(); diff --git a/servers/slapd/ldapsync.c b/servers/slapd/ldapsync.c index 1cad64cab2..19c74eb6b5 100644 --- a/servers/slapd/ldapsync.c +++ b/servers/slapd/ldapsync.c @@ -86,15 +86,9 @@ slap_build_sync_state_ctrl( ber_free_buf( ber ); if ( ret < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "slap_build_sync_ctrl: ber_flatten2 failed\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_build_sync_ctrl: ber_flatten2 failed\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_OTHER, "internal error" ); return ret; } @@ -137,15 +131,9 @@ slap_build_sync_done_ctrl( ber_free_buf( ber ); if ( ret < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "slap_build_sync_done_ctrl: ber_flatten2 failed\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_build_sync_done_ctrl: ber_flatten2 failed\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_OTHER, "internal error" ); return ret; } @@ -200,15 +188,9 @@ slap_build_sync_state_ctrl_from_slog( ber_free_buf( ber ); if ( ret < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "slap_build_sync_ctrl: ber_flatten2 failed\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_build_sync_ctrl: ber_flatten2 failed\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_OTHER, "internal error" ); return ret; } @@ -263,15 +245,9 @@ slap_send_syncinfo( ber_printf( ber, "N}" ); break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "slap_send_syncinfo: invalid syncinfo type (%d)\n", - type, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_send_syncinfo: invalid syncinfo type (%d)\n", type, 0, 0 ); -#endif return LDAP_OTHER; } } @@ -279,15 +255,9 @@ slap_send_syncinfo( ret = ber_flatten2( ber, &rspdata, 0 ); if ( ret < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, RESULTS, - "slap_send_syncinfo: ber_flatten2 failed\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_send_syncinfo: ber_flatten2 failed\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_OTHER, "internal error" ); return ret; } diff --git a/servers/slapd/limits.c b/servers/slapd/limits.c index c60e734068..3f507f27f2 100644 --- a/servers/slapd/limits.c +++ b/servers/slapd/limits.c @@ -74,16 +74,9 @@ limits_get( assert( op ); assert( limit ); -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, DETAIL1, "==> limits_get: conn=%lu op=%lu dn=\"%s\"\n", - op->o_connid, op->o_opid, - BER_BVISNULL( ndn ) ? "[anonymous]" : ndn->bv_val ); - -#else 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 ); -#endif /* * default values */ @@ -112,33 +105,20 @@ limits_get( lm[0]->lm_group_ad ); if ( rc == 0 ) { *limit = &lm[0]->lm_limits; -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=GROUP match=EXACT " - "dn=\"%s\" oc=\"%s\" ad=\"%s\"\n", - lm[0]->lm_pat.bv_val, - lm[0]->lm_group_oc->soc_cname.bv_val, - lm[0]->lm_group_ad->ad_cname.bv_val ); -#else Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=GROUP match=EXACT " "dn=\"%s\" oc=\"%s\" ad=\"%s\"\n", lm[0]->lm_pat.bv_val, lm[0]->lm_group_oc->soc_cname.bv_val, lm[0]->lm_group_ad->ad_cname.bv_val ); -#endif return( 0 ); } } else { if ( dn_match( &lm[0]->lm_pat, ndn ) ) { *limit = &lm[0]->lm_limits; -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=DN match=EXACT dn=\"%s\"\n", - lm[0]->lm_pat.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=DN match=EXACT dn=\"%s\"\n", lm[0]->lm_pat.bv_val, 0, 0 ); -#endif return( 0 ); } } @@ -190,13 +170,8 @@ limits_get( } *limit = &lm[0]->lm_limits; -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=DN match=%s dn=\"%s\"\n", - limits2str( style ), lm[0]->lm_pat.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=DN match=%s dn=\"%s\"\n", limits2str( style ), lm[0]->lm_pat.bv_val, 0 ); -#endif return( 0 ); } @@ -211,26 +186,16 @@ limits_get( 0, NULL, 0 ) == 0 ) { *limit = &lm[0]->lm_limits; -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=DN match=%s dn=\"%s\"\n", - limits2str( style ), lm[0]->lm_pat.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=DN match=%s dn=\"%s\"\n", limits2str( style ), lm[0]->lm_pat.bv_val, 0 ); -#endif return( 0 ); } break; case SLAP_LIMITS_ANONYMOUS: if ( ndn->bv_len == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=DN match=%s\n", - limits2str( style ), 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=DN match=%s\n", limits2str( style ), 0, 0 ); -#endif *limit = &lm[0]->lm_limits; return( 0 ); } @@ -239,13 +204,8 @@ limits_get( case SLAP_LIMITS_USERS: if ( ndn->bv_len != 0 ) { *limit = &lm[0]->lm_limits; -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=DN match=%s\n", - limits2str( style ), 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=DN match=%s\n", limits2str( style ), 0, 0 ); -#endif return( 0 ); } break; @@ -384,16 +344,10 @@ limits_parse( assert( be ); if ( argc < 3 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s : line %d: missing arg(s) in " - "\"limits \" line.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s : line %d: missing arg(s) in " "\"limits \" line.\n%s", fname, lineno, "" ); -#endif return( -1 ); } @@ -459,17 +413,10 @@ limits_parse( pattern += STRLENOF( "level" ); } else { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, WARNING , - "%s : line %d: deprecated \"one\" style " - "\"limits \" line; " - "use \"onelevel\" instead.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s : line %d: deprecated \"one\" style " "\"limits \" line; " "use \"onelevel\" instead.\n", fname, lineno, 0 ); -#endif } } else if ( strncasecmp( pattern, "sub", STRLENOF( "sub" ) ) == 0 ) { @@ -479,17 +426,10 @@ limits_parse( pattern += STRLENOF( "tree" ); } else { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, WARNING , - "%s : line %d: deprecated \"sub\" style " - "\"limits \" line; " - "use \"subtree\" instead.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s : line %d: deprecated \"sub\" style " "\"limits \" line; " "use \"subtree\" instead.\n", fname, lineno, 0 ); -#endif } } else if ( strncasecmp( pattern, "children", STRLENOF( "children" ) ) == 0 ) { @@ -521,13 +461,6 @@ limits_parse( default: if ( pattern[0] != '=' ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s : line %d: missing '=' in " - "\"dn[.{exact|base|onelevel|subtree" - "|children|regex|anonymous}]" "=\" in " - "\"limits \" line.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s : line %d: missing '=' in " "\"dn[.{exact|base|onelevel|subtree" @@ -536,7 +469,6 @@ limits_parse( "\"limits \" " "line.\n%s", fname, lineno, "" ); -#endif return( -1 ); } @@ -614,21 +546,12 @@ no_ad:; flags = SLAP_LIMITS_TYPE_GROUP | SLAP_LIMITS_EXACT; if ( pattern[0] != '=' ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s : line %d: missing '=' in " - "\"group[/objectClass[/attributeType]]" - "=\" in " - "\"limits \" line.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s : line %d: missing '=' in " "\"group[/objectClass[/attributeType]]" "=\" in " "\"limits \" line.\n", fname, lineno, 0 ); -#endif return( -1 ); } @@ -640,17 +563,10 @@ no_ad:; for ( i = 2; i < argc; i++ ) { if ( limits_parse_one( argv[i], &limit ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s : line %d: unknown limit values \"%s\" in " - "\"limits \" line.\n", - fname, lineno, argv[i] ); -#else Debug( LDAP_DEBUG_ANY, "%s : line %d: unknown limit values \"%s\" in " "\"limits \" line.\n", fname, lineno, argv[i] ); -#endif return( 1 ); } @@ -705,17 +621,10 @@ no_ad:; rc = limits_add( be, flags, pattern, group_oc, group_ad, &limit ); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s : line %d: unable to add limit in " - "\"limits \" line.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s : line %d: unable to add limit in " "\"limits \" line.\n", fname, lineno, 0 ); -#endif } return( rc ); diff --git a/servers/slapd/lock.c b/servers/slapd/lock.c index 7db26a764c..6e1ad3e106 100644 --- a/servers/slapd/lock.c +++ b/servers/slapd/lock.c @@ -50,12 +50,7 @@ lock_fopen( const char *fname, const char *type, FILE **lfp ) snprintf( buf, sizeof buf, "%s.lock", fname ); if ( (*lfp = fopen( buf, "w" )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "lock_fopen: could not open lock file \"%s\".\n", buf, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", buf, 0, 0 ); -#endif return( NULL ); } @@ -65,12 +60,7 @@ lock_fopen( const char *fname, const char *type, FILE **lfp ) /* open the log file */ if ( (fp = fopen( fname, type )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "lock_fopen: could not open log file \"%s\".\n", buf, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", fname, 0, 0 ); -#endif ldap_unlockf( fileno(*lfp) ); fclose( *lfp ); diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 09f674dd8c..864463d9c0 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -303,15 +303,8 @@ int main( int argc, char **argv ) i = (int*)lutil_getRegParam( regService, "DebugLevel" ); if ( i != NULL ) { slap_debug = *i; -#ifdef NEW_LOGGING - lutil_log_initialize( argc, argv ); - LDAP_LOG( SLAPD, INFO, - "main: new debug level from registry is: %d\n", - slap_debug, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "new debug level from registry is: %d\n", slap_debug, 0, 0 ); -#endif } newUrls = (char *) lutil_getRegParam(regService, "Urls"); @@ -320,24 +313,14 @@ int main( int argc, char **argv ) ch_free(urls); urls = ch_strdup(newUrls); -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, INFO, - "main: new urls from registry: %s\n", urls, 0, 0 ); -#else Debug(LDAP_DEBUG_ANY, "new urls from registry: %s\n", urls, 0, 0); -#endif } newConfigFile = (char*)lutil_getRegParam( regService, "ConfigFile" ); if ( newConfigFile != NULL ) { configfile = newConfigFile; -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, INFO, - "main: new config file from registry is: %s\n", configfile, 0, 0 ); -#else Debug ( LDAP_DEBUG_ANY, "new config file from registry is: %s\n", configfile, 0, 0 ); -#endif } } #endif @@ -381,15 +364,9 @@ int main( int argc, char **argv ) LDAP_STAILQ_FOREACH( scp_entry, &slap_sync_cookie, sc_next ) { if ( scp->rid == scp_entry->rid ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "main: duplicated replica id in cookies\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "main: duplicated replica id in cookies\n", 0, 0, 0 ); -#endif slap_sync_cookie_free( scp, 1 ); goto destroy; } @@ -524,14 +501,10 @@ unhandled_option:; } } -#ifdef NEW_LOGGING - lutil_log_initialize( argc, argv ); -#else lutil_set_debug_level( "slapd", slap_debug ); ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &slap_debug); ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &slap_debug); ldif_debug = slap_debug; -#endif if ( version ) { fprintf( stderr, "%s\n", Versionstr ); @@ -557,11 +530,7 @@ unhandled_option:; #endif } -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, INFO, "%s", Versionstr, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s", Versionstr, 0, 0 ); -#endif if( check == CHECK_NONE && slapd_daemon_init( urls ) != 0 ) { rc = 1; @@ -603,13 +572,9 @@ unhandled_option:; #endif if ( slap_schema_init( ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "main: schema initialization error\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "schema initialization error\n", 0, 0, 0 ); -#endif goto destroy; } @@ -621,13 +586,9 @@ unhandled_option:; } if ( slap_controls_init( ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "main: controls initialization error\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "controls initialization error\n", 0, 0, 0 ); -#endif goto destroy; } @@ -644,13 +605,9 @@ unhandled_option:; #ifdef LDAP_SLAPI if ( slapi_int_initialize() != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "main: slapi initialization error\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slapi initialization error\n", 0, 0, 0 ); -#endif goto destroy; } @@ -686,24 +643,16 @@ unhandled_option:; } if ( glue_sub_init( ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, "main: subordinate config error\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "subordinate config error\n", 0, 0, 0 ); -#endif goto destroy; } if ( slap_schema_check( ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, "main: schema prep error\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "schema prep error\n", 0, 0, 0 ); -#endif goto destroy; } @@ -711,13 +660,9 @@ unhandled_option:; #ifdef HAVE_TLS rc = ldap_pvt_tls_init(); if( rc != 0) { -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, "main: tls init failed: %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "main: TLS init failed: %d\n", 0, 0, 0 ); -#endif rc = 1; SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 20 ); goto destroy; @@ -734,13 +679,9 @@ unhandled_option:; rc = ldap_pvt_tls_init_def_ctx(); if( rc != 0) { -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, "main: tls init def ctx failed: %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "main: TLS init def ctx failed: %d\n", rc, 0, 0 ); -#endif rc = 1; SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 20 ); goto destroy; @@ -791,11 +732,7 @@ unhandled_option:; goto shutdown; } -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, INFO, "main: slapd starting.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 ); -#endif if ( slapd_pid_file != NULL ) { @@ -867,11 +804,7 @@ stop: lutil_LogStoppedEvent( serverName ); #endif -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, "main: slapd stopped.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slapd stopped.\n", 0, 0, 0 ); -#endif #ifdef HAVE_NT_SERVICE_MANAGER diff --git a/servers/slapd/matchedValues.c b/servers/slapd/matchedValues.c index eb8aa71c3c..749e9496a6 100644 --- a/servers/slapd/matchedValues.c +++ b/servers/slapd/matchedValues.c @@ -66,39 +66,22 @@ filter_matched_values( ValuesReturnFilter *vrf; int rc = LDAP_SUCCESS; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "filter_matched_values: begin\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "=> filter_matched_values\n", 0, 0, 0 ); -#endif for ( vrf = op->o_vrFilter; vrf != NULL; vrf = vrf->vrf_next ) { switch ( vrf->vrf_choice ) { case SLAPD_FILTER_COMPUTED: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, - "test_vrFilter: COMPUTED %s (%d)\n", - vrf->vrf_result == LDAP_COMPARE_FALSE ? "false" : - vrf->vrf_result == LDAP_COMPARE_TRUE ? "true" : - vrf->vrf_result == SLAPD_COMPARE_UNDEFINED ? "undefined" : - "error", vrf->vrf_result, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " COMPUTED %s (%d)\n", vrf->vrf_result == LDAP_COMPARE_FALSE ? "false" : vrf->vrf_result == LDAP_COMPARE_TRUE ? "true" : vrf->vrf_result == SLAPD_COMPARE_UNDEFINED ? "undefined" : "error", vrf->vrf_result, 0 ); -#endif /*This type of filter does not affect the result */ rc = LDAP_SUCCESS; break; case LDAP_FILTER_EQUALITY: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: EQUALITY\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " EQUALITY\n", 0, 0, 0 ); -#endif rc = test_ava_vrFilter( op, a, vrf->vrf_ava, LDAP_FILTER_EQUALITY, e_flags ); if( rc == -1 ) { @@ -107,11 +90,7 @@ filter_matched_values( break; case LDAP_FILTER_SUBSTRINGS: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_vrFilter SUBSTRINGS\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " SUBSTRINGS\n", 0, 0, 0 ); -#endif rc = test_substrings_vrFilter( op, a, vrf, e_flags ); @@ -121,11 +100,7 @@ filter_matched_values( break; case LDAP_FILTER_PRESENT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: PRESENT\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " PRESENT\n", 0, 0, 0 ); -#endif rc = test_presence_vrFilter( op, a, vrf->vrf_desc, e_flags ); if( rc == -1 ) { @@ -150,11 +125,7 @@ filter_matched_values( break; case LDAP_FILTER_EXT: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: EXT\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, " EXT\n", 0, 0, 0 ); -#endif rc = test_mra_vrFilter( op, a, vrf->vrf_mra, e_flags ); if( rc == -1 ) { @@ -163,22 +134,13 @@ filter_matched_values( break; default: -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, INFO, - "test_vrFilter: unknown filter type %lu\n", vrf->vrf_choice, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " unknown filter type %lu\n", vrf->vrf_choice, 0, 0 ); -#endif rc = LDAP_PROTOCOL_ERROR; } } -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "filter_matched_values: return=%d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "<= filter_matched_values %d\n", rc, 0, 0 ); -#endif return( rc ); } diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 70f282a396..908a4a841f 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -52,11 +52,7 @@ do_modify( Modifications **modtail = &modlist; int increment = 0; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "do_modify: enter\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 ); -#endif /* * Parse the modify request. It looks like this: @@ -78,21 +74,13 @@ do_modify( */ if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "do_modify: ber_scanf failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modify: ber_scanf failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); return SLAPD_DISCONNECT; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, "do_modify: dn (%s)\n", dn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "do_modify: dn (%s)\n", dn.bv_val, 0, 0 ); -#endif /* collect modifications & save for later */ for ( tag = ber_first_element( op->o_ber, &len, &last ); @@ -125,15 +113,9 @@ do_modify( switch( mop ) { case LDAP_MOD_ADD: if ( mod->sml_values == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_modify: modify/add operation (%ld) requires values\n", - (long)mop, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modify: modify/add operation (%ld) requires values\n", (long) mop, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "modify/add operation requires values" ); @@ -150,15 +132,9 @@ do_modify( if( op->o_protocol >= LDAP_VERSION3 ) { increment++; if ( mod->sml_values == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "do_modify: " - "modify/increment operation (%ld) requires value\n", - (long)mop, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modify: " "modify/increment operation (%ld) requires value\n", (long) mop, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "modify/increment operation requires value" ); @@ -166,15 +142,9 @@ do_modify( } if( mod->sml_values[1].bv_val ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "do_modify: modify/increment " - "operation (%ld) requires single value\n", - (long)mop, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modify: modify/increment " "operation (%ld) requires single value\n", (long) mop, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "modify/increment operation requires single value" ); @@ -186,15 +156,9 @@ do_modify( /* fall thru */ default: { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_modify: unrecognized modify operation (%ld)\n", - (long)mop, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modify: unrecognized modify operation (%ld)\n", (long) mop, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "unrecognized modify operation" ); @@ -207,11 +171,7 @@ do_modify( *modtail = NULL; if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "do_modify: get_ctrls failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modify: get_ctrls failed\n", 0, 0, 0 ); -#endif goto cleanup; } @@ -219,13 +179,8 @@ do_modify( rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx ); if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "do_modify: conn %d invalid dn (%s)\n", - op->o_connid, dn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modify: invalid dn (%s)\n", dn.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" ); goto cleanup; } @@ -262,24 +217,14 @@ fe_op_modify( Operation *op, SlapReply *rs ) int increment = op->orm_increment; if( op->o_req_ndn.bv_len == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_modify: attempt to modify root DSE.\n",0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modify: root dse!\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, "modify upon the root DSE not supported" ); goto cleanup; } else if ( bvmatch( &op->o_req_ndn, &frontendDB->be_schemandn ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_modify: attempt to modify subschema subentry.\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modify: subschema subentry!\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, "modification of subschema subentry not supported" ); @@ -287,31 +232,9 @@ fe_op_modify( Operation *op, SlapReply *rs ) } #ifdef LDAP_DEBUG -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, "do_modify: modifications:\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "modifications:\n", 0, 0, 0 ); -#endif for ( tmp = modlist; tmp != NULL; tmp = tmp->sml_next ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, "\t%s: %s\n", - tmp->sml_op == LDAP_MOD_ADD ? "add" : - (tmp->sml_op == LDAP_MOD_INCREMENT ? "increment" : - (tmp->sml_op == LDAP_MOD_DELETE ? "delete" : - "replace")), tmp->sml_type.bv_val, 0 ); - - if ( tmp->sml_values == NULL ) { - LDAP_LOG( OPERATION, DETAIL1, "\t\tno values", 0, 0, 0 ); - } else if ( tmp->sml_values[0].bv_val == NULL ) { - LDAP_LOG( OPERATION, DETAIL1, "\t\tzero values", 0, 0, 0 ); - } else if ( tmp->sml_values[1].bv_val == NULL ) { - LDAP_LOG( OPERATION, DETAIL1, "\t\tone value", 0, 0, 0 ); - } else { - LDAP_LOG( OPERATION, DETAIL1, "\t\tmultiple values", 0, 0, 0 ); - } - -#else Debug( LDAP_DEBUG_ARGS, "\t%s: %s\n", tmp->sml_op == LDAP_MOD_ADD ? "add" : (tmp->sml_op == LDAP_MOD_INCREMENT ? "increment" : @@ -331,7 +254,6 @@ fe_op_modify( Operation *op, SlapReply *rs ) Debug( LDAP_DEBUG_ARGS, "%s\n", "\t\tmultiple values", NULL, NULL ); } -#endif } if ( StatslogTest( LDAP_DEBUG_STATS ) ) { @@ -439,15 +361,9 @@ fe_op_modify( Operation *op, SlapReply *rs ) * A preoperation plugin failure will abort the * entire operation. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_modify: modify preoperation plugin failed\n", - 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "do_modify: modify preoperation plugin failed.\n", 0, 0, 0); -#endif if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 ) || rs->sr_err == LDAP_SUCCESS ) { @@ -559,13 +475,8 @@ fe_op_modify( Operation *op, SlapReply *rs ) if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_MODIFY_FN, pb ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_modify: modify postoperation plugins failed\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "do_modify: modify postoperation plugins failed.\n", 0, 0, 0); -#endif } #endif /* defined( LDAP_SLAPI ) */ @@ -760,15 +671,9 @@ int slap_mods_check( ad->ad_type->sat_equality, &ml->sml_values[nvals], &ml->sml_nvalues[nvals], ctx ); if( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "str2entry: NULL (ssyn_normalize %d)\n", - rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "<= str2entry NULL (ssyn_normalize %d)\n", rc, 0, 0 ); -#endif snprintf( textbuf, textlen, "%s: value #%ld normalization failed", ml->sml_type.bv_val, (long) nvals ); diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index 0d71c39c98..db5a99f680 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -61,11 +61,7 @@ do_modrdn( ber_len_t length; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "do_modrdn: begin\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 ); -#endif /* @@ -82,11 +78,7 @@ do_modrdn( if ( ber_scanf( op->o_ber, "{mmb", &dn, &newrdn, &deloldrdn ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "do_modrdn: ber_scanf failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); return SLAPD_DISCONNECT; @@ -99,14 +91,9 @@ do_modrdn( /* Conection record indicates v2 but field * newSuperior is present: report error. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_modrdn: (v2) invalid field newSuperior.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "modrdn(v2): invalid field newSuperior!\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "newSuperior requires LDAPv3" ); @@ -117,13 +104,8 @@ do_modrdn( if ( ber_scanf( op->o_ber, "m", &newSuperior ) == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_modrdn: ber_scanf(\"m\") failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_scanf(\"m\") failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); @@ -134,24 +116,13 @@ do_modrdn( op->orr_nnewSup = &nnewSuperior; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "do_modrdn: dn (%s) newrdn (%s) newsuperior(%s)\n", - dn.bv_val, newrdn.bv_val, - newSuperior.bv_len ? newSuperior.bv_val : "" ); -#else Debug( LDAP_DEBUG_ARGS, "do_modrdn: dn (%s) newrdn (%s) newsuperior (%s)\n", dn.bv_val, newrdn.bv_val, newSuperior.bv_len ? newSuperior.bv_val : "" ); -#endif if ( ber_scanf( op->o_ber, /*{*/ "}") == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "do_modrdn: ber_scanf failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modrdn: ber_scanf failed\n", 0, 0, 0 ); -#endif send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" ); @@ -160,11 +131,7 @@ do_modrdn( } if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "do_modrdn: get_ctrls failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modrdn: get_ctrls failed\n", 0, 0, 0 ); -#endif /* get_ctrls has sent results. Now clean up. */ goto cleanup; @@ -172,14 +139,8 @@ do_modrdn( rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx ); if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_modrdn: conn %d invalid dn (%s)\n", - op->o_connid, dn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid dn (%s)\n", dn.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" ); goto cleanup; } @@ -188,26 +149,15 @@ do_modrdn( rs->sr_err = dnPrettyNormal( NULL, &newrdn, &op->orr_newrdn, &op->orr_nnewrdn, op->o_tmpmemctx ); if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_modrdn: conn %d invalid newrdn (%s)\n", - op->o_connid, newrdn.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid newrdn (%s)\n", newrdn.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid new RDN" ); goto cleanup; } if( rdn_validate( &op->orr_newrdn ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_modrdn: invalid rdn (%s).\n", op->orr_newrdn.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid rdn (%s)\n", op->orr_newrdn.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid new RDN" ); goto cleanup; @@ -217,15 +167,9 @@ do_modrdn( rs->sr_err = dnPrettyNormal( NULL, &newSuperior, &pnewSuperior, &nnewSuperior, op->o_tmpmemctx ); if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_modrdn: conn %d invalid newSuperior (%s)\n", - op->o_connid, newSuperior.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid newSuperior (%s)\n", newSuperior.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid newSuperior" ); goto cleanup; } @@ -261,26 +205,15 @@ fe_op_modrdn( Operation *op, SlapReply *rs ) struct berval pdn = BER_BVNULL; if( op->o_req_ndn.bv_len == 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_modrdn: attempt to modify root DSE.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modrdn: root dse!\n", 0, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, "cannot rename the root DSE" ); goto cleanup; } else if ( bvmatch( &op->o_req_ndn, &frontendDB->be_schemandn ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_modrdn: attempt to modify subschema subentry: %s (%ld)\n", - frontendDB->be_schemandn.bv_val, (long)frontendDB->be_schemandn.bv_len, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_modrdn: subschema subentry: %s (%ld)\n", frontendDB->be_schemandn.bv_val, (long)frontendDB->be_schemandn.bv_len, 0 ); -#endif send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, "cannot rename subschema subentry" ); @@ -358,13 +291,8 @@ fe_op_modrdn( Operation *op, SlapReply *rs ) * A preoperation plugin failure will abort the * entire operation. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "do_modrdn: modrdn preoperation plugin " - "failed\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "do_modrdn: modrdn preoperation plugin " "failed.\n", 0, 0, 0); -#endif if ( ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 ) || rs->sr_err == LDAP_SUCCESS ) { rs->sr_err = LDAP_OTHER; @@ -463,13 +391,8 @@ fe_op_modrdn( Operation *op, SlapReply *rs ) #if defined( LDAP_SLAPI ) if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_MODRDN_FN, pb ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "do_modrdn: modrdn postoperation plugins " - "failed\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "do_modrdn: modrdn postoperation plugins " "failed.\n", 0, 0, 0); -#endif } #endif /* defined( LDAP_SLAPI ) */ @@ -504,34 +427,20 @@ slap_modrdn2mods( rs->sr_err = slap_bv2ad( &new_rdn[a_cnt]->la_attr, &desc, &rs->sr_text ); if ( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "slap_modrdn2modlist: %s: %s (new)\n", - rs->sr_text, - new_rdn[ a_cnt ]->la_attr.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_modrdn2modlist: %s: %s (new)\n", rs->sr_text, new_rdn[ a_cnt ]->la_attr.bv_val, 0 ); -#endif goto done; } /* ACL check of newly added attrs */ if ( op->o_bd && !access_allowed( op, e, desc, &new_rdn[a_cnt]->la_value, ACL_WRITE, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "slap_modrdn2modlist: access to attr \"%s\" " - "(new) not allowed\n", - new_rdn[a_cnt]->la_attr.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_modrdn2modlist: access to attr \"%s\" " "(new) not allowed\n", new_rdn[ a_cnt ]->la_attr.bv_val, 0, 0 ); -#endif rs->sr_err = LDAP_INSUFFICIENT_ACCESS; goto done; } @@ -568,19 +477,11 @@ slap_modrdn2mods( rs->sr_err = slap_bv2ad( &old_rdn[d_cnt]->la_attr, &desc, &rs->sr_text ); if ( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "slap_modrdn2modlist: %s: %s (old)\n", - rs->sr_text, - old_rdn[d_cnt]->la_attr.bv_val, - 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_modrdn2modlist: %s: %s (old)\n", rs->sr_text, old_rdn[d_cnt]->la_attr.bv_val, 0 ); -#endif goto done; } @@ -588,19 +489,11 @@ slap_modrdn2mods( if ( op->o_bd && !access_allowed( op, e, desc, &old_rdn[d_cnt]->la_value, ACL_WRITE, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "slap_modrdn2modlist: access " - "to attr \"%s\" (old) not allowed\n", - old_rdn[ d_cnt ]->la_attr.bv_val, - 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_modrdn2modlist: access " "to attr \"%s\" (old) not allowed\n", old_rdn[ d_cnt ]->la_attr.bv_val, 0, 0 ); -#endif rs->sr_err = LDAP_INSUFFICIENT_ACCESS; goto done; } diff --git a/servers/slapd/module.c b/servers/slapd/module.c index a292422d16..445c8180dd 100644 --- a/servers/slapd/module.c +++ b/servers/slapd/module.c @@ -63,12 +63,7 @@ int module_init (void) __etoa( ebuf ); error = ebuf; #endif -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, - "module_init: lt_dlinit failed: %s\n", error, 0, 0 ); -#else Debug(LDAP_DEBUG_ANY, "lt_dlinit failed: %s\n", error, 0, 0); -#endif return -1; } @@ -89,12 +84,7 @@ int module_kill (void) __etoa( ebuf ); error = ebuf; #endif -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, "module_kill: lt_dlexit failed: %s\n", - error, 0, 0 ); -#else Debug(LDAP_DEBUG_ANY, "lt_dlexit failed: %s\n", error, 0, 0); -#endif return -1; } @@ -115,13 +105,8 @@ int module_load(const char* file_name, int argc, char *argv[]) module = (module_loaded_t *)ch_calloc(1, sizeof(module_loaded_t)); if (module == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, - "module_load: (%s) out of memory.\n", file_name, 0, 0 ); -#else Debug(LDAP_DEBUG_ANY, "module_load failed: (%s) out of memory\n", file_name, 0, 0); -#endif return -1; } @@ -142,24 +127,14 @@ int module_load(const char* file_name, int argc, char *argv[]) __etoa( ebuf ); error = ebuf; #endif -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, - "module_load: lt_dlopenext failed: (%s) %s.\n", - file_name, error, 0 ); -#else Debug(LDAP_DEBUG_ANY, "lt_dlopenext failed: (%s) %s\n", file_name, error, 0); -#endif ch_free(module); return -1; } -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, INFO, "module_load: loaded module %s\n", file_name, 0, 0 ); -#else Debug(LDAP_DEBUG_CONFIG, "loaded module %s\n", file_name, 0, 0); -#endif #ifdef HAVE_EBCDIC @@ -169,14 +144,8 @@ int module_load(const char* file_name, int argc, char *argv[]) #ifdef HAVE_EBCDIC #pragma convlit(resume) #endif -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, ERR, - "module_load: module %s : no init_module() function found\n", - file_name, 0, 0 ); -#else Debug(LDAP_DEBUG_CONFIG, "module %s: no init_module() function found\n", file_name, 0, 0); -#endif lt_dlclose(module->lib); ch_free(module); @@ -200,13 +169,8 @@ int module_load(const char* file_name, int argc, char *argv[]) */ rc = initialize(argc, argv); if (rc == -1) { -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, ERR, - "module_load: module %s init_module() failed\n", file_name, 0, 0); -#else Debug(LDAP_DEBUG_CONFIG, "module %s: init_module() failed\n", file_name, 0, 0); -#endif lt_dlclose(module->lib); ch_free(module); @@ -216,14 +180,8 @@ int module_load(const char* file_name, int argc, char *argv[]) if (rc >= (int)(sizeof(module_regtable) / sizeof(struct module_regtable_t)) || module_regtable[rc].proc == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, ERR, - "module_load: module %s: unknown registration type (%d).\n", - file_name, rc, 0); -#else Debug(LDAP_DEBUG_CONFIG, "module %s: unknown registration type (%d)\n", file_name, rc, 0); -#endif module_unload(module); return -1; @@ -231,14 +189,8 @@ int module_load(const char* file_name, int argc, char *argv[]) rc = (module_regtable[rc].proc)(module, file_name); if (rc != 0) { -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, ERR, - "module_load: module %s:%s could not be registered.\n", - file_name, module_regtable[rc].type, 0 ); -#else Debug(LDAP_DEBUG_CONFIG, "module %s: %s module could not be registered\n", file_name, module_regtable[rc].type, 0); -#endif module_unload(module); return rc; @@ -247,14 +199,8 @@ int module_load(const char* file_name, int argc, char *argv[]) module->next = module_list; module_list = module; -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, INFO, - "module_load: module %s:%s registered\n", file_name, - module_regtable[rc].type, 0 ); -#else Debug(LDAP_DEBUG_CONFIG, "module %s: %s module registered\n", file_name, module_regtable[rc].type, 0); -#endif return 0; } diff --git a/servers/slapd/mr.c b/servers/slapd/mr.c index 016f7421c9..77e070b595 100644 --- a/servers/slapd/mr.c +++ b/servers/slapd/mr.c @@ -221,13 +221,8 @@ register_matching_rule( if( def->mrd_usage == SLAP_MR_NONE && def->mrd_compat_syntaxes == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "register_matching_rule: %s not usable\n", def->mrd_desc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "register_matching_rule: not usable %s\n", def->mrd_desc, 0, 0 ); -#endif return -1; } @@ -236,16 +231,9 @@ register_matching_rule( amr = mr_find( def->mrd_associated ); if( amr == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "register_matching_rule: could not locate associated " - "matching rule %s for %s\n", - def->mrd_associated, def->mrd_desc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "register_matching_rule: could not locate " "associated matching rule %s for %s\n", def->mrd_associated, def->mrd_desc, 0 ); -#endif return -1; } @@ -256,32 +244,18 @@ register_matching_rule( if (( def->mrd_usage & SLAP_MR_EQUALITY ) && (( def->mrd_usage & SLAP_MR_SUBTYPE_MASK ) != SLAP_MR_NONE )) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "register_matching_rule: inappropriate (approx) association " - "%s for %s\n", - def->mrd_associated, def->mrd_desc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "register_matching_rule: inappropriate (approx) association " "%s for %s\n", def->mrd_associated, def->mrd_desc, 0 ); -#endif return -1; } } else if (!( amr->smr_usage & SLAP_MR_EQUALITY )) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "register_matching_rule: inappropriate (equalilty) association " - "%s for %s\n", - def->mrd_associated, def->mrd_desc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "register_matching_rule: inappropriate (equalilty) association " "%s for %s\n", def->mrd_associated, def->mrd_desc, 0 ); -#endif return -1; } } @@ -289,15 +263,9 @@ register_matching_rule( mr = ldap_str2matchingrule( def->mrd_desc, &code, &err, LDAP_SCHEMA_ALLOW_ALL ); if ( !mr ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "register_matching_rule: %s before %s in %s.\n", - ldap_scherr2str(code), err, def->mrd_desc ); -#else Debug( LDAP_DEBUG_ANY, "Error in register_matching_rule: %s before %s in %s\n", ldap_scherr2str(code), err, def->mrd_desc ); -#endif return -1; } @@ -308,15 +276,9 @@ register_matching_rule( ldap_memfree( mr ); if ( code ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "register_matching_rule: %s for %s in %s.\n", - scherr2str(code), err, def->mrd_desc ); -#else Debug( LDAP_DEBUG_ANY, "Error in register_matching_rule: %s for %s in %s\n", scherr2str(code), err, def->mrd_desc ); -#endif return -1; } @@ -353,11 +315,7 @@ matching_rule_use_init( void ) MatchingRule *mr; MatchingRuleUse **mru_ptr = &LDAP_SLIST_FIRST(&mru_list); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "matching_rule_use_init\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "matching_rule_use_init\n", 0, 0, 0 ); -#endif LDAP_SLIST_FOREACH( mr, &mr_list, smr_next ) { AttributeType *at; @@ -400,15 +358,9 @@ matching_rule_use_init( void ) mru->smru_names = mr->smr_names; mru->smru_desc = mr->smr_desc; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, " %s (%s): ", - mru->smru_oid, - mru->smru_names ? mru->smru_names[ 0 ] : "", 0 ); -#else Debug( LDAP_DEBUG_TRACE, " %s (%s): ", mru->smru_oid, mru->smru_names ? mru->smru_names[ 0 ] : "", 0 ); -#endif at = NULL; for ( at_start( &at ); at; at_next( &at ) ) { @@ -426,19 +378,11 @@ matching_rule_use_init( void ) */ if ( applies_oids != NULL ) { mru->smru_applies_oids = applies_oids; -#ifdef NEW_LOGGING - { - char *str = ldap_matchingruleuse2str( &mru->smru_mruleuse ); - LDAP_LOG( OPERATION, INFO, "matchingRuleUse: %s\n", str, 0, 0 ); - ldap_memfree( str ); - } -#else { char *str = ldap_matchingruleuse2str( &mru->smru_mruleuse ); Debug( LDAP_DEBUG_TRACE, "matchingRuleUse: %s\n", str, 0, 0 ); ldap_memfree( str ); } -#endif mru = (MatchingRuleUse *)ber_memalloc( sizeof( MatchingRuleUse ) ); /* call-forward from MatchingRule to MatchingRuleUse */ diff --git a/servers/slapd/mra.c b/servers/slapd/mra.c index 1cb4e69f3f..d9e1ec6226 100644 --- a/servers/slapd/mra.c +++ b/servers/slapd/mra.c @@ -54,12 +54,7 @@ get_mra( rtag = ber_scanf( ber, "{t" /*"}"*/, &tag ); if( rtag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "get_mra: ber_scanf (\"{t\") failure\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf\n", 0, 0, 0 ); -#endif *text = "Error parsing matching rule assertion"; return SLAPD_DISCONNECT; @@ -68,12 +63,7 @@ get_mra( if ( tag == LDAP_FILTER_EXT_OID ) { rtag = ber_scanf( ber, "m", &rule_text ); if ( rtag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "get_mra: ber_scanf(\"o\") failure.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf for mr\n", 0, 0, 0 ); -#endif *text = "Error parsing matching rule in matching rule assertion"; return SLAPD_DISCONNECT; @@ -81,12 +71,7 @@ get_mra( rtag = ber_scanf( ber, "t", &tag ); if( rtag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "get_mra: ber_scanf (\"t\") failure\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf\n", 0, 0, 0 ); -#endif *text = "Error parsing matching rule assertion"; return SLAPD_DISCONNECT; @@ -96,12 +81,7 @@ get_mra( if ( tag == LDAP_FILTER_EXT_TYPE ) { rtag = ber_scanf( ber, "m", &type ); if ( rtag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "get_mra: ber_scanf (\"o\") failure.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf for ad\n", 0, 0, 0 ); -#endif *text = "Error parsing attribute description in matching rule assertion"; return SLAPD_DISCONNECT; @@ -109,12 +89,7 @@ get_mra( rtag = ber_scanf( ber, "t", &tag ); if( rtag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "get_mra: ber_scanf (\"t\") failure.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf\n", 0, 0, 0 ); -#endif *text = "Error parsing matching rule assertion"; return SLAPD_DISCONNECT; @@ -122,12 +97,7 @@ get_mra( } if ( tag != LDAP_FILTER_EXT_VALUE ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "get_mra: ber_scanf missing value\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf missing value\n", 0, 0, 0 ); -#endif *text = "Missing value in matching rule assertion"; return SLAPD_DISCONNECT; @@ -136,12 +106,7 @@ get_mra( rtag = ber_scanf( ber, "m", &value ); if( rtag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "get_mra: ber_scanf (\"o\") failure.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf\n", 0, 0, 0 ); -#endif *text = "Error decoding value in matching rule assertion"; return SLAPD_DISCONNECT; @@ -156,11 +121,7 @@ get_mra( } if( rtag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "get_mra: ber_scanf failure\n", 0, 0, 0); -#else Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf\n", 0, 0, 0 ); -#endif *text = "Error decoding dnattrs matching rule assertion"; return SLAPD_DISCONNECT; diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index 42fd967ec3..b31defeaef 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -34,14 +34,8 @@ int is_object_subclass( if( sub == NULL || sup == NULL ) return 0; #if 0 -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "is_object_subclass(%s,%s) %d\n", - sup->soc_oid, sub->soc_oid, sup == sub ); -#else Debug( LDAP_DEBUG_TRACE, "is_object_subclass(%s,%s) %d\n", sup->soc_oid, sub->soc_oid, sup == sub ); -#endif #endif if( sup == sub ) { @@ -93,17 +87,10 @@ int is_entry_objectclass( attr = attr_find(e->e_attrs, objectClass); if( attr == NULL ) { /* no objectClass attribute */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "is_entry_objectclass: dn(%s), oid (%s), no objectClass " - "attribute.\n", e->e_dn == NULL ? "" : e->e_dn, - oc->soc_oclass.oc_oid, 0 ); -#else Debug( LDAP_DEBUG_ANY, "is_entry_objectclass(\"%s\", \"%s\") " "no objectClass attribute\n", e->e_dn == NULL ? "" : e->e_dn, oc->soc_oclass.oc_oid, 0 ); -#endif return 0; } diff --git a/servers/slapd/oidm.c b/servers/slapd/oidm.c index b866af63a8..15e5ac61c6 100644 --- a/servers/slapd/oidm.c +++ b/servers/slapd/oidm.c @@ -56,13 +56,8 @@ oidm_find(char *oid) char *tmp = SLAP_MALLOC( om->som_oid.bv_len + suflen + 1); if( tmp == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "oidm_find: SLAP_MALLOC failed", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "oidm_find: SLAP_MALLOC failed", 0, 0, 0 ); -#endif return NULL; } strcpy(tmp, om->som_oid.bv_val); @@ -121,11 +116,7 @@ usage: fprintf( stderr, "\tObjectIdentifier \n"); om = (OidMacro *) SLAP_MALLOC( sizeof(OidMacro) ); if( om == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "parse_oidm: SLAP_MALLOC failed", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "parse_oidm: SLAP_MALLOC failed", 0, 0, 0 ); -#endif return 1; } diff --git a/servers/slapd/overlays/lastmod.c b/servers/slapd/overlays/lastmod.c index 90b3259e28..1485713472 100644 --- a/servers/slapd/overlays/lastmod.c +++ b/servers/slapd/overlays/lastmod.c @@ -723,42 +723,24 @@ lastmod_db_init( at = ldap_str2attributetype( mat[i].schema, &code, &err, LDAP_SCHEMA_ALLOW_ALL ); if ( !at ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "lastmod_init: " - "in AttributeType '%s' %s before %s\n", - mat[i].name, ldap_scherr2str(code), err ); -#else Debug( LDAP_DEBUG_ANY, "lastmod_init: " "in AttributeType '%s' %s before %s\n", mat[i].name, ldap_scherr2str(code), err ); -#endif return -1; } if ( at->at_oid == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "lastmod_init: " - "null OID for attributeType '%s'\n", - mat[i].name, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "lastmod_init: " "null OID for attributeType '%s'\n", mat[i].name, 0, 0 ); -#endif return -1; } code = at_add(at, &err); if ( code ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "lastmod_init: " - "%s in attributeType '%s'\n", - scherr2str(code), mat[i].name, 0 ); -#else Debug( LDAP_DEBUG_ANY, "lastmod_init: " "%s in attributeType '%s'\n", scherr2str(code), mat[i].name, 0 ); -#endif return -1; } ldap_memfree(at); @@ -766,13 +748,8 @@ lastmod_db_init( ad = ((AttributeDescription **)&(((char *)&lastmod_schema)[mat[i].offset])); ad[0] = NULL; if ( slap_str2ad( mat[i].name, ad, &text ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "lastmod_init: %s\n", text, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "lastmod_init: %s\n", text, 0, 0 ); -#endif return -1; } @@ -788,44 +765,25 @@ lastmod_db_init( oc = ldap_str2objectclass(moc[i].schema, &code, &err, LDAP_SCHEMA_ALLOW_ALL ); if ( !oc ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "unable to parse lastmod objectClass '%s': " - "%s before %s\n" , moc[i].name, - ldap_scherr2str(code), err ); -#else Debug( LDAP_DEBUG_ANY, "unable to parse lastmod objectClass '%s': " "%s before %s\n" , moc[i].name, ldap_scherr2str(code), err ); -#endif return -1; } if ( oc->oc_oid == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "objectClass '%s' has no OID\n" , - moc[i].name, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "objectClass '%s' has no OID\n" , moc[i].name, 0, 0 ); -#endif return -1; } code = oc_add(oc, 0, &err); if ( code ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "objectClass '%s': %s \"%s\"\n" , - moc[i].name, scherr2str(code), err ); -#else Debug( LDAP_DEBUG_ANY, "objectClass '%s': %s \"%s\"\n" , moc[i].name, scherr2str(code), err ); -#endif return -1; } @@ -833,15 +791,9 @@ lastmod_db_init( Oc = oc_find( moc[i].name ); if ( Oc == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, "lastmod_init: " - "unable to find objectClass %s " - "(just added)\n", moc[i].name, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "lastmod_init: " "unable to find objectClass %s " "(just added)\n", moc[i].name, 0, 0 ); -#endif return -1; } diff --git a/servers/slapd/overlays/overlays.c b/servers/slapd/overlays/overlays.c index 8d2a348989..b3db84eb6d 100644 --- a/servers/slapd/overlays/overlays.c +++ b/servers/slapd/overlays/overlays.c @@ -93,13 +93,8 @@ overlay_init(void) for ( i=0; funcs[i].name; i++ ) { rc = funcs[i].func(); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, ERR, - "%s overlay setup failed, err %d\n", funcs[i].name, rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s overlay setup failed, err %d\n", funcs[i].name, rc, 0 ); -#endif break; } } diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 8ebd8c015a..b631a58efd 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -260,13 +260,8 @@ add_query_on_top (query_manager* qm, CachedQuery* qc) qc->lru_down = top; qc->lru_up = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Base of added query = %s\n", - q->base.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Base of added query = %s\n", q->base.bv_val, 0, 0 ); -#endif } /* remove_query from LRU list */ @@ -521,13 +516,8 @@ query_containment(query_manager *qm, MatchingRule* mrule = NULL; if (inputf != NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Lock QC index = %d\n", - template_index, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Lock QC index = %d\n", template_index, 0, 0 ); -#endif ldap_pvt_thread_rdwr_rlock(&(templa[template_index].t_rwlock)); for(qc=templa[template_index].query; qc != NULL; qc= qc->next) { q = (Query*)qc; @@ -557,15 +547,9 @@ query_containment(query_manager *qm, &(fs->f_ava->aa_value), &text); if (rc != LDAP_SUCCESS) { ldap_pvt_thread_rdwr_runlock(&(templa[template_index].t_rwlock)); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "Unlock: Exiting QC index=%d\n", - template_index, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Unlock: Exiting QC index=%d\n", template_index, 0, 0 ); -#endif return 0; } } @@ -634,15 +618,9 @@ query_containment(query_manager *qm, } } } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "Not answerable: Unlock QC index=%d\n", - template_index, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Not answerable: Unlock QC index=%d\n", template_index, 0, 0 ); -#endif ldap_pvt_thread_rdwr_runlock(&(templa[template_index].t_rwlock)); } return 0; @@ -680,13 +658,8 @@ static void add_query( new_cached_query->lru_up = NULL; new_cached_query->lru_down = NULL; new_cached_query->expiry_time = slap_get_time() + templ->ttl; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Added query expires at %ld\n", - (long) new_cached_query->expiry_time, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Added query expires at %ld\n", (long) new_cached_query->expiry_time, 0, 0 ); -#endif new_query = (Query*)new_cached_query; ber_dupbv(&new_query->base, &query->base); @@ -695,13 +668,8 @@ static void add_query( new_query->attrs = query->attrs; /* Adding a query */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Lock AQ index = %d\n", - template_index, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Lock AQ index = %d\n", template_index, 0, 0 ); -#endif ldap_pvt_thread_rdwr_wlock(&templ->t_rwlock); if (templ->query == NULL) templ->query_last = new_cached_query; @@ -711,21 +679,11 @@ static void add_query( new_cached_query->prev = NULL; templ->query = new_cached_query; templ->no_of_queries++; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "TEMPLATE %d QUERIES++ %d\n", - template_index, templ->no_of_queries, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TEMPLATE %d QUERIES++ %d\n", template_index, templ->no_of_queries, 0 ); -#endif -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Unlock AQ index = %d \n", - template_index, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Unlock AQ index = %d \n", template_index, 0, 0 ); -#endif ldap_pvt_thread_rdwr_wunlock(&templ->t_rwlock); /* Adding on top of LRU list */ @@ -766,15 +724,9 @@ static void cache_replacement(query_manager* qm, struct berval *result) result->bv_len = 0; if (!bottom) { -#ifdef NEW_LOGGING - LDAP_LOG ( BACK_META, DETAIL1, - "Cache replacement invoked without " - "any query in LRU list\n", 0, 0, 0 ); -#else Debug ( LDAP_DEBUG_ANY, "Cache replacement invoked without " "any query in LRU list\n", 0, 0, 0 ); -#endif return; } @@ -785,25 +737,12 @@ static void cache_replacement(query_manager* qm, struct berval *result) *result = bottom->q_uuid; bottom->q_uuid.bv_val = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Lock CR index = %d\n", temp_id, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Lock CR index = %d\n", temp_id, 0, 0 ); -#endif ldap_pvt_thread_rdwr_wlock(&(qm->templates[temp_id].t_rwlock)); remove_from_template(bottom, (qm->templates+temp_id)); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "TEMPLATE %d QUERIES-- %d\n", - temp_id, qm->templates[temp_id].no_of_queries, 0 ); -#else Debug( LDAP_DEBUG_ANY, "TEMPLATE %d QUERIES-- %d\n", temp_id, qm->templates[temp_id].no_of_queries, 0 ); -#endif -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Unlock CR index = %d\n", temp_id, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Unlock CR index = %d\n", temp_id, 0, 0 ); -#endif ldap_pvt_thread_rdwr_wunlock(&(qm->templates[temp_id].t_rwlock)); free_query(bottom); } @@ -892,14 +831,8 @@ remove_query_data ( op->o_req_ndn = qi->xdn; if ( qi->del) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "DELETING ENTRY TEMPLATE=%s\n", - query_uuid->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "DELETING ENTRY TEMPLATE=%s\n", query_uuid->bv_val, 0, 0 ); -#endif op->o_tag = LDAP_REQ_DELETE; @@ -919,15 +852,9 @@ remove_query_data ( mod.sml_values = vals; mod.sml_nvalues = NULL; mod.sml_next = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "REMOVING TEMP ATTR : TEMPLATE=%s\n", - query_uuid->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "REMOVING TEMP ATTR : TEMPLATE=%s\n", query_uuid->bv_val, 0, 0 ); -#endif op->orm_modlist = &mod; @@ -1092,77 +1019,38 @@ cache_entries( op_tmp.o_dn = cm->db.be_rootdn; op_tmp.o_ndn = cm->db.be_rootndn; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "UUID for query being added = %s\n", - uuidbuf, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "UUID for query being added = %s\n", uuidbuf, 0, 0 ); -#endif /* !NEW_LOGGING */ for ( e=si->head; e; e=si->head ) { si->head = e->e_private; e->e_private = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL2, "LOCKING REMOVE MUTEX\n", - 0, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_NONE, "LOCKING REMOVE MUTEX\n", 0, 0, 0 ); -#endif /* !NEW_LOGGING */ ldap_pvt_thread_mutex_lock(&cm->remove_mutex); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL2, "LOCKED REMOVE MUTEX\n", 0, 0, 0); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_NONE, "LOCKED REMOVE MUTEX\n", 0, 0, 0); -#endif /* !NEW_LOGGING */ while ( cm->cur_entries > (cm->max_entries) ) { qm->crfunc(qm, &crp_uuid); if (crp_uuid.bv_val) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "Removing query UUID %s\n", - crp_uuid.bv_val, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "Removing query UUID %s\n", crp_uuid.bv_val, 0, 0 ); -#endif /* !NEW_LOGGING */ return_val = remove_query_data(&op_tmp, rs, &crp_uuid); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "QUERY REMOVED, SIZE=%d\n", - return_val, 0, 0); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "QUERY REMOVED, SIZE=%d\n", return_val, 0, 0); -#endif /* !NEW_LOGGING */ ldap_pvt_thread_mutex_lock( &cm->cache_mutex ); cm->cur_entries -= return_val; cm->num_cached_queries--; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "STORED QUERIES = %lu\n", - cm->num_cached_queries, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %lu\n", cm->num_cached_queries, 0, 0 ); -#endif /* !NEW_LOGGING */ ldap_pvt_thread_mutex_unlock( &cm->cache_mutex ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "QUERY REMOVED, CACHE =" - "%d entries\n", - cm->cur_entries, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "QUERY REMOVED, CACHE =" "%d entries\n", cm->cur_entries, 0, 0 ); -#endif /* !NEW_LOGGING */ } } @@ -1170,27 +1058,16 @@ cache_entries( ldap_pvt_thread_mutex_unlock(&cm->remove_mutex); ldap_pvt_thread_mutex_lock(&cm->cache_mutex); cm->cur_entries += return_val; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "ENTRY ADDED/MERGED, CACHED ENTRIES=%d\n", - cm->cur_entries, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "ENTRY ADDED/MERGED, CACHED ENTRIES=%d\n", cm->cur_entries, 0, 0 ); -#endif /* !NEW_LOGGING */ return_val = 0; ldap_pvt_thread_mutex_unlock(&cm->cache_mutex); } ldap_pvt_thread_mutex_lock(&cm->cache_mutex); cm->num_cached_queries++; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "STORED QUERIES = %lu\n", - cm->num_cached_queries, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %lu\n", cm->num_cached_queries, 0, 0 ); -#endif /* !NEW_LOGGING */ ldap_pvt_thread_mutex_unlock(&cm->cache_mutex); return return_val; @@ -1353,13 +1230,8 @@ proxy_cache_search( return SLAP_CB_CONTINUE; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "query template of incoming query = %s\n", - tempstr.bv_val, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "query template of incoming query = %s\n", tempstr.bv_val, 0, 0 ); -#endif /* !NEW_LOGGING */ /* find attr set */ attr_set = get_attr_set(op->ors_attrs, qm, cm->numattrsets); @@ -1380,14 +1252,8 @@ proxy_cache_search( cacheable = 1; template_id = i; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL2, - "Entering QC, querystr = %s\n", - op->ors_filterstr.bv_val, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_NONE, "Entering QC, querystr = %s\n", op->ors_filterstr.bv_val, 0, 0 ); -#endif /* !NEW_LOGGING */ answerable = (*(qm->qcfunc))(qm, &query, i); if (answerable) @@ -1405,11 +1271,7 @@ proxy_cache_search( BackendDB *save_bd = op->o_bd; slap_callback *save_cb = op->o_callback; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "QUERY ANSWERABLE\n", 0, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "QUERY ANSWERABLE\n", 0, 0, 0 ); -#endif /* !NEW_LOGGING */ free(filter_attrs); ldap_pvt_thread_rdwr_runlock(&qm->templates[i].t_rwlock); op->o_bd = &cm->db; @@ -1420,12 +1282,7 @@ proxy_cache_search( return i; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "QUERY NOT ANSWERABLE\n", - 0, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "QUERY NOT ANSWERABLE\n", 0, 0, 0 ); -#endif /* !NEW_LOGGING */ ldap_pvt_thread_mutex_lock(&cm->cache_mutex); if (cm->num_cached_queries >= cm->max_queries) { @@ -1437,12 +1294,7 @@ proxy_cache_search( slap_callback *cb; struct search_info *si; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "QUERY CACHEABLE\n", 0, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "QUERY CACHEABLE\n", 0, 0, 0 ); -#endif /* !NEW_LOGGING */ query.filter = str2filter(op->ors_filterstr.bv_val); if (op->ors_attrs) { for ( count = 0; !BER_BVISNULL( &op->ors_attrs[ count ].an_name ); count++ ) { @@ -1497,14 +1349,8 @@ proxy_cache_search( } } else { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "QUERY NOT CACHEABLE\n", - 0, 0, 0); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "QUERY NOT CACHEABLE\n", 0, 0, 0); -#endif /* !NEW_LOGGING */ } free(filter_attrs); @@ -1591,62 +1437,28 @@ consistency_check( ldap_pvt_thread_mutex_lock(&qm->lru_mutex); remove_query(qm, query); ldap_pvt_thread_mutex_unlock(&qm->lru_mutex); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Lock CR index = %d\n", - i, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "Lock CR index = %d\n", i, 0, 0 ); -#endif /* !NEW_LOGGING */ ldap_pvt_thread_rdwr_wlock(&templ->t_rwlock); remove_from_template(query, templ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "TEMPLATE %d QUERIES-- %d\n", - i, templ->no_of_queries, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "TEMPLATE %d QUERIES-- %d\n", i, templ->no_of_queries, 0 ); -#endif /* !NEW_LOGGING */ -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Unlock CR index = %d\n", - i, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "Unlock CR index = %d\n", i, 0, 0 ); -#endif /* !NEW_LOGGING */ ldap_pvt_thread_rdwr_wunlock(&templ->t_rwlock); return_val = remove_query_data(&op, &rs, &query->q_uuid); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "STALE QUERY REMOVED, SIZE=%d\n", - return_val, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "STALE QUERY REMOVED, SIZE=%d\n", return_val, 0, 0 ); -#endif /* !NEW_LOGGING */ ldap_pvt_thread_mutex_lock(&cm->cache_mutex); cm->cur_entries -= return_val; cm->num_cached_queries--; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "STORED QUERIES = %lu\n", - cm->num_cached_queries, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %lu\n", cm->num_cached_queries, 0, 0 ); -#endif /* !NEW_LOGGING */ ldap_pvt_thread_mutex_unlock(&cm->cache_mutex); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "STALE QUERY REMOVED, CACHE =" - "%d entries\n", - cm->cur_entries, 0, 0 ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "STALE QUERY REMOVED, CACHE =" "%d entries\n", cm->cur_entries, 0, 0 ); -#endif /* !NEW_LOGGING */ query_prev = query; query = query->prev; free_query(query_prev); @@ -1727,15 +1539,9 @@ proxy_cache_config( cm->num_entries_limit = atoi( argv[4] ); cm->cc_period = atoi( argv[5] ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "Total # of attribute sets to be cached = %d\n", - cm->numattrsets, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Total # of attribute sets to be cached = %d\n", cm->numattrsets, 0, 0 ); -#endif qm->attr_sets = ( struct attr_set * )ch_malloc( cm->numattrsets * sizeof( struct attr_set )); for ( i = 0; i < cm->numattrsets; i++ ) { @@ -1748,13 +1554,8 @@ proxy_cache_config( " \"\n", fname, lineno ); return( 1 ); } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Attribute Set # %d\n", - atoi( argv[1] ), 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Attribute Set # %d\n", atoi( argv[1] ), 0, 0 ); -#endif if (atoi(argv[1]) >= cm->numattrsets) { fprintf( stderr, "%s; line %d index out of bounds \n", fname, lineno ); @@ -1767,13 +1568,8 @@ proxy_cache_config( (argc-1) * sizeof( AttributeName )); attr_name = qm->attr_sets[index].attrs; for ( i = 2; i < argc; i++ ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "\t %s\n", - argv[i], 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "\t %s\n", argv[i], 0, 0 ); -#endif ber_str2bv( argv[i], 0, 1, &attr_name->an_name); attr_name->an_desc = NULL; @@ -1792,15 +1588,9 @@ proxy_cache_config( return( 1 ); } if (( i = atoi( argv[2] )) >= cm->numattrsets ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "%s: line %d, template index invalid\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d, template index invalid\n", fname, lineno, 0 ); -#endif return 1; } num = cm->numtemplates; @@ -1814,45 +1604,21 @@ proxy_cache_config( temp->ttl = atoi( argv[3] ); temp->no_of_queries = 0; if ( argv[1] == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "Templates string not specified " - "for template %d\n", num, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Templates string not specified " "for template %d\n", num, 0, 0 ); -#endif return 1; } ber_str2bv( argv[1], 0, 1, &temp->querystr ); -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Template:\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Template:\n", 0, 0, 0 ); -#endif -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, " query template: %s\n", - temp->querystr.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " query template: %s\n", temp->querystr.bv_val, 0, 0 ); -#endif temp->attr_set_index = i; -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, " attributes: \n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, " attributes: \n", 0, 0, 0 ); -#endif if ( ( attrarray = qm->attr_sets[i].attrs ) != NULL ) { for ( i=0; attrarray[i].an_name.bv_val; i++ ) -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "\t%s\n", - attrarray[i].an_name.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "\t%s\n", attrarray[i].an_name.bv_val, 0, 0 ); -#endif } temp++; temp->querystr.bv_val = NULL; @@ -1865,15 +1631,9 @@ proxy_cache_config( * final entry is cached. */ if ( argc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "missing specifier for \"response-callback {head(default)|tail}\" " - "callback position\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "missing specifier for \"response-callback {head(default)|tail}\" " "callback position\n", 0, 0, 0 ); -#endif return 1; } @@ -1884,15 +1644,9 @@ proxy_cache_config( cm->response_cb = PCACHE_RESPONSE_CB_TAIL; } else { -#ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, - "unknown specifier %s for \"response-callback {head(default)|tail}\" " - "callback position\n", argv[1], 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "unknown specifier %s for \"response-callback {head(default)|tail}\" " "callback position\n", argv[1], 0, 0 ); -#endif return 1; } } diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index 77537f64bc..c0741354f1 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -440,13 +440,8 @@ ppolicy_get( Operation *op, Entry *e, PassPolicy *pp ) } else { vals = a->a_nvals; if (vals[0].bv_val == NULL) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "ppolicy_get: NULL value for policySubEntry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ppolicy_get: NULL value for policySubEntry\n", 0, 0, 0 ); -#endif goto defaultpol; } } @@ -510,13 +505,8 @@ ppolicy_get( Operation *op, Entry *e, PassPolicy *pp ) return; defaultpol: -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, DETAIL1, - "ppolicy_get: using default policy\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ppolicy_get: using default policy\n", 0, 0, 0 ); -#endif op->o_private = opr; return; } @@ -607,15 +597,9 @@ check_password_quality( struct berval *cred, PassPolicy *pp, LDAPPasswordPolicyE if ((mod = lt_dlopen( pp->pwdCheckModule )) == NULL) { err = lt_dlerror(); -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, - "check_password_quality: lt_dlopen failed: (%s) %s.\n", - pp->pwdCheckModule, err, 0 ); -#else Debug(LDAP_DEBUG_ANY, "check_password_quality: lt_dlopen failed: (%s) %s.\n", pp->pwdCheckModule, err, 0 ); -#endif ok = LDAP_OTHER; /* internal error */ } else { int (*prog)( char *passwd, char **text, void *arg ); @@ -623,15 +607,9 @@ check_password_quality( struct berval *cred, PassPolicy *pp, LDAPPasswordPolicyE if ((prog = lt_dlsym( mod, "check_password" )) == NULL) { err = lt_dlerror(); -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, - "check_password_quality: lt_dlsym failed: (%s) %s.\n", - pp->pwdCheckModule, err, 0 ); -#else Debug(LDAP_DEBUG_ANY, "check_password_quality: lt_dlsym failed: (%s) %s.\n", pp->pwdCheckModule, err, 0 ); -#endif ok = LDAP_OTHER; } else { char *txt = NULL; @@ -640,15 +618,9 @@ check_password_quality( struct berval *cred, PassPolicy *pp, LDAPPasswordPolicyE ok = prog( cred->bv_val, &txt, NULL ); ldap_pvt_thread_mutex_unlock( &chk_syntax_mutex ); if (txt) { -#ifdef NEW_LOGGING - LDAP_LOG( SLAPD, CRIT, - "check_password_quality: module error (%s) %s[%d].\n", - pp->pwdCheckModule, txt, ok ); -#else Debug(LDAP_DEBUG_ANY, "check_password_quality: module error: (%s) %s.[%d]\n", pp->pwdCheckModule, txt, ok ); -#endif free(txt); } else ok = LDAP_SUCCESS; @@ -955,16 +927,10 @@ ppolicy_bind_resp( Operation *op, SlapReply *rs ) * missing if the DIT was established via * an import process. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "ppolicy_bind: Entry %s does not have valid pwdChangedTime attribute - assuming password expired\n", - e->e_name.bv_val, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "ppolicy_bind: Entry %s does not have valid pwdChangedTime attribute - assuming password expired\n", e->e_name.bv_val, 0, 0); -#endif pwExpired = 1; } else { /* @@ -989,15 +955,9 @@ grace: /* * ngut is the number of remaining grace logins */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "ppolicy_bind: Entry %s has an expired password: %d grace logins\n", - e->e_name.bv_val, ngut, 0); -#else Debug( LDAP_DEBUG_ANY, "ppolicy_bind: Entry %s has an expired password: %d grace logins\n", e->e_name.bv_val, ngut, 0); -#endif if (ngut < 1) { ppb->pErr = PP_passwordExpired; @@ -1057,15 +1017,9 @@ check_expiring_password: warn = ppb->pp.pwdMaxAge - age; /* seconds left until expiry */ if (warn < 0) warn = 0; /* something weird here - why is pwExpired not set? */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATIONS, DETAIL1, - "ppolicy_bind: Setting warning for password expiry for %s = %d seconds\n", - op->o_req_dn.bv_val, warn, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ppolicy_bind: Setting warning for password expiry for %s = %d seconds\n", op->o_req_dn.bv_val, warn, 0 ); -#endif } } @@ -1198,13 +1152,8 @@ ppolicy_restrict( } if ( op->o_conn && pwcons[op->o_conn->c_conn_idx].restrict ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "connection restricted to password changing only\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection restricted to password changing only\n", 0, 0, 0); -#endif if ( send_ctrl ) { LDAPControl **ctrls = NULL; @@ -1391,13 +1340,8 @@ ppolicy_modify( Operation *op, SlapReply *rs ) } if (pwcons[op->o_conn->c_conn_idx].restrict && !mod_pw_only) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "connection restricted to password changing only\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "connection restricted to password changing only\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_UNWILLING_TO_PERFORM; rs->sr_text = "Operations are restricted to bind/unbind/abandon/StartTLS/modify password"; pErr = PP_changeAfterReset; @@ -1421,13 +1365,8 @@ ppolicy_modify( Operation *op, SlapReply *rs ) if (!addmod) { rs->sr_err = LDAP_OTHER; rs->sr_text = "Internal Error"; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "cannot locate modification supplying new password\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "cannot locate modification supplying new password\n", 0, 0, 0 ); -#endif goto return_results; } @@ -1480,15 +1419,9 @@ ppolicy_modify( Operation *op, SlapReply *rs ) } if (pp.pwdSafeModify && deladd != 2) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "change password must use DELETE followed by ADD/REPLACE\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "change password must use DELETE followed by ADD/REPLACE\n", 0, 0, 0 ); -#endif rs->sr_err = LDAP_UNWILLING_TO_PERFORM; rs->sr_text = "Must supply old password to be changed as well as new one"; pErr = PP_mustSupplyOldPassword; @@ -1528,13 +1461,8 @@ ppolicy_modify( Operation *op, SlapReply *rs ) bv = oldpw.bv_val ? &oldpw : delmod->sml_values; rc = slap_passwd_check( op->o_conn, pa, bv, &txt ); if (rc != LDAP_SUCCESS) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "old password check failed: %s\n", txt, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "old password check failed: %s\n", txt, 0, 0 ); -#endif rs->sr_err = LDAP_UNWILLING_TO_PERFORM; rs->sr_text = "Must supply correct old password to change to new one"; @@ -1747,13 +1675,8 @@ do_modify: modtail->sml_next = mods; modtail = mods; } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "ppolicy_modify: password attr lookup failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "ppolicy_modify: password attr lookup failed\n", 0, 0, 0 ); -#endif } } diff --git a/servers/slapd/overlays/rwmdn.c b/servers/slapd/overlays/rwmdn.c index 4892e4365e..e867ce9361 100644 --- a/servers/slapd/overlays/rwmdn.c +++ b/servers/slapd/overlays/rwmdn.c @@ -91,15 +91,9 @@ rwm_dn_massage( rc = LDAP_SUCCESS; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, DETAIL1, - "[rw] %s: \"%s\" -> \"%s\"\n", - dc->ctx, in->bv_val, dn ? dn->bv_val : ndn->bv_val ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "[rw] %s: \"%s\" -> \"%s\"\n", dc->ctx, in->bv_val, dn ? dn->bv_val : ndn->bv_val ); -#endif /* !NEW_LOGGING */ break; case REWRITE_REGEXEC_UNWILLING: @@ -232,16 +226,10 @@ rwm_dn_massage( out->bv_val = ch_malloc( out->bv_len + 1 ); strncpy( out->bv_val, in->bv_val, diff ); strcpy( &out->bv_val[diff], dc->rwmap->rwm_suffix_massage[i+dst].bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG ( BACK_LDAP, ARGS, - "rwm_dn_massage: converted \"%s\" to \"%s\"\n", - in->bv_val, out->bv_val, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "rwm_dn_massage:" " converted \"%s\" to \"%s\"\n", in->bv_val, out->bv_val, 0 ); -#endif if ( dn && ndn ) { rc = dnNormalize( 0, NULL, NULL, dn, ndn, NULL ); } diff --git a/servers/slapd/overlays/rwmmap.c b/servers/slapd/overlays/rwmmap.c index 89543c4453..a390a37116 100644 --- a/servers/slapd/overlays/rwmmap.c +++ b/servers/slapd/overlays/rwmmap.c @@ -712,15 +712,9 @@ rwm_filter_map_rewrite( *fstr = ftmp; } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, DETAIL1, - "[rw] %s: \"%s\" -> \"%s\"\n", - dc->ctx, ftmp.bv_val, fstr->bv_val ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "[rw] %s: \"%s\" -> \"%s\"\n", dc->ctx, ftmp.bv_val, fstr->bv_val ); -#endif /* !NEW_LOGGING */ rc = LDAP_SUCCESS; break; diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index f0e97b6b9b..6832098f95 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -269,13 +269,8 @@ int slap_passwd_parse( struct berval *reqdata, tag = ber_scanf( ber, "{" /*}*/ ); if( tag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "slap_passwd_parse: decoding error\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: decoding error\n", 0, 0, 0 ); -#endif rc = LDAP_PROTOCOL_ERROR; goto done; } @@ -283,13 +278,8 @@ int slap_passwd_parse( struct berval *reqdata, tag = ber_peek_tag( ber, &len ); if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_ID ) { if( id == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "slap_passwd_parse: ID not allowed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID not allowed.\n", 0, 0, 0 ); -#endif *text = "user must change own password"; rc = LDAP_UNWILLING_TO_PERFORM; @@ -299,13 +289,8 @@ int slap_passwd_parse( struct berval *reqdata, tag = ber_scanf( ber, "m", id ); if( tag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "slap_passwd_parse: ID parse failed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID parse failed.\n", 0, 0, 0 ); -#endif goto decoding_error; } @@ -315,13 +300,8 @@ int slap_passwd_parse( struct berval *reqdata, if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_OLD ) { if( oldpass == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "slap_passwd_parse: OLD not allowed.\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: OLD not allowed.\n", 0, 0, 0 ); -#endif *text = "use bind to verify old password"; rc = LDAP_UNWILLING_TO_PERFORM; @@ -331,13 +311,8 @@ int slap_passwd_parse( struct berval *reqdata, tag = ber_scanf( ber, "m", oldpass ); if( tag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "slap_passwd_parse: ID parse failed.\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID parse failed.\n", 0, 0, 0 ); -#endif goto decoding_error; } @@ -347,13 +322,8 @@ int slap_passwd_parse( struct berval *reqdata, if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_NEW ) { if( newpass == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "slap_passwd_parse: NEW not allowed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: NEW not allowed.\n", 0, 0, 0 ); -#endif *text = "user specified passwords disallowed"; rc = LDAP_UNWILLING_TO_PERFORM; @@ -363,13 +333,8 @@ int slap_passwd_parse( struct berval *reqdata, tag = ber_scanf( ber, "m", newpass ); if( tag == LBER_ERROR ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "slap_passwd_parse: OLD parse failed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: OLD parse failed.\n", 0, 0, 0 ); -#endif goto decoding_error; } @@ -379,14 +344,9 @@ int slap_passwd_parse( struct berval *reqdata, if( len != 0 ) { decoding_error: -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "slap_passwd_parse: decoding error, len=%ld\n", (long)len, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: decoding error, len=%ld\n", (long) len, 0, 0 ); -#endif *text = "data decoding error"; rc = LDAP_PROTOCOL_ERROR; @@ -407,13 +367,8 @@ struct berval * slap_passwd_return( assert( cred != NULL ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "slap_passwd_return: %ld\n",(long)cred->bv_len, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_passwd_return: %ld\n", (long) cred->bv_len, 0, 0 ); -#endif ber_init_w_nullc( ber, LBER_USE_DER ); @@ -466,11 +421,7 @@ slap_passwd_check( void slap_passwd_generate( struct berval *pass ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "slap_passwd_generate: begin\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_passwd_generate\n", 0, 0, 0 ); -#endif pass->bv_val = NULL; pass->bv_len = 0; diff --git a/servers/slapd/referral.c b/servers/slapd/referral.c index a55d32d07b..91db896f1c 100644 --- a/servers/slapd/referral.c +++ b/servers/slapd/referral.c @@ -112,13 +112,8 @@ static char * referral_dn_muck( muck.bv_len = ntargetDN.bv_len + nrefDN.bv_len - nbaseDN.bv_len; muck.bv_val = SLAP_MALLOC( muck.bv_len + 1 ); if( muck.bv_val == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "referral_dn_muck: SLAP_MALLOC failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "referral_dn_muck: SLAP_MALLOC failed\n", 0, 0, 0 ); -#endif return NULL; } @@ -164,61 +159,36 @@ int validate_global_referral( const char *url ) default: /* other error, bail */ -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "referral: invalid URL (%s): %s (%d)\n", - url, "" /* ldap_url_error2str(rc) */, rc ); -#else Debug( LDAP_DEBUG_ANY, "referral: invalid URL (%s): %s (%d)\n", url, "" /* ldap_url_error2str(rc) */, rc ); -#endif return 1; } rc = 0; if( lurl->lud_dn && *lurl->lud_dn ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "referral: URL (%s): contains DN\n", url, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "referral: URL (%s): contains DN\n", url, 0, 0 ); -#endif rc = 1; } else if( lurl->lud_attrs ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "referral: URL (%s): requests attributes\n", url, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "referral: URL (%s): requests attributes\n", url, 0, 0 ); -#endif rc = 1; } else if( lurl->lud_scope != LDAP_SCOPE_DEFAULT ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "referral: URL (%s): contains explicit scope\n", url, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "referral: URL (%s): contains explicit scope\n", url, 0, 0 ); -#endif rc = 1; } else if( lurl->lud_filter ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "referral: URL (%s): contains explicit filter\n", url, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "referral: URL (%s): contains explicit filter\n", url, 0, 0 ); -#endif rc = 1; } @@ -246,13 +216,8 @@ BerVarray referral_rewrite( refs = SLAP_MALLOC( (i+1) * sizeof( struct berval ) ); if( refs == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "referral_rewrite: SLAP_MALLOC failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "referral_rewrite: SLAP_MALLOC failed\n", 0, 0, 0 ); -#endif return NULL; } @@ -323,13 +288,8 @@ BerVarray get_entry_referrals( refs = SLAP_MALLOC( (i + 1) * sizeof(struct berval)); if( refs == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "get_entry_referrals: SLAP_MALLOC failed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "get_entry_referrals: SLAP_MALLOC failed\n", 0, 0, 0 ); -#endif return NULL; } diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 8dfb871436..69ec2f4740 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -88,11 +88,7 @@ static char *v2ref( BerVarray ref, const char *text ) v2 = SLAP_MALLOC( len+i+sizeof("Referral:") ); if( v2 == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "v2ref: SLAP_MALLOC failed", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "v2ref: SLAP_MALLOC failed", 0, 0, 0 ); -#endif return NULL; } @@ -108,11 +104,7 @@ static char *v2ref( BerVarray ref, const char *text ) for( i=0; ref[i].bv_val != NULL; i++ ) { v2 = SLAP_REALLOC( v2, len + ref[i].bv_len + 1 ); if( v2 == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "v2ref: SLAP_MALLOC failed", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "v2ref: SLAP_MALLOC failed", 0, 0, 0 ); -#endif return NULL; } v2[len-1] = '\n'; @@ -197,14 +189,8 @@ static long send_ldap_ber( * it's a hard error and return. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_ldap_ber: conn %lu ber_flush failed err=%d (%s)\n", - conn ? conn->c_connid : 0, err, sock_errstr(err) ); -#else Debug( LDAP_DEBUG_CONNS, "ber_flush failed errno=%d reason=\"%s\"\n", err, sock_errstr(err), 0 ); -#endif if ( err != EWOULDBLOCK && err != EAGAIN ) { connection_closing( conn ); @@ -344,27 +330,14 @@ send_ldap_response( ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx ); } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "send_ldap_response: msgid=%d tag=%lu err=%d\n", - rs->sr_msgid, rs->sr_tag, rs->sr_err ); -#else Debug( LDAP_DEBUG_TRACE, "send_ldap_response: msgid=%d tag=%lu err=%d\n", rs->sr_msgid, rs->sr_tag, rs->sr_err ); -#endif if( rs->sr_ref ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "send_ldap_response: conn %lu ref=\"%s\"\n", - op->o_connid, - rs->sr_ref[0].bv_val ? rs->sr_ref[0].bv_val : "NULL" , 0 ); -#else Debug( LDAP_DEBUG_ARGS, "send_ldap_response: ref=\"%s\"\n", rs->sr_ref[0].bv_val ? rs->sr_ref[0].bv_val : "NULL", NULL, NULL ); -#endif } #ifdef LDAP_CONNECTIONLESS @@ -437,13 +410,7 @@ send_ldap_response( #endif if ( rc == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_ldap_response: conn %lu ber_printf failed\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); -#endif #ifdef LDAP_CONNECTIONLESS if (!op->o_conn || op->o_conn->c_is_udp == 0) @@ -464,15 +431,9 @@ send_ldap_response( } if ( bytes < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_ldap_response: conn %lu ber write failed\n", - op->o_connid ? op->o_connid : 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_ldap_response: ber write failed\n", 0, 0, 0 ); -#endif goto cleanup; } @@ -544,15 +505,9 @@ send_ldap_disconnect( Operation *op, SlapReply *rs ) rs->sr_type = REP_EXTENDED; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "send_ldap_disconnect: conn %lu %d:%s\n", - op->o_connid, rs->sr_err, rs->sr_text ? rs->sr_text : "" ); -#else Debug( LDAP_DEBUG_TRACE, "send_ldap_disconnect %d:%s\n", rs->sr_err, rs->sr_text ? rs->sr_text : "", NULL ); -#endif if ( op->o_protocol < LDAP_VERSION3 ) { rs->sr_rspoid = NULL; @@ -584,40 +539,21 @@ slap_send_ldap_result( Operation *op, SlapReply *rs ) assert( !LDAP_API_ERROR( rs->sr_err )); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "send_ldap_result: conn=%lu op=%lu p=%d\n", - op->o_connid, op->o_opid, op->o_protocol ); -#else Debug( LDAP_DEBUG_TRACE, "send_ldap_result: conn=%lu op=%lu p=%d\n", op->o_connid, op->o_opid, op->o_protocol ); -#endif -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "send_ldap_result: err=%d matched=\"%s\" text=\"%s\"\n", - rs->sr_err, rs->sr_matched ? rs->sr_matched : "", - rs->sr_text ? rs->sr_text : "" ); -#else Debug( LDAP_DEBUG_ARGS, "send_ldap_result: err=%d matched=\"%s\" text=\"%s\"\n", rs->sr_err, rs->sr_matched ? rs->sr_matched : "", rs->sr_text ? rs->sr_text : "" ); -#endif if( rs->sr_ref ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "send_ldap_result: referral=\"%s\"\n", - rs->sr_ref[0].bv_val ? rs->sr_ref[0].bv_val : "NULL", 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "send_ldap_result: referral=\"%s\"\n", rs->sr_ref[0].bv_val ? rs->sr_ref[0].bv_val : "NULL", NULL, NULL ); -#endif } assert( rs->sr_err != LDAP_PARTIAL_RESULTS ); @@ -691,16 +627,9 @@ void send_ldap_sasl( Operation *op, SlapReply *rs ) { rs->sr_type = REP_SASL; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "send_ldap_sasl: conn %lu err=%d len=%lu\n", - op->o_connid, rs->sr_err, - rs->sr_sasldata ? rs->sr_sasldata->bv_len : -1 ); -#else Debug( LDAP_DEBUG_TRACE, "send_ldap_sasl: err=%d len=%ld\n", rs->sr_err, rs->sr_sasldata ? (long) rs->sr_sasldata->bv_len : -1, NULL ); -#endif rs->sr_tag = req2res( op->o_tag ); rs->sr_msgid = (rs->sr_tag != LBER_SEQUENCE) ? op->o_msgid : 0; @@ -713,18 +642,11 @@ slap_send_ldap_extended( Operation *op, SlapReply *rs ) { rs->sr_type = REP_EXTENDED; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "send_ldap_extended: err=%d oid=%s len=%ld\n", - rs->sr_err, rs->sr_rspoid ? rs->sr_rspoid : "", - rs->sr_rspdata != NULL ? rs->sr_rspdata->bv_len : 0 ); -#else Debug( LDAP_DEBUG_TRACE, "send_ldap_extended: err=%d oid=%s len=%ld\n", rs->sr_err, rs->sr_rspoid ? rs->sr_rspoid : "", rs->sr_rspdata != NULL ? rs->sr_rspdata->bv_len : 0 ); -#endif rs->sr_tag = req2res( op->o_tag ); rs->sr_msgid = (rs->sr_tag != LBER_SEQUENCE) ? op->o_msgid : 0; @@ -736,18 +658,11 @@ void slap_send_ldap_intermediate( Operation *op, SlapReply *rs ) { rs->sr_type = REP_INTERMEDIATE; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "send_ldap_intermediate: err=%d oid=%s len=%ld\n", - rs->sr_err, rs->sr_rspoid ? rs->sr_rspoid : "", - rs->sr_rspdata != NULL ? rs->sr_rspdata->bv_len : 0 ); -#else Debug( LDAP_DEBUG_TRACE, "send_ldap_intermediate: err=%d oid=%s len=%ld\n", rs->sr_err, rs->sr_rspoid ? rs->sr_rspoid : "", rs->sr_rspdata != NULL ? rs->sr_rspdata->bv_len : 0 ); -#endif rs->sr_tag = LDAP_RES_INTERMEDIATE; rs->sr_msgid = op->o_msgid; send_ldap_response( op, rs ); @@ -815,26 +730,14 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) if ( rc != SLAP_CB_CONTINUE ) goto error_return; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "send_search_entry: conn %lu dn=\"%s\"%s\n", - op->o_connid, rs->sr_entry->e_name.bv_val, - op->ors_attrsonly ? " (attrsOnly)" : "" ); -#else Debug( LDAP_DEBUG_TRACE, "=> send_search_entry: conn %lu dn=\"%s\"%s\n", op->o_connid, rs->sr_entry->e_name.bv_val, op->ors_attrsonly ? " (attrsOnly)" : "" ); -#endif if ( !access_allowed( op, rs->sr_entry, ad_entry, NULL, ACL_READ, NULL )) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, INFO, - "send_search_entry: conn %lu access to entry (%s) not allowed\n", - op->o_connid, rs->sr_entry->e_name.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ACL, "send_search_entry: conn %lu access to entry (%s) not allowed\n", op->o_connid, rs->sr_entry->e_name.bv_val, 0 ); -#endif rc = 1; goto error_return; @@ -878,15 +781,9 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) } if ( rc == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu ber_printf failed\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu ber_printf failed\n", op->o_connid, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, "encoding DN error" ); @@ -913,15 +810,9 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) char *a_flags; e_flags = slap_sl_calloc ( 1, i * sizeof(char *) + k, op->o_tmpmemctx ); if( e_flags == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu slap_sl_calloc failed\n", - op->o_connid ? op->o_connid : 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu slap_sl_calloc failed\n", op->o_connid ? op->o_connid : 0, 0, 0 ); -#endif ber_free( ber, 1 ); send_ldap_error( op, rs, LDAP_OTHER, "out of memory" ); @@ -937,15 +828,9 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) rc = filter_matched_values(op, rs->sr_entry->e_attrs, &e_flags) ; if ( rc == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "send_search_entry: " - "conn %lu matched values filtering failed\n", - op->o_connid ? op->o_connid : 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: " "conn %lu matched values filtering failed\n", op->o_connid ? op->o_connid : 0, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, "matched values filtering error" ); @@ -985,28 +870,16 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) if ( ! access_allowed( op, rs->sr_entry, desc, NULL, ACL_READ, &acl_state ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, INFO, - "send_search_entry: conn %lu access to attribute %s not " - "allowed\n", op->o_connid, desc->ad_cname.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ACL, "send_search_entry: " "conn %lu access to attribute %s not allowed\n", op->o_connid, desc->ad_cname.bv_val, 0 ); -#endif continue; } if (( rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname )) == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu ber_printf failed\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu ber_printf failed\n", op->o_connid, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, @@ -1021,17 +894,10 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) if ( ! access_allowed( op, rs->sr_entry, desc, &a->a_nvals[i], ACL_READ, &acl_state ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, INFO, - "send_search_entry: conn %lu " - "access to attribute %s, value #%d not allowed\n", - op->o_connid, desc->ad_cname.bv_val, i ); -#else Debug( LDAP_DEBUG_ACL, "send_search_entry: conn %lu " "access to attribute %s, value #%d not allowed\n", op->o_connid, desc->ad_cname.bv_val, i ); -#endif continue; } @@ -1044,15 +910,9 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) first = 0; finish = 1; if (( rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname )) == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu ber_printf failed\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu ber_printf failed\n", op->o_connid, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, @@ -1061,15 +921,9 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) } } if (( rc = ber_printf( ber, "O", &a->a_vals[i] )) == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu " - "ber_printf failed.\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu " "ber_printf failed.\n", op->o_connid, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, @@ -1080,15 +934,9 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) } if ( finish && ( rc = ber_printf( ber, /*{[*/ "]N}" )) == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu ber_printf failed\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu ber_printf failed\n", op->o_connid, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, "encode end error" ); @@ -1117,19 +965,11 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) tmp = slap_sl_realloc( e_flags, i * sizeof(char *) + k, op->o_tmpmemctx ); if ( tmp == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu " - "not enough memory " - "for matched values filtering\n", - op->o_connid, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu " "not enough memory " "for matched values filtering\n", op->o_connid, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, "not enough memory for matched values filtering" ); @@ -1146,17 +986,10 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) rc = filter_matched_values(op, rs->sr_operational_attrs, &e_flags) ; if ( rc == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu " - "matched values filtering failed\n", - op->o_connid ? op->o_connid : 0, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu " "matched values filtering failed\n", op->o_connid ? op->o_connid : 0, 0, 0); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, "matched values filtering error" ); @@ -1192,32 +1025,19 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) if ( ! access_allowed( op, rs->sr_entry, desc, NULL, ACL_READ, &acl_state ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, INFO, - "send_search_entry: conn %lu " - "access to attribute %s not allowed\n", - op->o_connid, desc->ad_cname.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ACL, "send_search_entry: conn %lu " "access to attribute %s not allowed\n", op->o_connid, desc->ad_cname.bv_val, 0 ); -#endif continue; } rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname ); if ( rc == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu " - "ber_printf failed\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu " "ber_printf failed\n", op->o_connid, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, @@ -1230,17 +1050,10 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) if ( ! access_allowed( op, rs->sr_entry, desc, &a->a_vals[i], ACL_READ, &acl_state ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, INFO, - "send_search_entry: conn %lu " - "access to %s, value %d not allowed\n", - op->o_connid, desc->ad_cname.bv_val, i ); -#else Debug( LDAP_DEBUG_ACL, "send_search_entry: conn %lu " "access to %s, value %d not allowed\n", op->o_connid, desc->ad_cname.bv_val, i ); -#endif continue; } @@ -1250,15 +1063,9 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) } if (( rc = ber_printf( ber, "O", &a->a_vals[i] )) == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu ber_printf failed\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu ber_printf failed\n", op->o_connid, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, @@ -1269,15 +1076,9 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) } if (( rc = ber_printf( ber, /*{[*/ "]N}" )) == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu ber_printf failed\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu ber_printf failed\n", op->o_connid, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, "encode end error" ); @@ -1351,13 +1152,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) } if ( rc == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu ber_printf failed\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); -#endif if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, "encode entry end error" ); @@ -1370,15 +1165,9 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) ber_free_buf( ber ); if ( bytes < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_entry: conn %lu ber write failed.\n", - op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_entry: conn %lu ber write failed.\n", op->o_connid, 0, 0 ); -#endif rc = -1; goto error_return; @@ -1395,13 +1184,8 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) 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 ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "send_search_entry: conn %lu exit.\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= send_search_entry: conn %lu exit.\n", op->o_connid, 0, 0 ); -#endif rc = 0; @@ -1487,30 +1271,16 @@ slap_send_search_reference( Operation *op, SlapReply *rs ) if ( rc != SLAP_CB_CONTINUE ) goto rel; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "send_search_reference: conn %lu dn=\"%s\"\n", - op->o_connid, - rs->sr_entry ? rs->sr_entry->e_name.bv_val : "(null)", 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=> send_search_reference: dn=\"%s\"\n", rs->sr_entry ? rs->sr_entry->e_name.bv_val : "(null)", 0, 0 ); -#endif if ( rs->sr_entry && ! access_allowed( op, rs->sr_entry, ad_entry, NULL, ACL_READ, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, INFO, - "send_search_reference: conn %lu " - "access to entry %s not allowed\n", - op->o_connid, rs->sr_entry->e_dn, 0 ); -#else Debug( LDAP_DEBUG_ACL, "send_search_reference: access to entry not allowed\n", 0, 0, 0 ); -#endif rc = 1; goto rel; } @@ -1518,46 +1288,28 @@ slap_send_search_reference( Operation *op, SlapReply *rs ) if ( rs->sr_entry && ! access_allowed( op, rs->sr_entry, ad_ref, NULL, ACL_READ, NULL ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( ACL, INFO, - "send_search_reference: conn %lu access " - "to reference not allowed.\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ACL, "send_search_reference: access " "to reference not allowed\n", 0, 0, 0 ); -#endif rc = 1; goto rel; } #ifdef LDAP_CONTROL_X_DOMAIN_SCOPE if( op->o_domain_scope ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_reference: conn %lu domainScope control in (%s).\n", - op->o_connid, rs->sr_entry->e_dn, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_reference: domainScope control in (%s)\n", rs->sr_entry->e_dn, 0, 0 ); -#endif rc = 0; goto rel; } #endif if( rs->sr_ref == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_reference: conn %lu null ref in (%s).\n", - op->o_connid, rs->sr_entry ? rs->sr_entry->e_dn : "(null)", 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_reference: null ref in (%s)\n", rs->sr_entry ? rs->sr_entry->e_dn : "(null)", 0, 0 ); -#endif rc = 1; goto rel; } @@ -1594,14 +1346,8 @@ slap_send_search_reference( Operation *op, SlapReply *rs ) } if ( rc == -1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "send_search_reference: conn %lu " - "ber_printf failed.\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "send_search_reference: ber_printf failed\n", 0, 0, 0 ); -#endif #ifdef LDAP_CONNECTIONLESS if (!op->o_conn || op->o_conn->c_is_udp == 0) @@ -1629,12 +1375,7 @@ slap_send_search_reference( Operation *op, SlapReply *rs ) 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 ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "send_search_reference: conn %lu exit.\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<= send_search_reference\n", 0, 0, 0 ); -#endif rel: if ( op->o_callback ) { @@ -1675,13 +1416,8 @@ str2result( *info = NULL; if ( strncasecmp( s, "RESULT", STRLENOF( "RESULT" ) ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "str2result: (%s), expecting \"RESULT\"\n", s, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "str2result (%s) expecting \"RESULT\"\n", s, 0, 0 ); -#endif return( -1 ); } @@ -1709,12 +1445,8 @@ str2result( *info = c; } } else { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "str2result: (%s) unknown.\n", s, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "str2result (%s) unknown\n", s, 0, 0 ); -#endif rc = -1; } @@ -1738,13 +1470,8 @@ int slap_read_controls( ber_len_t siz, len; Operation myop; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "slap_read_controls: (%s) %s\n", - oid->bv_val, e->e_dn, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slap_read_controls: (%s) %s\n", oid->bv_val, e->e_dn, 0 ); -#endif rs->sr_entry = e; rs->sr_attrs = ( oid == &slap_pre_read_bv ) ? diff --git a/servers/slapd/root_dse.c b/servers/slapd/root_dse.c index 9761bdfbfc..642decbc88 100644 --- a/servers/slapd/root_dse.c +++ b/servers/slapd/root_dse.c @@ -81,13 +81,8 @@ root_dse_info( e = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) ); if( e == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "root_dse_info: SLAP_CALLOC failed", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "root_dse_info: SLAP_CALLOC failed", 0, 0, 0 ); -#endif return LDAP_OTHER; } @@ -245,13 +240,8 @@ int read_root_dse_file( const char *fname ) usr_attr = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) ); if( usr_attr == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "read_root_dse_file: SLAP_CALLOC failed", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "read_root_dse_file: SLAP_CALLOC failed", 0, 0, 0 ); -#endif fclose( fp ); return LDAP_OTHER; } diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 899adb31a2..44313a51a8 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -74,32 +74,18 @@ int slap_sasl_config( int cargc, char **cargv, char *line, !strcasecmp( cargv[0], "sasl-authz-policy" )) { if ( cargc != 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing policy in" - " \"%s \" line\n", - cargv[0], fname, lineno ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing policy in" " \"%s \" line\n", cargv[0], fname, lineno ); -#endif return( 1 ); } if ( slap_sasl_setpolicy( cargv[1] ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: " - "unable to parse value \"%s\" in \"authz-policy " - "\" line.\n", - fname, lineno, cargv[1] ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "unable to parse value \"%s\" in \"authz-policy " "\" line.\n", fname, lineno, cargv[1] ); -#endif return( 1 ); } @@ -109,17 +95,10 @@ int slap_sasl_config( int cargc, char **cargv, char *line, { int rc; if ( cargc != 3 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: need 2 args in " - "\"authz-regexp \"\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: need 2 args in " "\"authz-regexp \"\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -132,29 +111,17 @@ int slap_sasl_config( int cargc, char **cargv, char *line, /* set SASL host */ } else if ( strcasecmp( cargv[0], "sasl-host" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing host in \"sasl-host \" line\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing host in \"sasl-host \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( global_host != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: already set sasl-host!\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: already set sasl-host!\n", fname, lineno, 0 ); -#endif return 1; @@ -165,29 +132,17 @@ int slap_sasl_config( int cargc, char **cargv, char *line, /* set SASL realm */ } else if ( strcasecmp( cargv[0], "sasl-realm" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: " - "missing realm in \"sasl-realm \" line.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "missing realm in \"sasl-realm \" line.\n", fname, lineno, 0 ); -#endif return( 1 ); } if ( global_realm != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: already set sasl-realm!\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: already set sasl-realm!\n", fname, lineno, 0 ); -#endif return 1; @@ -200,30 +155,18 @@ int slap_sasl_config( int cargc, char **cargv, char *line, char *txt; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: " - "missing flags in \"sasl-secprops \" line\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "missing flags in \"sasl-secprops \" line\n", fname, lineno, 0 ); -#endif return 1; } txt = slap_sasl_secprops( cargv[1] ); if ( txt != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d sasl-secprops: %s\n", - fname, lineno, txt ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: sasl-secprops: %s\n", fname, lineno, txt ); -#endif return 1; } @@ -301,14 +244,9 @@ slap_sasl_log( return SASL_BADPARAM; } -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "SASL [conn=%ld] %s: %s\n", conn ? conn->c_connid : -1, label, message); -#else Debug( level, "SASL [conn=%ld] %s: %s\n", conn ? conn->c_connid: -1, label, message ); -#endif return SASL_OK; @@ -368,13 +306,8 @@ sasl_ap_lookup( Operation *op, SlapReply *rs ) ad = NULL; rc = slap_str2ad( name, &ad, &text ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, DETAIL1, - "slap_ap_lookup: str2ad(%s): %s\n", name, text, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_ap_lookup: str2ad(%s): %s\n", name, text, 0 ); -#endif continue; } a = attr_find( rs->sr_entry->e_attrs, ad ); @@ -655,18 +588,10 @@ slap_sasl_canonicalize( *out_len = 0; -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_canonicalize: conn %d %s=\"%s\"\n", - conn ? conn->c_connid : -1, - (flags & SASL_CU_AUTHID) ? "authcid" : "authzid", - in ? in : ""); -#else Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: %s=\"%s\"\n", conn ? conn->c_connid : -1, (flags & SASL_CU_AUTHID) ? "authcid" : "authzid", in ? in : ""); -#endif /* If name is too big, just truncate. We don't care, we're * using DNs, not the usernames. @@ -741,16 +666,9 @@ slap_sasl_canonicalize( prop_set( props, names[0], (char *)&dn, sizeof( dn ) ); -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_canonicalize: conn %d %s=\"%s\"\n", - conn ? conn->c_connid : -1, names[0]+1, - dn.bv_val ? dn.bv_val : "" ); -#else Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: %s=\"%s\"\n", conn ? conn->c_connid : -1, names[0]+1, dn.bv_val ? dn.bv_val : "" ); -#endif done: AC_MEMCPY( out, in, inlen ); @@ -782,15 +700,9 @@ slap_sasl_authorize( if ( !conn->c_sasl_bindop || conn->c_sasl_bindop->orb_method != LDAP_AUTH_SASL ) return SASL_OK; -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_authorize: conn %d authcid=\"%s\" authzid=\"%s\"\n", - conn ? conn->c_connid : -1, auth_identity, requested_user); -#else Debug( LDAP_DEBUG_ARGS, "SASL proxy authorize [conn=%ld]: " "authcid=\"%s\" authzid=\"%s\"\n", conn ? conn->c_connid : -1, auth_identity, requested_user ); -#endif if ( conn->c_sasl_dn.bv_val ) { ch_free( conn->c_sasl_dn.bv_val ); BER_BVZERO( &conn->c_sasl_dn ); @@ -818,16 +730,9 @@ slap_sasl_authorize( rc = slap_sasl_authorized( conn->c_sasl_bindop, &authcDN, &authzDN ); ch_free( authcDN.bv_val ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, INFO, - "slap_sasl_authorize: conn %ld " - "proxy authorization disallowed (%d)\n", - (long)(conn ? conn->c_connid : -1), rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "SASL Proxy Authorize [conn=%ld]: " "proxy authorization disallowed (%d)\n", (long) (conn ? conn->c_connid : -1), rc, 0 ); -#endif sasl_seterror( sconn, 0, "not authorized" ); ch_free( authzDN.bv_val ); @@ -843,15 +748,9 @@ ok: auth_identity, 0, 0); } -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_authorize: conn %d proxy authorization allowed\n", - (long)(conn ? conn->c_connid : -1), 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: " " proxy authorization allowed\n", (long) (conn ? conn->c_connid : -1), 0, 0 ); -#endif return SASL_OK; } #else @@ -875,29 +774,17 @@ slap_sasl_authorize( BER_BVZERO( &conn->c_sasl_dn ); } -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_authorize: conn %d authcid=\"%s\" authzid=\"%s\"\n", - conn ? conn->c_connid : -1, authcid ? authcid : "", - authzid ? authzid : "" ); -#else Debug( LDAP_DEBUG_ARGS, "SASL Authorize [conn=%ld]: " "authcid=\"%s\" authzid=\"%s\"\n", (long) (conn ? conn->c_connid : -1), authcid ? authcid : "", authzid ? authzid : "" ); -#endif /* Figure out how much data we have for the dn */ rc = sasl_getprop( conn->c_sasl_authctx, SASL_REALM, (void **)&realm ); if( rc != SASL_OK && rc != SASL_NOTDONE ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ERR, - "slap_sasl_authorize: getprop(REALM) failed.\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "authorize: getprop(REALM) failed!\n", 0,0,0); -#endif *errstr = "Could not extract realm"; return SASL_NOAUTHZ; } @@ -913,14 +800,8 @@ slap_sasl_authorize( return SASL_NOAUTHZ; } if( ( authzid == NULL ) || !strcmp( authcid, authzid ) ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_authorize: conn %d Using authcDN=%s\n", - conn ? conn->c_connid : -1, authcDN.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: " "Using authcDN=%s\n", (long) (conn ? conn->c_connid : -1), authcDN.bv_val,0 ); -#endif conn->c_sasl_dn = authcDN; goto ok; @@ -939,16 +820,9 @@ slap_sasl_authorize( rc = slap_sasl_authorized(conn->c_sasl_bindop, &authcDN, &authzDN ); ch_free( authcDN.bv_val ); if( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, INFO, - "slap_sasl_authorize: conn %ld " - "proxy authorization disallowed (%d)\n", - (long)(conn ? conn->c_connid : -1), rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: " "proxy authorization disallowed (%d)\n", (long) (conn ? conn->c_connid : -1), rc, 0 ); -#endif *errstr = "not authorized"; ch_free( authzDN.bv_val ); @@ -957,15 +831,9 @@ slap_sasl_authorize( conn->c_sasl_dn = authzDN; ok: -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, RESULTS, - "slap_sasl_authorize: conn %d proxy authorization allowed\n", - (long)(conn ? conn->c_connid : -1 ), 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: " " authorization allowed\n", (long) (conn ? conn->c_connid : -1), 0, 0 ); -#endif if (conn->c_sasl_bindop) { Statslog( LDAP_DEBUG_STATS, @@ -1042,17 +910,10 @@ int slap_sasl_init( void ) char version[sizeof("xxx.xxx.xxxxx")]; sprintf( version, "%u.%d.%d", (unsigned)rc >> 24, (rc >> 16) & 0xff, rc & 0xffff ); -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, INFO, - "slap_sasl_init: SASL library version mismatch:" - " expected " SASL_VERSION_STRING "," - " got %s\n", version, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slap_sasl_init: SASL library version mismatch:" " expected " SASL_VERSION_STRING "," " got %s\n", version, 0, 0 ); -#endif return -1; } #endif @@ -1082,12 +943,8 @@ int slap_sasl_init( void ) rc = sasl_server_init( server_callbacks, "slapd" ); if( rc != SASL_OK ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, INFO, "slap_sasl_init: init failed.\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n", 0, 0, 0 ); -#endif #if SASL_VERSION_MAJOR < 2 /* A no-op used to make sure we linked with Cyrus 1.5 */ sasl_client_auth( NULL, NULL, NULL, 0, NULL, NULL ); @@ -1096,12 +953,8 @@ int slap_sasl_init( void ) return -1; } -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, INFO, "slap_sasl_init: initialized!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_sasl_init: initialized!\n", 0, 0, 0 ); -#endif /* default security properties */ memset( &sasl_secprops, '\0', sizeof(sasl_secprops) ); @@ -1149,13 +1002,8 @@ int slap_sasl_open( Connection *conn, int reopen ) SLAP_CALLOC( 3, sizeof(sasl_callback_t)); #endif if( session_callbacks == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ERR, - "slap_sasl_open: SLAP_MALLOC failed", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slap_sasl_open: SLAP_MALLOC failed", 0, 0, 0 ); -#endif return -1; } conn->c_sasl_extra = session_callbacks; @@ -1229,13 +1077,8 @@ int slap_sasl_open( Connection *conn, int reopen ) #endif if( sc != SASL_OK ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ERR, - "slap_sasl_open: sasl_server_new failed: %d\n", sc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "sasl_server_new failed: %d\n", sc, 0, 0 ); -#endif return -1; } @@ -1247,13 +1090,8 @@ int slap_sasl_open( Connection *conn, int reopen ) SASL_SEC_PROPS, &sasl_secprops ); if( sc != SASL_OK ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ERR, - "slap_sasl_open: sasl_setprop failed: %d \n", sc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "sasl_setprop failed: %d\n", sc, 0, 0 ); -#endif slap_sasl_close( conn ); return -1; @@ -1361,13 +1199,8 @@ char ** slap_sasl_mechs( Connection *conn ) &mechstr, NULL, NULL ); if( sc != SASL_OK ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ERR, - "slap_sasl_mechs: sasl_listmech failed: %d\n", sc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slap_sasl_listmech failed: %d\n", sc, 0, 0 ); -#endif return NULL; } @@ -1435,21 +1268,12 @@ int slap_sasl_bind( Operation *op, SlapReply *rs ) unsigned reslen = 0; int sc; -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "sasl_bind: dn=\"%s\" mech=%s datalen=%ld\n", - op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "", - op->o_conn->c_sasl_bind_in_progress ? "" : - op->o_conn->c_sasl_bind_mech.bv_val, - op->orb_cred.bv_len ); -#else Debug(LDAP_DEBUG_ARGS, "==> sasl_bind: dn=\"%s\" mech=%s datalen=%ld\n", op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "", op->o_conn->c_sasl_bind_in_progress ? "" : op->o_conn->c_sasl_bind_mech.bv_val, op->orb_cred.bv_len ); -#endif if( ctx == NULL ) { send_ldap_error( op, rs, LDAP_UNAVAILABLE, @@ -1572,11 +1396,7 @@ int slap_sasl_bind( Operation *op, SlapReply *rs ) } #endif -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, RESULTS, "slap_sasl_bind: rc=%d\n", rs->sr_err, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "<== slap_sasl_bind: rc=%d\n", rs->sr_err, 0, 0); -#endif #elif defined(SLAP_BUILTIN_SASL) /* built-in SASL implementation */ @@ -1643,14 +1463,8 @@ slap_sasl_setpass( Operation *op, SlapReply *rs ) goto done; } -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, ENTRY, - "slap_sasl_setpass: \"%s\"\n", - id.bv_val ? id.bv_val : "", 0, 0); -#else Debug( LDAP_DEBUG_ARGS, "==> slap_sasl_setpass: \"%s\"\n", id.bv_val ? id.bv_val : "", 0, 0 ); -#endif rs->sr_err = slap_passwd_parse( op->ore_reqdata, NULL, &old, &new, &rs->sr_text ); @@ -1722,18 +1536,10 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id, assert( conn ); assert( id ); -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_getdn: conn %d id=%s [len=%d]\n", - conn->c_connid, - BER_BVISNULL( id ) ? "NULL" : ( BER_BVISEMPTY( id ) ? "" : id->bv_val ), - BER_BVISNULL( id ) ? 0 : ( BER_BVISEMPTY( id ) ? 0 : id->bv_len ) ); -#else Debug( LDAP_DEBUG_ARGS, "slap_sasl_getdn: conn %d id=%s [len=%d]\n", conn->c_connid, BER_BVISNULL( id ) ? "NULL" : ( BER_BVISEMPTY( id ) ? "" : id->bv_val ), BER_BVISNULL( id ) ? 0 : ( BER_BVISEMPTY( id ) ? 0 : id->bv_len ) ); -#endif if ( !op ) { op = conn->c_sasl_bindop; @@ -1820,13 +1626,8 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id, /* Build the new dn */ dn->bv_val = slap_sl_malloc( len + 1, op->o_tmpmemctx ); if( dn->bv_val == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ERR, - "slap_sasl_getdn: SLAP_MALLOC failed", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slap_sasl_getdn: SLAP_MALLOC failed", 0, 0, 0 ); -#endif return LDAP_OTHER; } p = lutil_strcopy( dn->bv_val, "uid=" ); @@ -1844,12 +1645,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id, p = lutil_strcopy( p, ",cn=auth" ); dn->bv_len = p - dn->bv_val; -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_getdn: u:id converted to %s.\n", dn->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_sasl_getdn: u:id converted to %s\n", dn->bv_val,0,0 ); -#endif } else { /* Dup the DN in any case, so we don't risk @@ -1878,13 +1674,8 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id, if( !BER_BVISNULL( &dn2 ) ) { slap_sl_free( dn->bv_val, op->o_tmpmemctx ); *dn = dn2; -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_getdn: dn:id converted to %s.\n", dn->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "getdn: dn:id converted to %s\n", dn->bv_val, 0, 0 ); -#endif } return( LDAP_SUCCESS ); diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index e178192b26..7b61f06e0c 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -206,13 +206,8 @@ static int slap_parseURI( Operation *op, struct berval *uri, *scope = -1; *filter = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_parseURI: parsing %s\n", uri->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_parseURI: parsing %s\n", uri->bv_val, 0, 0 ); -#endif rc = LDAP_PROTOCOL_ERROR; /* @@ -486,16 +481,10 @@ static int slap_sasl_rx_off(char *rep, int *off) } if ( *c == '$' ) { if ( n == SASLREGEX_REPLACE ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ERR, - "slap_sasl_rx_off: \"%s\" has too many $n " - "placeholders (max %d)\n", rep, SASLREGEX_REPLACE, 0 ); -#else Debug( LDAP_DEBUG_ANY, "SASL replace pattern %s has too many $n " "placeholders (max %d)\n", rep, SASLREGEX_REPLACE, 0 ); -#endif return( LDAP_OTHER ); } @@ -606,15 +595,9 @@ int slap_sasl_regexp_config( const char *match, const char *replace ) /* Precompile matching pattern */ rc = regcomp( ®->sr_workspace, reg->sr_match, REG_EXTENDED|REG_ICASE ); if ( rc ) { -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ERR, - "slap_sasl_regexp_config: \"%s\" could not be compiled.\n", - reg->sr_match, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "SASL match pattern %s could not be compiled by regexp engine\n", reg->sr_match, 0, 0 ); -#endif return( LDAP_OTHER ); } @@ -706,15 +689,9 @@ static int slap_authz_regexp( struct berval *in, struct berval *out, } else { ber_dupbv_x( out, in, ctx ); } -#ifdef NEW_LOGGING - LDAP_LOG( BACK_LDAP, DETAIL1, - "[rw] %s: \"%s\" -> \"%s\"\n", - context, in->bv_val, out->bv_val ); -#else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "[rw] %s: \"%s\" -> \"%s\"\n", context, in->bv_val, out->bv_val ); -#endif /* !NEW_LOGGING */ return 1; case REWRITE_REGEXEC_UNWILLING: @@ -731,13 +708,8 @@ static int slap_authz_regexp( struct berval *in, struct berval *out, memset( out, 0, sizeof( *out ) ); -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_authz_regexp: converting SASL name %s\n", saslname, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_authz_regexp: converting SASL name %s\n", saslname, 0, 0 ); -#endif if (( saslname == NULL ) || ( nSaslRegexp == 0 )) { return( 0 ); @@ -760,15 +732,9 @@ static int slap_authz_regexp( struct berval *in, struct berval *out, slap_sasl_rx_exp( reg->sr_replace, reg->sr_offset, sr_strings, saslname, out, ctx ); -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_authz_regexp: converted SASL name to %s\n", - BER_BVISEMPTY( out ) ? "" : out->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_authz_regexp: converted SASL name to %s\n", BER_BVISEMPTY( out ) ? "" : out->bv_val, 0, 0 ); -#endif return( 1 ); #endif /* ! SLAP_AUTH_REWRITE */ @@ -786,13 +752,8 @@ static int sasl_sc_sasl2dn( Operation *o, SlapReply *rs ) o->o_tmpfree(ndn->bv_val, o->o_tmpmemctx); BER_BVZERO( ndn ); -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, DETAIL1, - "slap_sc_sasl2dn: search DN returned more than 1 entry\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_sc_sasl2dn: search DN returned more than 1 entry\n", 0, 0, 0 ); -#endif return -1; } @@ -874,15 +835,9 @@ int slap_sasl_match( Operation *opx, struct berval *rule, sm.match = 0; cb.sc_private = &sm; -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_match: comparing DN %s to rule %s\n", - assertDN->bv_val, rule->bv_val,0 ); -#else Debug( LDAP_DEBUG_TRACE, "===>slap_sasl_match: comparing DN %s to rule %s\n", assertDN->bv_val, rule->bv_val, 0 ); -#endif rc = slap_parseURI( opx, rule, &op.o_req_dn, &op.o_req_ndn, &op.ors_scope, &op.ors_filter, @@ -1018,15 +973,9 @@ exact_match: goto CONCLUDED; } -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, DETAIL1, - "slap_sasl_match: performing internal search (base=%s, scope=%d)\n", - op.o_req_ndn.bv_val, op.ors_scope, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_sasl_match: performing internal search (base=%s, scope=%d)\n", op.o_req_ndn.bv_val, op.ors_scope, 0 ); -#endif op.o_bd = select_backend( &op.o_req_ndn, 0, 1 ); if(( op.o_bd == NULL ) || ( op.o_bd->be_search == NULL)) { @@ -1072,13 +1021,8 @@ CONCLUDED: if( op.ors_filter ) filter_free_x( opx, op.ors_filter ); if( !BER_BVISNULL( &op.ors_filterstr ) ) ch_free( op.ors_filterstr.bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_match: comparison returned %d\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<===slap_sasl_match: comparison returned %d\n", rc, 0, 0); -#endif return( rc ); } @@ -1102,15 +1046,9 @@ slap_sasl_check_authz( Operation *op, int i, rc; BerVarray vals = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_check_authz: does %s match %s rule in %s?\n", - assertDN->bv_val, ad->ad_cname.bv_val, searchDN->bv_val); -#else Debug( LDAP_DEBUG_TRACE, "==>slap_sasl_check_authz: does %s match %s rule in %s?\n", assertDN->bv_val, ad->ad_cname.bv_val, searchDN->bv_val); -#endif rc = backend_attribute( op, NULL, searchDN, ad, &vals, ACL_AUTH ); if( rc != LDAP_SUCCESS ) goto COMPLETE; @@ -1121,15 +1059,9 @@ slap_sasl_check_authz( Operation *op, COMPLETE: if( vals ) ber_bvarray_free_x( vals, op->o_tmpmemctx ); -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, RESULTS, - "slap_sasl_check_authz: %s check returning %d\n", - ad->ad_cname.bv_val, rc, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<==slap_sasl_check_authz: %s check returning %d\n", ad->ad_cname.bv_val, rc, 0); -#endif return( rc ); } @@ -1151,15 +1083,9 @@ void slap_sasl2dn( Operation *opx, SlapReply rs = {REP_RESULT}; struct berval regout = BER_BVNULL; -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl2dn: converting SASL name %s to DN.\n", - saslname->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "==>slap_sasl2dn: " "converting SASL name %s to a DN\n", saslname->bv_val, 0,0 ); -#endif sasldn->bv_val = NULL; sasldn->bv_len = 0; @@ -1210,15 +1136,9 @@ void slap_sasl2dn( Operation *opx, assert( 0 ); } -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, DETAIL1, - "slap_sasl2dn: performing internal search (base=%s, scope=%d)\n", - op.o_req_ndn.bv_val, op.ors_scope, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_sasl2dn: performing internal search (base=%s, scope=%d)\n", op.o_req_ndn.bv_val, op.ors_scope, 0 ); -#endif if(( op.o_bd == NULL ) || ( op.o_bd->be_search == NULL)) { goto FINISHED; @@ -1268,14 +1188,8 @@ FINISHED: ch_free( op.ors_filterstr.bv_val ); } -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl2dn: Converted SASL name to %s\n", - !BER_BVISEMPTY( sasldn ) ? sasldn->bv_val : "", 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<==slap_sasl2dn: Converted SASL name to %s\n", !BER_BVISEMPTY( sasldn ) ? sasldn->bv_val : "", 0, 0 ); -#endif return; } @@ -1296,15 +1210,9 @@ int slap_sasl_authorized( Operation *op, goto DONE; } -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, ENTRY, - "slap_sasl_authorized: can %s become %s?\n", - authcDN->bv_val, authzDN->bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "==>slap_sasl_authorized: can %s become %s?\n", authcDN->bv_val, authzDN->bv_val, 0 ); -#endif /* If person is authorizing to self, succeed */ if ( dn_match( authcDN, authzDN ) ) { @@ -1342,12 +1250,8 @@ int slap_sasl_authorized( Operation *op, DONE: -#ifdef NEW_LOGGING - LDAP_LOG( TRANSPORT, RESULTS, "slap_sasl_authorized: return %d\n", rc,0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "<== slap_sasl_authorized: return %d\n", rc, 0, 0 ); -#endif return( rc ); } diff --git a/servers/slapd/schema.c b/servers/slapd/schema.c index 0d4b99af68..8f6f2af619 100644 --- a/servers/slapd/schema.c +++ b/servers/slapd/schema.c @@ -46,13 +46,8 @@ schema_info( Entry **entry, const char **text ) e = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) ); if( e == NULL ) { /* Out of memory, do something about it */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "schema_info: SLAP_CALLOC failed - out of memory.\n", 0, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "schema_info: SLAP_CALLOC failed - out of memory.\n", 0, 0, 0 ); -#endif *text = "out of memory"; return LDAP_OTHER; } diff --git a/servers/slapd/schema_check.c b/servers/slapd/schema_check.c index 2ec71868dd..1a11a0b011 100644 --- a/servers/slapd/schema_check.c +++ b/servers/slapd/schema_check.c @@ -104,14 +104,9 @@ entry_schema_check( "attribute '%s' cannot have multiple values", type ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn=\"%s\" %s\n", e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Entry (%s), %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_CONSTRAINT_VIOLATION; } @@ -123,15 +118,9 @@ entry_schema_check( /* find the structural object class attribute */ asc = attr_find( e->e_attrs, ad_structuralObjectClass ); if ( asc == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: No structuralObjectClass for entry (%s)\n", - e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "No structuralObjectClass for entry (%s)\n", e->e_dn, 0, 0 ); -#endif *text = "no structuralObjectClass operational attribute"; return LDAP_OTHER; @@ -147,14 +136,9 @@ entry_schema_check( "unrecognized structuralObjectClass '%s'", asc->a_vals[0].bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "entry_check_schema(%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -164,14 +148,9 @@ entry_schema_check( "structuralObjectClass '%s' is not STRUCTURAL", asc->a_vals[0].bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "entry_check_schema(%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OTHER; } @@ -181,14 +160,9 @@ entry_schema_check( "structuralObjectClass '%s' is OBSOLETE", asc->a_vals[0].bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "entry_check_schema(%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -196,14 +170,8 @@ entry_schema_check( /* find the object class attribute */ aoc = attr_find( e->e_attrs, ad_objectClass ); if ( aoc == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: No objectClass for entry (%s).\n", - e->e_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "No objectClass for entry (%s)\n", e->e_dn, 0, 0 ); -#endif *text = "no objectClass attribute"; return LDAP_OBJECT_CLASS_VIOLATION; @@ -258,14 +226,9 @@ entry_schema_check( "content rule '%s' is obsolete", ldap_contentrule2name( &cr->scr_crule )); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn=\"%s\" %s", e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Entry (%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -286,14 +249,9 @@ entry_schema_check( ldap_contentrule2name( &cr->scr_crule ), at->sat_cname.bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn=\"%s\" %s", e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Entry (%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -315,14 +273,9 @@ entry_schema_check( ldap_contentrule2name( &cr->scr_crule ), at->sat_cname.bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn=\"%s\" %s", e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Entry (%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -336,14 +289,9 @@ entry_schema_check( "unrecognized objectClass '%s'", aoc->a_vals[i].bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "entry_check_schema(%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -354,14 +302,9 @@ entry_schema_check( "objectClass '%s' is OBSOLETE", aoc->a_vals[i].bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "entry_check_schema(%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -389,15 +332,9 @@ entry_schema_check( "unrecognized objectClass '%s'", aoc->a_vals[i].bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn (%s), %s\n", - e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "entry_check_schema(%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -422,15 +359,9 @@ entry_schema_check( "abstract objectClass '%s' not allowed", aoc->a_vals[i].bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn (%s), %s\n", - e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "entry_check_schema(%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -466,15 +397,9 @@ entry_schema_check( ldap_contentrule2name( &cr->scr_crule ), oc->soc_cname.bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn=\"%s\" %s", - e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Entry (%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -486,14 +411,9 @@ entry_schema_check( "object class '%s' requires attribute '%s'", aoc->a_vals[i].bv_val, s ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn=\"%s\" %s", e->e_dn, textbuf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Entry (%s): %s\n", e->e_dn, textbuf, 0 ); -#endif return LDAP_OBJECT_CLASS_VIOLATION; } @@ -544,14 +464,9 @@ entry_schema_check( "attribute '%s' not allowed", type ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "entry_schema_check: dn=\"%s\" %s\n", e->e_dn, textbuf, 0); -#else Debug( LDAP_DEBUG_ANY, "Entry (%s), %s\n", e->e_dn, textbuf, 0 ); -#endif return ret; } @@ -570,15 +485,9 @@ oc_check_required( int i; Attribute *a; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "oc_check_required: dn (%s), objectClass \"%s\"\n", - e->e_dn, ocname->bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "oc_check_required entry (%s), objectClass \"%s\"\n", e->e_dn, ocname->bv_val, 0 ); -#endif /* check for empty oc_required */ @@ -611,14 +520,9 @@ int oc_check_allowed( { int i, j; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "oc_check_allowed: type \"%s\"\n", at->sat_cname.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "oc_check_allowed type \"%s\"\n", at->sat_cname.bv_val, 0, 0 ); -#endif /* always allow objectClass attribute */ if ( strcasecmp( at->sat_cname.bv_val, "objectClass" ) == 0 ) { diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 07fcecb8fc..d995917870 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -923,11 +923,7 @@ nameUIDPretty( assert( out ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, ">>> nameUIDPretty: <%s>\n", val->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, ">>> nameUIDPretty: <%s>\n", val->bv_val, 0, 0 ); -#endif if( val->bv_len == 0 ) { ber_dupbv_x( out, val, ctx ); @@ -1000,11 +996,7 @@ nameUIDPretty( } } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, "<<< nameUIDPretty: <%s>\n", out->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<<< nameUIDPretty: <%s>\n", out->bv_val, 0, 0 ); -#endif return LDAP_SUCCESS; } @@ -2203,13 +2195,8 @@ serialNumberAndIssuerPretty( assert( val ); assert( out ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, ">>> serialNumberAndIssuerPretty: <%s>\n", - val->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, ">>> serialNumberAndIssuerPretty: <%s>\n", val->bv_val, 0, 0 ); -#endif if( val->bv_len < 3 ) return LDAP_INVALID_SYNTAX; @@ -2254,13 +2241,8 @@ serialNumberAndIssuerPretty( /* terminate */ out->bv_val[out->bv_len] = '\0'; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, "<<< serialNumberAndIssuerPretty: <%s>\n", - out->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<<< serialNumberAndIssuerPretty: <%s>\n", out->bv_val, 0, 0 ); -#endif return LDAP_SUCCESS; } @@ -2288,13 +2270,8 @@ serialNumberAndIssuerNormalize( assert( val ); assert( out ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, ">>> serialNumberAndIssuerNormalize: <%s>\n", - val->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, ">>> serialNumberAndIssuerNormalize: <%s>\n", val->bv_val, 0, 0 ); -#endif if( val->bv_len < 3 ) return LDAP_INVALID_SYNTAX; @@ -2341,13 +2318,8 @@ serialNumberAndIssuerNormalize( /* terminate */ out->bv_val[out->bv_len] = '\0'; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, "<<< serialNumberAndIssuerNormalize: <%s>\n", - out->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "<<< serialNumberAndIssuerNormalize: <%s>\n", out->bv_val, 0, 0 ); -#endif return rc; } @@ -2404,13 +2376,8 @@ certificateExactNormalize( p += issuer_dn.bv_len; *p = '\0'; -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ARGS, "certificateExactNormalize: %s\n", - normalized->bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "certificateExactNormalize: %s\n", normalized->bv_val, NULL, NULL ); -#endif done: if (xcert) X509_free(xcert); diff --git a/servers/slapd/search.c b/servers/slapd/search.c index 9df49bf0cb..361dfe3096 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -52,11 +52,7 @@ do_search( struct berval base = BER_BVNULL; ber_len_t siz, off, i; -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, "do_search: conn %d\n", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 ); -#endif /* * Parse the search request. It looks like this: @@ -129,29 +125,16 @@ do_search( rs->sr_err = dnPrettyNormal( NULL, &base, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx ); if( rs->sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_search: conn %d invalid dn (%s)\n", - op->o_connid, base.bv_val, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_search: invalid dn (%s)\n", base.bv_val, 0, 0 ); -#endif send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" ); goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, "SRCH \"%s\" %d %d", - base.bv_val, op->ors_scope, op->ors_deref ); - LDAP_LOG( OPERATION, ARGS, " %d %d %d\n", - op->ors_slimit, op->ors_tlimit, op->ors_attrsonly); -#else Debug( LDAP_DEBUG_ARGS, "SRCH \"%s\" %d %d", base.bv_val, op->ors_scope, op->ors_deref ); Debug( LDAP_DEBUG_ARGS, " %d %d %d\n", op->ors_slimit, op->ors_tlimit, op->ors_attrsonly); -#endif /* filter - returns a "normalized" version */ rs->sr_err = get_filter( op, op->o_ber, &op->ors_filter, &rs->sr_text ); @@ -167,15 +150,8 @@ do_search( } filter2bv_x( op, op->ors_filter, &op->ors_filterstr ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "do_search: conn %d filter: %s\n", - op->o_connid, !BER_BVISEMPTY( &op->ors_filterstr ) ? op->ors_filterstr.bv_val : "empty", - 0 ); -#else Debug( LDAP_DEBUG_ARGS, " filter: %s\n", !BER_BVISEMPTY( &op->ors_filterstr ) ? op->ors_filterstr.bv_val : "empty", 0, 0 ); -#endif /* attributes */ siz = sizeof(AttributeName); @@ -194,40 +170,20 @@ do_search( } if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "do_search: conn %d get_ctrls failed (%d)\n", - op->o_connid, rs->sr_err, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_search: get_ctrls failed\n", 0, 0, 0 ); -#endif goto return_results; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "do_search: conn %d attrs:", op->o_connid, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, " attrs:", 0, 0, 0 ); -#endif if ( siz != 0 ) { for ( i = 0; iors_attrs[i].an_name.bv_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, " %s", op->ors_attrs[i].an_name.bv_val, 0, 0 ); -#endif } } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, "\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 ); -#endif if ( StatslogTest( LDAP_DEBUG_STATS ) ) { char abuf[BUFSIZ/2], *ptr = abuf; @@ -518,13 +474,8 @@ static int call_search_preop_plugins( Operation *op ) * A preoperation plugin failure will abort the * entire operation. */ -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "call_search_preop_plugins: search preoperation plugin " - "returned %d\n", rc, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "call_search_preop_plugins: search preoperation plugin " "returned %d.\n", rc, 0, 0); -#endif if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 ) || rc == LDAP_SUCCESS ) { rc = LDAP_OTHER; @@ -569,14 +520,8 @@ static int call_search_rewrite_plugins( Operation *op ) slapi_pblock_get( op->o_pb, SLAPI_SEARCH_SCOPE, (void **)&op->ors_scope ); slapi_pblock_get( op->o_pb, SLAPI_SEARCH_DEREF, (void **)&op->ors_deref ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ARGS, - "call_search_rewrite_plugins: after compute_rewrite_search filter: %s\n", - !BER_BVISEMPTY( &op->ors_filterstr ) ? op->ors_filterstr.bv_val : "empty", 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, " after compute_rewrite_search filter: %s\n", !BER_BVISEMPTY( &op->ors_filterstr ) ? op->ors_filterstr.bv_val : "empty", 0, 0 ); -#endif } return LDAP_SUCCESS; @@ -585,13 +530,8 @@ static int call_search_rewrite_plugins( Operation *op ) static void call_search_postop_plugins( Operation *op ) { if ( slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_SEARCH_FN, op->o_pb ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, "call_search_postop_plugins: search postoperation plugins " - "failed\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "call_search_postop_plugins: search postoperation plugins " "failed.\n", 0, 0, 0); -#endif } } diff --git a/servers/slapd/sl_malloc.c b/servers/slapd/sl_malloc.c index 2a59d023f9..923e44462b 100644 --- a/servers/slapd/sl_malloc.c +++ b/servers/slapd/sl_malloc.c @@ -120,15 +120,9 @@ slap_sl_malloc( size &= ~pad; if ((char *) sh->h_last + size >= (char *) sh->h_end ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "slap_sl_malloc of %lu bytes failed, using ch_malloc\n", - (long)size, 0,0 ); -#else Debug( LDAP_DEBUG_TRACE, "slap_sl_malloc of %lu bytes failed, using ch_malloc\n", (long)size, 0,0 ); -#endif return ch_malloc( size ); } new = sh->h_last; @@ -167,13 +161,8 @@ slap_sl_realloc( void *ptr, ber_len_t size, void *ctx ) if (new ) { return new; } -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "ch_realloc: reallocation of %lu bytes failed\n", (long)size, 0,0 ); -#else Debug( LDAP_DEBUG_ANY, "ch_realloc of %lu bytes failed\n", (long) size, 0, 0 ); -#endif assert( 0 ); exit( EXIT_FAILURE ); } diff --git a/servers/slapd/slapacl.c b/servers/slapd/slapacl.c index 8ad1fef0d7..5fdeae7e31 100644 --- a/servers/slapd/slapacl.c +++ b/servers/slapd/slapacl.c @@ -43,9 +43,6 @@ slapacl( int argc, char **argv ) Operation op; Entry e = { 0 }; -#ifdef NEW_LOGGING - lutil_log_initialize( argc, argv ); -#endif slap_tool_init( progname, SLAPACL, argc, argv ); argv = &argv[ optind ]; diff --git a/servers/slapd/slapadd.c b/servers/slapd/slapadd.c index 8a93a5c212..2d64827816 100644 --- a/servers/slapd/slapadd.c +++ b/servers/slapd/slapadd.c @@ -81,9 +81,6 @@ slapadd( int argc, char **argv ) int i; struct berval mc; struct sync_cookie sc; -#ifdef NEW_LOGGING - lutil_log_initialize(argc, argv ); -#endif slap_tool_init( progname, SLAPADD, argc, argv ); LDAP_SLIST_INIT( &consumer_subentry ); diff --git a/servers/slapd/slapauth.c b/servers/slapd/slapauth.c index 04d35afcd9..8952c935b1 100644 --- a/servers/slapd/slapauth.c +++ b/servers/slapd/slapauth.c @@ -82,9 +82,6 @@ slapauth( int argc, char **argv ) Connection conn; Operation op; -#ifdef NEW_LOGGING - lutil_log_initialize( argc, argv ); -#endif slap_tool_init( progname, SLAPAUTH, argc, argv ); argv = &argv[ optind ]; diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index 73e52e4601..dc64b83065 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -484,15 +484,9 @@ slap_tool_init( } if ( nosubordinates == 0 && dbnum > 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( BACKEND, ERR, -"The first database does not allow %s; using the first available one (%d)\n", - progname, dbnum + 1, 0 ); -#else Debug( LDAP_DEBUG_ANY, "The first database does not allow %s; using the first available one (%d)\n", progname, dbnum + 1, 0 ); -#endif } } else if ( dbnum < 0 || dbnum > (nbackends-1) ) { diff --git a/servers/slapd/slapdn.c b/servers/slapd/slapdn.c index e0a40d6541..57c796845c 100644 --- a/servers/slapd/slapdn.c +++ b/servers/slapd/slapdn.c @@ -40,9 +40,6 @@ slapdn( int argc, char **argv ) int rc = 0; const char *progname = "slapdn"; -#ifdef NEW_LOGGING - lutil_log_initialize( argc, argv ); -#endif slap_tool_init( progname, SLAPDN, argc, argv ); argv = &argv[ optind ]; diff --git a/servers/slapd/slaptest.c b/servers/slapd/slaptest.c index 7a20dfdab9..12680414c7 100644 --- a/servers/slapd/slaptest.c +++ b/servers/slapd/slaptest.c @@ -40,9 +40,6 @@ slaptest( int argc, char **argv ) int rc = EXIT_SUCCESS; const char *progname = "slaptest"; -#ifdef NEW_LOGGING - lutil_log_initialize( argc, argv ); -#endif slap_tool_init( progname, SLAPTEST, argc, argv ); fprintf( stderr, "config file testing succeeded\n"); diff --git a/servers/slapd/str2filter.c b/servers/slapd/str2filter.c index 4ce084aad5..f8b9cfcdf3 100644 --- a/servers/slapd/str2filter.c +++ b/servers/slapd/str2filter.c @@ -51,11 +51,7 @@ str2filter_x( Operation *op, const char *str ) BerElement *ber = (BerElement *)&berbuf; const char *text = NULL; -#ifdef NEW_LOGGING - LDAP_LOG( FILTER, ENTRY, "str2filter: \"%s\"\n", str, 0, 0 ); -#else Debug( LDAP_DEBUG_FILTER, "str2filter \"%s\"\n", str, 0, 0 ); -#endif if ( str == NULL || *str == '\0' ) { return NULL; diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index abd37f4d61..895f11c8ca 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -81,11 +81,7 @@ init_syncrepl(syncinfo_t *si) for ( n = 0; si->si_attrs[ n ] != NULL; n++ ) /* empty */; tmp = ( char ** ) ch_realloc( si->si_attrs, (n + 4)*sizeof( char * )); if ( tmp == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "out of memory\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_ANY, "out of memory\n", 0,0,0 ); -#endif } /* Add Attributes */ @@ -97,11 +93,7 @@ init_syncrepl(syncinfo_t *si) } else { tmp = ( char ** ) ch_realloc( si->si_attrs, 3 * sizeof( char * )); if ( tmp == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "out of memory\n", 0,0,0 ); -#else Debug( LDAP_DEBUG_ANY, "out of memory\n", 0,0,0 ); -#endif } tmp[ n++ ] = ch_strdup( "*" ); tmp[ n++ ] = ch_strdup( "+" ); @@ -207,15 +199,9 @@ do_syncrep1( /* Init connection to master */ rc = ldap_initialize( &si->si_ld, si->si_provideruri ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_syncrep1: ldap_initialize failed (%s)\n", - si->si_provideruri, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_syncrep1: ldap_initialize failed (%s)\n", si->si_provideruri, 0, 0 ); -#endif return rc; } @@ -227,17 +213,10 @@ do_syncrep1( if ( si->si_tls ) { rc = ldap_start_tls_s( si->si_ld, NULL, NULL ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_syncrep1: " - "%s: ldap_start_tls failed (%d)\n", - si->si_tls == SYNCINFO_TLS_CRITICAL ? "Error" : "Warning", - rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: ldap_start_tls failed (%d)\n", si->si_tls == SYNCINFO_TLS_CRITICAL ? "Error" : "Warning", rc, 0 ); -#endif if( si->si_tls == SYNCINFO_TLS_CRITICAL ) goto done; } } @@ -251,15 +230,9 @@ do_syncrep1( LDAP_OPT_X_SASL_SECPROPS, si->si_secprops); if( rc != LDAP_OPT_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: Error: " - "ldap_set_option(%s,SECPROPS,\"%s\") failed!\n", - si->si_provideruri, si->si_secprops, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option " "(%s,SECPROPS,\"%s\") failed!\n", si->si_provideruri, si->si_secprops, 0 ); -#endif goto done; } } @@ -282,15 +255,9 @@ do_syncrep1( * 2) on err policy : exit, retry, backoff ... */ if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_syncrep1: " - "ldap_sasl_interactive_bind_s failed (%d)\n", - rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_syncrep1: " "ldap_sasl_interactive_bind_s failed (%d)\n", rc, 0, 0 ); -#endif /* FIXME (see above comment) */ /* if Kerberos credentials cache is not active, retry */ @@ -314,13 +281,8 @@ do_syncrep1( rc = ldap_bind_s( si->si_ld, si->si_binddn, si->si_passwd, si->si_bindmethod ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_syncrep1: " - "ldap_bind_s failed (%d)\n", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_syncrep1: " "ldap_bind_s failed (%d)\n", rc, 0, 0 ); -#endif goto done; } } @@ -433,13 +395,8 @@ do_syncrep1( rc = ldap_sync_search( si, op->o_tmpmemctx ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_syncrep1: " - "ldap_search_ext: %s (%d)\n", ldap_err2string( rc ), rc, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_syncrep1: " "ldap_search_ext: %s (%d)\n", ldap_err2string( rc ), rc, 0 ); -#endif } done: @@ -505,11 +462,7 @@ do_syncrep2( ber_init2( ber, NULL, LBER_USE_DER ); ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, "do_syncrep2\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=>do_syncrep2\n", 0, 0, 0 ); -#endif psub = &si->si_be->be_nsuffix[0]; @@ -575,13 +528,8 @@ do_syncrep2( break; case LDAP_RES_SEARCH_REFERENCE: -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_syncrep2 : reference received\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_syncrep2 : reference received\n", 0, 0, 0 ); -#endif break; case LDAP_RES_SEARCH_RESULT: @@ -723,15 +671,9 @@ do_syncrep2( ber_memfree_x( syncUUIDs, op->o_tmpmemctx ); break; default: -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_syncrep2 : unknown syncinfo tag (%ld)\n", - (long) si_tag, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_syncrep2 : unknown syncinfo tag (%ld)\n", (long) si_tag, 0, 0 ); -#endif ldap_memfree( retoid ); ber_bvfree( retdata ); continue; @@ -766,15 +708,9 @@ do_syncrep2( break; } else { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "do_syncrep2 :" - " unknown intermediate " - "response\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_syncrep2 : " "unknown intermediate response (%d)\n", rc, 0, 0 ); -#endif ldap_memfree( retoid ); ber_bvfree( retdata ); break; @@ -782,13 +718,8 @@ do_syncrep2( break; default: -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, "do_syncrep2 : " - "unknown message\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_syncrep2 : " "unknown message\n", 0, 0, 0 ); -#endif break; } @@ -808,13 +739,8 @@ do_syncrep2( ldap_get_option( si->si_ld, LDAP_OPT_ERROR_NUMBER, &rc ); errstr = ldap_err2string( rc ); -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "do_syncrep2 : %s\n", errstr, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "do_syncrep2 : %s\n", errstr, 0, 0 ); -#endif } done: @@ -849,11 +775,7 @@ do_syncrepl( ber_socket_t s; int i, defer = 1; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, "do_syncrepl\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "=>do_syncrepl\n", 0, 0, 0 ); -#endif if ( si == NULL ) return NULL; @@ -999,13 +921,8 @@ syncrepl_message_to_entry( *modlist = NULL; if ( ldap_msgtype( msg ) != LDAP_RES_SEARCH_ENTRY ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "Message type should be entry (%d)", ldap_msgtype( msg ), 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Message type should be entry (%d)", ldap_msgtype( msg ), 0, 0 ); -#endif return -1; } @@ -1014,13 +931,8 @@ syncrepl_message_to_entry( rc = ldap_get_dn_ber( si->si_ld, msg, &ber, &bdn ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syncrepl_message_to_entry : dn get failed (%d)", rc, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_entry : dn get failed (%d)", rc, 0, 0 ); -#endif return rc; } @@ -1066,13 +978,8 @@ syncrepl_message_to_entry( } if ( *modlist == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syncrepl_message_to_entry: no attributes\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_entry: no attributes\n", 0, 0, 0 ); -#endif rc = -1; goto done; } @@ -1080,13 +987,8 @@ syncrepl_message_to_entry( rc = slap_mods_check( *modlist, 1, &text, txtbuf, textlen, NULL ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syncrepl_message_to_entry: mods check (%s)\n", text, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_entry: mods check (%s)\n", text, 0, 0 ); -#endif goto done; } @@ -1117,13 +1019,8 @@ syncrepl_message_to_entry( rc = slap_mods2entry( *modlist, &e, 1, 1, &text, txtbuf, textlen); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syncrepl_message_to_entry: mods2entry (%s)\n", text, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_entry: mods2entry (%s)\n", text, 0, 0 ); -#endif } done: @@ -1331,15 +1228,9 @@ syncrepl_entry( rc = be->be_modify( op, &rs_modify ); if ( rs_modify.sr_err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syncrepl_entry : be_modify failed (%d)\n", - rs_modify.sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "syncrepl_entry : be_modify failed (%d)\n", rs_modify.sr_err, 0, 0 ); -#endif } ret = 1; goto done; @@ -1349,15 +1240,9 @@ syncrepl_entry( ret = 0; goto done; } else { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syncrepl_entry : be_add failed (%d)\n", - rs_add.sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "syncrepl_entry : be_add failed (%d)\n", rs_add.sr_err, 0, 0 ); -#endif ret = 1; goto done; } @@ -1367,15 +1252,9 @@ syncrepl_entry( goto done; } } else { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syncrepl_entry : be_search failed (%d)\n", - rs_search.sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "syncrepl_entry : be_search failed (%d)\n", rs_search.sr_err, 0, 0 ); -#endif ret = 1; goto done; } @@ -1386,13 +1265,8 @@ syncrepl_entry( goto done; default : -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syncrepl_entry : unknown syncstate\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "syncrepl_entry : unknown syncstate\n", 0, 0, 0 ); -#endif ret = 1; goto done; } @@ -1797,13 +1671,8 @@ syncrepl_updateCookie( } if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syncrepl_updateCookie: mods opattrs (%s)\n", text, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "syncrepl_updateCookie: mods opattrs (%s)\n", text, 0, 0 ); -#endif } e = ( Entry * ) ch_calloc( 1, sizeof( Entry )); @@ -1828,13 +1697,8 @@ syncrepl_updateCookie( rc = slap_mods2entry( modlist, &e, 1, 1, &text, txtbuf, textlen ); if( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syncrepl_updateCookie: mods2entry (%s)\n", text, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "syncrepl_updateCookie: mods2entry (%s)\n", text, 0, 0 ); -#endif } cb.sc_response = null_callback; @@ -1862,36 +1726,20 @@ update_cookie_retry: goto update_cookie_retry; } else if ( rs_add.sr_err == LDAP_REFERRAL || rs_add.sr_err == LDAP_NO_SUCH_OBJECT ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "cookie will be non-persistent\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "cookie will be non-persistent\n", 0, 0, 0 ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "be_add failed (%d)\n", rs_add.sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "be_add failed (%d)\n", rs_add.sr_err, 0, 0 ); -#endif } } else { be_entry_release_w( op, e ); goto done; } } else { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "be_modify failed (%d)\n", rs_modify.sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "be_modify failed (%d)\n", rs_modify.sr_err, 0, 0 ); -#endif } } @@ -1956,25 +1804,15 @@ dn_callback( if ( rs->sr_type == REP_SEARCH ) { if ( si->si_syncUUID_ndn.bv_val != NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "dn_callback : consistency error - entryUUID is not unique\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "dn_callback : consistency error - entryUUID is not unique\n", 0, 0, 0 ); -#endif } else { ber_dupbv_x( &si->si_syncUUID_ndn, &rs->sr_entry->e_nname, op->o_tmpmemctx ); } } else if ( rs->sr_type == REP_RESULT ) { if ( rs->sr_err == LDAP_SIZELIMIT_EXCEEDED ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "dn_callback : consistency error - entryUUID is not unique\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "dn_callback : consistency error - entryUUID is not unique\n", 0, 0, 0 ); -#endif } } @@ -2032,15 +1870,9 @@ null_callback( rs->sr_err != LDAP_NO_SUCH_OBJECT && rs->sr_err != LDAP_NOT_ALLOWED_ON_NONLEAF ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "null_callback : error code 0x%x\n", - rs->sr_err, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "null_callback : error code 0x%x\n", rs->sr_err, 0, 0 ); -#endif } return LDAP_SUCCESS; } diff --git a/servers/slapd/syntax.c b/servers/slapd/syntax.c index fea075aebc..711ed6171c 100644 --- a/servers/slapd/syntax.c +++ b/servers/slapd/syntax.c @@ -105,12 +105,7 @@ syn_insert( sir = (struct sindexrec *) SLAP_CALLOC( 1, sizeof(struct sindexrec) ); if( sir == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syn_insert: SLAP_CALLOC Error\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "SLAP_CALLOC Error\n", 0, 0, 0 ); -#endif return LDAP_OTHER; } sir->sir_name = ssyn->ssyn_oid; @@ -139,12 +134,7 @@ syn_add( ssyn = (Syntax *) SLAP_CALLOC( 1, sizeof(Syntax) ); if( ssyn == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "syn_add: SLAP_CALLOC Error\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "SLAP_CALLOC Error\n", 0, 0, 0 ); -#endif return LDAP_OTHER; } @@ -181,14 +171,8 @@ register_syntax( syn = ldap_str2syntax( def->sd_desc, &code, &err, LDAP_SCHEMA_ALLOW_ALL); if ( !syn ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ERR, - "register_syntax: Error - %s before %s in %s.\n", - ldap_scherr2str(code), err, def->sd_desc ); -#else Debug( LDAP_DEBUG_ANY, "Error in register_syntax: %s before %s in %s\n", ldap_scherr2str(code), err, def->sd_desc ); -#endif return( -1 ); } @@ -198,14 +182,8 @@ register_syntax( ldap_memfree( syn ); if ( code ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, ERR, - "register_syntax: Error - %s %s in %s\n", - scherr2str(code), err, def->sd_desc ); -#else Debug( LDAP_DEBUG_ANY, "Error in register_syntax: %s %s in %s\n", scherr2str(code), err, def->sd_desc ); -#endif return( -1 ); } @@ -235,14 +213,8 @@ syn_schema_info( Entry *e ) return -1; } #if 0 -#ifdef NEW_LOGGING - LDAP_LOG( config, ENTRY, - "syn_schema_info: Merging syn [%ld] %s\n", - (long)val.bv_len, val.bv_val, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "Merging syn [%ld] %s\n", (long) val.bv_len, val.bv_val, 0 ); -#endif #endif nval.bv_val = syn->ssyn_oid; diff --git a/servers/slapd/unbind.c b/servers/slapd/unbind.c index 32eb609fca..728eeea51c 100644 --- a/servers/slapd/unbind.c +++ b/servers/slapd/unbind.c @@ -36,12 +36,7 @@ int do_unbind( Operation *op, SlapReply *rs ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ENTRY, - "do_unbind: conn %d\n", op->o_connid ? op->o_connid : -1, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "do_unbind\n", 0, 0, 0 ); -#endif /* * Parse the unbind request. It looks like this: diff --git a/servers/slapd/user.c b/servers/slapd/user.c index 2a3cf268ef..2de0ffd17c 100644 --- a/servers/slapd/user.c +++ b/servers/slapd/user.c @@ -63,13 +63,8 @@ slap_init_user( char *user, char *group ) pwd = getpwnam( user ); did_getpw: if ( pwd == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "slap_init_user: No passwd entry for user %s\n", user, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "No passwd entry for user %s\n", user, 0, 0 ); -#endif exit( EXIT_FAILURE ); } @@ -102,13 +97,8 @@ slap_init_user( char *user, char *group ) gid = grp->gr_gid; did_group: if ( grp == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "slap_init_user: No group entry for group %s\n", group, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "No group entry for group %s\n", group, 0, 0 ); -#endif exit( EXIT_FAILURE ); } @@ -119,14 +109,8 @@ slap_init_user( char *user, char *group ) if ( user ) { if ( getuid() == 0 && initgroups( user, gid ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "slap_init_user: Could not set the group access (gid) list.\n", - 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Could not set the group access (gid) list\n", 0, 0, 0 ); -#endif exit( EXIT_FAILURE ); } @@ -139,27 +123,15 @@ slap_init_user( char *user, char *group ) if ( got_gid ) { if ( setgid( gid ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "slap_init_user: could not set real group id to %d\n", - (int)gid, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "Could not set real group id to %d\n", (int) gid, 0, 0 ); -#endif exit( EXIT_FAILURE ); } #ifdef HAVE_SETEGID if ( setegid( gid ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "slap_init_user: Could not set effective group id to %d\n", - (int)gid, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "Could not set effective group id to %d\n", (int) gid, 0, 0 ); -#endif exit( EXIT_FAILURE ); } @@ -168,27 +140,15 @@ slap_init_user( char *user, char *group ) if ( got_uid ) { if ( setuid( uid ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "slap_init_user: Could not set real user id to %d\n", - (int)uid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Could not set real user id to %d\n", (int) uid, 0, 0 ); -#endif exit( EXIT_FAILURE ); } #ifdef HAVE_SETEUID if ( seteuid( uid ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, INFO, - "slap_init_user: Could not set effective user id to %d\n", - (int)uid, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Could not set effective user id to %d\n", (int) uid, 0, 0 ); -#endif exit( EXIT_FAILURE ); } diff --git a/servers/slapd/value.c b/servers/slapd/value.c index e22cab5144..cf46e7765b 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -55,13 +55,8 @@ value_add( *vals = (BerVarray) SLAP_MALLOC( (nn + 1) * sizeof(struct berval) ); if( *vals == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "value_add: SLAP_MALLOC failed.\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "value_add: SLAP_MALLOC failed.\n", 0, 0, 0 ); -#endif return LBER_ERROR_MEMORY; } n = 0; @@ -73,13 +68,8 @@ value_add( *vals = (BerVarray) SLAP_REALLOC( (char *) *vals, (n + nn + 1) * sizeof(struct berval) ); if( *vals == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "value_add: SLAP_MALLOC failed.\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "value_add: SLAP_MALLOC failed.\n", 0, 0, 0 ); -#endif return LBER_ERROR_MEMORY; } } @@ -105,13 +95,8 @@ value_add_one( if ( *vals == NULL ) { *vals = (BerVarray) SLAP_MALLOC( 2 * sizeof(struct berval) ); if( *vals == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 ); -#endif return LBER_ERROR_MEMORY; } n = 0; @@ -123,13 +108,8 @@ value_add_one( *vals = (BerVarray) SLAP_REALLOC( (char *) *vals, (n + 2) * sizeof(struct berval) ); if( *vals == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 ); -#else Debug(LDAP_DEBUG_TRACE, "value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 ); -#endif return LBER_ERROR_MEMORY; } } diff --git a/servers/slurpd/config.c b/servers/slurpd/config.c index 9e88115c1d..e767ee5ff5 100644 --- a/servers/slurpd/config.c +++ b/servers/slurpd/config.c @@ -87,14 +87,8 @@ slurpd_read_config( cargv_size = ARGS_STEP + 1; } -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, ARGS, - "slurpd_read_config: Config: opening config file \"%s\"\n", - fname, 0, 0 ); -#else Debug( LDAP_DEBUG_CONFIG, "Config: opening config file \"%s\"\n", fname, 0, 0 ); -#endif if ( (fp = fopen( fname, "r" )) == NULL ) { perror( fname ); @@ -108,12 +102,7 @@ slurpd_read_config( continue; } -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, DETAIL1, - "slurpd_read_config: Config: (%s)\n", line, 0, 0 ); -#else Debug( LDAP_DEBUG_CONFIG, "Config: (%s)\n", line, 0, 0 ); -#endif parse_line( line ); @@ -154,15 +143,9 @@ slurpd_read_config( int savelineno; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d: missing filename in \"include " - "\" line.\n", fname, lineno , 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing filename in \"include \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -179,15 +162,9 @@ slurpd_read_config( } else if ( strcasecmp( cargv[0], "replica-pidfile" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: line %d missing file name in \"replica-pidfile \" " - "line.\n", fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing file name in \"replica-pidfile \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -197,16 +174,9 @@ slurpd_read_config( } else if ( strcasecmp( cargv[0], "replica-argsfile" ) == 0 ) { if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, - "%s: %d: missing file name in " - "\"argsfile \" line.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing file name in \"argsfile \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } @@ -217,29 +187,17 @@ slurpd_read_config( } else if ( strcasecmp( cargv[0], "replicationinterval" ) == 0 ) { int c; if ( cargc < 2 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: %d: missing interval in " - "\"replicationinterval \" line.\n", - fname, lineno, 0 ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing interval in " "\"replicationinterval \" line\n", fname, lineno, 0 ); -#endif return( 1 ); } c = atoi( cargv[1] ); if( c < 1 ) { -#ifdef NEW_LOGGING - LDAP_LOG( CONFIG, CRIT, "%s: line %d: invalid interval " - "(%d) in \"replicationinterval \" line\n", - fname, lineno, c ); -#else Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid interval " "(%d) in \"replicationinterval \" line\n", fname, lineno, c ); -#endif return( 1 ); } @@ -248,15 +206,9 @@ slurpd_read_config( } } fclose( fp ); -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, RESULTS, - "slurpd_read_config: Config: " - "** configuration file successfully read and parsed\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_CONFIG, "Config: ** configuration file successfully read and parsed\n", 0, 0, 0 ); -#endif return 0; } @@ -436,19 +388,11 @@ add_replica( sglob->replicas[ nr - 1] = NULL; sglob->num_replicas--; } else { -#ifdef NEW_LOGGING - LDAP_LOG ( CONFIG, RESULTS, - "add_replica: Config: ** successfully added replica \"%s%d\"\n", - sglob->replicas[ nr - 1 ]->ri_hostname == NULL ? - "(null)" : sglob->replicas[ nr - 1 ]->ri_hostname, - sglob->replicas[ nr - 1 ]->ri_port, 0 ); -#else Debug( LDAP_DEBUG_CONFIG, "Config: ** successfully added replica \"%s:%d\"\n", sglob->replicas[ nr - 1 ]->ri_hostname == NULL ? "(null)" : sglob->replicas[ nr - 1 ]->ri_hostname, sglob->replicas[ nr - 1 ]->ri_port, 0 ); -#endif sglob->replicas[ nr - 1]->ri_stel = sglob->st->st_add( sglob->st, sglob->replicas[ nr - 1 ] ); diff --git a/servers/slurpd/fm.c b/servers/slurpd/fm.c index 3574539728..16526493fe 100644 --- a/servers/slurpd/fm.c +++ b/servers/slurpd/fm.c @@ -106,26 +106,16 @@ fm( while ( !sglob->slurpd_shutdown ) { if ( file_nonempty( sglob->slapd_replogfile )) { /* New work found - copy to slurpd replog file */ -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ARGS, - "fm: new work in %s\n", sglob->slapd_replogfile, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "new work in %s\n", sglob->slapd_replogfile, 0, 0 ); -#endif if (( rc = copy_replog( sglob->slapd_replogfile, sglob->slurpd_replogfile )) == 0 ) { populate_queue( sglob->slurpd_replogfile ); } else { if ( rc < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, CRIT, - "fm: Fatal error while copying replication log\n" , 0, 0, 0); -#else Debug( LDAP_DEBUG_ANY, "Fatal error while copying replication log\n", 0, 0, 0 ); -#endif sglob->slurpd_shutdown = 1; } } @@ -147,15 +137,9 @@ fm( FILE *fp, *lfp; if (( rc = acquire_lock( sglob->slurpd_replogfile, &fp, &lfp )) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "fm: Error: cannot acquire lock on \"%s\" for trimming\n", - sglob->slurpd_replogfile, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: cannot acquire lock on \"%s\" for trimming\n", sglob->slurpd_replogfile, 0, 0 ); -#endif } else { sglob->rq->rq_write( sglob->rq, fp ); (void) relinquish_lock( sglob->slurpd_replogfile, fp, lfp ); @@ -168,11 +152,7 @@ fm( (sglob->replicas[ i ])->ri_wake( sglob->replicas[ i ]); } sglob->rq->rq_unlock( sglob->rq ); /* unlock queue */ -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, RESULTS, "fm: exiting\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "fm: exiting\n", 0, 0, 0 ); -#endif return NULL; } @@ -219,15 +199,9 @@ populate_queue( char *p; if ( acquire_lock( f, &fp, &lfp ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "populate_queue: error: can't lock file \"%s\": %s\n", - f, sys_errlist[ errno ], 0 ); -#else Debug( LDAP_DEBUG_ANY, "error: can't lock file \"%s\": %s\n", f, sys_errlist[ errno ], 0 ); -#endif return; } @@ -236,15 +210,9 @@ populate_queue( * the queue. */ if ( fseek( fp, sglob->srpos, 0 ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "populate_queue: error: can't seek to offset %ld in file \"%s\"\n", - sglob->srpos, f, 0 ); -#else Debug( LDAP_DEBUG_ANY, "error: can't seek to offset %ld in file \"%s\"\n", sglob->srpos, f, 0 ); -#endif } else { while (( p = get_record( fp )) != NULL ) { if ( sglob->rq->rq_add( sglob->rq, p ) < 0 ) { @@ -253,15 +221,9 @@ populate_queue( if (( t = strchr( p, '\n' )) != NULL ) { *t = '\0'; } -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "populate_queue: error: malformed replog entry " - "(begins with \"%s\")\n", p, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "error: malformed replog entry (begins with \"%s\")\n", p, 0, 0 ); -#endif } free( p ); ldap_pvt_thread_yield(); diff --git a/servers/slurpd/ldap_op.c b/servers/slurpd/ldap_op.c index 03caeacda8..7312056a66 100644 --- a/servers/slurpd/ldap_op.c +++ b/servers/slurpd/ldap_op.c @@ -102,81 +102,47 @@ do_ldap( case T_ADDCT: lderr = op_ldap_add( ri, re, errmsg, errfree ); if ( lderr != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_ldap: " - "Error: ldap_add_s failed adding \"%s\": %s\n", - *errmsg ? *errmsg : ldap_err2string( lderr ), - re->re_dn, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_add_s failed adding \"%s\": %s\n", *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn, 0 ); -#endif } break; case T_MODIFYCT: lderr = op_ldap_modify( ri, re, errmsg, errfree ); if ( lderr != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_ldap: " - "Error: ldap_modify_s failed modifying \"%s\": %s\n", - *errmsg ? *errmsg : ldap_err2string( lderr ), - re->re_dn, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_modify_s failed modifying \"%s\": %s\n", *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn, 0 ); -#endif } break; case T_DELETECT: lderr = op_ldap_delete( ri, re, errmsg, errfree ); if ( lderr != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_ldap: " - "Error: ldap_delete_s failed deleting \"%s\": %s\n", - *errmsg ? *errmsg : ldap_err2string( lderr ), - re->re_dn, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_delete_s failed deleting \"%s\": %s\n", *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn, 0 ); -#endif } break; case T_MODRDNCT: lderr = op_ldap_modrdn( ri, re, errmsg, errfree ); if ( lderr != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_ldap: " - "Error: ldap_modrdn_s failed modifying %s: %s\n", - *errmsg ? *errmsg : ldap_err2string( lderr ), - re->re_dn, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_modrdn_s failed modifying %s: %s\n", *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn, 0 ); -#endif } break; default: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_ldap: " - "Error: bad op \"%d\", dn = \"%s\"\n", - re->re_changetype, re->re_dn, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: do_ldap: bad op \"%d\", dn = \"%s\"\n", re->re_changetype, re->re_dn, 0 ); -#endif return DO_LDAP_ERR_FATAL; } @@ -243,14 +209,8 @@ op_ldap_add( ldmarr[ nattrs ] = NULL; /* Perform the operation */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "op_ldap_add: replica %s:%d - add dn \"%s\"\n", - ri->ri_hostname, ri->ri_port, re->re_dn ); -#else Debug( LDAP_DEBUG_ARGS, "replica %s:%d - add dn \"%s\"\n", ri->ri_hostname, ri->ri_port, re->re_dn ); -#endif rc = ldap_add_s( ri->ri_ldp, re->re_dn, ldmarr ); ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_NUMBER, &lderr); @@ -259,13 +219,8 @@ op_ldap_add( } else { *errmsg = "No modifications to do"; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_add: Error: no mods to do (%s)!\n", re->re_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_add: no mods to do (%s)!\n", re->re_dn, 0, 0 ); -#endif } free_ldmarr( ldmarr ); return( lderr ); @@ -302,13 +257,8 @@ op_ldap_modify( if ( re->re_mods == NULL ) { *errmsg = "No arguments given"; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_modify: Error: no arguments\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modify: no arguments\n", 0, 0, 0 ); -#endif return -1; } @@ -365,14 +315,9 @@ op_ldap_modify( break; default: if ( state == AWAITING_OP ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_modify: Error: unknown mod type \"%s\"\n", type, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modify: unknown mod type \"%s\"\n", type, 0, 0 ); -#endif continue; } @@ -383,16 +328,9 @@ op_ldap_modify( * Construct the mod_bvalues part of the ldapmod struct. */ if ( strcasecmp( type, ldm->mod_type )) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_modify: Error: " - "malformed modify op, %s: %s (expecting \"%s\")\n", - type, value, ldm->mod_type ); -#else Debug( LDAP_DEBUG_ANY, "Error: malformed modify op, %s: %s (expecting %s:)\n", type, value, ldm->mod_type ); -#endif continue; } ldm->mod_bvalues = ( struct berval ** ) @@ -410,14 +348,8 @@ op_ldap_modify( if ( nops > 0 ) { /* Actually perform the LDAP operation */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, DETAIL1, - "op_ldap_modify: replica %s:%d - modify dn \"%s\"\n", - ri->ri_hostname, ri->ri_port, re->re_dn ); -#else Debug( LDAP_DEBUG_ARGS, "replica %s:%d - modify dn \"%s\"\n", ri->ri_hostname, ri->ri_port, re->re_dn ); -#endif rc = ldap_modify_s( ri->ri_ldp, re->re_dn, ldmarr ); ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg); *errfree = 1; @@ -442,14 +374,8 @@ op_ldap_delete( { int rc; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "op_ldap_delete: replica %s:%d - delete dn \"%s\"\n", - ri->ri_hostname, ri->ri_port, re->re_dn ); -#else Debug( LDAP_DEBUG_ARGS, "replica %s:%d - delete dn \"%s\"\n", ri->ri_hostname, ri->ri_port, re->re_dn ); -#endif rc = ldap_delete_s( ri->ri_ldp, re->re_dn ); ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg); *errfree = 1; @@ -488,13 +414,8 @@ op_ldap_modrdn( if ( re->re_mods == NULL ) { *errmsg = "No arguments given"; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_modrdn: Error: no arguments\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: no arguments\n", 0, 0, 0 ); -#endif return -1; } @@ -504,15 +425,9 @@ op_ldap_modrdn( for ( mi = re->re_mods, i = 0; mi[ i ].mi_type != NULL; i++ ) { if ( !strcmp( mi[ i ].mi_type, T_NEWRDNSTR )) { if( state & GOT_NEWRDN ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_modrdn: Error: multiple newrdn arg \"%s\"\n", - mi[ i ].mi_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: multiple newrdn arg \"%s\"\n", mi[ i ].mi_val, 0, 0 ); -#endif *errmsg = "Multiple newrdn argument"; return -1; } @@ -522,15 +437,9 @@ op_ldap_modrdn( } else if ( !strcmp( mi[ i ].mi_type, T_DELOLDRDNSTR )) { if( state & GOT_DELOLDRDN ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_modrdn: Error: multiple deleteoldrdn arg \"%s\"\n", - mi[ i ].mi_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: multiple deleteoldrdn arg \"%s\"\n", mi[ i ].mi_val, 0, 0 ); -#endif *errmsg = "Multiple newrdn argument"; return -1; } @@ -541,30 +450,18 @@ op_ldap_modrdn( } else if ( !strcmp( mi[ i ].mi_val, "1" )) { drdnflag = 1; } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_modrdn: Error: bad deleteoldrdn arg \"%s\"\n", - mi[ i ].mi_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: bad deleteoldrdn arg \"%s\"\n", mi[ i ].mi_val, 0, 0 ); -#endif *errmsg = "Incorrect argument to deleteoldrdn"; return -1; } } else if ( !strcmp( mi[ i ].mi_type, T_NEWSUPSTR )) { if( state & GOT_NEWSUP ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_modrdn: Error: multiple newsuperior arg \"%s\"\n", - mi[ i ].mi_val, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: multiple newsuperior arg \"%s\"\n", mi[ i ].mi_val, 0, 0 ); -#endif *errmsg = "Multiple newsuperior argument"; return -1; } @@ -573,14 +470,8 @@ op_ldap_modrdn( state |= GOT_NEWSUP; } else { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_modrdn: Error: bad type \"%s\"\n", - mi[ i ].mi_type, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: bad type \"%s\"\n", mi[ i ].mi_type, 0, 0 ); -#endif *errmsg = "Bad value in replication log entry"; return -1; } @@ -590,13 +481,8 @@ op_ldap_modrdn( * Punt if we don't have all the args. */ if ( !GOT_ALL_MODDN(state) ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "op_ldap_modrdn: Error: missing arguments\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: missing arguments\n", 0, 0, 0 ); -#endif *errmsg = "Missing argument: requires \"newrdn\" and \"deleteoldrdn\""; return -1; } @@ -612,15 +498,9 @@ op_ldap_modrdn( buf2 = (char *) ch_malloc( buf2len ); snprintf( buf2, buf2len, "(\"%s\" -> \"%s\")", re->re_dn, mi->mi_val ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "op_ldap_modrdn: replica %s - modify rdn %s (flag: %d)\n", - buf, buf2, drdnflag ); -#else Debug( LDAP_DEBUG_ARGS, "replica %s - modify rdn %s (flag: %d)\n", buf, buf2, drdnflag ); -#endif free( buf2 ); } #endif /* LDAP_DEBUG */ @@ -758,15 +638,9 @@ do_unbind( if (( ri != NULL ) && ( ri->ri_ldp != NULL )) { rc = ldap_unbind( ri->ri_ldp ); if ( rc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "do_unbind: ldap_unbind failed for %s:%d: %s\n", - ri->ri_hostname, ri->ri_port, ldap_err2string( rc ) ); -#else Debug( LDAP_DEBUG_ANY, "Error: do_unbind: ldap_unbind failed for %s:%d: %s\n", ri->ri_hostname, ri->ri_port, ldap_err2string( rc ) ); -#endif } ri->ri_ldp = NULL; } @@ -798,11 +672,7 @@ do_bind( *lderr = 0; if ( ri == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: null ri ptr\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: do_bind: null ri ptr\n", 0, 0, 0 ); -#endif return( BIND_ERR_BADRI ); } @@ -810,61 +680,32 @@ retry: if ( ri->ri_ldp != NULL ) { ldrc = ldap_unbind( ri->ri_ldp ); if ( ldrc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "do_bind: ldap_unbind failed: %s\n", ldap_err2string( ldrc ), 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: do_bind: ldap_unbind failed: %s\n", ldap_err2string( ldrc ), 0, 0 ); -#endif } ri->ri_ldp = NULL; } if ( ri->ri_uri != NULL ) { /* new URI style */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "do_bind: Initializing session to %s\n", - ri->ri_uri, 0, 0); -#else Debug( LDAP_DEBUG_ARGS, "Initializing session to %s\n", ri->ri_uri, 0, 0 ); -#endif ldrc = ldap_initialize( &(ri->ri_ldp), ri->ri_uri); if (ldrc != LDAP_SUCCESS) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "do_bind: ldap_initalize (0, %s) failed: %s\n", - ri->ri_uri, ldap_err2string(ldrc), 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_initialize(0, %s) failed: %s\n", ri->ri_uri, ldap_err2string(ldrc), 0 ); -#endif return( BIND_ERR_OPEN ); } } else { /* old HOST style */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "do_bind: Initializing session to %s:%d\n", - ri->ri_hostname, ri->ri_port, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "Initializing session to %s:%d\n", ri->ri_hostname, ri->ri_port, 0 ); -#endif ri->ri_ldp = ldap_init( ri->ri_hostname, ri->ri_port ); if ( ri->ri_ldp == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, - "do_bind: ldap_init (%s, %d) failed: %s\n", - ri->ri_hostname, ri->ri_port, sys_errlist[ errno ] ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_init(%s, %d) failed: %s\n", ri->ri_hostname, ri->ri_port, sys_errlist[ errno ] ); -#endif return( BIND_ERR_OPEN ); } } @@ -875,15 +716,9 @@ retry: LDAP_OPT_PROTOCOL_VERSION, &version); if( err != LDAP_OPT_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: " - "Error: ldap_set_option(%s, LDAP_OPT_VERSION, 3) failed!\n", - ri->ri_hostname, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option(%s, LDAP_OPT_VERSION, 3) failed!\n", ri->ri_hostname, NULL, NULL ); -#endif ldap_unbind( ri->ri_ldp ); ri->ri_ldp = NULL; @@ -900,15 +735,9 @@ retry: err = ldap_set_option(ri->ri_ldp, LDAP_OPT_REFERRALS, LDAP_OPT_OFF); if( err != LDAP_OPT_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: " - "Error: ldap_set_option(%s, REFERRALS, OFF) failed!\n", - ri->ri_hostname, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option(%s,REFERRALS, OFF) failed!\n", ri->ri_hostname, NULL, NULL ); -#endif ldap_unbind( ri->ri_ldp ); ri->ri_ldp = NULL; return BIND_ERR_REFERRALS; @@ -920,17 +749,10 @@ retry: int err = ldap_start_tls_s(ri->ri_ldp, NULL, NULL); if( err != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: " - "%s: ldap_start_tls failed: %s (%d)\n", - ri->ri_tls == TLS_CRITICAL ? "Error" : "Warning", - ldap_err2string( err ), err ); -#else Debug( LDAP_DEBUG_ANY, "%s: ldap_start_tls failed: %s (%d)\n", ri->ri_tls == TLS_CRITICAL ? "Error" : "Warning", ldap_err2string( err ), err ); -#endif if( ri->ri_tls == TLS_CRITICAL ) { *lderr = err; @@ -948,26 +770,14 @@ retry: /* * Bind with a plaintext password. */ -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "do_bind: bind to %s:%d as %s (simple)\n", - ri->ri_hostname, ri->ri_port, ri->ri_bind_dn ); -#else Debug( LDAP_DEBUG_ARGS, "bind to %s:%d as %s (simple)\n", ri->ri_hostname, ri->ri_port, ri->ri_bind_dn ); -#endif ldrc = ldap_simple_bind_s( ri->ri_ldp, ri->ri_bind_dn, ri->ri_password ); if ( ldrc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: " - "Error: ldap_simple_bind_s for %s:%d failed: %s\n", - ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ) ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_simple_bind_s for %s:%d failed: %s\n", ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc )); -#endif *lderr = ldrc; ldap_unbind( ri->ri_ldp ); ri->ri_ldp = NULL; @@ -976,18 +786,10 @@ retry: break; case LDAP_AUTH_SASL: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ARGS, - "do_bind: bind to %s as %s via %s (SASL)\n", - ri->ri_hostname, - ri->ri_authcId ? ri->ri_authcId : "-", - ri->ri_saslmech ); -#else Debug( LDAP_DEBUG_ARGS, "bind to %s as %s via %s (SASL)\n", ri->ri_hostname, ri->ri_authcId ? ri->ri_authcId : "-", ri->ri_saslmech ); -#endif #ifdef HAVE_CYRUS_SASL if( ri->ri_secprops != NULL ) { @@ -995,15 +797,9 @@ retry: LDAP_OPT_X_SASL_SECPROPS, ri->ri_secprops); if( err != LDAP_OPT_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: " - "Error: ldap_set_option(%s,SECPROPS,\"%s\") failed!\n", - ri->ri_hostname, ri->ri_secprops, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option(%s,SECPROPS,\"%s\") failed!\n", ri->ri_hostname, ri->ri_secprops, NULL ); -#endif ldap_unbind( ri->ri_ldp ); ri->ri_ldp = NULL; return BIND_ERR_SASL_FAILED; @@ -1020,14 +816,8 @@ retry: lutil_sasl_freedefs( defaults ); if ( ldrc != LDAP_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: " - "Error: LDAP SASL for %s:%d failed: %s\n", - ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ) ); -#else Debug( LDAP_DEBUG_ANY, "Error: LDAP SASL for %s:%d failed: %s\n", ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc )); -#endif *lderr = ldrc; ldap_unbind( ri->ri_ldp ); ri->ri_ldp = NULL; @@ -1035,31 +825,19 @@ retry: } } break; -#else -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: " - "Error: do_bind: SASL not supported %s:%d\n", - ri->ri_hostname, ri->ri_port, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: do_bind: SASL not supported %s:%d\n", ri->ri_hostname, ri->ri_port, NULL ); -#endif ldap_unbind( ri->ri_ldp ); ri->ri_ldp = NULL; return( BIND_ERR_BAD_ATYPE ); #endif default: -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: " - "Error: do_bind: unknown auth type \"%d\" for %s:%d\n", - ri->ri_bind_method, ri->ri_hostname, ri->ri_port ); -#else Debug( LDAP_DEBUG_ANY, "Error: do_bind: unknown auth type \"%d\" for %s:%d\n", ri->ri_bind_method, ri->ri_hostname, ri->ri_port ); -#endif ldap_unbind( ri->ri_ldp ); ri->ri_ldp = NULL; return( BIND_ERR_BAD_ATYPE ); @@ -1080,15 +858,9 @@ retry: err = ldap_set_option(ri->ri_ldp, LDAP_OPT_SERVER_CONTROLS, &ctrls); if( err != LDAP_OPT_SUCCESS ) { -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, ERR, "do_bind: " - "ldap_set_option(%s, SERVER_CONTROLS, ManageDSAit) failed!\n", - ri->ri_hostname, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: " "ldap_set_option(%s, SERVER_CONTROLS, ManageDSAit) failed!\n", ri->ri_hostname, NULL, NULL ); -#endif ldap_unbind( ri->ri_ldp ); ri->ri_ldp = NULL; return BIND_ERR_MANAGEDSAIT; @@ -1117,17 +889,6 @@ dump_ldm_array( for ( i = 0; ldmarr[ i ] != NULL; i++ ) { ldm = ldmarr[ i ]; -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: " - "Trace (%ld): *** ldmarr[ %d ] contents:\n", - (long) getpid(), i, 0 ); - LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: " - "Trace (%ld): *** ldm->mod_op: %d\n", - (long) getpid(), ldm->mod_op, 0 ); - LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: " - "Trace (%ld): *** ldm->mod_type: %s\n", - (long) getpid(), ldm->mod_type, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "Trace (%ld): *** ldmarr[ %d ] contents:\n", (long) getpid(), i, 0 ); @@ -1137,19 +898,13 @@ dump_ldm_array( Debug( LDAP_DEBUG_TRACE, "Trace (%ld): *** ldm->mod_type: %s\n", (long) getpid(), ldm->mod_type, 0 ); -#endif if ( ldm->mod_bvalues != NULL ) { for ( j = 0; ( b = ldm->mod_bvalues[ j ] ) != NULL; j++ ) { msgbuf = ch_malloc( b->bv_len + 512 ); sprintf( msgbuf, "***** bv[ %d ] len = %ld, val = <%s>", j, b->bv_len, b->bv_val ); -#ifdef NEW_LOGGING - LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: " - "Trace (%ld):%s\n", (long) getpid(), msgbuf, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "Trace (%ld):%s\n", (long) getpid(), msgbuf, 0 ); -#endif free( msgbuf ); } } diff --git a/servers/slurpd/lock.c b/servers/slurpd/lock.c index bce1e94978..24feb7b73a 100644 --- a/servers/slurpd/lock.c +++ b/servers/slurpd/lock.c @@ -62,13 +62,8 @@ lock_fopen( snprintf( buf, sizeof buf, "%s.lock", fname ); if ( (*lfp = fopen( buf, "w" )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "lock_fopen: " - "Error: could not open \"%s\"\n", buf, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: could not open \"%s\"\n", buf, 0, 0 ); -#endif return( NULL ); } @@ -77,13 +72,8 @@ lock_fopen( /* open the log file */ if ( (fp = fopen( fname, type )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "lock_fopen: " - "Error: could not open \"%s\"\n", fname, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: could not open \"%s\"\n", fname, 0, 0 ); -#endif ldap_unlockf( fileno(*lfp) ); fclose( *lfp ); *lfp = NULL; @@ -121,15 +111,9 @@ acquire_lock( ) { if (( *rfp = lock_fopen( file, "r+", lfp )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "acquire_lock: " - "Error: acquire_lock(%ld): Could not acquire lock on \"%s\"\n", - (long) getpid(), file, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: acquire_lock(%ld): Could not acquire lock on \"%s\"\n", (long) getpid(), file, 0); -#endif return( -1 ); } return( 0 ); @@ -149,15 +133,9 @@ relinquish_lock( ) { if ( lock_fclose( rfp, lfp ) == EOF ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "relinguish_lock: " - "Error: relinquish_lock (%ld): Error closing \"%s\"\n", - (long) getpid(), file, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: relinquish_lock (%ld): Error closing \"%s\"\n", (long) getpid(), file, 0 ); -#endif return( -1 ); } return( 0 ); diff --git a/servers/slurpd/main.c b/servers/slurpd/main.c index 9aece1f6b5..df3d919111 100644 --- a/servers/slurpd/main.c +++ b/servers/slurpd/main.c @@ -114,26 +114,14 @@ int main( int argc, char **argv ) if ( i != NULL ) { ldap_debug = *i; -#ifdef NEW_LOGGING - lutil_log_initialize( argc, argv ); - LDAP_LOG( SLURPD, INFO, - "main: new debug level from registry is: %d\n", - ldap_debug, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "new debug level from registry is: %d\n", ldap_debug, 0, 0 ); -#endif } newConfigFile = (char*)lutil_getRegParam( regService, "ConfigFile" ); if ( newConfigFile != NULL ) { sglob->slapd_configfile = newConfigFile; -#ifdef NEW_LOGGING - LDAP_LOG( SLURPD, INFO, - "main: new config file from registry is: %s\n", sglob->slapd_configfile, 0, 0 ); -#else Debug ( LDAP_DEBUG_ANY, "new config file from registry is: %s\n", sglob->slapd_configfile, 0, 0 ); -#endif } } @@ -156,11 +144,7 @@ int main( int argc, char **argv ) } } -#ifdef NEW_LOGGING - LDAP_LOG( SLURPD, INFO, "%s\n", Versionstr, 0, 0 ); -#else Debug ( LDAP_DEBUG_ANY, "%s\n", Versionstr, 0, 0 ); -#endif /* * Read slapd config file and initialize Re (per-replica) structs. @@ -269,13 +253,8 @@ int main( int argc, char **argv ) if ( ldap_pvt_thread_create( &(sglob->fm_tid), 0, fm, (void *) NULL ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "main: file manager ldap_pvt_thread_create failed\n" , 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "file manager ldap_pvt_thread_create failed\n", 0, 0, 0 ); -#endif SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 21 ); rc = 1; goto stop; @@ -329,11 +308,7 @@ stop: ldap_pvt_tls_destroy(); #endif -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, RESULTS, "main: slurpd terminated\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "slurpd: terminated.\n", 0, 0, 0 ); -#endif if ( slurpd_pid_file != NULL ) { unlink( slurpd_pid_file ); diff --git a/servers/slurpd/re.c b/servers/slurpd/re.c index 9224c12d41..955b67b617 100644 --- a/servers/slurpd/re.c +++ b/servers/slurpd/re.c @@ -94,14 +94,9 @@ Re_free( return 0; } if ( re->re_refcnt > 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, WARNING, "Re_free: " - "Warning: freeing re (dn: %s) with nonzero refcnt\n", re->re_dn, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Warning: freeing re (dn: %s) with nonzero refcnt\n", re->re_dn, 0, 0 ); -#endif } ldap_pvt_thread_mutex_destroy( &re->re_mutex ); @@ -153,19 +148,11 @@ Re_parse( int nreplicas; if ( re == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "Re_parse: Error: re is NULL\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Re_parse: error: re is NULL\n", 0, 0, 0 ); -#endif return -1; } if ( replbuf == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "Re_parse: Error: replbuf is NULL\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Re_parse: error: replbuf is NULL\n", 0, 0, 0 ); -#endif return -1; } @@ -190,14 +177,9 @@ Re_parse( } buflen = strlen( buf ); if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "Re_parse: Error: malformed replog file\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: Re_parse: malformed replog file\n", 0, 0, 0 ); -#endif return -1; } switch ( gettype( type )) { @@ -224,14 +206,9 @@ Re_parse( break; default: if ( !( state == GOT_ALL )) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "Re_parse: Error: bad type <%s>\n", type, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: Re_parse: bad type <%s>\n", type, 0, 0 ); -#endif free( type ); free( value ); return -1; @@ -242,14 +219,9 @@ Re_parse( } if ( state != GOT_ALL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "Re_parse: Error: malformed replog file\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: Re_parse: malformed replog file\n", 0, 0, 0 ); -#endif return -1; } @@ -265,14 +237,9 @@ Re_parse( value = NULL; } else { if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "Re_parse: Error: malformed replog line \"%s\"\n", buf, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: malformed replog line \"%s\"\n", buf, 0, 0 ); -#endif return -1; } } @@ -383,13 +350,8 @@ get_repl_hosts( rh = (Rh *) ch_realloc((char *) rh, ( nreplicas + 2 ) * sizeof( Rh )); if ( rh == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "get_repl_hosts: Out of memory\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Out of memory in get_repl_hosts\n", 0, 0, 0 ); -#endif return NULL; } rh[ nreplicas ].rh_hostname = strdup( value ); @@ -504,11 +466,7 @@ Re_dump( Mi *mi; if ( re == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "Re_dump: re is NULL\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_TRACE, "Re_dump: re is NULL\n", 0, 0, 0 ); -#endif return; } fprintf( fp, "Re_dump: ******\n" ); @@ -574,13 +532,8 @@ Re_write( int rc = 0; if ( re == NULL || fp == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "Re_write: Internal error: NULL argument\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Internal error: Re_write: NULL argument\n", 0, 0, 0 ); -#endif return -1; } @@ -668,13 +621,8 @@ Re_write( } bad: if ( rc != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "Re_write: Error while writing: %s\n", sys_errlist[ errno ], 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error while writing: %s\n", sys_errlist[ errno ], 0, 0 ); -#endif } return rc; } @@ -811,15 +759,9 @@ warn_unknown_replica( } } if ( !found ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, WARNING, "warn_unknown_replica: " - "Warning: unknown replica %s:%d found in replication log\n", - host, port, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Warning: unknown replica %s:%d found in replication log\n", host, port, 0 ); -#endif nur++; ur = (Rh *) ch_realloc( (char *) ur, ( nur * sizeof( Rh ))); ur[ nur - 1 ].rh_hostname = strdup( host ); diff --git a/servers/slurpd/reject.c b/servers/slurpd/reject.c index ae0c7c0a9a..09fa869755 100644 --- a/servers/slurpd/reject.c +++ b/servers/slurpd/reject.c @@ -83,15 +83,9 @@ write_reject( int rjfd; if (( rjfd = open( rejfile, O_RDWR|O_APPEND|O_CREAT|O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP )) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "write_reject: " - "Error: Cannot create \"%s\":%s\n", - rejfile, sys_errlist[ errno ], 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: write_reject: Cannot create \"%s\": %s\n", rejfile, sys_errlist[ errno ], 0 ); -#endif ldap_pvt_thread_mutex_unlock( &sglob->rej_mutex ); return; } else { @@ -99,13 +93,8 @@ write_reject( } } if (( rc = acquire_lock( rejfile, &rfp, &lfp )) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "write_reject: " - "Error: Cannot open reject file \"%s\"\n", rejfile, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: cannot open reject file \"%s\"\n", rejfile, 0, 0 ); -#endif } else { fseek( rfp, 0, 2 ); fprintf( rfp, "%s: %s", ERROR_STR, ldap_err2string( lderr )); @@ -114,25 +103,14 @@ write_reject( } fprintf( rfp, "\n" ); if ((rc = re->re_write( ri, re, rfp )) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "write_reject: " - "Error: Cannot write reject file \"%s\"\n", rejfile, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: cannot write reject file \"%s\"\n", rejfile, 0, 0 ); -#endif } (void) relinquish_lock( rejfile, rfp, lfp ); -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "write_reject: " - "Error: ldap operation failed, data written to \"%s\"\n", - rejfile, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: ldap operation failed, data written to \"%s\"\n", rejfile, 0, 0 ); -#endif } ldap_pvt_thread_mutex_unlock( &sglob->rej_mutex ); return; diff --git a/servers/slurpd/replica.c b/servers/slurpd/replica.c index 4a6df55e1a..68429c3829 100644 --- a/servers/slurpd/replica.c +++ b/servers/slurpd/replica.c @@ -51,25 +51,13 @@ replicate( { Ri *ri = (Ri *) ri_arg; -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ARGS, "replicate: " - "begin replication thread for %s:%d\n", - ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "begin replication thread for %s:%d\n", ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 ); -#endif ri->ri_process( ri ); -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ARGS, "replicate: " - "begin replication thread for %s:%d\n", - ri->ri_hostname, ri->ri_port, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "end replication thread for %s:%d\n", ri->ri_hostname, ri->ri_port, 0 ); -#endif return NULL; } @@ -86,14 +74,8 @@ start_replica_thread( /* POSIX_THREADS or compatible */ if ( ldap_pvt_thread_create( &(ri->ri_tid), 0, replicate, (void *) ri ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "start_replica_thread: " - "replica %s:%d ldap_pvt_thread_create failed\n", - ri->ri_hostname, ri->ri_port, 0 ); -#else Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" ldap_pvt_thread_create failed\n", ri->ri_hostname, ri->ri_port, 0 ); -#endif return -1; } diff --git a/servers/slurpd/replog.c b/servers/slurpd/replog.c index d146de0189..460c4a124b 100644 --- a/servers/slurpd/replog.c +++ b/servers/slurpd/replog.c @@ -70,14 +70,9 @@ copy_replog( static char rbuf[ 1024 ]; char *p; -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ARGS, "copy_replog: " - "copy replog \"%s\" to \"%s\"\n", src, dst, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "copy replog \"%s\" to \"%s\"\n", src, dst, 0 ); -#endif /* * Make sure the destination directory is writable. If not, exit @@ -90,15 +85,9 @@ copy_replog( *p = '\0'; } if ( access( buf, W_OK ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "copy_replog: " - "Error: (%ld): Directory %s is not writable\n", - (long) getpid(), buf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog (%ld): Directory %s is not writable\n", (long) getpid(), buf, 0 ); -#endif return( -1 ); } strcpy( buf, dst ); @@ -108,45 +97,27 @@ copy_replog( *p = '\0'; } if ( access( buf, W_OK ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "copy_replog: " - "Error: (%ld): Directory %s is not writable\n", - (long) getpid(), buf, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog (%ld): Directory %s is not writable\n", (long) getpid(), buf, 0 ); -#endif return( -1 ); } /* lock src */ rfp = lock_fopen( src, "r", &lfp ); if ( rfp == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "copy_replog: " - "Error: Can't lock replog \"%s\" for read: %s\n", - src, sys_errlist[ errno ], 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Can't lock replog \"%s\" for read: %s\n", src, sys_errlist[ errno ], 0 ); -#endif return( 1 ); } /* lock dst */ dfp = lock_fopen( dst, "a", &dlfp ); if ( dfp == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "copy_replog: Error: Can't lock replog \"%s\" for write: %s\n", - dst, sys_errlist[ errno ], 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Can't lock replog \"%s\" for write: %s\n", dst, sys_errlist[ errno ], 0 ); -#endif lock_fclose( rfp, lfp ); return( 1 ); } @@ -164,25 +135,14 @@ copy_replog( } if ( lock_fclose( dfp, dlfp ) == EOF ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, - "copy_replog: Error: Error closing \"%s\"\n", - dst, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Error closing \"%s\"\n", dst, 0, 0 ); -#endif } if ( lock_fclose( rfp, lfp ) == EOF ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "copy_replog: " - "Error: Error closing \"%s\"\n", src, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Error closing \"%s\"\n", src, 0, 0 ); -#endif } return( rc ); } diff --git a/servers/slurpd/ri.c b/servers/slurpd/ri.c index fe4e2a3852..b4384e2928 100644 --- a/servers/slurpd/ri.c +++ b/servers/slurpd/ri.c @@ -70,12 +70,7 @@ Ri_process( (void) SIGNAL( SIGPIPE, SIG_IGN ); #endif if ( ri == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "Ri_process: " - "Error: ri == NULL!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: Ri_process: ri == NULL!\n", 0, 0, 0 ); -#endif return -1; } @@ -105,40 +100,22 @@ Ri_process( if ( re != NULL ) { if ( !ismine( ri, re )) { /* The Re doesn't list my host:port */ -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, DETAIL1, "Ri_process: " - "Replica %s:%d, skip repl record for %s (not mine)\n", - ri->ri_hostname, ri->ri_port, re->re_dn ); -#else Debug( LDAP_DEBUG_TRACE, "Replica %s:%d, skip repl record for %s (not mine)\n", ri->ri_hostname, ri->ri_port, re->re_dn ); -#endif } else if ( !isnew( ri, re )) { /* This Re is older than my saved status information */ -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, DETAIL1, "Ri_process: " - "Replica %s:%d, skip repl record for %s (old)\n", - ri->ri_hostname, ri->ri_port, re->re_dn ); -#else Debug( LDAP_DEBUG_TRACE, "Replica %s:%d, skip repl record for %s (old)\n", ri->ri_hostname, ri->ri_port, re->re_dn ); -#endif } else { rc = do_ldap( ri, re, &errmsg, &errfree ); switch ( rc ) { case DO_LDAP_ERR_RETRYABLE: ldap_pvt_thread_sleep( RETRY_SLEEP_TIME ); -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, DETAIL1, "Ri_process: " - "Retrying operation for DN %s on replica %s:%d\n", - re->re_dn, ri->ri_hostname, ri->ri_port ); -#else Debug( LDAP_DEBUG_ANY, "Retrying operation for DN %s on replica %s:%d\n", re->re_dn, ri->ri_hostname, ri->ri_port ); -#endif continue; break; case DO_LDAP_ERR_FATAL: { @@ -163,13 +140,8 @@ Ri_process( } } } else { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "Ri_process: " - "Error: re is null in Ri_process\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: re is null in Ri_process\n", 0, 0, 0 ); -#endif } rq->rq_lock( rq ); while ( !sglob->slurpd_shutdown && diff --git a/servers/slurpd/rq.c b/servers/slurpd/rq.c index ff835cc373..810a6b78ec 100644 --- a/servers/slurpd/rq.c +++ b/servers/slurpd/rq.c @@ -144,13 +144,8 @@ Rq_delhead( } if ( savedhead->re_getrefcnt( savedhead ) != 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, WARNING, "Rq_delhead: " - "Warning: attempt to delete when refcnt != 0\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Warning: attempt to delete when refcnt != 0\n", 0, 0, 0 ); -#endif return( -1 ); } @@ -233,11 +228,7 @@ Rq_gc( ) { if ( rq == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, DETAIL1, "Rq_gc: rq is NULL!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Rq_gc: rq is NULL!\n", 0, 0, 0 ); -#endif return; } rq->rq_lock( rq ); @@ -265,42 +256,23 @@ Rq_dump( int tmpfd; if ( rq == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ARGS, "Rq_dump: rq is NULL!\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Rq_dump: rq is NULL!\n", 0, 0, 0 ); -#endif return; } if (unlink(SLURPD_DUMPFILE) == -1 && errno != ENOENT) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "Rq_dump: " - "\"%s\" exists, cannot unlink\n", SLURPD_DUMPFILE, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Rq_dump: \"%s\" exists, and cannot unlink\n", SLURPD_DUMPFILE, 0, 0 ); -#endif return; } if (( tmpfd = open(SLURPD_DUMPFILE, O_CREAT|O_RDWR|O_EXCL, 0600)) == -1) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "Rq_dump: " - "cannot open \"%s\" for write\n", SLURPD_DUMPFILE, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Rq_dump: cannot open \"%s\" for write\n", SLURPD_DUMPFILE, 0, 0 ); -#endif return; } if (( fp = fdopen( tmpfd, "w" )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "Rq_dump: " - "cannot fdopen \"%s\" for write\n", SLURPD_DUMPFILE, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Rq_dump: cannot fdopen \"%s\" for write\n", SLURPD_DUMPFILE, 0, 0 ); -#endif return; } @@ -332,13 +304,8 @@ Rq_write( return -1; } -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ENTRY, "Rq_write: " - "re-write on-disk replication log\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "re-write on-disk replication log\n", 0, 0, 0 ); -#endif #ifndef SEEK_SET #define SEEK_SET 0 #endif @@ -356,13 +323,8 @@ Rq_write( sglob->srpos = ftell( fp ); /* update replog file position */ /* and truncate to correct len */ if ( ftruncate( fileno( fp ), sglob->srpos ) < 0 ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "Rq_write: " - "Error truncating replication log: %s\n", sys_errlist[ errno ], 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error truncating replication log: %s\n", sys_errlist[ errno ], 0, 0 ); -#endif } rq->rq_ndel = 0; /* reset count of deleted re's */ time( &now ); diff --git a/servers/slurpd/st.c b/servers/slurpd/st.c index c99a4868f5..fa8d9029ee 100644 --- a/servers/slurpd/st.c +++ b/servers/slurpd/st.c @@ -109,15 +109,9 @@ St_write ( if (( rc = acquire_lock( sglob->slurpd_status_file, &(st->st_fp), &(st->st_lfp))) < 0 ) { if ( !st->st_err_logged ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "St_write: " - "Error: cannot open status file \"%s\":%s\n", - sglob->slurpd_status_file, sys_errlist[ errno ], 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: cannot open status file \"%s\": %s\n", sglob->slurpd_status_file, sys_errlist[ errno ], 0 ); -#endif st->st_err_logged = 1; ldap_pvt_thread_mutex_unlock( &(st->st_mutex )); return -1; @@ -195,26 +189,15 @@ St_read( * File doesn't exist, so create it and return. */ if (( fp = fopen( sglob->slurpd_status_file, "w" )) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, ERR, "St_write: " - "Error: cannot create status file \"%s\"\n", - sglob->slurpd_status_file, 0, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Error: cannot create status file \"%s\"\n", sglob->slurpd_status_file, 0, 0 ); -#endif ldap_pvt_thread_mutex_unlock( &(st->st_mutex )); return -1; } (void) fclose( fp ); ldap_pvt_thread_mutex_unlock( &(st->st_mutex )); -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, DETAIL1, "St_write: " - "No status file found, defaulting values\n", 0, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "No status file found, defaulting values\n", 0, 0, 0 ); -#endif return 0; } if (( rc = acquire_lock( sglob->slurpd_status_file, &fp, &lfp)) < 0 ) { @@ -259,23 +242,12 @@ St_read( char tbuf[ 255 ]; sprintf( tbuf, "%s:%s (timestamp %s.%s)", hostname, port, timestamp, seq ); -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, DETAIL1, "St_write: " - "Retrieved state information for %s\n", tbuf, 0, 0 ); -#else Debug( LDAP_DEBUG_ARGS, "Retrieved state information for %s\n", tbuf, 0, 0 ); -#endif } else { -#ifdef NEW_LOGGING - LDAP_LOG ( SLURPD, WARNING, "St_write: " - "Warning: saved state for %s:%s, not a known replica\n", - hostname, port, 0 ); -#else Debug( LDAP_DEBUG_ANY, "Warning: saved state for %s:%s, not a known replica\n", hostname, port, 0 ); -#endif } } (void) relinquish_lock( sglob->slurpd_status_file, fp, lfp);