From 6107ba67d2fd7eadb23ffdd1d284306011ef4013 Mon Sep 17 00:00:00 2001 From: Julius Enarusai Date: Thu, 11 Jul 2002 20:33:24 +0000 Subject: [PATCH] Coverted LDAP_LOG macro to use subsystem ID int values instead of string values --- clients/tools/ldapmodify.c | 4 - include/ldap_log.h | 56 ++- libraries/liblber/Makefile.in | 8 +- libraries/liblber/decode.c | 10 +- libraries/liblber/encode.c | 4 +- libraries/liblber/io.c | 25 +- libraries/liblber/lber-int.h | 4 + libraries/libldap/abandon.c | 7 +- libraries/libldap/add.c | 2 +- libraries/libldap/bind.c | 6 +- libraries/libldap/cache.c | 93 ++-- libraries/libldap/compare.c | 3 +- libraries/libldap/cyrus.c | 26 +- libraries/libldap/delete.c | 4 +- libraries/libldap/error.c | 6 +- libraries/libldap/extended.c | 10 +- libraries/libldap/filter.c | 51 +- libraries/libldap/getattr.c | 4 +- libraries/libldap/getdn.c | 39 +- libraries/libldap/getfilter.c | 6 +- libraries/libldap/getvalues.c | 4 +- libraries/libldap/init.c | 31 +- libraries/libldap/kbind.c | 22 +- libraries/libldap/modify.c | 4 +- libraries/libldap/modrdn.c | 4 +- libraries/libldap/open.c | 12 +- libraries/libldap/os-ip.c | 2 +- libraries/libldap/request.c | 80 ++-- libraries/libldap/result.c | 113 +++-- libraries/libldap/sasl.c | 17 +- libraries/libldap/sbind.c | 5 +- libraries/libldap/search.c | 6 +- libraries/libldap/tls.c | 111 +++-- libraries/libldap/unbind.c | 4 +- libraries/libldap/url.c | 3 +- libraries/liblutil/Makefile.in | 4 +- libraries/liblutil/debug.c | 161 ++++--- servers/slapd/abandon.c | 21 +- servers/slapd/acl.c | 230 +++++---- servers/slapd/add.c | 36 +- servers/slapd/ava.c | 3 +- servers/slapd/back-bdb/add.c | 50 +- servers/slapd/back-bdb/attr.c | 4 +- servers/slapd/back-bdb/attribute.c | 45 +- servers/slapd/back-bdb/bind.c | 10 +- servers/slapd/back-bdb/cache.c | 149 +++--- servers/slapd/back-bdb/compare.c | 3 +- servers/slapd/back-bdb/dbcache.c | 8 +- servers/slapd/back-bdb/delete.c | 70 ++- servers/slapd/back-bdb/dn2entry.c | 4 +- servers/slapd/back-bdb/dn2id.c | 104 ++-- servers/slapd/back-bdb/error.c | 2 +- servers/slapd/back-bdb/filterindex.c | 133 ++++-- servers/slapd/back-bdb/group.c | 51 +- servers/slapd/back-bdb/idl.c | 103 ++-- servers/slapd/back-bdb/index.c | 17 +- servers/slapd/back-bdb/init.c | 64 ++- servers/slapd/back-bdb/key.c | 19 +- servers/slapd/back-bdb/modify.c | 70 ++- servers/slapd/back-bdb/modrdn.c | 124 +++-- servers/slapd/back-bdb/nextid.c | 5 +- servers/slapd/back-bdb/operational.c | 14 +- servers/slapd/back-bdb/passwd.c | 14 +- servers/slapd/back-bdb/referral.c | 14 +- servers/slapd/back-bdb/search.c | 38 +- servers/slapd/back-bdb/tools.c | 61 ++- servers/slapd/back-ldap/add.c | 15 +- servers/slapd/back-ldap/bind.c | 23 +- servers/slapd/back-ldap/compare.c | 5 +- servers/slapd/back-ldap/delete.c | 4 +- servers/slapd/back-ldap/group.c | 12 +- servers/slapd/back-ldap/modify.c | 4 +- servers/slapd/back-ldap/modrdn.c | 11 +- servers/slapd/back-ldap/search.c | 41 +- servers/slapd/back-ldap/suffixmassage.c | 4 +- servers/slapd/back-ldap/unbind.c | 11 +- servers/slapd/back-ldbm/add.c | 56 ++- servers/slapd/back-ldbm/attr.c | 7 +- servers/slapd/back-ldbm/attribute.c | 46 +- servers/slapd/back-ldbm/bind.c | 12 +- servers/slapd/back-ldbm/cache.c | 84 ++-- servers/slapd/back-ldbm/close.c | 8 +- servers/slapd/back-ldbm/compare.c | 4 +- servers/slapd/back-ldbm/config.c | 21 +- servers/slapd/back-ldbm/dbcache.c | 62 +-- servers/slapd/back-ldbm/delete.c | 44 +- servers/slapd/back-ldbm/dn2id.c | 55 +-- servers/slapd/back-ldbm/filterindex.c | 198 ++++---- servers/slapd/back-ldbm/group.c | 52 +- servers/slapd/back-ldbm/id2children.c | 13 +- servers/slapd/back-ldbm/id2entry.c | 60 ++- servers/slapd/back-ldbm/idl.c | 47 +- servers/slapd/back-ldbm/index.c | 15 +- servers/slapd/back-ldbm/init.c | 4 +- servers/slapd/back-ldbm/key.c | 16 +- servers/slapd/back-ldbm/modify.c | 64 ++- servers/slapd/back-ldbm/modrdn.c | 159 +++---- servers/slapd/back-ldbm/nextid.c | 8 +- servers/slapd/back-ldbm/passwd.c | 9 +- servers/slapd/back-ldbm/referral.c | 8 +- servers/slapd/back-ldbm/search.c | 40 +- servers/slapd/back-ldbm/tools.c | 26 +- servers/slapd/back-meta/add.c | 8 +- servers/slapd/back-meta/bind.c | 25 +- servers/slapd/back-meta/compare.c | 10 +- servers/slapd/back-meta/conn.c | 23 +- servers/slapd/back-meta/delete.c | 5 +- servers/slapd/back-meta/group.c | 15 +- servers/slapd/back-meta/modify.c | 5 +- servers/slapd/back-meta/modrdn.c | 12 +- servers/slapd/back-meta/search.c | 47 +- servers/slapd/back-meta/unbind.c | 11 +- servers/slapd/back-monitor/backend.c | 14 +- servers/slapd/back-monitor/bind.c | 4 +- servers/slapd/back-monitor/conn.c | 25 +- servers/slapd/back-monitor/database.c | 14 +- servers/slapd/back-monitor/init.c | 52 +- servers/slapd/back-monitor/listener.c | 18 +- servers/slapd/back-monitor/log.c | 4 +- servers/slapd/back-monitor/modify.c | 4 +- servers/slapd/back-monitor/operation.c | 36 +- servers/slapd/back-monitor/search.c | 4 +- servers/slapd/back-monitor/sent.c | 36 +- servers/slapd/back-monitor/thread.c | 4 +- servers/slapd/back-monitor/time.c | 20 +- servers/slapd/backend.c | 47 +- servers/slapd/bind.c | 68 ++- servers/slapd/ch_malloc.c | 17 +- servers/slapd/compare.c | 45 +- servers/slapd/config.c | 599 ++++++++++++------------ servers/slapd/connection.c | 165 ++++--- servers/slapd/controls.c | 39 +- servers/slapd/daemon.c | 260 +++++----- servers/slapd/delete.c | 25 +- servers/slapd/dn.c | 18 +- servers/slapd/entry.c | 67 ++- servers/slapd/extended.c | 29 +- servers/slapd/filter.c | 186 ++++---- servers/slapd/filterentry.c | 66 +-- servers/slapd/init.c | 29 +- servers/slapd/limits.c | 17 +- servers/slapd/lock.c | 8 +- servers/slapd/main.c | 42 +- servers/slapd/matchedValues.c | 28 +- servers/slapd/modify.c | 57 +-- servers/slapd/modrdn.c | 48 +- servers/slapd/module.c | 48 +- servers/slapd/mr.c | 23 +- servers/slapd/mra.c | 32 +- servers/slapd/oc.c | 14 +- servers/slapd/passwd.c | 35 +- servers/slapd/referral.c | 23 +- servers/slapd/result.c | 240 +++++----- servers/slapd/sasl.c | 113 ++--- servers/slapd/saslauthz.c | 81 ++-- servers/slapd/schema_check.c | 62 ++- servers/slapd/schema_init.c | 46 +- servers/slapd/schema_prep.c | 22 +- servers/slapd/search.c | 34 +- servers/slapd/str2filter.c | 3 +- servers/slapd/suffixalias.c | 6 +- servers/slapd/syntax.c | 17 +- servers/slapd/tools/slapadd.c | 3 + servers/slapd/unbind.c | 5 +- servers/slapd/user.c | 35 +- servers/slurpd/config.c | 21 +- servers/slurpd/fm.c | 26 +- servers/slurpd/ldap_op.c | 162 +++---- servers/slurpd/lock.c | 16 +- servers/slurpd/main.c | 7 +- servers/slurpd/re.c | 42 +- servers/slurpd/reject.c | 17 +- servers/slurpd/replica.c | 13 +- servers/slurpd/replog.c | 28 +- servers/slurpd/ri.c | 20 +- servers/slurpd/rq.c | 29 +- servers/slurpd/st.c | 20 +- 177 files changed, 3564 insertions(+), 3600 deletions(-) diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index 427952c5fa..a72f6f0a93 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -582,10 +582,6 @@ main( int argc, char **argv ) (void) SIGNAL( SIGPIPE, SIG_IGN ); #endif -#ifdef NEW_LOGGING - lutil_log_initialize( argc, argv ); -#endif - if ( !not ) { if( ( ldaphost != NULL || ldapport ) && ( ldapuri == NULL ) ) { if ( verbose ) { diff --git a/include/ldap_log.h b/include/ldap_log.h index 30f57c418c..500e848d71 100644 --- a/include/ldap_log.h +++ b/include/ldap_log.h @@ -35,21 +35,29 @@ LDAP_BEGIN_DECL * reflect the number of subsystems and LDAP_SUBSYS_MAX reflect * the largest subsystem number. */ -#define LDAP_SUBSYS_NUM 12 -#define LDAP_SUBSYS_MAX 11 +#define LDAP_SUBSYS_NUM 20 +#define LDAP_SUBSYS_MAX 19 #define LDAP_SUBSYS_GLOBAL 0 #define LDAP_SUBSYS_OPERATION 1 #define LDAP_SUBSYS_TRANSPORT 2 #define LDAP_SUBSYS_CONNECTION 3 #define LDAP_SUBSYS_FILTER 4 -#define LDAP_SUBSYS_BACKEND 5 -#define LDAP_SUBSYS_BER 6 -#define LDAP_SUBSYS_CONFIG 7 -#define LDAP_SUBSYS_ACL 8 -#define LDAP_SUBSYS_CACHE 9 -#define LDAP_SUBSYS_INDEX 10 -#define LDAP_SUBSYS_LDIF 11 +#define LDAP_SUBSYS_BER 5 +#define LDAP_SUBSYS_CONFIG 6 +#define LDAP_SUBSYS_ACL 7 +#define LDAP_SUBSYS_CACHE 8 +#define LDAP_SUBSYS_INDEX 9 +#define LDAP_SUBSYS_LDIF 10 +#define LDAP_SUBSYS_TOOLS 11 +#define LDAP_SUBSYS_SLAPD 12 +#define LDAP_SUBSYS_SLURPD 13 +#define LDAP_SUBSYS_BACKEND 14 +#define LDAP_SUBSYS_BACK_BDB 15 +#define LDAP_SUBSYS_BACK_LDBM 16 +#define LDAP_SUBSYS_BACK_LDAP 17 +#define LDAP_SUBSYS_BACK_META 18 +#define LDAP_SUBSYS_BACK_MON 19 /* * debug reporting levels. @@ -125,27 +133,37 @@ LDAP_BEGIN_DECL } while ( 0 ) # endif -#ifndef LDAP_LOG -# define LDAP_LOG(a) lutil_log a -#endif - #else /* LDAP_DEBUG */ # define Debug( level, fmt, arg1, arg2, arg3 ) -#ifndef LDAP_LOG -# define LDAP_LOG(a) -#endif - #endif /* LDAP_DEBUG */ +#ifdef NEW_LOGGING +extern int ldap_loglevels[LDAP_SUBSYS_NUM]; +#define LDAP_LOG(a, b, fmt, arg1, arg2, arg3) do {\ + if (ldap_loglevels[LDAP_SUBSYS_##a] >= LDAP_LEVEL_##b || \ + ldap_loglevels[LDAP_SUBSYS_GLOBAL] >= LDAP_LEVEL_##b)\ + lutil_log (LDAP_SUBSYS_##a, LDAP_LEVEL_##b, fmt, arg1, arg2, arg3); \ + } while (0) + + +#define LDAP_LOGS_TEST(a, b) \ + (ldap_loglevels[LDAP_SUBSYS_##a] >= LDAP_LEVEL_##b || \ + ldap_loglevels[LDAP_SUBSYS_GLOBAL] >= LDAP_LEVEL_##b) + +#endif /* LDAP_LOG */ + +#ifndef LDAP_LOG +#define LDAP_LOG(a, b, fmt, arg1, arg2, arg3) +#endif LDAP_LUTIL_F(int) lutil_mnem2level LDAP_P(( const char *level )); LDAP_LUTIL_F(void) lutil_log_initialize LDAP_P(( int argc, char **argv )); -LDAP_LUTIL_F(void) lutil_set_debug_level LDAP_P(( +LDAP_LUTIL_F(int) lutil_set_debug_level LDAP_P(( const char *subsys, int level )); LDAP_LUTIL_F(void) lutil_log LDAP_P(( - const char *subsys, int level, const char *fmt, ... )); + const int subsys, int level, const char *fmt, ... )); LDAP_LUTIL_F(int) lutil_debug_file LDAP_P(( FILE *file )); diff --git a/libraries/liblber/Makefile.in b/libraries/liblber/Makefile.in index 4687775b07..416ac6cbf9 100644 --- a/libraries/liblber/Makefile.in +++ b/libraries/liblber/Makefile.in @@ -12,16 +12,16 @@ NT_OBJS = nt_err.lo LIB_DEFS = -DLBER_LIBRARY -SRCS= assert.c decode.c encode.c io.c bprint.c \ +SRCS= assert.c decode.c encode.c io.c bprint.c debug.c \ memory.c options.c sockbuf.c $(@PLAT@_SRCS) -OBJS= assert.lo decode.lo encode.lo io.lo bprint.lo \ +OBJS= assert.lo decode.lo encode.lo io.lo bprint.lo debug.lo\ memory.lo options.lo sockbuf.lo $(@PLAT@_OBJS) XSRCS= version.c PROGRAMS= dtest etest idtest -LDAP_INCDIR= ../../include -LDAP_LIBDIR= ../../libraries +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries XLIBS = $(LIBRARY) XXLIBS = diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index 89e9745ff5..e69bb496fa 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -643,8 +643,10 @@ ber_scanf ( BerElement *ber, fmt_reset = fmt; #ifdef NEW_LOGGING - LDAP_LOG(( "liblber", LDAP_LEVEL_ENTRY, "ber_scanf fmt (%s) ber:\n", fmt )); - BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 )); + 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 ); @@ -796,8 +798,8 @@ ber_scanf ( BerElement *ber, default: if( ber->ber_debug ) { #ifdef NEW_LOGGING - LDAP_LOG(( "liblber", LDAP_LEVEL_ERR, - "ber_scanf: unknown fmt %c\n", *fmt )); + 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 ); diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index 50eb6b5f92..fefad6d3ec 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -812,8 +812,8 @@ ber_printf( BerElement *ber, LDAP_CONST char *fmt, ... ) default: if( ber->ber_debug ) { #ifdef NEW_LOGGING - LDAP_LOG(( "liblber", LDAP_LEVEL_ERR, - "ber_printf: unknown fmt %c\n", *fmt )); + 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 ); diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 7003ec297b..4e3a1cebd8 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -33,6 +33,7 @@ #endif #include "lber-int.h" +#include "ldap_log.h" ber_slen_t ber_read( @@ -207,11 +208,14 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit ) if ( sb->sb_debug ) { #ifdef NEW_LOGGING - LDAP_LOG(( "liblber", LDAP_LEVEL_DETAIL1, + 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)" : "" )); - BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 )); + 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_ANY, sb->sb_debug, "ber_flush: %ld bytes to sd %ld%s\n", @@ -441,7 +445,7 @@ ber_get_next( assert( LBER_VALID( ber ) ); #ifdef NEW_LOGGING - LDAP_LOG(( "liblber", LDAP_LEVEL_ENTRY, "ber_get_next: enter\n" )); + 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" ); @@ -550,9 +554,9 @@ ber_get_next( return LBER_DEFAULT; } else if ( sb->sb_max_incoming && ber->ber_len > sb->sb_max_incoming ) { #ifdef NEW_LOGGING - LDAP_LOG(( "liblber", LDAP_LEVEL_ERR, + LDAP_LOG( BER, ERR, "ber_get_next: sockbuf_max_incoming limit hit " - "(%d > %d)\n", ber->ber_len, sb->sb_max_incoming )); + "(%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 limit hit " @@ -618,10 +622,11 @@ done: *len = ber->ber_len; if ( ber->ber_debug ) { #ifdef NEW_LOGGING - LDAP_LOG(( "liblber", LDAP_LEVEL_DETAIL1, - "ber_get_next: tag 0x%lx len %ld\n", - ber->ber_tag, ber->ber_len )); - BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 )); + 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", diff --git a/libraries/liblber/lber-int.h b/libraries/liblber/lber-int.h index 14f02ca555..1d6ad83ba3 100644 --- a/libraries/liblber/lber-int.h +++ b/libraries/liblber/lber-int.h @@ -38,16 +38,20 @@ struct lber_options { }; #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( diff --git a/libraries/libldap/abandon.c b/libraries/libldap/abandon.c index 70c2d97e73..a88a5865b5 100644 --- a/libraries/libldap/abandon.c +++ b/libraries/libldap/abandon.c @@ -58,7 +58,7 @@ ldap_abandon_ext( { int rc; #ifdef NEW_LOGGING - LDAP_LOG (( "abandon", LDAP_LEVEL_ARGS, "ldap_abandon_ext %d\n", msgid )); + 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 @@ -86,7 +86,7 @@ int ldap_abandon( LDAP *ld, int msgid ) { #ifdef NEW_LOGGING - LDAP_LOG (( "abandon", LDAP_LEVEL_ARGS, "ldap_abandon %d\n", msgid )); + LDAP_LOG ( OPERATION, ARGS, "ldap_abandon %d\n", msgid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_abandon %d\n", msgid, 0, 0 ); #endif @@ -110,8 +110,7 @@ do_abandon( LDAPRequest *lr; #ifdef NEW_LOGGING - LDAP_LOG (( "abandon", LDAP_LEVEL_ARGS, "do_abandon %d, msgid %d\n", - origid, msgid )); + 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 ); diff --git a/libraries/libldap/add.c b/libraries/libldap/add.c index 1ce57eba7f..20a987e977 100644 --- a/libraries/libldap/add.c +++ b/libraries/libldap/add.c @@ -100,7 +100,7 @@ ldap_add_ext( int i, rc; #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_ENTRY, "ldap_add_ext\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_add_ext\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_add_ext\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/bind.c b/libraries/libldap/bind.c index 076bd17976..4040da1804 100644 --- a/libraries/libldap/bind.c +++ b/libraries/libldap/bind.c @@ -42,7 +42,7 @@ #include #include "ldap-int.h" - +#include "ldap_log.h" /* * ldap_bind - bind to the ldap server (and X.500). The dn and password @@ -61,7 +61,7 @@ int ldap_bind( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd, int authmethod ) { #ifdef NEW_LOGGING - LDAP_LOG (( "bind", LDAP_LEVEL_ENTRY, "ldap_bind\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_bind\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_bind\n", 0, 0, 0 ); #endif @@ -110,7 +110,7 @@ ldap_bind_s( int authmethod ) { #ifdef NEW_LOGGING - LDAP_LOG (( "bind", LDAP_LEVEL_ENTRY, "ldap_bind_s\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_bind_s\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_bind_s\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/cache.c b/libraries/libldap/cache.c index 83e6e7953c..f071ab6255 100644 --- a/libraries/libldap/cache.c +++ b/libraries/libldap/cache.c @@ -118,7 +118,7 @@ ldap_flush_cache( LDAP *ld ) assert( LDAP_VALID( ld ) ); #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_ENTRY, "ldap_flush_cache\n" )); + LDAP_LOG ( CACHE, ENTRY, "ldap_flush_cache\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_flush_cache\n", 0, 0, 0 ); #endif @@ -154,9 +154,9 @@ ldap_uncache_request( LDAP *ld, int msgid ) #ifndef LDAP_NOCACHE #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_ARGS, - "ldap_uncache_request %d ld_cache %lx\n", - msgid, (long) ld->ld_cache )); + + LDAP_LOG ( CACHE, ARGS, "ldap_uncache_request %d ld_cache %lx\n", + msgid, (long) ld->ld_cache, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_uncache_request %d ld_cache %lx\n", msgid, (long) ld->ld_cache, 0 ); @@ -176,9 +176,9 @@ ldap_uncache_entry( LDAP *ld, LDAP_CONST char *dn ) #ifndef LDAP_NOCACHE #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_ARGS, - "ldap_uncache_entry %s ld_cache %lx\n", - dn, (long) ld->ld_cache )); + + LDAP_LOG ( CACHE, ARGS, "ldap_uncache_entry %s ld_cache %lx\n", + dn, (long) ld->ld_cache, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_uncache_entry %s ld_cache %lx\n", dn, (long) ld->ld_cache, 0 ); @@ -200,9 +200,10 @@ uncache_entry_or_req( LDAP *ld, LDAPMessage *m, *prev, *next; #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_ARGS, + + LDAP_LOG ( CACHE, ARGS, "uncache_entry_or_req dn %s msgid %ld ld_cache %lx\n", - dn, (long) msgid, (long) ld->ld_cache )); + dn, (long) msgid, (long) ld->ld_cache ); #else Debug( LDAP_DEBUG_TRACE, "ldap_uncache_entry_or_req dn %s msgid %ld ld_cache %lx\n", @@ -266,7 +267,7 @@ ldap_add_request_to_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request ) assert( LDAP_VALID( ld ) ); #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_ENTRY, "ldap_add_request_to_cache\n" )); + LDAP_LOG ( CACHE, ENTRY, "ldap_add_request_to_cache\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_add_request_to_cache\n", 0, 0, 0 ); #endif @@ -318,9 +319,10 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) assert( result != NULL ); #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_ARGS, + + LDAP_LOG ( CACHE, ARGS, "ldap_add_result_to_cache: id %ld, type %ld\n", - (long) result->lm_msgid, (long) result->lm_msgtype )); + (long) result->lm_msgid, (long) result->lm_msgtype, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_add_result_to_cache: id %ld, type %ld\n", (long) result->lm_msgid, (long) result->lm_msgtype, 0 ); @@ -329,8 +331,8 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) if ( ld->ld_cache == NULL || ( ld->ld_cache->lc_enabled == 0 )) { #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, - "ldap_add_result_to_cache: cache disabled\n" )); + LDAP_LOG ( CACHE, DETAIL1, + "ldap_add_result_to_cache: cache disabled\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "artc: cache disabled\n", 0, 0, 0 ); #endif @@ -345,9 +347,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) * only cache search and compare operations */ #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, - "ldap_add_result_to_cache: " - "only caching search & compare operations\n" )); + LDAP_LOG ( CACHE, DETAIL1, + "ldap_add_result_to_cache: only caching search & " + "compare operations\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "artc: only caching search & compare operations\n", 0, 0, 0 ); @@ -376,9 +378,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) new->lm_chain = NULL; m->lm_chain = new; #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, + LDAP_LOG ( CACHE, RESULTS, "ldap_add_result_to_cache: " - "result added to cache request chain\n" )); + "result added to cache request chain\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "artc: result added to cache request chain\n", @@ -418,9 +420,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) if ( !keep ) { #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, + LDAP_LOG ( CACHE, RESULTS, "ldap_add_result_to_cache: " - "not caching result with error\n" )); + "not caching result with error\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "artc: not caching result with error %d\n", @@ -436,9 +438,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) ld->ld_cache->lc_memused += msg_size( req ); check_cache_memused( ld->ld_cache ); #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, + LDAP_LOG ( CACHE, RESULTS, "ldap_add_result_to_cache: " - "cached result with error\n" )); + "cached result with error\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "artc: cached result with error %d\n", @@ -448,9 +450,8 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) } } else { #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, - "ldap_add_result_to_cache: " - "msgid not in request list\n" )); + LDAP_LOG ( CACHE, RESULTS, + "ldap_add_result_to_cache: msgid not in request list\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "artc: msgid not in request list\n", 0, 0, 0 ); @@ -481,7 +482,7 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request ) assert( request != NULL ); #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_ENTRY, "ldap_check_cache\n" )); + LDAP_LOG ( CACHE, ENTRY, "ldap_check_cache\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_check_cache\n", 0, 0, 0 ); #endif @@ -503,9 +504,9 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request ) hash = cache_hash( &reqber ); for ( m = ld->ld_cache->lc_buckets[ hash ]; m != NULL; m = next ) { #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( CACHE, DETAIL1, "ldap_check_cache: examining id %ld, type %ld\n", - (long) m->lm_msgid, (long) m->lm_msgtype )); + (long) m->lm_msgid, (long) m->lm_msgtype, 0 ); #else Debug( LDAP_DEBUG_TRACE,"cc: examining id %ld,type %ld\n", (long) m->lm_msgid, (long) m->lm_msgtype, 0 ); @@ -519,9 +520,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request ) prev->lm_next = next; } #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, - "ldap_check_cache: expired id %ld\n", - (long) m->lm_msgid )); + LDAP_LOG ( CACHE, DETAIL1, "ldap_check_cache: expired id %ld\n", + (long) m->lm_msgid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "cc: expired id %d\n", m->lm_msgid, 0, 0 ); @@ -562,9 +562,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request ) } prev = new; #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, - "ldap_check_cache: added type %ld\n", - (long) m->lm_msgtype )); + LDAP_LOG ( CACHE, DETAIL1, "ldap_check_cache: added type %ld\n", + (long) m->lm_msgtype, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "cc: added type %ld\n", (long) new->lm_msgtype, 0, 0 ); @@ -572,8 +571,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request ) } #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, - "ldap_check_cache: result returned from cache\n" )); + LDAP_LOG ( CACHE, RESULTS, + "ldap_check_cache: result returned from cache\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "cc: result returned from cache\n", 0, 0, 0 ); #endif @@ -603,9 +602,8 @@ cache_hash( BerElement *ber ) } #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_RESULTS, - "cache_hash: len is %ld, returning %ld\n", - len, len % LDAP_CACHE_BUCKETS )); + LDAP_LOG ( CACHE, RESULTS, "cache_hash: len is %ld, returning %ld\n", + len, len % LDAP_CACHE_BUCKETS, 0 ); #else Debug( LDAP_DEBUG_TRACE, "cache_hash: len is %ld, returning %ld\n", len, len % LDAP_CACHE_BUCKETS, 0 ); @@ -760,9 +758,9 @@ check_cache_memused( LDAPCache *lc ) LDAPMessage *m, *prev, *next; #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( CACHE, DETAIL1, "check_cache_memused: %ld bytes in use (%ld max)\n", - lc->lc_memused, lc->lc_maxmem )); + lc->lc_memused, lc->lc_maxmem, 0 ); #else Debug( LDAP_DEBUG_TRACE, "check_cache_memused: %ld bytes in use (%ld max)\n", lc->lc_memused, lc->lc_maxmem, 0 ); @@ -789,9 +787,8 @@ check_cache_memused( LDAPCache *lc ) } lc->lc_memused -= msg_size( m ); #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, - "check_cache_memused: removed %ld\n", - m->lm_msgid )); + LDAP_LOG ( CACHE, DETAIL1, + "check_cache_memused: removed %ld\n", m->lm_msgid,0,0 ); #else Debug( LDAP_DEBUG_TRACE, "ccm: removed %d\n", @@ -807,9 +804,9 @@ check_cache_memused( LDAPCache *lc ) } #ifdef NEW_LOGGING - LDAP_LOG (( "cache", LDAP_LEVEL_DETAIL1, - "check_cache_memused: reduced usage to %ld bytes\n", - lc->lc_memused )); + LDAP_LOG ( CACHE, DETAIL1, + "check_cache_memused: reduced usage to %ld bytes\n", + lc->lc_memused, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ccm: reduced usage to %ld bytes\n", lc->lc_memused, 0, 0 ); diff --git a/libraries/libldap/compare.c b/libraries/libldap/compare.c index 4af59d01b8..bb13bcc11f 100644 --- a/libraries/libldap/compare.c +++ b/libraries/libldap/compare.c @@ -29,6 +29,7 @@ #include #include "ldap-int.h" +#include "ldap_log.h" /* * ldap_compare_ext - perform an ldap extended compare operation. The dn @@ -55,7 +56,7 @@ ldap_compare_ext( BerElement *ber; #ifdef NEW_LOGGING - LDAP_LOG (( "compare", LDAP_LEVEL_ENTRY, "ldap_compare\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_compare\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_compare\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index f215b752e1..5310903c0e 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -361,7 +361,7 @@ Sockbuf_IO ldap_pvt_sockbuf_io_sasl = { int ldap_pvt_sasl_install( Sockbuf *sb, void *ctx_arg ) { #ifdef NEW_LOGGING - LDAP_LOG (( "cyrus", LDAP_LEVEL_ENTRY, "ldap_pvt_sasl_install\n" )); + 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 ); @@ -457,8 +457,8 @@ ldap_int_sasl_open( } #ifdef NEW_LOGGING - LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, - "ldap_int_sasl_open: host=%s\n", host )); + 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 ); @@ -479,8 +479,8 @@ ldap_int_sasl_open( (void *) &extprops ); #endif #ifdef NEW_LOGGING - LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, - "ldap_int_sasl_open: ssf=%ld\n", (long) ssf )); + LDAP_LOG ( TRANSPORT, DETAIL1, + "ldap_int_sasl_open: ssf=%ld\n", (long) ssf, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: ssf=%ld\n", (long) ssf, 0, 0 ); @@ -525,8 +525,8 @@ ldap_int_sasl_bind( ber_socket_t sd; #ifdef NEW_LOGGING - LDAP_LOG (( "cyrus", LDAP_LEVEL_ARGS, - "ldap_int_sasl_bind: %s\n", mechs ? mechs : "" )); + 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 ); @@ -637,9 +637,9 @@ ldap_int_sasl_bind( if( scred && scred->bv_len ) { /* and server provided us with data? */ #ifdef NEW_LOGGING - LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( TRANSPORT, DETAIL1, "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", - rc, saslrc, scred->bv_len )); + rc, saslrc, scred->bv_len ); #else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", @@ -655,9 +655,9 @@ ldap_int_sasl_bind( if( scred && scred->bv_len ) { /* but server provided us with data! */ #ifdef NEW_LOGGING - LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( TRANSPORT, DETAIL1, "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", - rc, saslrc, scred->bv_len )); + rc, saslrc, scred->bv_len ); #else Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", @@ -678,8 +678,8 @@ ldap_int_sasl_bind( &credlen ); #ifdef NEW_LOGGING - LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1, - "ldap_int_sasl_bind: sasl_client_step: %d\n", saslrc )); + 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 ); diff --git a/libraries/libldap/delete.c b/libraries/libldap/delete.c index c91e02e565..e930fc579b 100644 --- a/libraries/libldap/delete.c +++ b/libraries/libldap/delete.c @@ -49,7 +49,7 @@ ldap_delete_ext( BerElement *ber; #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_ENTRY, "ldap_delete_ext\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_delete_ext\n", 0,0,0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_delete_ext\n", 0, 0, 0 ); #endif @@ -139,7 +139,7 @@ ldap_delete( LDAP *ld, LDAP_CONST char *dn ) */ #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_ENTRY, "ldap_delete\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_delete\n", 0,0,0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_delete\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/error.c b/libraries/libldap/error.c index 3569887747..ca2b4268f4 100644 --- a/libraries/libldap/error.c +++ b/libraries/libldap/error.c @@ -147,7 +147,7 @@ ldap_err2string( int err ) const struct ldaperror *e; #ifdef NEW_LOGGING - LDAP_LOG (( "error", LDAP_LEVEL_ENTRY, "ldap_err2string\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_err2string\n", 0,0,0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_err2string\n", 0, 0, 0 ); #endif @@ -163,7 +163,7 @@ ldap_perror( LDAP *ld, LDAP_CONST char *str ) { const struct ldaperror *e; #ifdef NEW_LOGGING - LDAP_LOG (( "error", LDAP_LEVEL_ENTRY, "ldap_perror\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_perror\n", 0,0,0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_perror\n", 0, 0, 0 ); #endif @@ -243,7 +243,7 @@ ldap_parse_result( BerElement *ber; #ifdef NEW_LOGGING - LDAP_LOG (( "error", LDAP_LEVEL_ENTRY, "ldap_parse_result\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_result\n", 0,0,0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_parse_result\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/extended.c b/libraries/libldap/extended.c index b0a7ed691a..3789720d88 100644 --- a/libraries/libldap/extended.c +++ b/libraries/libldap/extended.c @@ -30,6 +30,7 @@ #include #include "ldap-int.h" +#include "ldap_log.h" int ldap_extended_operation( @@ -44,7 +45,7 @@ ldap_extended_operation( int rc; #ifdef NEW_LOGGING - LDAP_LOG (( "extended", LDAP_LEVEL_ENTRY, "ldap_extended_operation\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_extended_operation\n", 0,0,0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_extended_operation\n", 0, 0, 0 ); #endif @@ -117,7 +118,7 @@ ldap_extended_operation_s( LDAPMessage *res; #ifdef NEW_LOGGING - LDAP_LOG (( "extended", LDAP_LEVEL_ENTRY, "ldap_extended_operation_s\n" )); + 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 @@ -173,7 +174,7 @@ ldap_parse_extended_result ( assert( res != NULL ); #ifdef NEW_LOGGING - LDAP_LOG (( "extended", LDAP_LEVEL_ENTRY, "ldap_parse_extended_result\n" )); + 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 @@ -300,8 +301,7 @@ ldap_parse_extended_partial ( assert( res != NULL ); #ifdef NEW_LOGGING - LDAP_LOG (( "extended", LDAP_LEVEL_ENTRY, - "ldap_parse_extended_partial\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_extended_partial\n", 0,0,0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_parse_extended_partial\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/filter.c b/libraries/libldap/filter.c index 93a45cd75a..259c9a4590 100644 --- a/libraries/libldap/filter.c +++ b/libraries/libldap/filter.c @@ -357,8 +357,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) */ #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, "ldap_pvt_put_filter: \"%s\"\n", - str_in )); + 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 @@ -380,8 +379,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) switch ( *str ) { case '&': #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, - "ldap_pvt_put_filter: AND\n" )); + 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 ); @@ -399,8 +397,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) case '|': #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, - "ldap_pvt_put_filter: OR\n" )); + 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 ); @@ -418,8 +415,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) case '!': #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, - "ldap_pvt_put_filter: NOT\n" )); + 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 ); @@ -437,8 +433,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) default: #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, - "ldap_pvt_put_filter: simple\n" )); + 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 ); @@ -488,8 +483,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) case /*'('*/ ')': #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, - "ldap_pvt_put_filter: end\n" )); + 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 ); @@ -508,8 +502,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in ) default: /* assume it's a simple type=value filter */ #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, - "ldap_pvt_put_filter: default\n" )); + 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 ); @@ -542,8 +535,7 @@ put_filter_list( BerElement *ber, char *str, ber_tag_t tag ) char save; #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, - "put_filter_list \"%s\"\n", str )); + 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 ); @@ -587,8 +579,7 @@ put_simple_filter( int rc = -1; #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, - "put_simple_filter: \"%s\"\n", str )); + 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 ); @@ -759,8 +750,7 @@ put_substring_filter( BerElement *ber, char *type, char *val ) ber_tag_t ftype = LDAP_FILTER_SUBSTRINGS; #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, - "put_substring_filter \"%s=%s\"\n", type, val )); + 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 ); @@ -847,8 +837,8 @@ put_vrFilter( BerElement *ber, const char *str_in ) */ #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, "put_vrFilter: \"%s\"\n", - str_in )); + LDAP_LOG ( FILTER, ARGS, "ldap_pvt_put_vrFilter: \"%s\"\n", + str_in, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "put_vrFilter: \"%s\"\n", str_in, 0, 0 ); #endif @@ -892,8 +882,8 @@ put_vrFilter( BerElement *ber, const char *str_in ) default: #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, - "put_vrFilter: simple\n" )); + LDAP_LOG ( FILTER, DETAIL1, + "put_vrFilter: simple\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "put_vrFilter: simple\n", 0, 0, 0 ); @@ -943,8 +933,7 @@ put_vrFilter( BerElement *ber, const char *str_in ) case /*'('*/ ')': #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, - "ldap_pvt_put_filter: end\n" )); + 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 ); @@ -963,8 +952,8 @@ put_vrFilter( BerElement *ber, const char *str_in ) default: /* assume it's a simple type=value filter */ #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_DETAIL1, - "ldap_pvt_put_filter: default\n" )); + 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 ); @@ -1011,8 +1000,7 @@ put_vrFilter_list( BerElement *ber, char *str ) char save; #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, - "put_vrFilter_list \"%s\"\n", str )); + 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 ); @@ -1050,8 +1038,7 @@ put_simple_vrFilter( int rc = -1; #ifdef NEW_LOGGING - LDAP_LOG (( "filter", LDAP_LEVEL_ARGS, - "put_simple_vrFilter: \"%s\"\n", str )); + 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 ); diff --git a/libraries/libldap/getattr.c b/libraries/libldap/getattr.c index e5cd6e628d..91e37b2835 100644 --- a/libraries/libldap/getattr.c +++ b/libraries/libldap/getattr.c @@ -31,7 +31,7 @@ ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **berout ) BerElement *ber; #ifdef NEW_LOGGING - LDAP_LOG (( "getattr", LDAP_LEVEL_ENTRY, "ldap_first_attribute\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_first_attribute\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 ); #endif @@ -97,7 +97,7 @@ ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber ) char *attr; #ifdef NEW_LOGGING - LDAP_LOG (( "getattr", LDAP_LEVEL_ENTRY, "ldap_next_attribute\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_next_attribute\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index 43c1b4470b..781dca07af 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -85,7 +85,7 @@ ldap_get_dn( LDAP *ld, LDAPMessage *entry ) BerElement tmp; #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_get_dn\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_get_dn\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_get_dn\n", 0, 0, 0 ); #endif @@ -112,7 +112,7 @@ ldap_dn2ufn( LDAP_CONST char *dn ) char *out = NULL; #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_dn2ufn\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2ufn\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_dn2ufn\n", 0, 0, 0 ); #endif @@ -135,7 +135,7 @@ ldap_explode_dn( LDAP_CONST char *dn, int notypes ) unsigned flag = notypes ? LDAP_DN_FORMAT_UFN : LDAP_DN_FORMAT_LDAPV3; #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_explode_dn\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_explode_dn\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_explode_dn\n", 0, 0, 0 ); #endif @@ -179,7 +179,7 @@ ldap_explode_rdn( LDAP_CONST char *rdn, int notypes ) int iAVA; #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_explode_rdn\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_explode_rdn\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_explode_rdn\n", 0, 0, 0 ); #endif @@ -264,7 +264,7 @@ ldap_dn2dcedn( LDAP_CONST char *dn ) char *out = NULL; #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_dn2dcedn\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2dcedn\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_dn2dcedn\n", 0, 0, 0 ); #endif @@ -281,7 +281,7 @@ ldap_dcedn2dn( LDAP_CONST char *dce ) char *out = NULL; #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_dcedn2dn\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_dcedn2dn\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_dcedn2dn\n", 0, 0, 0 ); #endif @@ -297,7 +297,7 @@ ldap_dn2ad_canonical( LDAP_CONST char *dn ) char *out = NULL; #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_dn2ad_canonical\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2ad_canonical\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_dn2ad_canonical\n", 0, 0, 0 ); #endif @@ -333,7 +333,7 @@ ldap_dn_normalize( LDAP_CONST char *dnin, LDAPDN *tmpDN = NULL; #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_ENTRY, "ldap_dn_normalize\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_dn_normalize\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_dn_normalize\n", 0, 0, 0 ); #endif @@ -660,9 +660,8 @@ ldap_bv2dn( struct berval *bv, LDAPDN **dn, unsigned flags ) assert( dn ); #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_ARGS, "ldap_bv2dn(%s,%u)\n%s", - str, flags, "" )); -#elif 0 + LDAP_LOG ( OPERATION, ARGS, "ldap_bv2dn(%s,%u)\n%s", str, flags, "" ); +#else Debug( LDAP_DEBUG_TRACE, "=> ldap_bv2dn(%s,%u)\n%s", str, flags, "" ); #endif @@ -837,9 +836,9 @@ return_result:; } #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_RESULTS, "<= ldap_bv2dn(%s,%u)=%d\n", - str, flags, rc )); -#elif 0 + LDAP_LOG ( OPERATION, RESULTS, "<= ldap_bv2dn(%s,%u)=%d\n", + str, flags, rc ); +#else Debug( LDAP_DEBUG_TRACE, "<= ldap_bv2dn(%s,%u)=%d\n", str, flags, rc ); #endif *dn = newDN; @@ -2967,9 +2966,9 @@ int ldap_dn2bv( LDAPDN *dn, struct berval *bv, unsigned flags ) bv->bv_val = NULL; #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_ARGS, "=> ldap_dn2bv(%u)\n%s%s", - flags, "", "" )); -#elif 0 + LDAP_LOG ( OPERATION, ARGS, "=> ldap_dn2bv(%u)\n%s%s", + flags, "", "" ); +#else Debug( LDAP_DEBUG_TRACE, "=> ldap_dn2bv(%u)\n%s%s", flags, "", "" ); #endif @@ -3279,9 +3278,9 @@ int ldap_dn2bv( LDAPDN *dn, struct berval *bv, unsigned flags ) } #ifdef NEW_LOGGING - LDAP_LOG (( "getdn", LDAP_LEVEL_RESULTS, "<= ldap_dn2bv(%s,%u)=%d\n", - bv->bv_val, flags, rc )); -#elif 0 + LDAP_LOG ( OPERATION, RESULTS, "<= ldap_dn2bv(%s,%u)=%d\n", + bv->bv_val, flags, rc ); +#else Debug( LDAP_DEBUG_TRACE, "<= ldap_dn2bv(%s,%u)=%d\n", bv->bv_val, flags, rc ); #endif diff --git a/libraries/libldap/getfilter.c b/libraries/libldap/getfilter.c index d6f62f3255..d4d0d4452a 100644 --- a/libraries/libldap/getfilter.c +++ b/libraries/libldap/getfilter.c @@ -79,9 +79,9 @@ ldap_init_getfilter_buf( char *buf, ber_len_t buflen ) regerror(rc, &re, error, sizeof(error)); ldap_getfilter_free( lfdp ); #ifdef NEW_LOGGING - LDAP_LOG (( "getfilter", LDAP_LEVEL_ERR, - "ldap_init_get_filter_buf: bad regular expression %s, %s\n", - nextflp->lfl_pattern, error )); + LDAP_LOG ( FILTER, ERR, + "ldap_init_get_filter_buf: bad regular expression %s, %s\n", + nextflp->lfl_pattern, error, 0 ); #else Debug( LDAP_DEBUG_ANY, "ldap_init_get_filter_buf: " "bad regular expression %s, %s\n", diff --git a/libraries/libldap/getvalues.c b/libraries/libldap/getvalues.c index bbf16d8c41..34ee28da56 100644 --- a/libraries/libldap/getvalues.c +++ b/libraries/libldap/getvalues.c @@ -37,7 +37,7 @@ ldap_get_values( LDAP *ld, LDAPMessage *entry, LDAP_CONST char *target ) assert( target != NULL ); #ifdef NEW_LOGGING - LDAP_LOG (( "getvalues", LDAP_LEVEL_ENTRY, "ldap_get_values\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_get_values\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_get_values\n", 0, 0, 0 ); #endif @@ -98,7 +98,7 @@ ldap_get_values_len( LDAP *ld, LDAPMessage *entry, LDAP_CONST char *target ) assert( target != NULL ); #ifdef NEW_LOGGING - LDAP_LOG (( "getvalues", LDAP_LEVEL_ENTRY, "ldap_get_values_len\n" )); + 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 diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c index c6b6875982..e7d0648a1f 100644 --- a/libraries/libldap/init.c +++ b/libraries/libldap/init.c @@ -116,8 +116,8 @@ static void openldap_ldap_init_w_conf( } #ifdef NEW_LOGGING - LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, - "openldap_init_w_conf: trying %s\n", file )); + 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 @@ -129,8 +129,7 @@ static void openldap_ldap_init_w_conf( } #ifdef NEW_LOGGING - LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, - "openldap_init_w_conf: using %s\n", file )); + 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 @@ -262,8 +261,8 @@ static void openldap_ldap_init_w_userconf(const char *file) if (home != NULL) { #ifdef NEW_LOGGING - LDAP_LOG (( "init", LDAP_LEVEL_ARGS, - "openldap_init_w_userconf: HOME env is %s\n", home )); + 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); @@ -271,8 +270,8 @@ static void openldap_ldap_init_w_userconf(const char *file) path = LDAP_MALLOC(strlen(home) + strlen(file) + 3); } else { #ifdef NEW_LOGGING - LDAP_LOG (( "init", LDAP_LEVEL_ARGS, - "openldap_init_w_userconf: HOME env is NULL\n" )); + 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); @@ -555,9 +554,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl ) if( altfile != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( CONFIG, DETAIL1, "openldap_init_w_userconf: %sCONF env is %s\n", - LDAP_ENV_PREFIX, altfile )); + LDAP_ENV_PREFIX, altfile, 0 ); #else Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is %s\n", LDAP_ENV_PREFIX "CONF", altfile, 0); @@ -566,9 +565,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl ) } else #ifdef NEW_LOGGING - LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( CONFIG, DETAIL1, "openldap_init_w_userconf: %sCONF env is NULL\n", - LDAP_ENV_PREFIX )); + LDAP_ENV_PREFIX, 0, 0 ); #else Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is NULL\n", LDAP_ENV_PREFIX "CONF", 0, 0); @@ -580,9 +579,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl ) if( altfile != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( CONFIG, DETAIL1, "openldap_init_w_userconf: %sRC env is %s\n", - LDAP_ENV_PREFIX, altfile )); + LDAP_ENV_PREFIX, altfile, 0 ); #else Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is %s\n", LDAP_ENV_PREFIX "RC", altfile, 0); @@ -591,9 +590,9 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl ) } else #ifdef NEW_LOGGING - LDAP_LOG (( "init", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( CONFIG, DETAIL1, "openldap_init_w_userconf: %sRC env is NULL\n", - LDAP_ENV_PREFIX )); + LDAP_ENV_PREFIX, 0, 0 ); #else Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is NULL\n", LDAP_ENV_PREFIX "RC", 0, 0); diff --git a/libraries/libldap/kbind.c b/libraries/libldap/kbind.c index 372eb9fa00..eadf2ac72d 100644 --- a/libraries/libldap/kbind.c +++ b/libraries/libldap/kbind.c @@ -45,7 +45,6 @@ #include "ldap-int.h" - /* * ldap_kerberos_bind1 - initiate a bind to the ldap server using * kerberos authentication. The dn is supplied. It is assumed the user @@ -65,7 +64,7 @@ ldap_kerberos_bind1( LDAP *ld, LDAP_CONST char *dn ) ber_len_t credlen; #ifdef NEW_LOGGING - LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, "ldap_kerberos_bind1\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind1\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind1\n", 0, 0, 0 ); #endif @@ -119,7 +118,7 @@ ldap_kerberos_bind1_s( LDAP *ld, LDAP_CONST char *dn ) LDAPMessage *res; #ifdef NEW_LOGGING - LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, "ldap_kerberos_bind1_s\n" )); + 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 @@ -156,7 +155,7 @@ ldap_kerberos_bind2( LDAP *ld, LDAP_CONST char *dn ) ber_len_t credlen; #ifdef NEW_LOGGING - LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, "ldap_kerberos_bind2\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind2\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind2\n", 0, 0, 0 ); #endif @@ -205,7 +204,7 @@ ldap_kerberos_bind2_s( LDAP *ld, LDAP_CONST char *dn ) LDAPMessage *res; #ifdef NEW_LOGGING - LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, "ldap_kerberos_bind2_s\n" )); + 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 @@ -230,7 +229,7 @@ ldap_kerberos_bind_s( LDAP *ld, LDAP_CONST char *dn ) int err; #ifdef NEW_LOGGING - LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, "ldap_kerberos_bind_s\n" )); + 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 @@ -261,17 +260,16 @@ ldap_get_kerberosv4_credentials( char realm[REALM_SZ], *cred, *krbinstance; #ifdef NEW_LOGGING - LDAP_LOG (( "kbind", LDAP_LEVEL_ENTRY, - "ldap_get_kerberosv4_credentials\n" )); + 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 (( "kbind", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "ldap_get_kerberosv4_credentials: krb_get_tf_realm failed: %s\n", - krb_err_txt[err] )); + 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 ); @@ -293,9 +291,9 @@ ldap_get_kerberosv4_credentials( != KSUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "kbind", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "ldap_get_kerberosv4_credentials: krb_mk_req failed: %s\n", - krb_err_txt[err] )); + 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 ); diff --git a/libraries/libldap/modify.c b/libraries/libldap/modify.c index cf9f6ed573..f346064370 100644 --- a/libraries/libldap/modify.c +++ b/libraries/libldap/modify.c @@ -72,7 +72,7 @@ ldap_modify_ext( LDAP *ld, */ #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ENTRY, "ldap_modify_ext\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_modify_ext\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_modify_ext\n", 0, 0, 0 ); #endif @@ -160,7 +160,7 @@ ldap_modify( LDAP *ld, LDAP_CONST char *dn, LDAPMod **mods ) int rc, msgid; #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ENTRY, "ldap_modify\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_modify\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_modify\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/modrdn.c b/libraries/libldap/modrdn.c index 5603d6dbea..6907a22998 100644 --- a/libraries/libldap/modrdn.c +++ b/libraries/libldap/modrdn.c @@ -69,7 +69,7 @@ ldap_rename( int rc; #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ENTRY, "ldap_rename\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_rename\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_rename\n", 0, 0, 0 ); #endif @@ -156,7 +156,7 @@ ldap_rename2( int rc; #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ENTRY, "ldap_rename2\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_rename2\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_rename2\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 11a9b41331..8030790a94 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -23,6 +23,7 @@ #include #include "ldap-int.h" +#include "ldap_log.h" int ldap_open_defconn( LDAP *ld ) { @@ -55,8 +56,7 @@ ldap_open( LDAP_CONST char *host, int port ) LDAP *ld; #ifdef NEW_LOGGING - LDAP_LOG (( "open", LDAP_LEVEL_ARGS, "ldap_open(%s, %d)\n", - host, port )); + 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 ); @@ -75,8 +75,8 @@ ldap_open( LDAP_CONST char *host, int port ) } #ifdef NEW_LOGGING - LDAP_LOG (( "open", LDAP_LEVEL_RESULTS, "ldap_open: %s\n", - ld == NULL ? "succeeded" : "failed" )); + 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 ); @@ -107,7 +107,7 @@ ldap_create( LDAP **ldp ) } #ifdef NEW_LOGGING - LDAP_LOG (( "open", LDAP_LEVEL_ENTRY, "ldap_create\n" )); + LDAP_LOG ( CONNECTION, ENTRY, "ldap_create\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_create\n", 0, 0, 0 ); #endif @@ -240,7 +240,7 @@ ldap_int_open_connection( long addr; #ifdef NEW_LOGGING - LDAP_LOG (( "open", LDAP_LEVEL_ENTRY, "ldap_int_open_connection\n" )); + 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 diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 7412a58014..61f8a7c0ab 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -686,7 +686,7 @@ ldap_int_select( LDAP *ld, struct timeval *timeout ) struct selectinfo *sip; #ifdef NEW_LOGGING - LDAP_LOG (( "os-ip", LDAP_LEVEL_ENTRY, "ldap_int_select\n" )); + LDAP_LOG ( CONNECTION, ENTRY, "ldap_int_select\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_int_select\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 3c4d2347f7..b9ecd9b3bd 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -84,7 +84,7 @@ ldap_send_initial_request( int rc; #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_send_initial_request\n" )); + 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 @@ -99,8 +99,9 @@ ldap_send_initial_request( } #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, - "ldap_send_initial_request: ldap_open_defconn: successful\n" )); + 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", @@ -151,7 +152,7 @@ ldap_send_server_request( int incparent; #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_send_server_request\n" )); + 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 @@ -263,7 +264,7 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb, Sockbuf *sb = NULL; #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_new_connection\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_new_connection\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_new_connection\n", 0, 0, 0 ); #endif @@ -329,8 +330,9 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb, ld->ld_defconn = lc; #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, - "ldap_new_connection: Call application rebind_proc\n" )); + 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 @@ -354,8 +356,9 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb, ld->ld_defconn = lc; #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, - "ldap_new_connection: anonymous rebind via ldap_bind_s\n" )); + 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 @@ -422,7 +425,7 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) LDAPConn *tmplc, *prevlc; #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_free_connection\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_free_connection\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_free_connection\n", 0, 0, 0 ); #endif @@ -472,8 +475,8 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) } LDAP_FREE( lc ); #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_RESULTS, - "ldap_free_connection: actually freed\n" )); + 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 ); @@ -481,8 +484,8 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) } else { lc->lconn_lastused = time( NULL ); #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_RESULTS, - "ldap_free_connection: refcnt %d\n", lc->lconn_refcnt )); + 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 ); @@ -612,9 +615,8 @@ ldap_free_request( LDAP *ld, LDAPRequest *lr ) LDAPRequest **ttmplr; #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ARGS, - "ldap_free_request (origid %d, msgid %d)\n", - lr->lr_origid, lr->lr_msgid )); + 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 ); @@ -665,7 +667,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * *hadrefp = 0; #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_chase_v3referrals\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_chase_v3referrals\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_chase_v3referrals\n", 0, 0, 0 ); #endif @@ -682,9 +684,9 @@ 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 (( "request", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "ldap_chase_v3referrals: more than %d referral hops (dropping)\n", - ld->ld_refhoplimit )); + ld->ld_refhoplimit, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "more than %d referral hops (dropping)\n", ld->ld_refhoplimit, 0, 0 ); @@ -737,9 +739,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * * for the same server with different contexts. */ #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "ldap_chase_v3referrals: queue referral \"%s\"\n", - refarray[i] )); + refarray[i], 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_chase_v3referrals: queue referral \"%s\"\n", @@ -807,9 +809,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * } #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "ldap_chase_v3referrals: msgid %d, url \"%s\"\n", - lr->lr_msgid, refarray[i] )); + lr->lr_msgid, refarray[i], 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_chase_v3referral: msgid %d, url \"%s\"\n", @@ -823,9 +825,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char * origreq, srv, NULL, &rinfo )) < 0 ) { /* Failure, try next referral in the list */ #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "ldap_chase_v3referrals: Unable to chase referral \"%s\" (%s)\n", - refarray[i], ldap_err2string( ld->ld_errno ) )); + 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); @@ -908,7 +910,7 @@ ldap_chase_referrals( LDAP *ld, LDAPreqinfo rinfo; #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, "ldap_chase_referrals\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_chase_referrals\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_chase_referrals\n", 0, 0, 0 ); #endif @@ -935,9 +937,9 @@ ldap_chase_referrals( LDAP *ld, if ( lr->lr_parentcnt >= ld->ld_refhoplimit ) { #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ENTRY, + LDAP_LOG ( OPERATION, ENTRY, "ldap_chase_referrals: more than %d referral hops (dropping)\n", - ld->ld_refhoplimit )); + ld->ld_refhoplimit, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "more than %d referral hops (dropping)\n", @@ -968,9 +970,9 @@ ldap_chase_referrals( LDAP *ld, if ( rc != LDAP_URL_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "ldap_chase_referrals: ignoring unknown referral <%s>\n", - ref )); + ref, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ignoring unknown referral <%s>\n", ref, 0, 0 ); @@ -986,8 +988,8 @@ ldap_chase_referrals( LDAP *ld, } #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, - "ldap_chase_referrals: chasing LDAP referral <%s>\n", ref )); + 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 ); @@ -1016,9 +1018,9 @@ ldap_chase_referrals( LDAP *ld, ++count; } else { #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "ldap_chase_referrals: Unable to chase referral <%s>\n", - ldap_err2string( ld->ld_errno) )); + ldap_err2string( ld->ld_errno), 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Unable to chase referral (%s)\n", @@ -1091,10 +1093,10 @@ re_encode_request( LDAP *ld, char *dn; #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_ARGS, + 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 )); + ( 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", @@ -1192,8 +1194,8 @@ re_encode_request( LDAP *ld, #ifdef LDAP_DEBUG if ( ldap_debug & LDAP_DEBUG_PACKETS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "request", LDAP_LEVEL_DETAIL1, - "re_encode_request: new request is:\n" )); + 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 ); diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index a1ee317cf6..1a7bcec9ef 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -53,7 +53,7 @@ #include #include "ldap-int.h" - +#include "ldap_log.h" static int ldap_abandoned LDAP_P(( LDAP *ld, ber_int_t msgid )); static int ldap_mark_abandoned LDAP_P(( LDAP *ld, ber_int_t msgid )); @@ -98,7 +98,7 @@ ldap_result( assert( result != NULL ); #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_ARGS, "ldap_result msgid %d\n", msgid )); + 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 @@ -129,8 +129,8 @@ chkResponseList( */ #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_ARGS, - "ldap_chkResponseList for msgid=%d, all=%d\n", msgid, all )); + 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", @@ -142,8 +142,8 @@ chkResponseList( if ( ldap_abandoned( ld, lm->lm_msgid ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, - "ldap_chkResponseList msg abandoned, msgid %d\n", msgid )); + 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", @@ -207,17 +207,17 @@ chkResponseList( #ifdef LDAP_DEBUG if( lm == NULL) { #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_RESULTS, - "ldap_chkResponseList returns NULL\n" )); + 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 (( "result", LDAP_LEVEL_RESULTS, - "ldap_chkResponseList returns msgid %d, type 0x02lu\n", - lm->lm_msgid, (unsigned long) lm->lm_msgtype )); + 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", @@ -248,17 +248,17 @@ wait4msg( #ifdef LDAP_DEBUG if ( timeout == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_ARGS, - "wait4msg (infinite timeout), msgid %d\n", msgid )); + 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 (( "result", LDAP_LEVEL_ARGS, + LDAP_LOG ( OPERATION, ARGS, "wait4msg (timeout %ld sec, %ld usec), msgid %d\n", - (long) timeout->tv_sec, (long) timeout->tv_usec, msgid )); + (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 ); @@ -278,8 +278,8 @@ wait4msg( while ( rc == -2 ) { #ifdef LDAP_DEBUG #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_ARGS, - "wait4msg continue, msgid %d, all %d\n", msgid, all )); + 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 ); @@ -310,9 +310,9 @@ wait4msg( #ifdef LDAP_DEBUG if ( rc == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_ARGS, + LDAP_LOG ( OPERATION, ARGS, "wait4msg: ldap_int_select returned -1: errno %d\n", - errno )); + errno, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_int_select returned -1: errno %d\n", @@ -358,8 +358,8 @@ wait4msg( } #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, - "wait4msg: %ld secs to go\n", (long) tv.tv_sec )); + 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 ); @@ -401,8 +401,7 @@ try_read1msg( assert( lc != NULL ); #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_ARGS, "read1msg: msgid %d, all %d\n", - msgid, all )); + 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 @@ -431,8 +430,8 @@ try_read1msg( if ( tag == LBER_DEFAULT) { #ifdef LDAP_DEBUG #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, - "read1msg: ber_get_next failed\n" )); + 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 ); @@ -468,8 +467,7 @@ try_read1msg( if ( ldap_abandoned( ld, id ) ) { ber_free( ber, 1 ); #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, - "read1msg: abandoned\n" )); + LDAP_LOG ( OPERATION, DETAIL1, "read1msg: abandoned\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "abandoned\n", 0, 0, 0); #endif @@ -478,9 +476,9 @@ try_read1msg( if (( lr = ldap_find_request_by_msgid( ld, id )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "read1msg: no request for response with msgid %ld (tossing)\n", - (long) id )); + (long) id, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "no request for response with msgid %ld (tossing)\n", @@ -503,10 +501,10 @@ try_read1msg( } #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, + 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 )); + (long) lr->lr_msgid, (long) lr->lr_origid ); #else Debug( LDAP_DEBUG_TRACE, "ldap_read: message type %s msgid %ld, original id %ld\n", @@ -548,10 +546,10 @@ try_read1msg( if( lr->lr_status != LDAP_REQST_COMPLETED) { lr->lr_status = LDAP_REQST_CHASINGREFS; #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "read1msg: search ref chased," "mark request chasing refs, id = %d\n", - lr->lr_msgid )); + lr->lr_msgid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "read1msg: search ref chased, mark request chasing refs, id = %d\n", @@ -581,10 +579,10 @@ try_read1msg( rc = LDAP_DECODING_ERROR; lr->lr_status = LDAP_REQST_COMPLETED; #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "read1msg: referral decode error," "mark request completed, id = %d\n", - lr->lr_msgid )); + lr->lr_msgid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "read1msg: referral decode error, mark request completed, id = %d\n", @@ -598,10 +596,10 @@ try_read1msg( 0, &lr->lr_res_error, &hadref ); lr->lr_status = LDAP_REQST_COMPLETED; #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "read1msg: referral chased," "mark request completed, id = %d\n", - lr->lr_msgid )); + lr->lr_msgid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "read1msg: referral chased, mark request completed, id = %d\n", @@ -654,10 +652,10 @@ try_read1msg( &lr->lr_res_error, -1, &hadref ); lr->lr_status = LDAP_REQST_COMPLETED; #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "read1msg: V2 referral chased," "mark request completed, id = %d\n", - lr->lr_msgid )); + 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); @@ -675,10 +673,10 @@ try_read1msg( lr->lr_res_errno = LDAP_PARTIAL_RESULTS; } #ifdef NEW_LOGGING -LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, +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 : "" )); + 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", @@ -689,8 +687,8 @@ Debug( LDAP_DEBUG_TRACE, } #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, - "read1msg: %d new referrals\n", refer_cnt )); + 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 ); @@ -715,8 +713,9 @@ Debug( LDAP_DEBUG_TRACE, lr->lr_status = LDAP_REQST_COMPLETED; /* declare this request done */ #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, - "read1msg: mark request completed, id = %d\n", lr->lr_msgid )); + 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); @@ -745,12 +744,12 @@ Debug( LDAP_DEBUG_TRACE, id = lr->lr_msgid; tag = lr->lr_res_msgtype; #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, - "read1msg: request %ld done\n", (long) id )); - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, + 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 : "" )); + lr->lr_res_matched ? lr->lr_res_matched : "" ); #else Debug( LDAP_DEBUG_ANY, "request %ld done\n", (long) id, 0, 0 ); @@ -838,9 +837,9 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); } #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "read1msg: adding response id %ld type %ld\n", - (long) new->lm_msgid, (long) new->lm_msgtype )); + (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 ); @@ -964,12 +963,12 @@ merge_error_info( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr ) } #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_DETAIL1, - "read1msg: merged parent (id %d) error info: result errno %d, " - "error <%s>, matched <%s>\n", parentr->lr_msgid, + 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 : "" )); + parentr->lr_res_matched : "" ); #else Debug( LDAP_DEBUG_TRACE, "merged parent (id %d) error info: ", parentr->lr_msgid, 0, 0 ); @@ -1024,7 +1023,7 @@ ldap_msgfree( LDAPMessage *lm ) int type = 0; #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_ENTRY, "ldap_msgfree\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_msgfree\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_msgfree\n", 0, 0, 0 ); #endif @@ -1052,7 +1051,7 @@ ldap_msgdelete( LDAP *ld, int msgid ) assert( ld != NULL ); #ifdef NEW_LOGGING - LDAP_LOG (( "result", LDAP_LEVEL_ENTRY, "ldap_msgdelete\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_msgdelete\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_msgdelete\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/sasl.c b/libraries/libldap/sasl.c index 0164bc962f..e5c64921d5 100644 --- a/libraries/libldap/sasl.c +++ b/libraries/libldap/sasl.c @@ -62,7 +62,7 @@ ldap_sasl_bind( int rc; #ifdef NEW_LOGGING - LDAP_LOG (( "sasl", LDAP_LEVEL_ENTRY, "ldap_sasl_bind\n" )); + LDAP_LOG ( TRANSPORT, ENTRY, "ldap_sasl_bind\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_sasl_bind\n", 0, 0, 0 ); #endif @@ -169,7 +169,7 @@ ldap_sasl_bind_s( struct berval *scredp = NULL; #ifdef NEW_LOGGING - LDAP_LOG (( "sasl", LDAP_LEVEL_ENTRY, "ldap_sasl_bind_s\n" )); + 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 @@ -255,7 +255,7 @@ ldap_parse_sasl_bind_result( BerElement *ber; #ifdef NEW_LOGGING - LDAP_LOG (( "sasl", LDAP_LEVEL_ENTRY, "ldap_parse_sasl_bind_result\n" )); + 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 @@ -368,7 +368,7 @@ ldap_pvt_sasl_getmechs ( LDAP *ld, char **pmechlist ) int rc; #ifdef NEW_LOGGING - LDAP_LOG (( "sasl", LDAP_LEVEL_ENTRY, "ldap_pvt_sasl_getmech\n" )); + 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 @@ -456,8 +456,9 @@ ldap_sasl_interactive_bind_s( } #ifdef NEW_LOGGING - LDAP_LOG (( "sasl", LDAP_LEVEL_DETAIL1, - "ldap_interactive_sasl_bind_s: server supports: %s\n", smechs )); + LDAP_LOG ( TRANSPORT, DETAIL1, + "ldap_interactive_sasl_bind_s: server supports: %s\n", + smechs, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_interactive_sasl_bind_s: server supports: %s\n", @@ -468,8 +469,8 @@ ldap_sasl_interactive_bind_s( } else { #ifdef NEW_LOGGING - LDAP_LOG (( "sasl", LDAP_LEVEL_DETAIL1, - "ldap_interactive_sasl_bind_s: user selected: %s\n", mechs )); + LDAP_LOG ( TRANSPORT, DETAIL1, + "ldap_interactive_sasl_bind_s: user selected: %s\n", mechs, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_interactive_sasl_bind_s: user selected: %s\n", diff --git a/libraries/libldap/sbind.c b/libraries/libldap/sbind.c index eb8aaed4bd..1d016bbf92 100644 --- a/libraries/libldap/sbind.c +++ b/libraries/libldap/sbind.c @@ -41,7 +41,6 @@ #include "ldap-int.h" - /* * ldap_simple_bind - bind to the ldap server (and X.500). The dn and * password of the entry to which to bind are supplied. The message id @@ -63,7 +62,7 @@ ldap_simple_bind( struct berval cred; #ifdef NEW_LOGGING - LDAP_LOG (( "sbind", LDAP_LEVEL_ENTRY, "ldap_simple_bind\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_simple_bind\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_simple_bind\n", 0, 0, 0 ); #endif @@ -102,7 +101,7 @@ ldap_simple_bind_s( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd ) struct berval cred; #ifdef NEW_LOGGING - LDAP_LOG (( "sbind", LDAP_LEVEL_ENTRY, "ldap_simple_bind_s\n" )); + 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 diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index c0bc46df78..2817e65082 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -21,7 +21,7 @@ #include #include "ldap-int.h" - +#include "ldap_log.h" /* * ldap_search_ext - initiate an ldap search operation. @@ -62,7 +62,7 @@ ldap_search_ext( int timelimit; #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_ENTRY, "ldap_search_ext\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_search_ext\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_search_ext\n", 0, 0, 0 ); #endif @@ -184,7 +184,7 @@ ldap_search( BerElement *ber; #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_ENTRY, "ldap_search\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_search\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_search\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index f7f27bce46..7b87c247bb 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -180,9 +180,9 @@ ldap_pvt_tls_init_def_ctx( void ) tls_def_ctx = SSL_CTX_new( SSLv23_method() ); if ( tls_def_ctx == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: " + LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: " "TLS could not allocate default ctx (%d).\n", - ERR_peek_error() )); + ERR_peek_error(), 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "TLS: could not allocate default ctx (%lu).\n", @@ -195,9 +195,9 @@ ldap_pvt_tls_init_def_ctx( void ) !SSL_CTX_set_cipher_list( tls_def_ctx, tls_opt_ciphersuite ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: " + LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: " "TLS could not set cipher list %s.\n", - tls_opt_ciphersuite )); + tls_opt_ciphersuite, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "TLS: could not set cipher list %s.\n", @@ -213,12 +213,12 @@ ldap_pvt_tls_init_def_ctx( void ) !SSL_CTX_set_default_verify_paths( tls_def_ctx ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, + 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 : "" )); + tls_opt_cacertdir ? tls_opt_cacertdir : "", 0 ); #else Debug( LDAP_DEBUG_ANY, "TLS: " "could not load verify locations (file:`%s',dir:`%s').\n", @@ -233,10 +233,10 @@ ldap_pvt_tls_init_def_ctx( void ) calist = get_ca_list( tls_opt_cacertfile, tls_opt_cacertdir ); if ( !calist ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: " + 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 : "" )); + tls_opt_cacertdir ? tls_opt_cacertdir : "", 0 ); #else Debug( LDAP_DEBUG_ANY, "TLS: " "could not load client CA list (file:`%s',dir:`%s').\n", @@ -256,8 +256,8 @@ ldap_pvt_tls_init_def_ctx( void ) tls_opt_keyfile, SSL_FILETYPE_PEM ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: " - "TLS could not use key file `%s'.\n", tls_opt_keyfile )); + 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", @@ -272,8 +272,9 @@ ldap_pvt_tls_init_def_ctx( void ) tls_opt_certfile, SSL_FILETYPE_PEM ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: " - "TLS could not use certificate `%s'.\n", tls_opt_certfile )); + 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", @@ -287,8 +288,9 @@ ldap_pvt_tls_init_def_ctx( void ) !SSL_CTX_check_private_key( tls_def_ctx ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_init_def_ctx: " - "TLS private key mismatch.\n" )); + 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", @@ -397,8 +399,8 @@ alloc_handle( void *ctx_arg ) ssl = SSL_new( ctx ); if ( ssl == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "alloc_handle: " - "TLS can't create ssl handle.\n" )); + 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 @@ -739,8 +741,8 @@ ldap_int_tls_connect( LDAP *ld, LDAPConn *conn ) } #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_int_tls_connect: " - "TLS can't connect.\n" )); + 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 @@ -791,8 +793,8 @@ ldap_pvt_tls_accept( Sockbuf *sb, void *ctx_arg ) if ( update_flags( sb, ssl, err )) return 1; #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_accept: " - "TLS can't accept.\n" )); + 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 @@ -929,8 +931,9 @@ ldap_pvt_tls_check_hostname( void *s, const char *name_in ) x = tls_get_cert((SSL *)s); if (!x) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_check_hostname: " - "TLS unable to get peer certificate.\n" )); + 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", @@ -1006,8 +1009,9 @@ ldap_pvt_tls_check_hostname( void *s, const char *name_in ) buf, sizeof(buf)) == -1) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_check_hostname: " - "TLS unable to get common name from peer certificate.\n" )); + 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", @@ -1016,9 +1020,9 @@ ldap_pvt_tls_check_hostname( void *s, const char *name_in ) } else if (strcasecmp(name, buf)) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "ldap_pvt_tls_check_hostname: " + LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_check_hostname: " "TLS hostname (%s) does not match " - "common name in certificate (%s).\n", name, buf )); + "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", @@ -1344,8 +1348,8 @@ tls_info_cb( SSL *ssl, int where, int ret ) if ( where & SSL_CB_LOOP ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_DETAIL1, "tls_info_cb: " - "TLS trace: %s:%s\n", op, SSL_state_string_long( ssl ) )); + LDAP_LOG ( TRANSPORT, DETAIL1, "tls_info_cb: " + "TLS trace: %s:%s\n", op, SSL_state_string_long( ssl ), 0 ); #else Debug( LDAP_DEBUG_TRACE, "TLS trace: %s:%s\n", @@ -1355,10 +1359,10 @@ tls_info_cb( SSL *ssl, int where, int ret ) } else if ( where & SSL_CB_ALERT ) { op = ( where & SSL_CB_READ ) ? "read" : "write"; #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_DETAIL1, "tls_info_cb: " - "TLS trace: SSL3 alert %s:%s:%s\n", op, - SSL_alert_type_string_long( ret ), - SSL_alert_desc_string_long( ret) )); + LDAP_LOG ( TRANSPORT, DETAIL1, + "tls_info_cb: TLS trace: SSL3 alert %s:%s:%s\n", + op, SSL_alert_type_string_long( ret ), + SSL_alert_desc_string_long( ret) ); #else Debug( LDAP_DEBUG_TRACE, "TLS trace: SSL3 alert %s:%s:%s\n", @@ -1370,8 +1374,9 @@ tls_info_cb( SSL *ssl, int where, int ret ) } else if ( where & SSL_CB_EXIT ) { if ( ret == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "tls_info_cb: " - "TLS trace: %s:failed in %s\n", op, SSL_state_string_long( ssl ) )); + LDAP_LOG ( TRANSPORT, ERR, + "tls_info_cb: TLS trace: %s:failed in %s\n", + op, SSL_state_string_long( ssl ), 0 ); #else Debug( LDAP_DEBUG_TRACE, "TLS trace: %s:failed in %s\n", @@ -1379,8 +1384,9 @@ tls_info_cb( SSL *ssl, int where, int ret ) #endif } else if ( ret < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "tls_info_cb: " - "TLS trace: %s:error in %s\n", op, SSL_state_string_long( ssl ) )); + LDAP_LOG ( TRANSPORT, ERR, + "tls_info_cb: TLS trace: %s:error in %s\n", + op, SSL_state_string_long( ssl ), 0 ); #else Debug( LDAP_DEBUG_TRACE, "TLS trace: %s:error in %s\n", @@ -1415,13 +1421,15 @@ tls_verify_cb( int ok, X509_STORE_CTX *ctx ) sname = X509_NAME_oneline( subject, NULL, 0 ); iname = X509_NAME_oneline( issuer, NULL, 0 ); #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, "tls_verify_cb" - "TLS certificate verification: depth: %d, err: %d: " - "subject: %s, issuer: %s\n", errdepth, errnum, - sname ? sname : "-unknown-", iname ? iname : "-unknown-" )); + 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 (( "tls", LDAP_LEVEL_ERR, "TLS certificate verification: Error, %s\n", - X509_verify_cert_error_string(errnum))); + LDAP_LOG ( TRANSPORT, ERR, + "TLS certificate verification: Error, %s\n", + X509_verify_cert_error_string(errnum), 0, 0 ); } #else Debug( LDAP_DEBUG_TRACE, @@ -1461,9 +1469,9 @@ tls_report_error( void ) while ( ( l = ERR_get_error_line( &file, &line ) ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, + LDAP_LOG ( TRANSPORT, ERR, "tls_report_error: TLS %s %s:%d\n", - ERR_error_string( l, buf ), file, line )); + ERR_error_string( l, buf ), file, line ); #else Debug( LDAP_DEBUG_ANY, "TLS: %s %s:%d\n", ERR_error_string( l, buf ), file, line ); @@ -1482,9 +1490,9 @@ tls_tmp_rsa_cb( SSL *ssl, int is_export, int key_length ) if ( !tmp_rsa ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_ERR, - "tls_tmp_rsa_cb: TLS Failed to generate temporary %d-bit %s RSA key\n", - key_length, is_export ? "export" : "domestic" )); + 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", @@ -1518,9 +1526,9 @@ tls_seed_PRNG( const char *randfile ) if (randfile == NULL) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( TRANSPORT, DETAIL1, "tls_seed_PRNG: TLS Use configuration file or " - "$RANDFILE to define seed PRNG\n" )); + "$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", @@ -1533,8 +1541,9 @@ tls_seed_PRNG( const char *randfile ) if (RAND_status() == 0) { #ifdef NEW_LOGGING - LDAP_LOG (( "tls", LDAP_LEVEL_DETAIL1, - "tls_seed_PRNG: TLS PRNG not been seeded with enough data\n" )); + 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", diff --git a/libraries/libldap/unbind.c b/libraries/libldap/unbind.c index 4474920bf7..45b77f6528 100644 --- a/libraries/libldap/unbind.c +++ b/libraries/libldap/unbind.c @@ -59,7 +59,7 @@ int ldap_unbind( LDAP *ld ) { #ifdef NEW_LOGGING - LDAP_LOG (( "unbind", LDAP_LEVEL_ENTRY, "ldap_unbind\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_unbind\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_unbind\n", 0, 0, 0 ); #endif @@ -181,7 +181,7 @@ ldap_send_unbind( BerElement *ber; #ifdef NEW_LOGGING - LDAP_LOG (( "unbind", LDAP_LEVEL_ENTRY, "ldap_send_unbind\n" )); + LDAP_LOG ( OPERATION, ENTRY, "ldap_send_unbind\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldap_send_unbind\n", 0, 0, 0 ); #endif diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index e7985dae6b..6b9e756cd3 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -34,7 +34,6 @@ #include "ldap-int.h" - /* local functions */ static const char* skip_url_prefix LDAP_P(( const char *url, @@ -446,7 +445,7 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) * the options and cause infinite recursion */ #ifdef NEW_LOGGING - LDAP_LOG (( "url", LDAP_LEVEL_ENTRY, "ldap_url_parse_ext(%s)\n", url_in )); + 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 diff --git a/libraries/liblutil/Makefile.in b/libraries/liblutil/Makefile.in index 908fbd7b51..ba9f3ec5e7 100644 --- a/libraries/liblutil/Makefile.in +++ b/libraries/liblutil/Makefile.in @@ -13,11 +13,11 @@ NT_OBJS = ntservice.o slapdmsg.res UNIX_SRCS = detach.c UNIX_OBJS = detach.o -SRCS = base64.c csn.c debug.c entropy.c sasl.c signal.c hash.c \ +SRCS = base64.c csn.c entropy.c sasl.c signal.c hash.c \ md5.c passwd.c sha1.c getpass.c lockf.c utils.c uuid.c sockpair.c \ @LIBSRCS@ $(@PLAT@_SRCS) -OBJS = base64.o csn.o debug.o entropy.o sasl.o signal.o hash.o \ +OBJS = base64.o csn.o entropy.o sasl.o signal.o hash.o \ md5.o passwd.o sha1.o getpass.o lockf.o utils.o uuid.o sockpair.o \ @LIBOBJS@ $(@PLAT@_OBJS) diff --git a/libraries/liblutil/debug.c b/libraries/liblutil/debug.c index 1d47361d8e..4cc883f104 100644 --- a/libraries/liblutil/debug.c +++ b/libraries/liblutil/debug.c @@ -12,6 +12,7 @@ #include #include #include +#include #ifdef LDAP_SYSLOG #include @@ -27,7 +28,7 @@ struct DEBUGLEVEL int level; }; -static struct DEBUGLEVEL **levelArray; +int ldap_loglevels[LDAP_SUBSYS_NUM]; static long numLevels = 0; static FILE *log_file = NULL; @@ -56,6 +57,39 @@ static char *lutil_levels[] = {"emergency", "alert", "critical", "results", "detail1", "detail2", NULL}; +static char *lutil_subsys[LDAP_SUBSYS_NUM] = {"global","operation", "transport", + "connection", "filter", "ber", + "config", "acl", "cache", "index", + "ldif", "tools", "slapd", "slurpd", + "backend", "back_bdb", "back_ldbm", + "back_ldap", "back_meta", "back_mon" }; + +int lutil_mnem2subsys( const char *subsys ) +{ + int i; + for( i = 0; i < LDAP_SUBSYS_NUM; i++ ) + { + if ( !strcasecmp( subsys, lutil_subsys[i] ) ) + { + return i; + } + } + return 0; +} + +void lutil_set_all_backends( level ) +{ + int i; + + for( i = 0; i < LDAP_SUBSYS_NUM; i++ ) + { + if ( !strncasecmp( "back_", lutil_subsys[i], strlen("back_") ) ) + { + ldap_loglevels[i] = level; + } + } +} + int lutil_mnem2level( const char *level ) { int i; @@ -71,36 +105,15 @@ int lutil_mnem2level( const char *level ) static void addSubsys( const char *subsys, int level ) { - int i, j; - - if ( !strcasecmp( subsys, "global") ) global_level = level; + int i, j, subsys_num; - for( i = 0; i < numLevels; i++ ) - { - if ( levelArray[i] == NULL ) - { - levelArray[i] = (struct DEBUGLEVEL*)ber_memalloc( sizeof( struct DEBUGLEVEL ) ); - levelArray[i]->subsystem = (char*)ber_memalloc( strlen( subsys ) + 1 ); - strcpy ( levelArray[i]->subsystem, subsys ); - levelArray[i]->level = level; - return; - } - if( !strcasecmp( subsys, levelArray[i]->subsystem ) ) - { - levelArray[i]->level = level; - return; - } - } - levelArray = (struct DEBUGLEVEL**)ber_memrealloc( levelArray, sizeof( struct DEBUGLEVEL* ) * (numLevels + 10) ); - for( j = numLevels; j < (numLevels + 10); j++ ) + if ( !strcasecmp( subsys, "backend" ) ) + lutil_set_all_backends( level ); + else { - levelArray[j] = NULL; + subsys_num = lutil_mnem2subsys(subsys); + ldap_loglevels[subsys_num] = level; } - numLevels += 10; - levelArray[i] = (struct DEBUGLEVEL*)ber_memalloc( sizeof( struct DEBUGLEVEL ) ); - levelArray[i]->subsystem = (char*)ber_memalloc( strlen( subsys ) + 1 ); - strcpy( levelArray[i]->subsystem, subsys ); - levelArray[i]->level = level; return; } @@ -127,27 +140,14 @@ void lutil_log_int( struct tm *today; #endif int i; + char data[4096]; + char * t_subsys; + char * tmp; - if ( levelArray == NULL ) return; /* logging isn't set up */ - - /* - * Look for the subsystem in the level array. When we find it, - * break out of the loop. - */ - for( i = 0; i < numLevels; i++ ) { - if ( levelArray[i] == NULL ) break; - if ( ! strcasecmp( levelArray[i]->subsystem, subsys ) ) break; - } - - /* - * If we didn't find the subsystem, or the set level is less than - * the requested output level, don't output it. - */ - if ( (level > global_level) && - ((i > numLevels ) || (levelArray[i] == NULL) || ( level > levelArray[i]->level )) ) - { - return; - } + t_subsys = strdup(subsys); + + for(tmp = t_subsys, i = 0; i < strlen(t_subsys); i++, tmp++) + *tmp = TOUPPER( (unsigned char) *tmp ); #ifdef LDAP_SYSLOG /* we're configured to use syslog */ @@ -198,7 +198,10 @@ void lutil_log_int( /* * format the output data. */ + + fprintf(file, "\n%s:: ", t_subsys ); vfprintf( file, fmt, vl ); + fflush( file ); } /* @@ -206,13 +209,13 @@ void lutil_log_int( * level of the log output and the format and data. Send this on to the * internal routine with the print file, if any. */ -void lutil_log( const char *subsys, int level, const char *fmt, ... ) +void lutil_log( const int subsys, int level, const char *fmt, ... ) { FILE* outfile = NULL; va_list vl; va_start( vl, fmt ); ber_get_option( NULL, LBER_OPT_LOG_PRINT_FILE, &outfile ); - lutil_log_int( outfile, subsys, level, fmt, vl ); + lutil_log_int( outfile, lutil_subsys[subsys], level, fmt, vl ); va_end( vl ); } @@ -232,32 +235,38 @@ void lutil_log_initialize(int argc, char **argv) */ for( i = 0; i < argc; i++ ) { - char *next = argv[i]; - if ( i < argc-1 && next[0] == '-' && next[1] == 'd' ) - { - char subsys[64]; - int level; - char *optarg = argv[i+1]; - char *index = strchr( optarg, '=' ); - if ( index != NULL ) - { - *index = 0; - strcpy ( subsys, optarg ); - level = atoi( index+1 ); - if ( level <= 0 ) level = lutil_mnem2level( index + 1 ); - lutil_set_debug_level( subsys, level ); - *index = '='; - } - else - { - global_level = atoi( optarg ); - /* - * if a negative number was used, make the global level the - * maximum sane level. - */ - if ( global_level < 0 ) global_level = 65535; - } - } + char *next = argv[i]; + + if ( i < argc-1 && next[0] == '-' && next[1] == 'd' ) + { + char subsys[64]; + int level; + char *optarg = argv[i+1]; + char *index = strchr( optarg, '=' ); + if ( index != NULL ) + { + *index = 0; + strcpy ( subsys, optarg ); + level = atoi( index+1 ); + if ( level <= 0 ) level = lutil_mnem2level( index + 1 ); + lutil_set_debug_level( subsys, level ); + *index = '='; + } + else + { + global_level = atoi( optarg ); + ldap_loglevels[0] = global_level; + /* + * if a negative number was used, make the global level the + * maximum sane level. + */ + if ( global_level < 0 ) + { + global_level = 65535; + ldap_loglevels[0] = 65535; + } + } + } } } diff --git a/servers/slapd/abandon.c b/servers/slapd/abandon.c index b092d124f3..80ea94be0c 100644 --- a/servers/slapd/abandon.c +++ b/servers/slapd/abandon.c @@ -35,8 +35,7 @@ do_abandon( int rc; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, "conn: %d do_abandon\n", - conn->c_connid)); + LDAP_LOG( OPERATION, ENTRY, "conn: %d do_abandon\n", conn->c_connid, 0, 0); #else Debug( LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0, 0 ); #endif @@ -49,9 +48,8 @@ do_abandon( if ( ber_scanf( op->o_ber, "i", &id ) == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "conn: %d do_abandon: ber_scanf failed\n", - conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "conn: %d do_abandon: ber_scanf failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_abandon: ber_scanf failed\n", 0, 0 ,0 ); #endif @@ -66,16 +64,17 @@ do_abandon( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "do_abandon: conn: %d id=%ld\n", conn->c_connid, (long) id )); + LDAP_LOG( OPERATION, ARGS, "do_abandon: conn: %d id=%ld\n", + conn->c_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", LDAP_LEVEL_ERR, - "do_abandon: conn: %d bad msgid %ld\n", conn->c_connid, (long) id )); + LDAP_LOG( OPERATION, ERR, + "do_abandon: conn: %d bad msgid %ld\n", + conn->c_connid, (long) id, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_abandon: bad msgid %ld\n", (long) id, 0, 0 ); @@ -109,9 +108,9 @@ done: ldap_pvt_thread_mutex_unlock( &conn->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, + LDAP_LOG( OPERATION, ENTRY, "do_abandon: conn: %d op=%ld %sfound\n", - conn->c_connid, (long)id, o ? "" : "not " )); + conn->c_connid, (long)id, o ? "" : "not " ); #else Debug( LDAP_DEBUG_TRACE, "do_abandon: op=%ld %sfound\n", (long) id, o ? "" : "not ", 0 ); diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index 2318cbffd5..c2f8641db8 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -19,7 +19,6 @@ #define ACL_BUF_SIZE 1024 /* use most appropriate size */ - /* * speed up compares */ @@ -122,6 +121,7 @@ access_allowed( int ret = 1; int count; AccessControl *a; + #ifdef LDAP_DEBUG char accessmaskbuf[ACCESSMASK_MAXLEN]; #endif @@ -152,9 +152,9 @@ access_allowed( } #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY, - "access_allowed: conn %lu %s access to \"%s\" \"%s\" requested\n", - conn ? conn->c_connid : -1, access2str( access ), e->e_dn, attr )); + 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", @@ -172,9 +172,9 @@ access_allowed( /* grant database root access */ if ( be != NULL && be_isroot( be, &op->o_ndn ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_INFO, - "access_allowed: conn %lu root access granted\n", - conn->c_connid)); + LDAP_LOG( ACL, INFO, + "access_allowed: conn %lu root access granted\n", + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= root access granted\n", @@ -193,9 +193,9 @@ access_allowed( && desc != slap_schema.si_ad_children ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "access_allowed: conn %lu NoUserMod Operational attribute: %s access granted\n", - conn->c_connid, attr )); + LDAP_LOG( ACL, DETAIL1, + "access_allowed: conn %lu NoUserMod Operational attribute: %s " + "access granted\n", conn->c_connid, attr , 0 ); #else Debug( LDAP_DEBUG_ACL, "NoUserMod Operational attribute:" " %s access granted\n", @@ -207,10 +207,11 @@ access_allowed( /* use backend default access if no backend acls */ if( be != NULL && be->be_acl == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "access_allowed: conn %lu backend default %s access %s to \"%s\"\n", - conn->c_connid, access2str( access ), - be->be_dfltaccess >= access ? "granted" : "denied", op->o_dn.bv_val )); + 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 ); #else Debug( LDAP_DEBUG_ACL, "=> access_allowed: backend default %s access %s to \"%s\"\n", @@ -225,10 +226,11 @@ access_allowed( /* use global default access if no global acls */ } else if ( be == NULL && global_acl == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "access_allowed: conn %lu global default %s access %s to \"%s\"\n", - conn->c_connid, access2str( access ), - global_default_access >= access ? "granted" : "denied", op->o_dn.bv_val )); + LDAP_LOG( ACL, DETAIL1, + "access_allowed: global default %s access %s to \"%s\"\n", + access2str( access ), + global_default_access >= access ? "granted" : "denied", + op->o_dn.bv_val ); #else Debug( LDAP_DEBUG_ACL, "=> access_allowed: global default %s access %s to \"%s\"\n", @@ -267,10 +269,9 @@ access_allowed( for (i = 0; i < MAXREMATCHES && matches[i].rm_so > 0; i++) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "access_allowed: conn %lu match[%d]: %d %d ", - conn->c_connid, i, - (int)matches[i].rm_so, (int)matches[i].rm_eo )); + 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 ); @@ -282,7 +283,7 @@ access_allowed( } } #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_ARGS, "\n" )); + LDAP_LOG( ACL, ARGS, "\n" , 0, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 ); #endif @@ -301,9 +302,9 @@ vd_access: if ( ACL_IS_INVALID( mask ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "access_allowed: conn %lu \"%s\" (%s) invalid!\n", - conn->c_connid, e->e_dn, attr )); + LDAP_LOG( ACL, DETAIL1, + "access_allowed: conn %lu \"%s\" (%s) invalid!\n", + conn->c_connid, e->e_dn, attr ); #else Debug( LDAP_DEBUG_ACL, "=> access_allowed: \"%s\" (%s) invalid!\n", @@ -313,9 +314,8 @@ vd_access: } else if ( control == ACL_BREAK ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "access_allowed: conn %lu no more rules\n", - conn->c_connid )); + LDAP_LOG( ACL, DETAIL1, + "access_allowed: conn %lu no more rules\n", conn->c_connid, 0,0 ); #else Debug( LDAP_DEBUG_ACL, "=> access_allowed: no more rules\n", 0, 0, 0); @@ -325,12 +325,10 @@ vd_access: } #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY, - "access_allowed: conn %lu %s access %s by %s\n", - conn->c_connid, - access2str( access ), - ACL_GRANT( mask, access ) ? "granted" : "denied", - accessmask2str( mask, accessmaskbuf ) )); + 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", @@ -398,9 +396,10 @@ 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", LDAP_LEVEL_DETAIL1, - "acl_get: dnpat [%d] %s nsub: %d\n", - *count, a->acl_dn_pat.bv_val, (int) a->acl_dn_re.re_nsub )); + 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 ); @@ -410,9 +409,8 @@ acl_get( } else { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "acl_get: dn [%d] %s\n", - *count, a->acl_dn_pat.bv_val )); + 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 ); @@ -455,9 +453,8 @@ acl_get( } #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "acl_get: [%d] matched\n", - *count )); + 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 ); @@ -472,9 +469,8 @@ acl_get( } #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "acl_get: [%d] check attr %s\n", - *count, attr )); + LDAP_LOG( ACL, DETAIL1, + "acl_get: [%d] check attr %s\n", *count, attr ,0 ); #else Debug( LDAP_DEBUG_ACL, "=> acl_get: [%d] check attr %s\n", *count, attr, 0); @@ -483,9 +479,8 @@ acl_get( ad_inlist( desc, a->acl_attrs ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "acl_get: [%d] acl %s attr: %s\n", - *count, e->e_dn, attr )); + LDAP_LOG( ACL, DETAIL1, + "acl_get: [%d] acl %s attr: %s\n", *count, e->e_dn, attr ); #else Debug( LDAP_DEBUG_ACL, "<= acl_get: [%d] acl %s attr: %s\n", @@ -497,8 +492,7 @@ acl_get( } #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY, - "acl_get: done.\n" )); + LDAP_LOG( ACL, RESULTS, "acl_get: done.\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= acl_get: done.\n", 0, 0, 0 ); #endif @@ -559,15 +553,14 @@ acl_mask( assert( attr != NULL ); #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_ENTRY, - "acl_mask: conn %lu access to entry \"%s\", attr \"%s\" requested\n", - conn->c_connid, e->e_dn, attr )); - - LDAP_LOG(( "acl", LDAP_LEVEL_ARGS, - " to %s by \"%s\", (%s) \n", - val ? "value" : "all values", - op->o_ndn.bv_val ? op->o_ndn.bv_val : "", - accessmask2str( *mask, accessmaskbuf ) )); + LDAP_LOG( ACL, ENTRY, + "acl_mask: conn %lu access to entry \"%s\", attr \"%s\" requested\n", + conn->c_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", @@ -599,9 +592,9 @@ acl_mask( /* AND clauses */ if ( b->a_dn_pat.bv_len != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "acl_mask: conn %lu check a_dn_pat: %s\n", - conn->c_connid, b->a_dn_pat.bv_val )); + LDAP_LOG( ACL, DETAIL1, + "acl_mask: conn %lu check a_dn_pat: %s\n", + conn->c_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); @@ -723,9 +716,9 @@ dn_match_cleanup:; if ( b->a_sockurl_pat.bv_len ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, + LDAP_LOG( ACL, DETAIL1, "acl_mask: conn %lu check a_sockurl_pat: %s\n", - conn->c_connid, b->a_sockurl_pat.bv_val )); + conn->c_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 ); @@ -747,9 +740,9 @@ dn_match_cleanup:; if ( b->a_domain_pat.bv_len ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, + LDAP_LOG( ACL, DETAIL1, "acl_mask: conn %lu check a_domain_pat: %s\n", - conn->c_connid, b->a_domain_pat.bv_val )); + conn->c_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 ); @@ -801,9 +794,9 @@ dn_match_cleanup:; if ( b->a_peername_pat.bv_len ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, + LDAP_LOG( ACL, DETAIL1, "acl_mask: conn %lu check a_perrname_path: %s\n", - conn->c_connid, b->a_peername_pat.bv_val )); + conn->c_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 ); @@ -824,9 +817,9 @@ dn_match_cleanup:; if ( b->a_sockname_pat.bv_len ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, + LDAP_LOG( ACL, DETAIL1, "acl_mask: conn %lu check a_sockname_path: %s\n", - conn->c_connid, b->a_sockname_pat.bv_val )); + conn->c_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 ); @@ -859,9 +852,9 @@ dn_match_cleanup:; } #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, + LDAP_LOG( ACL, DETAIL1, "acl_mask: conn %lu check a_dn_pat: %s\n", - conn->c_connid, attr )); + conn->c_connid, attr , 0 ); #else Debug( LDAP_DEBUG_ACL, "<= check a_dn_at: %s\n", attr, 0, 0); @@ -970,9 +963,9 @@ dn_match_cleanup:; if ( b->a_authz.sai_ssf ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "acl_mask: conn %lu check a_authz.sai_ssf: ACL %u > OP %u\n", - conn->c_connid, b->a_authz.sai_ssf, op->o_ssf )); + LDAP_LOG( ACL, DETAIL1, + "acl_mask: conn %lu check a_authz.sai_ssf: ACL %u > OP %u\n", + conn->c_connid, b->a_authz.sai_ssf, op->o_ssf ); #else Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_ssf: ACL %u > OP %u\n", b->a_authz.sai_ssf, op->o_ssf, 0 ); @@ -984,9 +977,11 @@ dn_match_cleanup:; if ( b->a_authz.sai_transport_ssf ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "acl_mask: conn %lu check a_authz.sai_transport_ssf: ACL %u > OP %u\n", - conn->c_connid, b->a_authz.sai_transport_ssf, op->o_transport_ssf )); + LDAP_LOG( ACL, DETAIL1, + "acl_mask: conn %lu check a_authz.sai_transport_ssf: " + "ACL %u > OP %u\n", + conn->c_connid, b->a_authz.sai_transport_ssf, + op->o_transport_ssf ); #else Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_transport_ssf: ACL %u > OP %u\n", @@ -999,9 +994,10 @@ dn_match_cleanup:; if ( b->a_authz.sai_tls_ssf ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "acl_mask: conn %lu check a_authz.sai_tls_ssf: ACL %u > OP %u\n", - conn->c_connid, b->a_authz.sai_tls_ssf, op->o_tls_ssf )); + LDAP_LOG( ACL, DETAIL1, + "acl_mask: conn %lu check a_authz.sai_tls_ssf: ACL %u > " + "OP %u\n", + conn->c_connid, b->a_authz.sai_tls_ssf, op->o_tls_ssf ); #else Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_tls_ssf: ACL %u > OP %u\n", @@ -1014,9 +1010,10 @@ dn_match_cleanup:; if ( b->a_authz.sai_sasl_ssf ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, - "acl_mask: conn %lu check a_authz.sai_sasl_ssf: ACL %u > OP %u\n", - conn->c_connid, b->a_authz.sai_sasl_ssf, op->o_sasl_ssf )); + LDAP_LOG( ACL, DETAIL1, + "acl_mask: conn %lu check a_authz.sai_sasl_ssf: " + "ACL %u > OP %u\n", + conn->c_connid, b->a_authz.sai_sasl_ssf, op->o_sasl_ssf ); #else Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_sasl_ssf: ACL %u > OP %u\n", @@ -1109,11 +1106,11 @@ dn_match_cleanup:; } #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_RESULTS, - "acl_mask: conn %lu [%d] applying %s (%s)\n", - conn->c_connid, i, accessmask2str( modmask, accessmaskbuf), + 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" )); + ? "break" : "stop" ); #else Debug( LDAP_DEBUG_ACL, "<= acl_mask: [%d] applying %s (%s)\n", @@ -1147,9 +1144,9 @@ dn_match_cleanup:; } #ifdef NEW_LOGGING - LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1, + LDAP_LOG( ACL, DETAIL1, "acl_mask: conn %lu [%d] mask: %s\n", - conn->c_connid, i, accessmask2str( *mask, accessmaskbuf) )); + conn->c_connid, i, accessmask2str( *mask, accessmaskbuf) ); #else Debug( LDAP_DEBUG_ACL, "<= acl_mask: [%d] mask: %s\n", @@ -1171,9 +1168,9 @@ dn_match_cleanup:; ACL_INIT(*mask); #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_RESULTS, + LDAP_LOG( ACL, RESULTS, "acl_mask: conn %lu no more clauses, returning %d (stop)\n", - conn->c_connid, accessmask2str( *mask, accessmaskbuf) )); + conn->c_connid, accessmask2str( *mask, accessmaskbuf) , 0 ); #else Debug( LDAP_DEBUG_ACL, "<= acl_mask: no more clauses, returning %s (stop)\n", @@ -1205,9 +1202,9 @@ acl_check_modlist( /* short circuit root database access */ if ( be_isroot( be, &op->o_ndn ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_DETAIL1, + LDAP_LOG( ACL, DETAIL1, "acl_check_modlist: conn %lu access granted to root user\n", - conn->c_connid )); + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= acl_access_allowed: granted to database root\n", @@ -1219,10 +1216,11 @@ acl_check_modlist( /* use backend default access if no backend acls */ if( be != NULL && be->be_acl == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1, - "acl_check_modlist: conn %lu backend default %s access %s to \"%s\"\n", - conn->c_connid, access2str( ACL_WRITE ), - be->be_dfltaccess >= ACL_WRITE ? "granted" : "denied", op->o_dn.bv_val )); + LDAP_LOG( ACL, DETAIL1, + "acl_check_modlist: backend default %s access %s to \"%s\"\n", + access2str( ACL_WRITE ), + be->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", @@ -1236,10 +1234,11 @@ acl_check_modlist( /* use global default access if no global acls */ } else if ( be == NULL && global_acl == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1, - "acl_check_modlist: conn %lu global default %s access %s to \"%s\"\n", - conn->c_connid, access2str( ACL_WRITE ), - global_default_access >= ACL_WRITE ? "granted" : "denied", op->o_dn )); + LDAP_LOG( ACL, DETAIL1, + "acl_check_modlist: global default %s access %s to \"%s\"\n", + access2str( ACL_WRITE ), + global_default_access >= ACL_WRITE ? "granted" : "denied", + op->o_dn ); #else Debug( LDAP_DEBUG_ACL, "=> access_allowed: global default %s access %s to \"%s\"\n", @@ -1261,9 +1260,9 @@ acl_check_modlist( */ if ( is_at_no_user_mod( mlist->sml_desc->ad_type ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1, + LDAP_LOG( ACL, DETAIL1, "acl_check_modlist: conn %lu no-user-mod %s: modify access granted\n", - conn->c_connid, mlist->sml_desc->ad_cname.bv_val )); + conn->c_connid, mlist->sml_desc->ad_cname.bv_val , 0 ); #else Debug( LDAP_DEBUG_ACL, "acl: no-user-mod %s:" " modify access granted\n", @@ -1889,10 +1888,9 @@ string_expand( bv->bv_len = size; #ifdef NEW_LOGGING - LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1, - "string_expand: pattern = %.*s\n", (int)pat->bv_len, pat->bv_val )); - LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL1, - "string_expand: expanded = %s\n", bv->bv_val )); + 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 ); @@ -1923,9 +1921,9 @@ regex_matches( regerror(rc, &re, error, sizeof(error)); #ifdef NEW_LOGGING - LDAP_LOG(( "aci", LDAP_LEVEL_ERR, + LDAP_LOG( ACL, ERR, "regex_matches: compile( \"%s\", \"%s\") failed %s\n", - pat->bv_val, str, error )); + pat->bv_val, str, error ); #else Debug( LDAP_DEBUG_TRACE, "compile( \"%s\", \"%s\") failed %s\n", @@ -1938,11 +1936,9 @@ regex_matches( regfree( &re ); #ifdef NEW_LOGGING - LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL2, - "regex_matches: string: %s\n", str )); - LDAP_LOG(( "aci", LDAP_LEVEL_DETAIL2, - "regex_matches: rc: %d %s\n", - rc, rc ? "matches" : "no matches" )); + 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 ); diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 48411f3b99..b43e781052 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -50,8 +50,7 @@ do_add( Connection *conn, Operation *op ) int manageDSAit; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "do_add: conn %d enter\n", conn->c_connid )); + LDAP_LOG( OPERATION, ENTRY, "do_add: conn %d enter\n", conn->c_connid,0,0 ); #else Debug( LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 ); #endif @@ -70,8 +69,8 @@ do_add( Connection *conn, Operation *op ) /* get the name */ if ( ber_scanf( ber, "{m", /*}*/ &dn ) == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_add: conn %d ber_scanf failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_add: conn %d ber_scanf failed\n", conn->c_connid,0,0 ); #else Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 ); #endif @@ -86,9 +85,8 @@ do_add( Connection *conn, Operation *op ) if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_add: conn %d invalid dn (%s)\n", conn->c_connid, - dn.bv_val )); + LDAP_LOG( OPERATION, ERR, + "do_add: conn %d invalid dn (%s)\n", conn->c_connid, dn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_add: invalid dn (%s)\n", dn.bv_val, 0, 0 ); #endif @@ -98,8 +96,8 @@ do_add( Connection *conn, Operation *op ) } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "do_add: conn %d dn (%s)\n", conn->c_connid, e->e_dn )); + LDAP_LOG( OPERATION, ARGS, + "do_add: conn %d dn (%s)\n", conn->c_connid, e->e_dn, 0 ); #else Debug( LDAP_DEBUG_ARGS, "do_add: dn (%s)\n", e->e_dn, 0, 0 ); #endif @@ -115,8 +113,8 @@ do_add( Connection *conn, Operation *op ) if ( rtag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_add: conn %d decoding error \n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_add: conn %d decoding error \n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_add: decoding error\n", 0, 0, 0 ); #endif @@ -128,9 +126,9 @@ do_add( Connection *conn, Operation *op ) if ( tmp.sml_bvalues == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_add: conn %d no values for type %s\n", - conn->c_connid, tmp.sml_type.bv_val )); + conn->c_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 ); @@ -153,8 +151,8 @@ do_add( Connection *conn, Operation *op ) if ( ber_scanf( ber, /*{*/ "}") == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_add: conn %d ber_scanf failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_add: conn %d ber_scanf failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 ); #endif @@ -166,8 +164,8 @@ do_add( Connection *conn, Operation *op ) if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "do_add: conn %d get_ctrls failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, INFO, + "do_add: conn %d get_ctrls failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 ); #endif @@ -309,8 +307,8 @@ do_add( Connection *conn, Operation *op ) } } else { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "do_add: conn %d no backend support\n", conn->c_connid )); + LDAP_LOG( OPERATION, INFO, + "do_add: conn %d no backend support\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, " do_add: no backend support\n", 0, 0, 0 ); #endif diff --git a/servers/slapd/ava.c b/servers/slapd/ava.c index c521993c54..e0fdd8bb2e 100644 --- a/servers/slapd/ava.c +++ b/servers/slapd/ava.c @@ -44,8 +44,7 @@ get_ava( if( rtag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "get_ava: ber_scanf failure\n" )); + 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 diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 98fa9b8566..983ddd9dba 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -41,7 +41,7 @@ bdb_add( #endif #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_ARGS, "==> bdb_add: %s\n", e->e_dn )); + LDAP_LOG ( OPERATION, ARGS, "==> bdb_add: %s\n", e->e_dn, 0, 0 ); #else Debug(LDAP_DEBUG_ARGS, "==> bdb_add: %s\n", e->e_dn, 0, 0); #endif @@ -50,7 +50,8 @@ bdb_add( rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: entry failed schema check: %s (%d)\n", text, rc )); + LDAP_LOG ( OPERATION, ERR, + "bdb_add: entry failed schema check: %s (%d)\n", text, rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_add: entry failed schema check: %s (%d)\n", @@ -70,7 +71,8 @@ bdb_add( rc = bdb_next_id( be, NULL, &e->e_id ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: next_id failed (%d)\n", rc )); + LDAP_LOG ( OPERATION, ERR, + "bdb_add: next_id failed (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_add: next_id failed (%d)\n", @@ -100,7 +102,8 @@ retry: /* transaction retry */ text = NULL; if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: txn_begin failed: %s (%d)\n", db_strerror(rc), rc )); + LDAP_LOG ( OPERATION, ERR, + "bdb_add: txn_begin failed: %s (%d)\n", db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_add: txn_begin failed: %s (%d)\n", @@ -182,7 +185,8 @@ retry: /* transaction retry */ } #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: parent does not exist\n" )); + 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 ); @@ -211,7 +215,8 @@ retry: /* transaction retry */ if ( ! rc ) { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: no write access to parent\n" )); + 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 ); @@ -225,7 +230,8 @@ retry: /* transaction retry */ if ( is_entry_subentry( p ) ) { /* parent is a subentry, don't allow add */ #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: parent is subentry\n" )); + 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 ); @@ -239,7 +245,8 @@ retry: /* transaction retry */ if ( is_entry_alias( p ) ) { /* parent is an alias, don't allow add */ #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: parent is alias\n" )); + 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 ); @@ -256,7 +263,8 @@ retry: /* transaction retry */ BerVarray refs = get_entry_referrals( be, conn, op, p ); #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: parent is referral\n" )); + 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 ); @@ -305,7 +313,8 @@ retry: /* transaction retry */ if ( ! rc ) { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: no write access to parent\n" )); + 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", @@ -318,7 +327,8 @@ retry: /* transaction retry */ } else { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: %s denied\n", pdn.bv_len == 0 ? "suffix" : "entry at root" )); + 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", @@ -332,7 +342,8 @@ retry: /* transaction retry */ #ifdef BDB_SUBENTRIES if( subentry ) { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_DETAIL1, "bdb_add: no parent, cannot add subentry\n" )); + LDAP_LOG ( OPERATION, DETAIL1, + "bdb_add: no parent, cannot add subentry\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_add: no parent, cannot add subentry\n", @@ -358,7 +369,8 @@ retry: /* transaction retry */ rc = bdb_dn2id_add( be, ltid, &pdn, e ); if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: dn2id_add failed: %s (%d)\n", db_strerror(rc), rc )); + LDAP_LOG ( OPERATION, ERR, + "bdb_add: dn2id_add failed: %s (%d)\n", db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_add: dn2id_add failed: %s (%d)\n", db_strerror(rc), rc, 0 ); @@ -381,7 +393,7 @@ retry: /* transaction retry */ rc = bdb_id2entry_add( be, ltid, e ); if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: id2entry_add failed\n" )); + 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 ); @@ -401,7 +413,8 @@ retry: /* transaction retry */ rc = bdb_index_entry_add( be, ltid, e, e->e_attrs ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: index_entry_add failed\n" )); + 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 ); @@ -471,7 +484,9 @@ retry: /* transaction retry */ if (rc == LDAP_SUCCESS) { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_RESULTS, "bdb_add: added%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn )); + LDAP_LOG ( OPERATION, RESULTS, + "bdb_add: added%s id=%08lx dn=\"%s\"\n", + op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn ); #else Debug(LDAP_DEBUG_TRACE, "bdb_add: added%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn ); @@ -481,7 +496,8 @@ retry: /* transaction retry */ } else { #ifdef NEW_LOGGING - LDAP_LOG (( "add", LDAP_LEVEL_ERR, "bdb_add: %s : %s (%d)\n", text, db_strerror(rc), rc )); + LDAP_LOG ( OPERATION, ERR, + "bdb_add: %s : %s (%d)\n", text, db_strerror(rc), rc ); #else Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n", text, db_strerror(rc), rc ); diff --git a/servers/slapd/back-bdb/attr.c b/servers/slapd/back-bdb/attr.c index c05cfc3933..b60f82c8de 100644 --- a/servers/slapd/back-bdb/attr.c +++ b/servers/slapd/back-bdb/attr.c @@ -181,9 +181,9 @@ bdb_attr_index_config( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, + LDAP_LOG( BACK_BDB, DETAIL1, "attr_index_config: index %s 0x%04lx\n", - ad->ad_cname.bv_val, mask )); + ad->ad_cname.bv_val, mask, 0 ); #else Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04lx\n", ad->ad_cname.bv_val, mask, 0 ); diff --git a/servers/slapd/back-bdb/attribute.c b/servers/slapd/back-bdb/attribute.c index 1277f02561..b41177b4e7 100644 --- a/servers/slapd/back-bdb/attribute.c +++ b/servers/slapd/back-bdb/attribute.c @@ -43,13 +43,12 @@ bdb_attribute( DB_LOCK lock; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ARGS, - "bdb_attribute: gr dn: \"%s\"\n", entry_ndn->bv_val )); - LDAP_LOG(( "backend", LDAP_LEVEL_ARGS, - "bdb_attribute: at: \"%s\"\n", entry_at_name)); - LDAP_LOG(( "backend", LDAP_LEVEL_ARGS, - "bdb_attribute: tr dn: \"%s\"\n", - target ? target->e_ndn : "" )); + LDAP_LOG( BACK_BDB, ARGS, + "bdb_attribute: gr dn: \"%s\"\n", entry_ndn->bv_val, 0, 0 ); + LDAP_LOG( BACK_BDB, ARGS, + "bdb_attribute: at: \"%s\"\n", entry_at_name, 0, 0); + LDAP_LOG( BACK_BDB, ARGS, "bdb_attribute: tr dn: \"%s\"\n", + target ? target->e_ndn : "", 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "=> bdb_attribute: gr dn: \"%s\"\n", @@ -77,9 +76,8 @@ bdb_attribute( /* we already have a LOCKED copy of the entry */ e = target; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "bdb_attribute: target is LOCKED (%s)\n", - entry_ndn->bv_val )); + LDAP_LOG( BACK_BDB, DETAIL1, + "bdb_attribute: target is LOCKED (%s)\n", entry_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "=> bdb_attribute: target is entry: \"%s\"\n", @@ -109,9 +107,9 @@ dn2entry_retry: } if (e == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "bdb_attribute: cannot find entry (%s)\n", - entry_ndn->bv_val )); + LDAP_LOG( BACK_BDB, INFO, + "bdb_attribute: cannot find entry (%s)\n", + entry_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "=> bdb_attribute: cannot find entry: \"%s\"\n", @@ -124,9 +122,8 @@ dn2entry_retry: } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "bdb_attribute: found entry (%s)\n", - entry_ndn->bv_val )); + LDAP_LOG( BACK_BDB, DETAIL1, "bdb_attribute: found entry (%s)\n", + entry_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "=> bdb_attribute: found entry: \"%s\"\n", @@ -138,8 +135,8 @@ dn2entry_retry: /* find attribute values */ if( is_entry_alias( e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "bdb_attribute: entry (%s) is an alias\n", e->e_dn )); + LDAP_LOG( BACK_BDB, INFO, + "bdb_attribute: entry (%s) is an alias\n", e->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= bdb_attribute: entry is an alias\n", 0, 0, 0 ); @@ -151,8 +148,8 @@ dn2entry_retry: if( is_entry_referral( e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "bdb_attribute: entry (%s) is a referral.\n", e->e_dn )); + LDAP_LOG( BACK_BDB, INFO, + "bdb_attribute: entry (%s) is a referral.\n", e->e_dn, 0, 0); #else Debug( LDAP_DEBUG_ACL, "<= bdb_attribute: entry is a referral\n", 0, 0, 0 ); @@ -171,8 +168,8 @@ dn2entry_retry: if ((attr = attr_find(e->e_attrs, entry_at)) == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "bdb_attribute: failed to find %s.\n", entry_at_name )); + LDAP_LOG( BACK_BDB, INFO, + "bdb_attribute: failed to find %s.\n", entry_at_name, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= bdb_attribute: failed to find %s\n", @@ -231,9 +228,7 @@ return_results: } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "bdb_attribute: rc=%d nvals=%d.\n", - rc, j )); + LDAP_LOG( BACK_BDB, ENTRY, "bdb_attribute: rc=%d nvals=%d.\n", rc, j, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_attribute: rc=%d nvals=%d\n", diff --git a/servers/slapd/back-bdb/bind.c b/servers/slapd/back-bdb/bind.c index be64c5b6a8..ebd4880642 100644 --- a/servers/slapd/back-bdb/bind.c +++ b/servers/slapd/back-bdb/bind.c @@ -44,7 +44,7 @@ bdb_bind( DB_LOCK lock; #ifdef NEW_LOGGING - LDAP_LOG (( "bind", LDAP_LEVEL_ARGS, "==> bdb_bind: dn: %s\n", dn->bv_val )); + LDAP_LOG ( OPERATION, ARGS, "==> bdb_bind: dn: %s\n", dn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "==> bdb_bind: dn: %s\n", dn->bv_val, 0, 0); #endif @@ -134,7 +134,8 @@ dn2entry_retry: if ( is_entry_subentry( e ) ) { /* entry is an subentry, don't allow bind */ #ifdef NEW_LOGGING - LDAP_LOG (( "bind", LDAP_LEVEL_DETAIL1, "bdb_bind: entry is subentry\n" )); + 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 ); @@ -151,7 +152,7 @@ dn2entry_retry: if ( is_entry_alias( e ) ) { /* entry is an alias, don't allow bind */ #ifdef NEW_LOGGING - LDAP_LOG (( "bind", LDAP_LEVEL_DETAIL1, "bdb_bind: entry is alias\n" )); + 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 ); @@ -170,7 +171,8 @@ dn2entry_retry: conn, op, e ); #ifdef NEW_LOGGING - LDAP_LOG (( "bind", LDAP_LEVEL_DETAIL1, "bdb_bind: entry is referral\n" )); + 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 ); diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 18854548fe..8f20bcee6f 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -49,9 +49,9 @@ static int bdb_cache_entry_rdwr_lock(Entry *e, int rw) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY, - "bdb_cache_entry_rdwr_lock: %s lock on ID %ld\n", - rw ? "w" : "r", e->e_id )); + LDAP_LOG( CACHE, ENTRY, + "bdb_cache_entry_rdwr_lock: %s lock on ID %ld\n", + rw ? "w" : "r", e->e_id, 0 ); #else Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%slock: ID: %ld\n", rw ? "w" : "r", e->e_id, 0); @@ -67,9 +67,9 @@ static int bdb_cache_entry_rdwr_trylock(Entry *e, int rw) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY, - "bdb_cache_entry_rdwr_trylock: try %s lock on ID: %ld.\n", - rw ? "w" : "r", e->e_id )); + LDAP_LOG( CACHE, ENTRY, + "bdb_cache_entry_rdwr_trylock: try %s lock on ID: %ld.\n", + rw ? "w" : "r", e->e_id, 0 ); #else Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%strylock: ID: %ld\n", rw ? "w" : "r", e->e_id, 0); @@ -85,9 +85,9 @@ static int bdb_cache_entry_rdwr_unlock(Entry *e, int rw) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY, - "bdb_cache_entry_rdwr_unlock: remove %s lock on ID %ld.\n", - rw ? "w" : "r", e->e_id )); + LDAP_LOG( CACHE, ENTRY, + "bdb_cache_entry_rdwr_unlock: remove %s lock on ID %ld.\n", + rw ? "w" : "r", e->e_id, 0 ); #else Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%sunlock: ID: %ld\n", rw ? "w" : "r", e->e_id, 0); @@ -232,9 +232,9 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw ) ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "bdb_unlocked_cache_return_entry_rw: return (%ld):%s, refcnt=%d\n", - id, rw ? "w" : "r", refcnt )); + id, rw ? "w" : "r", refcnt ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_unlocked_cache_return_entry_%s( %ld ): created (%d)\n", @@ -248,9 +248,9 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw ) ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "bdb_unlocked_cache_return_entry_rw: %ld, delete pending (%d).\n", - id, refcnt )); + id, refcnt, 0 ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_unlocked_cache_return_entry_%s( %ld ): delete pending (%d)\n", @@ -267,9 +267,9 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw ) ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "bdb_unlocked_cache_return_entry_rw: (%ld): deleted (%d)\n", - id, refcnt )); + id, refcnt, 0 ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_unlocked_cache_return_entry_%s( %ld ): deleted (%d)\n", @@ -282,9 +282,9 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw ) ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "bdb_unlocked_cache_return_entry_rw: ID %ld:%s returned (%d)\n", - id, rw ? "w": "r", refcnt )); + id, rw ? "w": "r", refcnt ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_unlocked_cache_return_entry_%s( %ld ): returned (%d)\n", @@ -335,9 +335,9 @@ bdb_cache_return_entry_rw ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "bdb_cache_return_entry_rw: return (%ld):%s, refcnt=%d\n", - id, rw ? "w" : "r", refcnt )); + id, rw ? "w" : "r", refcnt ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_return_entry_%s( %ld ): created (%d)\n", @@ -351,9 +351,9 @@ bdb_cache_return_entry_rw ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "bdb_cache_return_entry_rw: %ld, delete pending (%d).\n", - id, refcnt )); + id, refcnt, 0 ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_return_entry_%s( %ld ): delete pending (%d)\n", @@ -370,9 +370,9 @@ bdb_cache_return_entry_rw ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "bdb_cache_return_entry_rw: (%ld): deleted (%d)\n", - id, refcnt )); + id, refcnt, 0 ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_return_entry_%s( %ld ): deleted (%d)\n", @@ -385,9 +385,9 @@ bdb_cache_return_entry_rw ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "bdb_cache_return_entry_rw: ID %ld:%s returned (%d)\n", - id, rw ? "w": "r", refcnt )); + id, rw ? "w": "r", refcnt ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_return_entry_%s( %ld ): returned (%d)\n", @@ -442,9 +442,9 @@ bdb_cache_add_entry_rw( Entry *ee; #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY, - "bdb_cache_add_entry_rw: add (%s):%s to cache\n", - e->e_dn, rw ? "w" : "r" )); + LDAP_LOG( CACHE, ENTRY, + "bdb_cache_add_entry_rw: add (%s):%s to cache\n", + e->e_dn, rw ? "w" : "r", 0 ); #endif /* set cache write lock */ ldap_pvt_thread_rdwr_wlock( &cache->c_rwlock ); @@ -456,9 +456,9 @@ bdb_cache_add_entry_rw( ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ERR, - "bdb_cache_add_entry_rw: add (%s):%ld private init failed!\n", - e->e_dn, e->e_id )); + LDAP_LOG( CACHE, ERR, + "bdb_cache_add_entry_rw: add (%s):%ld private init failed!\n", + e->e_dn, e->e_id, 0 ); #else Debug( LDAP_DEBUG_ANY, "====> bdb_cache_add_entry( %ld ): \"%s\": private init failed!\n", @@ -476,9 +476,9 @@ bdb_cache_add_entry_rw( ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "bdb_cache_add_entry: (%s):%ld already in cache.\n", - e->e_dn, e->e_id )); + LDAP_LOG( CACHE, DETAIL1, + "bdb_cache_add_entry: (%s):%ld already in cache.\n", + e->e_dn, e->e_id, 0 ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_add_entry( %ld ): \"%s\": already in dn cache\n", @@ -495,9 +495,9 @@ bdb_cache_add_entry_rw( (AVL_CMP) entry_id_cmp, avl_dup_error ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "bdb_cache_add_entry: (%s):%ls already in cache.\n", - e->e_dn, e->e_id )); + LDAP_LOG( CACHE, DETAIL1, + "bdb_cache_add_entry: (%s):%ls already in cache.\n", + e->e_dn, e->e_id, 0 ); #else Debug( LDAP_DEBUG_ANY, "====> bdb_cache_add_entry( %ld ): \"%s\": already in id cache\n", @@ -509,9 +509,9 @@ bdb_cache_add_entry_rw( (AVL_CMP) entry_dn_cmp ) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "bdb_cache_add_entry: can't delete (%s) from cache.\n", - e->e_dn )); + LDAP_LOG( CACHE, INFO, + "bdb_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 ); @@ -535,8 +535,9 @@ bdb_cache_add_entry_rw( if ( avl_delete( &cache->c_idtree, (caddr_t) e, (AVL_CMP) entry_id_cmp ) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "bdb_cache_add_entry: can't delete (%s) from cache.\n", e->e_dn )); + LDAP_LOG( CACHE, INFO, + "bdb_cache_add_entry: can't delete (%s) from cache.\n", + e->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "====> can't delete from id cache\n", 0, 0, 0 ); #endif @@ -544,8 +545,9 @@ bdb_cache_add_entry_rw( if ( avl_delete( &cache->c_dntree, (caddr_t) e, (AVL_CMP) entry_dn_cmp ) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "bdb_cache_add_entry: can't delete (%s) from cache.\n", e->e_dn )); + LDAP_LOG( CACHE, INFO, + "bdb_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 @@ -633,9 +635,9 @@ bdb_cache_update_entry( (AVL_CMP) entry_dn_cmp, avl_dup_error ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "bdb_cache_update_entry: (%s):%ld already in dn cache\n", - e->e_dn, e->e_id )); + LDAP_LOG( CACHE, DETAIL1, + "bdb_cache_update_entry: (%s):%ld already in dn cache\n", + e->e_dn, e->e_id, 0 ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_update_entry( %ld ): \"%s\": already in dn cache\n", @@ -652,9 +654,9 @@ bdb_cache_update_entry( (AVL_CMP) entry_id_cmp, avl_dup_error ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "bdb_cache_update_entry: (%s)%ld already in id cache\n", - e->e_dn, e->e_id )); + LDAP_LOG( CACHE, DETAIL1, + "bdb_cache_update_entry: (%s)%ld already in id cache\n", + e->e_dn, e->e_id, 0 ); #else Debug( LDAP_DEBUG_ANY, "====> bdb_cache_update_entry( %ld ): \"%s\": already in id cache\n", @@ -666,9 +668,9 @@ bdb_cache_update_entry( (AVL_CMP) entry_dn_cmp ) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "bdb_cache_update_entry: can't delete (%s)%ld from dn cache.\n", - e->e_dn, e->e_id )); + LDAP_LOG( CACHE, INFO, + "bdb_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 ); @@ -778,9 +780,9 @@ try_again: ldap_pvt_thread_rdwr_runlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "bdb_cache_find_entry_dn2id: (%s) %ld not ready: %d\n", - ndn->bv_val, id, state )); + LDAP_LOG( CACHE, INFO, + "bdb_cache_find_entry_dn2id: (%s) %ld not ready: %d\n", + ndn->bv_val, id, state ); #else Debug(LDAP_DEBUG_TRACE, "====> bdb_cache_find_entry_dn2id(\"%s\"): %ld (not ready) %d\n", @@ -806,9 +808,9 @@ try_again: ldap_pvt_thread_mutex_unlock( &cache->lru_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "bdb_cache_find_entry_dn2id: (%s): %ld %d tries\n", - ndn->bv_val, id, count )); + LDAP_LOG( CACHE, DETAIL1, + "bdb_cache_find_entry_dn2id: (%s): %ld %d tries\n", + ndn->bv_val, id, count ); #else Debug(LDAP_DEBUG_TRACE, "====> bdb_cache_find_entry_dn2id(\"%s\"): %ld (%d tries)\n", @@ -874,9 +876,9 @@ try_again: ldap_pvt_thread_rdwr_runlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "bdb_cache_find_entry_id: (%ld)->%ld not ready (%d).\n", - id, ep_id, state )); + LDAP_LOG( CACHE, INFO, + "bdb_cache_find_entry_id: (%ld)->%ld not ready (%d).\n", + id, ep_id, state ); #else Debug(LDAP_DEBUG_TRACE, @@ -905,9 +907,9 @@ try_again: ldap_pvt_thread_rdwr_runlock( &cache->c_rwlock ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "bdb_cache_find_entry_id: %ld -> %ld (busy) %d.\n", - id, ep_id, state )); + LDAP_LOG( CACHE, INFO, + "bdb_cache_find_entry_id: %ld -> %ld (busy) %d.\n", + id, ep_id, state ); #else Debug(LDAP_DEBUG_TRACE, "====> bdb_cache_find_entry_id( %ld ): %ld (busy) %d\n", @@ -935,9 +937,9 @@ try_again: ldap_pvt_thread_mutex_unlock( &cache->lru_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "bdb_cache_find_entry_id: %ld -> %s found %d tries.\n", - ep_id, ep->e_dn, count )); + LDAP_LOG( CACHE, DETAIL1, + "bdb_cache_find_entry_id: %ld -> %s found %d tries.\n", + ep_id, ep->e_dn, count ); #else Debug(LDAP_DEBUG_TRACE, "====> bdb_cache_find_entry_id( %ld ) \"%s\" (found) (%d tries)\n", @@ -979,8 +981,8 @@ bdb_cache_delete_entry( assert( e->e_private ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY, - "bdb_cache_delete_entry: delete %ld.\n", e->e_id )); + LDAP_LOG( CACHE, ENTRY, + "bdb_cache_delete_entry: delete %ld.\n", e->e_id, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_delete_entry( %ld )\n", e->e_id, 0, 0 ); @@ -1047,8 +1049,7 @@ bdb_cache_release_all( Cache *cache ) ldap_pvt_thread_mutex_lock( &cache->lru_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY, - "bdb_cache_release_all: enter\n" )); + 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 @@ -1067,8 +1068,8 @@ bdb_cache_release_all( Cache *cache ) if ( cache->c_cursize ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "bdb_cache_release_all: Entry cache could not be emptied.\n" )); + LDAP_LOG( CACHE, INFO, + "bdb_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 diff --git a/servers/slapd/back-bdb/compare.c b/servers/slapd/back-bdb/compare.c index ac799bb627..25c8cf4f95 100644 --- a/servers/slapd/back-bdb/compare.c +++ b/servers/slapd/back-bdb/compare.c @@ -88,7 +88,8 @@ dn2entry_retry: conn, op, e ); #ifdef NEW_LOGGING - LDAP_LOG (( "compare", LDAP_LEVEL_DETAIL1,"bdb_compare: entry is referral\n" )); + 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 ); diff --git a/servers/slapd/back-bdb/dbcache.c b/servers/slapd/back-bdb/dbcache.c index 85ed700fbb..68efe9aad4 100644 --- a/servers/slapd/back-bdb/dbcache.c +++ b/servers/slapd/back-bdb/dbcache.c @@ -87,7 +87,9 @@ bdb_db_cache( rc = db_create( &db->bdi_db, bdb->bi_dbenv, 0 ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "dbcache", LDAP_LEVEL_ERR, "bdb_db_cache: db_create(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc )); + 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", @@ -116,7 +118,9 @@ bdb_db_cache( if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "dbcache", LDAP_LEVEL_ERR, "bdb_db_cache: db_open(%s) failed: %s (%d)\n", name, db_strerror(rc), rc )); + 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", diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 8c26e9a080..c15662b15d 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -42,8 +42,7 @@ bdb_delete( #endif #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_ARGS, "==> bdb_delete: %s\n", - dn->bv_val )); + LDAP_LOG ( OPERATION, ARGS, "==> bdb_delete: %s\n", dn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "==> bdb_delete: %s\n", dn->bv_val, 0, 0 ); @@ -55,8 +54,8 @@ retry: /* transaction retry */ bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e); } #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, - "==> bdb_delete: retrying...\n" )); + LDAP_LOG ( OPERATION, DETAIL1, + "==> bdb_delete: retrying...\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "==> bdb_delete: retrying...\n", 0, 0, 0 ); @@ -78,9 +77,9 @@ retry: /* transaction retry */ text = NULL; if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "==> bdb_delete: txn_begin failed: %s (%d)\n", - db_strerror(rc), rc )); + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_delete: txn_begin failed: %s (%d)\n", @@ -136,8 +135,8 @@ retry: /* transaction retry */ if( p == NULL) { #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, - "<=- bdb_delete: parent does not exist\n" )); + 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", @@ -163,8 +162,8 @@ retry: /* transaction retry */ if ( !rc ) { #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, - "<=- bdb_delete: no access to parent\n" )); + 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", @@ -194,8 +193,8 @@ retry: /* transaction retry */ if ( !rc ) { #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, - "<=- bdb_delete: no access to parent\n" )); + LDAP_LOG ( OPERATION, DETAIL1, + "<=- bdb_delete: no access to parent\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<=- bdb_delete: no access " @@ -207,8 +206,8 @@ retry: /* transaction retry */ } else { #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, - "<=- bdb_delete: no parent and not root\n" )); + LDAP_LOG ( OPERATION, DETAIL1, + "<=- bdb_delete: no parent and not root\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<=- bdb_delete: no parent " @@ -254,9 +253,8 @@ retry: /* transaction retry */ BerVarray refs; #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_ARGS, - "<=- bdb_delete: no such object %s\n", - dn->bv_val )); + LDAP_LOG ( OPERATION, ARGS, + "<=- bdb_delete: no such object %s\n", dn->bv_val, 0, 0); #else Debug( LDAP_DEBUG_ARGS, "<=- bdb_delete: no such object %s\n", @@ -292,8 +290,8 @@ retry: /* transaction retry */ conn, op, e ); #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, - "<=- bdb_delete: entry is referral\n" )); + LDAP_LOG ( OPERATION, DETAIL1, + "<=- bdb_delete: entry is referral\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_delete: entry is referral\n", @@ -317,9 +315,8 @@ retry: /* transaction retry */ goto retry; case 0: #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, - "<=- bdb_delete: non-leaf %s\n", - dn->bv_val )); + LDAP_LOG ( OPERATION, DETAIL1, + "<=- bdb_delete: non-leaf %s\n", dn->bv_val, 0, 0 ); #else Debug(LDAP_DEBUG_ARGS, "<=- bdb_delete: non-leaf %s\n", @@ -330,9 +327,9 @@ retry: /* transaction retry */ break; default: #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "<=- bdb_delete: has_children failed %s (%d)\n", - db_strerror(rc), rc )); + db_strerror(rc), rc, 0 ); #else Debug(LDAP_DEBUG_ARGS, "<=- bdb_delete: has_children failed: %s (%d)\n", @@ -355,9 +352,8 @@ retry: /* transaction retry */ rc = LDAP_OTHER; } #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_ERR, - "<=- bdb_delete: dn2id failed %s (%d)\n", - db_strerror(rc), rc )); + LDAP_LOG ( OPERATION, ERR, + "<=- bdb_delete: dn2id failed %s (%d)\n", db_strerror(rc), rc, 0 ); #else Debug(LDAP_DEBUG_ARGS, "<=- bdb_delete: dn2id failed: %s (%d)\n", @@ -378,9 +374,9 @@ retry: /* transaction retry */ rc = LDAP_OTHER; } #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_ERR, - "<=- bdb_delete: id2entry failed: %s (%d)\n", - db_strerror(rc), rc )); + LDAP_LOG ( OPERATION, ERR, + "<=- bdb_delete: id2entry failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); #else Debug(LDAP_DEBUG_ARGS, "<=- bdb_delete: id2entry failed: %s (%d)\n", @@ -401,8 +397,8 @@ retry: /* transaction retry */ rc = LDAP_OTHER; } #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_ERR, - "<=- bdb_delete: entry index delete failed!\n" )); + LDAP_LOG ( OPERATION, ERR, + "<=- bdb_delete: entry index delete failed!\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "entry index delete failed!\n", 0, 0, 0 ); @@ -429,10 +425,9 @@ retry: /* transaction retry */ if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "bdb_delete: txn_%s failed: %s (%d)\n", - op->o_noop ? "abort (no-op)" : "commit", - db_strerror(rc), rc )); + op->o_noop ? "abort (no-op)" : "commit", db_strerror(rc), rc ); #else Debug( LDAP_DEBUG_TRACE, "bdb_delete: txn_%s failed: %s (%d)\n", @@ -444,10 +439,9 @@ retry: /* transaction retry */ } else { #ifdef NEW_LOGGING - LDAP_LOG (( "delete", LDAP_LEVEL_RESULTS, + LDAP_LOG ( OPERATION, RESULTS, "bdb_delete: deleted%s id=%08lx db=\"%s\"\n", - op->o_noop ? " (no-op)" : "", - e->e_id, e->e_dn )); + 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", diff --git a/servers/slapd/back-bdb/dn2entry.c b/servers/slapd/back-bdb/dn2entry.c index 4975141130..c2817e23b2 100644 --- a/servers/slapd/back-bdb/dn2entry.c +++ b/servers/slapd/back-bdb/dn2entry.c @@ -12,6 +12,7 @@ #include "back-bdb.h" + /* * dn2entry - look up dn in the cache/indexes and return the corresponding * entry. @@ -33,8 +34,7 @@ bdb_dn2entry_rw( ID id, id2 = 0; #ifdef NEW_LOGGING - LDAP_LOG (( "db2entry", LDAP_LEVEL_ARGS, "bdb_dn2entry_rw(\"%s\")\n", - dn->bv_val )); + LDAP_LOG ( CACHE, ARGS, "bdb_dn2entry_rw(\"%s\")\n", dn->bv_val, 0, 0 ); #else Debug(LDAP_DEBUG_TRACE, "bdb_dn2entry_rw(\"%s\")\n", dn->bv_val, 0, 0 ); diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index ea63172b6a..9f4c5a5c0f 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -29,8 +29,8 @@ bdb_dn2id_add( struct berval ptr, pdn; #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, "bdb_dn2id_add( \"%s\", 0x%08lx )\n", - e->e_ndn, (long) e->e_id )); + 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 ); @@ -57,9 +57,8 @@ bdb_dn2id_add( rc = db->put( db, txn, &key, &data, DB_NOOVERWRITE ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, - "bdb_dn2id_add: put failed: %s %d\n", - db_strerror(rc), rc )); + 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 ); @@ -72,9 +71,9 @@ bdb_dn2id_add( rc = bdb_idl_insert_key( be, db, txn, &key, e->e_id ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, - "=> bdb_dn2id_add: subtree (%s) insert failed: %d\n", - ptr.bv_val, rc )); + 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", @@ -95,9 +94,9 @@ bdb_dn2id_add( if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, + LDAP_LOG ( INDEX, ERR, "=> bdb_dn2id_add: parent (%s) insert failed: %d\n", - ptr.bv_val, rc )); + ptr.bv_val, rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_add: parent (%s) insert failed: %d\n", @@ -114,9 +113,9 @@ bdb_dn2id_add( if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, + LDAP_LOG ( INDEX, ERR, "=> bdb_dn2id_add: subtree (%s) insert failed: %d\n", - ptr.bv_val, rc )); + ptr.bv_val, rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_add: subtree (%s) insert failed: %d\n", @@ -135,8 +134,7 @@ bdb_dn2id_add( done: ch_free( buf ); #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_RESULTS, - "<= bdb_dn2id_add: %d\n", rc )); + 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 @@ -158,9 +156,8 @@ bdb_dn2id_delete( struct berval pdn, ptr; #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, - "=> bdb_dn2id_delete ( \"%s\", 0x08lx )\n", - e->e_ndn, e->e_id )); + 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 ); @@ -181,9 +178,9 @@ bdb_dn2id_delete( rc = db->del( db, txn, &key, 0 ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, + LDAP_LOG ( INDEX, ERR, "=> bdb_dn2id_delete: delete failed: %s %d\n", - db_strerror(rc), rc )); + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_delete: delete failed: %s %d\n", db_strerror(rc), rc, 0 ); @@ -196,9 +193,9 @@ bdb_dn2id_delete( rc = db->del( db, txn, &key, 0 ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, - "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n", - ptr.bv_val, rc )); + 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", @@ -219,9 +216,9 @@ bdb_dn2id_delete( if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, + LDAP_LOG ( INDEX, ERR, "=> bdb_dn2id_delete: parent (%s) delete failed: %d\n", - ptr.bv_val, rc )); + ptr.bv_val, rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_delete: parent (%s) delete failed: %d\n", @@ -237,9 +234,9 @@ bdb_dn2id_delete( rc = bdb_idl_delete_key( be, db, txn, &key, e->e_id ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, + LDAP_LOG ( INDEX, ERR, "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n", - ptr.bv_val, rc )); + ptr.bv_val, rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n", @@ -258,7 +255,7 @@ bdb_dn2id_delete( done: ch_free( buf ); #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_RESULTS, "<= bdb_dn2id_delete %d\n", rc )); + 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 @@ -279,8 +276,7 @@ bdb_dn2id( DB *db = bdb->bi_dn2id->bdi_db; #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, "=> bdb_dn2id( \"%s\" )\n", - dn->bv_val )); + 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 @@ -309,17 +305,16 @@ bdb_dn2id( if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, - "<= bdb_dn2id: get failed %s (%d)\n", - db_strerror(rc), rc )); + 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 (( "db2id", LDAP_LEVEL_RESULTS, - "<= bdb_dn2id: got id=0x%08lx\n", *id )); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_dn2id: got id=0x%08lx\n", *id, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: got id=0x%08lx\n", *id, 0, 0 ); @@ -348,8 +343,8 @@ bdb_dn2id_matched( ID cached_id; #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, - "=> bdb_dn2id_matched( \"%s\" )\n", in->bv_val )); + LDAP_LOG ( INDEX, ARGS, + "=> bdb_dn2id_matched( \"%s\" )\n", in->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_matched( \"%s\" )\n", in->bv_val, 0, 0 ); #endif @@ -395,8 +390,8 @@ bdb_dn2id_matched( dnParent( &dn, &pdn ); } else { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_DETAIL1, - "<= bdb_dn2id_matched: no match\n" )); + LDAP_LOG ( INDEX, DETAIL1, + "<= bdb_dn2id_matched: no match\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_matched: no match\n", @@ -412,10 +407,10 @@ bdb_dn2id_matched( } else if ( rc == 0 ) { if( data.size != sizeof( ID ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( INDEX, DETAIL1, "<= bdb_dn2id_matched: get size mismatch:" "expected %ld, got %ld\n", - (long) sizeof(ID), (long) data.size )); + (long) sizeof(ID), (long) data.size, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= bdb_dn2id_matched: get size mismatch: " @@ -429,9 +424,9 @@ bdb_dn2id_matched( } #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( INDEX, DETAIL1, "<= bdb_dn2id_matched: id=0x%08lx: %s %s\n", - (long) *id, *id2 == 0 ? "entry" : "matched", dn.bv_val )); + (long) *id, *id2 == 0 ? "entry" : "matched", dn.bv_val ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_matched: id=0x%08lx: %s %s\n", @@ -441,9 +436,9 @@ bdb_dn2id_matched( } else { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, + LDAP_LOG ( INDEX, ERR, "<= bdb_dn2id_matched: get failed: %s (%d)\n", - db_strerror(rc), rc )); + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= bdb_dn2id_matched: get failed: %s (%d)\n", @@ -471,8 +466,8 @@ bdb_dn2id_children( ID id; #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, - "=> bdb_dn2id_children( %s )\n", dn->bv_val )); + LDAP_LOG ( INDEX, ARGS, + "=> bdb_dn2id_children( %s )\n", dn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_children( %s )\n", dn->bv_val, 0, 0 ); @@ -496,10 +491,10 @@ bdb_dn2id_children( free( key.data ); #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( INDEX, DETAIL1, "<= bdb_dn2id_children( %s ): %schildren (%d)\n", dn->bv_val, rc == 0 ? "" : ( rc == DB_NOTFOUND ? "no " : - db_strerror(rc)), rc )); + db_strerror(rc)), rc ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_children( %s ): %schildren (%d)\n", dn->bv_val, @@ -523,8 +518,8 @@ bdb_dn2idl( DB *db = bdb->bi_dn2id->bdi_db; #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ARGS, - "=> bdb_dn2ididl( \"%s\" )\n", dn->bv_val )); + LDAP_LOG ( INDEX, ARGS, + "=> bdb_dn2ididl( \"%s\" )\n", dn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2idl( \"%s\" )\n", dn->bv_val, 0, 0 ); #endif @@ -547,9 +542,8 @@ bdb_dn2idl( if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_ERR, - "<= bdb_dn2ididl: get failed: %s (%d)\n", - db_strerror(rc), rc )); + 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", @@ -558,10 +552,10 @@ bdb_dn2idl( } else { #ifdef NEW_LOGGING - LDAP_LOG (( "db2id", LDAP_LEVEL_RESULTS, + 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 ) )); + (long) BDB_IDL_LAST( ids ) ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2idl: id=%ld first=%ld last=%ld\n", diff --git a/servers/slapd/back-bdb/error.c b/servers/slapd/back-bdb/error.c index ba96309a39..c34b277df1 100644 --- a/servers/slapd/back-bdb/error.c +++ b/servers/slapd/back-bdb/error.c @@ -16,7 +16,7 @@ void bdb_errcall( const char *pfx, char * msg ) { #ifdef NEW_LOGGING - LDAP_LOG (( "error", LDAP_LEVEL_INFO, "bdb(%s): %s\n", pfx, msg )); + LDAP_LOG ( OPERATION, INFO, "bdb(%s): %s\n", pfx, msg, 0 ); #else Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 ); #endif diff --git a/servers/slapd/back-bdb/filterindex.c b/servers/slapd/back-bdb/filterindex.c index a09bc1e3f4..53289e7ffa 100644 --- a/servers/slapd/back-bdb/filterindex.c +++ b/servers/slapd/back-bdb/filterindex.c @@ -52,7 +52,7 @@ bdb_filter_candidates( { int rc = -1; #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ENTRY, "=> bdb_filter_candidates\n")); + LDAP_LOG ( INDEX, ENTRY, "=> bdb_filter_candidates\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "=> bdb_filter_candidates\n", 0, 0, 0 ); #endif @@ -60,7 +60,7 @@ bdb_filter_candidates( switch ( f->f_choice ) { case SLAPD_FILTER_DN_ONE: #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tDN ONE\n")); + 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 @@ -73,7 +73,7 @@ bdb_filter_candidates( case SLAPD_FILTER_DN_SUBTREE: #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tDN SUBTREE\n")); + LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN SUBTREE\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tDN SUBTREE\n", 0, 0, 0 ); #endif @@ -82,7 +82,7 @@ bdb_filter_candidates( case LDAP_FILTER_PRESENT: #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tPRESENT\n")); + LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tPRESENT\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 ); #endif @@ -91,7 +91,7 @@ bdb_filter_candidates( case LDAP_FILTER_EQUALITY: #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tEQUALITY\n")); + LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tEQUALITY\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 ); #endif @@ -100,7 +100,7 @@ bdb_filter_candidates( case LDAP_FILTER_APPROX: #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tAPPROX\n")); + LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAPPROX\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 ); #endif @@ -109,7 +109,7 @@ bdb_filter_candidates( case LDAP_FILTER_SUBSTRINGS: #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tSUBSTRINGS\n")); + LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tSUBSTRINGS\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 ); #endif @@ -119,7 +119,7 @@ bdb_filter_candidates( case LDAP_FILTER_GE: /* no GE index, use pres */ #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tGE\n")); + LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tGE\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 ); #endif @@ -129,7 +129,7 @@ bdb_filter_candidates( case LDAP_FILTER_LE: /* no LE index, use pres */ #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tLE\n")); + LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tLE\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 ); #endif @@ -139,7 +139,7 @@ bdb_filter_candidates( case LDAP_FILTER_NOT: /* no indexing to support NOT filters */ #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tNOT\n")); + LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tNOT\n",0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 ); #endif @@ -147,7 +147,7 @@ bdb_filter_candidates( case LDAP_FILTER_AND: #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tAND\n")); + LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAND\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 ); #endif @@ -157,7 +157,7 @@ bdb_filter_candidates( case LDAP_FILTER_OR: #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tOR\n")); + LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tOR\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 ); #endif @@ -167,7 +167,7 @@ bdb_filter_candidates( default: #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_filter_candidates: \tUNKNOWN\n")); + 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 ); @@ -175,7 +175,9 @@ bdb_filter_candidates( } #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_filter_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) )); + 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", @@ -201,7 +203,7 @@ list_candidates( Filter *f; #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "=> bdb_list_candidates: 0x%x\n", ftype)); + 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 @@ -237,7 +239,10 @@ list_candidates( if( rc ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_list_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) )); + 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", @@ -248,7 +253,7 @@ list_candidates( } else { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ARGS, "<= bdb_list_candidates: rc=%d\n", rc)); + 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", @@ -272,7 +277,7 @@ presence_candidates( struct berval prefix = {0}; #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ENTRY, "=> bdb_presence_candidates\n")); + LDAP_LOG ( INDEX, ENTRY, "=> bdb_presence_candidates\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> bdb_presence_candidates\n", 0, 0, 0 ); #endif @@ -287,7 +292,8 @@ presence_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_presence_candidates: index_parm returned=%d\n", rc )); + LDAP_LOG ( INDEX, RESULTS, + "=> bdb_presence_candidates: index_parm returned=%d\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_presence_candidates: index_param returned=%d\n", @@ -299,7 +305,8 @@ presence_candidates( if( db == NULL ) { /* not indexed */ #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_presence_candidates: not indexed\n" )); + LDAP_LOG(INDEX, RESULTS, + "<= bdb_presence_candidates: not indexed\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_presence_candidates: not indexed\n", @@ -310,7 +317,8 @@ presence_candidates( if( prefix.bv_val == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_presence_candidates: no prefix\n" )); + LDAP_LOG(INDEX, RESULTS, + "<= bdb_presence_candidates: no prefix\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_presence_candidates: no prefix\n", @@ -326,7 +334,8 @@ presence_candidates( rc = 0; } else if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_presence_candidates: key read failed (%d)\n", rc )); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_presence_candidates: key read failed (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_presense_candidates: key read failed (%d)\n", @@ -336,7 +345,9 @@ presence_candidates( } #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) )); + 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", @@ -365,7 +376,7 @@ equality_candidates( MatchingRule *mr; #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ENTRY, "=> equality_candidates\n")); + LDAP_LOG ( INDEX, ENTRY, "=> equality_candidates\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> bdb_equality_candidates\n", 0, 0, 0 ); #endif @@ -375,7 +386,8 @@ equality_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_equality_candidates: index_param failed (%d)\n", rc)); + LDAP_LOG ( INDEX, RESULTS, + "=> bdb_equality_candidates: index_param failed (%d)\n", rc, 0, 0); #else Debug( LDAP_DEBUG_ANY, "<= bdb_equality_candidates: index_param failed (%d)\n", @@ -386,7 +398,8 @@ equality_candidates( if ( db == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_equality_candidates: not indexed\n")); + LDAP_LOG(INDEX, RESULTS, + "=> bdb_equality_candidates: not indexed\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= bdb_equality_candidates: not indexed\n", 0, 0, 0 ); @@ -414,7 +427,8 @@ equality_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_equality_candidates: MR filter failed (%d)\n", rc)); + LDAP_LOG ( INDEX, RESULTS, + "=> bdb_equality_candidates: MR filter failed (%d)\n", rc, 0, 0); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_equality_candidates: MR filter failed (%d)\n", @@ -425,7 +439,8 @@ equality_candidates( if( keys == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_equality_candidates: no keys\n")); + LDAP_LOG ( INDEX, RESULTS, + "=> bdb_equality_candidates: no keys\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_equality_candidates: no keys\n", @@ -442,7 +457,8 @@ equality_candidates( rc = 0; } else if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_equality_candidates: key read failed (%d)\n", rc)); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_equality_candidates: key read failed (%d)\n", rc, 0, 0); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_equality_candidates key read failed (%d)\n", @@ -453,7 +469,7 @@ equality_candidates( if( BDB_IDL_IS_ZERO( tmp ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "=> bdb_equality_candidates: NULL\n")); + LDAP_LOG ( INDEX, RESULTS, "=> bdb_equality_candidates: NULL\n", 0, 0, 0); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_equality_candidates NULL\n", @@ -472,7 +488,10 @@ equality_candidates( ber_bvarray_free( keys ); #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_equality_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) )); + 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", @@ -500,7 +519,7 @@ approx_candidates( MatchingRule *mr; #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ENTRY, "=> bdb_approx_candidates\n")); + LDAP_LOG ( INDEX, ENTRY, "=> bdb_approx_candidates\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> bdb_approx_candidates\n", 0, 0, 0 ); #endif @@ -510,7 +529,8 @@ approx_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: index_param failed (%d)\n", rc )); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_approx_candidates: index_param failed (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= bdb_approx_candidates: index_param failed (%d)\n", @@ -521,7 +541,8 @@ approx_candidates( if ( db == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: not indexed\n" )); + LDAP_LOG(INDEX, RESULTS, + "<= bdb_approx_candidates: not indexed\n",0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= bdb_approx_candidates: not indexed\n", 0, 0, 0 ); @@ -554,7 +575,8 @@ approx_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: MR filter failed (%d)\n", rc )); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_approx_candidates: MR filter failed (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates: (%s) MR filter failed (%d)\n", @@ -565,7 +587,8 @@ approx_candidates( if( keys == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: no keys (%s)\n", prefix.bv_val )); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_approx_candidates: no keys (%s)\n", prefix.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates: no keys (%s)\n", @@ -583,7 +606,8 @@ approx_candidates( break; } else if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: key read failed (%d)\n", rc )); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_approx_candidates: key read failed (%d)\n", rc, 0, 0); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates key read failed (%d)\n", rc, 0, 0 ); @@ -593,7 +617,8 @@ approx_candidates( if( BDB_IDL_IS_ZERO( tmp ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: NULL\n" )); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_approx_candidates: NULL\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates NULL\n", 0, 0, 0 ); @@ -611,7 +636,10 @@ approx_candidates( ber_bvarray_free( keys ); #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_approx_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) )); + 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], @@ -637,7 +665,7 @@ substring_candidates( MatchingRule *mr; #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_ENTRY, "=> bdb_substring_candidates\n")); + LDAP_LOG ( INDEX, ENTRY, "=> bdb_substring_candidates\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> bdb_substring_candidates\n", 0, 0, 0 ); #endif @@ -647,7 +675,8 @@ substring_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: index_param failed (%d)\n", rc )); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_substring_candidates: index_param failed (%d)\n", rc, 0, 0); #else Debug( LDAP_DEBUG_ANY, "<= bdb_substring_candidates: index_param failed (%d)\n", @@ -658,7 +687,8 @@ substring_candidates( if ( db == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: not indexed\n")); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_substring_candidates: not indexed\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= bdb_substring_candidates not indexed\n", @@ -688,7 +718,9 @@ substring_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: (%s) MR filter failed (%d)\n", sub->sa_desc->ad_cname.bv_val, rc )); + 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", @@ -699,7 +731,9 @@ substring_candidates( if( keys == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: (%s) MR filter failed (%d)\n", mask, sub->sa_desc->ad_cname.bv_val )); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_substring_candidates: (%d) MR filter failed (%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", @@ -717,7 +751,8 @@ substring_candidates( break; } else if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: key read failed (%d)\n", rc)); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_substring_candidates: key read failed (%d)\n", rc, 0,0); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates key read failed (%d)\n", rc, 0, 0 ); @@ -727,7 +762,8 @@ substring_candidates( if( BDB_IDL_IS_ZERO( tmp ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: NULL \n" )); + LDAP_LOG ( INDEX, RESULTS, + "<= bdb_substring_candidates: NULL \n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates NULL\n", 0, 0, 0 ); @@ -745,7 +781,10 @@ substring_candidates( ber_bvarray_free( keys ); #ifdef NEW_LOGGING - LDAP_LOG (( "filterindex", LDAP_LEVEL_RESULTS, "<= bdb_substring_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) )); + 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], diff --git a/servers/slapd/back-bdb/group.c b/servers/slapd/back-bdb/group.c index 6c2cdf1133..59a33e94b3 100644 --- a/servers/slapd/back-bdb/group.c +++ b/servers/slapd/back-bdb/group.c @@ -54,9 +54,9 @@ bdb_group( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, + LDAP_LOG( BACK_BDB, ENTRY, "bdb_group: check (%s) member of (%s), oc %s\n", - op_ndn->bv_val, gr_ndn->bv_val, group_oc_name )); + op_ndn->bv_val, gr_ndn->bv_val, group_oc_name ); #else Debug( LDAP_DEBUG_ARGS, "=> bdb_group: gr dn: \"%s\"\n", @@ -88,8 +88,8 @@ bdb_group( /* we already have a LOCKED copy of the entry */ e = target; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "bdb_group: target is group (%s)\n", gr_ndn->bv_val )); + LDAP_LOG( BACK_BDB, DETAIL1, + "bdb_group: target is group (%s)\n", gr_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "=> bdb_group: target is group: \"%s\"\n", @@ -112,9 +112,8 @@ dn2entry_retry: } if (e == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "bdb_group: cannot find group (%s)\n", - gr_ndn->bv_val )); + LDAP_LOG( BACK_BDB, DETAIL1, + "bdb_group: cannot find group (%s)\n", gr_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "=> bdb_group: cannot find group: \"%s\"\n", @@ -126,8 +125,8 @@ dn2entry_retry: return( 1 ); } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "bdb_group: found group (%s)\n", gr_ndn->bv_val )); + LDAP_LOG( BACK_BDB, DETAIL1, + "bdb_group: found group (%s)\n", gr_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "=> bdb_group: found group: \"%s\"\n", @@ -144,8 +143,8 @@ dn2entry_retry: #ifdef BDB_ALIASES if( is_entry_alias( e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "bdb_group: group (%s) is an alias\n", gr_ndn->bv_val )); + LDAP_LOG( BACK_BDB, INFO, + "bdb_group: group (%s) is an alias\n", gr_ndn->bv_val, 0, 0); #else Debug( LDAP_DEBUG_ACL, "<= bdb_group: group is an alias\n", 0, 0, 0 ); @@ -156,8 +155,8 @@ dn2entry_retry: if( is_entry_referral( e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "bdb_group: group (%s) is a referral.\n", gr_ndn->bv_val )); + LDAP_LOG( BACK_BDB, INFO, + "bdb_group: group (%s) is a referral.\n", gr_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= bdb_group: group is a referral\n", 0, 0, 0 ); @@ -167,9 +166,9 @@ dn2entry_retry: if( !is_entry_objectclass( e, group_oc, 0 ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "bdb_group: failed to find %s in objectClass.\n", - group_oc_name )); + LDAP_LOG( BACK_BDB, ERR, + "bdb_group: failed to find %s in objectClass.\n", + group_oc_name, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= bdb_group: failed to find %s in objectClass\n", @@ -180,8 +179,8 @@ dn2entry_retry: if ((attr = attr_find(e->e_attrs, group_at)) == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "bdb_group: failed to find %s\n", group_at_name )); + LDAP_LOG( BACK_BDB, INFO, + "bdb_group: failed to find %s\n", group_at_name, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= bdb_group: failed to find %s\n", @@ -191,9 +190,9 @@ dn2entry_retry: } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, + LDAP_LOG( BACK_BDB, ENTRY, "bdb_group: found objectClass %s and %s\n", - group_oc_name, group_at_name )); + group_oc_name, group_at_name, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= bdb_group: found objectClass %s and %s\n", @@ -202,9 +201,9 @@ dn2entry_retry: if( value_find( group_at, attr->a_vals, op_ndn ) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, + LDAP_LOG( BACK_BDB, DETAIL1, "bdb_group: \"%s\" not in \"%s\": %s\n", - op_ndn->bv_val, gr_ndn->bv_val, group_at_name )); + op_ndn->bv_val, gr_ndn->bv_val, group_at_name ); #else Debug( LDAP_DEBUG_ACL, "<= bdb_group: \"%s\" not in \"%s\": %s\n", @@ -214,9 +213,8 @@ dn2entry_retry: } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "bdb_group: %s is in %s: %s\n", - op_ndn->bv_val, gr_ndn->bv_val, group_at_name )); + LDAP_LOG( BACK_BDB, DETAIL1, "bdb_group: %s is in %s: %s\n", + op_ndn->bv_val, gr_ndn->bv_val, group_at_name ); #else Debug( LDAP_DEBUG_ACL, "<= bdb_group: \"%s\" is in \"%s\": %s\n", @@ -236,8 +234,7 @@ return_results: } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "bdb_group: rc=%d\n", rc )); + LDAP_LOG( BACK_BDB, ENTRY, "bdb_group: rc=%d\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_group: rc=%d\n", rc, 0, 0 ); #endif diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index 175faa0bbd..4c445dbc27 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -36,9 +36,9 @@ static void idl_dump( ID *ids ) { if( BDB_IDL_IS_RANGE( ids ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_INFO, "IDL: range (%ld - %ld)\n", + LDAP_LOG( INDEX, INFO, "IDL: range (%ld - %ld)\n", (long) BDB_IDL_RANGE_FIRST( ids ), - (long) BDB_IDL_RANGE_LAST( ids ) )); + (long) BDB_IDL_RANGE_LAST( ids ), 0 ); #else Debug( LDAP_DEBUG_ANY, "IDL: range ( %ld - %ld )\n", @@ -49,8 +49,7 @@ static void idl_dump( ID *ids ) } else { ID i; #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_INFO, "IDL: size %ld", - (long) ids[0] )); + 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 @@ -60,7 +59,7 @@ static void idl_dump( ID *ids ) Debug( LDAP_DEBUG_ANY, "\n", 0, 0, 0 ); } #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_INFO, "%02lx",(long)ids[i] )); + LDAP_LOG( INDEX, INFO, "%02lx",(long)ids[i], 0, 0 ); #else Debug( LDAP_DEBUG_ANY, " %02lx", (long) ids[i], 0, 0 ); #endif @@ -139,8 +138,7 @@ int bdb_idl_insert( ID *ids, ID id ) #if IDL_DEBUG > 1 #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_DETAIL1, "insert: %04lx at %d\n", - (long) id, x )); + 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 ); @@ -193,8 +191,7 @@ static int idl_delete( ID *ids, ID id ) #if IDL_DEBUG > 1 #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_DETAIL1, "delete: %04lx at %d\n", - (long) id, x )); + 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 ); @@ -267,7 +264,9 @@ bdb_idl_fetch_key( rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_fetch_key: cursor failed: %s (%d)\n", db_strerror(rc), rc )); + 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 ); @@ -296,7 +295,10 @@ bdb_idl_fetch_key( if (ids[1] == 0) { if (ids[0] != BDB_IDL_RANGE_SIZE) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "=> bdb_idl_fetch_key: range size mismatch: expected %ld, got %ld\n", BDB_IDL_RANGE_SIZE, ids[0] )); + 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", @@ -312,7 +314,9 @@ bdb_idl_fetch_key( rc2 = cursor->c_close( cursor ); if (rc2) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_fetch_key: close failed: %s (%d)\n", db_strerror(rc2), rc2 )); + 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 ); @@ -333,7 +337,9 @@ bdb_idl_fetch_key( } else if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_fetch_key: get failed: %s (%d)\n", db_strerror(rc), rc )); + 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", @@ -344,7 +350,9 @@ bdb_idl_fetch_key( } else if ( data.size == 0 || data.size % sizeof( ID ) ) { /* size not multiple of ID size */ #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_fetch_key: odd size: expected %ld multiple, got %ld\n", (long) sizeof( ID ), (long) data.size )); + 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", @@ -355,7 +363,9 @@ bdb_idl_fetch_key( } else if ( data.size != BDB_IDL_SIZEOF(ids) ) { /* size mismatch */ #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_fetch_key: get size mismatch: expected %ld, got %ld\n", (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size )); + 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", @@ -385,7 +395,8 @@ bdb_idl_insert_key( #if 0 /* for printable keys only */ #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ARGS, "bdb_idl_insert_key: %s %ld\n", (char *)key->data, (long) id )); + LDAP_LOG( INDEX, ARGS, "bdb_idl_insert_key: %s %ld\n", + (char *)key->data, (long) id, 0 ); #else Debug( LDAP_DEBUG_ARGS, "=> bdb_idl_insert_key: %s %ld\n", @@ -409,7 +420,9 @@ bdb_idl_insert_key( rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags ); if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: cursor failed: %s (%d)\n", db_strerror(rc), rc )); + 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 ); @@ -518,7 +531,9 @@ put1: data.data = &id; /* initial c_get failed, nothing was done */ fail: #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: %s failed: %s (%d)\n", err, db_strerror(rc), rc )); + 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 ); @@ -543,7 +558,8 @@ fail: } else if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: get failed: %s (%d)\n", db_strerror(rc), rc )); + LDAP_LOG( INDEX, ERR, "bdb_idl_insert_key: get failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: " "get failed: %s (%d)\n", @@ -554,7 +570,9 @@ fail: } else if ( data.size == 0 || data.size % sizeof( ID ) ) { /* size not multiple of ID size */ #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: odd size: expected %ld multiple, got %ld\n", (long) sizeof( ID ), (long) data.size )); + LDAP_LOG( INDEX, ERR, + "bdb_idl_insert_key: odd size: expected %ld multiple, got %ld\n", + (long) sizeof( ID ), (long) data.size, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: " "odd size: expected %ld multiple, got %ld\n", @@ -565,7 +583,9 @@ fail: } else if ( data.size != BDB_IDL_SIZEOF(ids) ) { /* size mismatch */ #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: odd size: expected %ld multiple, got %ld\n", (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size )); + LDAP_LOG( INDEX, ERR, + "bdb_idl_insert_key: odd size: expected %ld multiple, got %ld\n", + (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: " "get size mismatch: expected %ld, got %ld\n", @@ -587,7 +607,7 @@ fail: if( rc == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_DETAIL1, "bdb_idl_insert_key: dup\n" )); + LDAP_LOG( INDEX, DETAIL1, "bdb_idl_insert_key: dup\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> bdb_idl_insert_key: dup\n", 0, 0, 0 ); @@ -596,7 +616,8 @@ fail: } if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: insert failed: (%d)\n", rc )); + LDAP_LOG( INDEX, ERR, + "bdb_idl_insert_key: insert failed: (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: " "bdb_idl_insert failed (%d)\n", @@ -616,7 +637,9 @@ fail: if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_insert_key: put failed: (%d)\n", db_strerror(rc), rc )); + LDAP_LOG( INDEX, ERR, + "bdb_idl_insert_key: put failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: " "put failed: %s (%d)\n", @@ -644,7 +667,8 @@ bdb_idl_delete_key( #if 0 /* for printable keys only */ #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ARGS, "bdb_idl_delete_key: %s %ld\n", (char *)key->data, (long) id )); + LDAP_LOG( INDEX, ARGS, "bdb_idl_delete_key: %s %ld\n", + (char *)key->data, (long) id, 0 ); #else Debug( LDAP_DEBUG_ARGS, "=> bdb_idl_delete_key: %s %ld\n", @@ -669,7 +693,9 @@ bdb_idl_delete_key( rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags ); if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: cursor failed: %s (%d)\n", db_strerror(rc), rc )); + 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 ); @@ -752,7 +778,9 @@ bdb_idl_delete_key( /* initial c_get failed, nothing was done */ fail: #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: %s failed: %s (%d)\n", err, db_strerror(rc), rc )); + 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 ); @@ -772,7 +800,8 @@ fail: if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: get failed: %s (%d)\n", db_strerror(rc), rc )); + LDAP_LOG( INDEX, ERR, "bdb_idl_delete_key: get failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: " "get failed: %s (%d)\n", @@ -783,7 +812,9 @@ fail: } else if ( data.size == 0 || data.size % sizeof( ID ) ) { /* size not multiple of ID size */ #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: odd size: expected: %ld multiple, got %ld\n", (long) sizeof( ID ), (long) data.size )); + LDAP_LOG( INDEX, ERR, + "bdb_idl_delete_key: odd size: expected: %ld multiple, got %ld\n", + (long) sizeof( ID ), (long) data.size, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: " "odd size: expected %ld multiple, got %ld\n", @@ -797,7 +828,9 @@ fail: } else if ( data.size != (1 + ids[0]) * sizeof( ID ) ) { /* size mismatch */ #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: get size mismatch: expected: %ld, got %ld\n", (long) ((1 + ids[0]) * sizeof( ID )), (long) data.size )); + LDAP_LOG( INDEX, ERR, + "bdb_idl_delete_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_delete_key: " "get size mismatch: expected %ld, got %ld\n", @@ -810,7 +843,8 @@ fail: if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: delete failed: (%d)\n", rc )); + LDAP_LOG( INDEX, ERR, + "bdb_idl_delete_key: delete failed: (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: " "idl_delete failed (%d)\n", @@ -824,7 +858,9 @@ fail: rc = db->del( db, tid, key, 0 ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: delete failed: %s (%d)\n", db_strerror(rc), rc )); + LDAP_LOG( INDEX, ERR, + "bdb_idl_delete_key: delete failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: " "delete failed: %s (%d)\n", @@ -844,7 +880,8 @@ fail: if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, "bdb_idl_delete_key: put failed: %s (%d)\n", db_strerror(rc), rc )); + LDAP_LOG( INDEX, ERR, "bdb_idl_delete_key: put failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: put failed: %s (%d)\n", diff --git a/servers/slapd/back-bdb/index.c b/servers/slapd/back-bdb/index.c index c4bb090f57..907b058902 100644 --- a/servers/slapd/back-bdb/index.c +++ b/servers/slapd/back-bdb/index.c @@ -168,8 +168,8 @@ static int indexer( if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ERR, - "bdb_index_read: Could not open DB %s\n", dbname)); + LDAP_LOG( INDEX, ERR, + "bdb_index_read: Could not open DB %s\n", dbname, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= bdb_index_read NULL (could not open %s)\n", @@ -345,10 +345,8 @@ bdb_index_entry( int rc; #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "index_entry: %s (%s) %ld\n", - op == SLAP_INDEX_ADD_OP ? "add" : "del", - e->e_dn, (long) e->e_id )); + LDAP_LOG( INDEX, ENTRY, "index_entry: %s (%s) %ld\n", + op == SLAP_INDEX_ADD_OP ? "add" : "del", e->e_dn, (long) e->e_id ); #else Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n", op == SLAP_INDEX_ADD_OP ? "add" : "del", @@ -362,8 +360,8 @@ bdb_index_entry( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "index_entry: failure (%d)\n", rc )); + LDAP_LOG( INDEX, ENTRY, + "index_entry: failure (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) failure\n", @@ -375,8 +373,7 @@ bdb_index_entry( } #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "index_entry: success\n" )); + LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n", op == SLAP_INDEX_ADD_OP ? "add" : "del", diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 8563b3ee83..5fe8baa358 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -61,7 +61,7 @@ bdb_db_init( BackendDB *be ) struct bdb_info *bdb; #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ENTRY, "bdb_db_init" )); + LDAP_LOG( BACK_BDB, ENTRY, "bdb_db_init", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "bdb_db_init: Initializing BDB database\n", @@ -126,7 +126,8 @@ static void *lock_detect_task( void *arg ) } #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_init: aborted %d locks\n", aborted )); + LDAP_LOG( BACK_BDB, ERR, "bdb_db_init: aborted %d locks\n", + aborted, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "bdb_lock_detect: aborted %d locks\n", @@ -171,7 +172,8 @@ bdb_db_open( BackendDB *be ) u_int32_t flags; #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ARGS, "bdb_db_open: %s\n", be->be_suffix[0].bv_val )); + 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", @@ -183,7 +185,9 @@ bdb_db_open( BackendDB *be ) rc = db_env_create( &bdb->bi_dbenv, 0 ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: db_env_create failed: %s (%d)\n", db_strerror(rc), rc )); + 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", @@ -212,7 +216,9 @@ bdb_db_open( BackendDB *be ) rc = bdb->bi_dbenv->set_tmp_dir( bdb->bi_dbenv, dir ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: set_tmp_dir(%s) failed: %s (%d)\n", dir, db_strerror(rc), rc )); + 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", @@ -226,7 +232,9 @@ bdb_db_open( BackendDB *be ) rc = bdb->bi_dbenv->set_lg_dir( bdb->bi_dbenv, dir ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: set_lg_dir(%s) failed: %s (%d)\n", dir, db_strerror(rc), rc )); + 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", @@ -240,7 +248,9 @@ bdb_db_open( BackendDB *be ) rc = bdb->bi_dbenv->set_data_dir( bdb->bi_dbenv, dir ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: set_data_dir(%s) failed: %s (%d)\n", dir, db_strerror(rc), rc )); + 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", @@ -252,7 +262,8 @@ bdb_db_open( BackendDB *be ) #endif #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_DETAIL1, "bdb_db_open: dbenv_open %s\n", bdb->bi_dbenv_home )); + 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", @@ -265,7 +276,9 @@ bdb_db_open( BackendDB *be ) bdb->bi_dbenv_mode ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: dbenv_open failed: %s (%d)\n", db_strerror(rc), rc )); + 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", @@ -279,7 +292,9 @@ bdb_db_open( BackendDB *be ) bdb->bi_dbenv_xflags, 1); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: dbenv_set_flags failed: %s (%d)\n", db_strerror(rc), rc )); + 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", @@ -303,7 +318,9 @@ bdb_db_open( BackendDB *be ) rc = db_create( &db->bdi_db, bdb->bi_dbenv, 0 ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: db_create(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc )); + 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", @@ -340,7 +357,9 @@ bdb_db_open( BackendDB *be ) if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: db_create(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc )); + 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", @@ -360,7 +379,9 @@ bdb_db_open( BackendDB *be ) rc = bdb_last_id( be, NULL ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_open: last_id(%s) failed: %s (%d)\n", bdb->bi_dbenv_home, db_strerror(rc), rc )); + 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", @@ -419,7 +440,9 @@ bdb_db_destroy( BackendDB *be ) rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n", db_strerror(rc), rc )); + 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", @@ -433,7 +456,9 @@ bdb_db_destroy( BackendDB *be ) bdb->bi_dbenv = NULL; if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_destroy: close failed: %s (%d)\n", db_strerror(rc), rc )); + 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", @@ -490,7 +515,7 @@ bdb_initialize( /* initialize the underlying database system */ #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ENTRY, "bdb_db_initialize\n" )); + LDAP_LOG( BACK_BDB, ENTRY, "bdb_db_initialize\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_open: initialize BDB backend\n", 0, 0, 0 ); @@ -505,7 +530,9 @@ bdb_initialize( patch < DB_VERSION_PATCH ) { #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_initialize: version mismatch: \texpected: %s \tgot: %s\n", DB_VERSION_STRING, version )); + LDAP_LOG( BACK_BDB, ERR, + "bdb_db_initialize: version mismatch: " + "\texpected: %s \tgot: %s\n", DB_VERSION_STRING, version, 0 ); #else Debug( LDAP_DEBUG_ANY, "bdb_open: version mismatch\n" @@ -515,7 +542,8 @@ bdb_initialize( } #ifdef NEW_LOGGING - LDAP_LOG(( "init", LDAP_LEVEL_DETAIL1, "bdb_db_initialize: bdb_open: %s\n", version )); + LDAP_LOG( BACK_BDB, DETAIL1, + "bdb_db_initialize: bdb_open: %s\n", version, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "bdb_open: %s\n", version, 0, 0 ); diff --git a/servers/slapd/back-bdb/key.c b/servers/slapd/back-bdb/key.c index a6b490f101..46371dc519 100644 --- a/servers/slapd/back-bdb/key.c +++ b/servers/slapd/back-bdb/key.c @@ -30,8 +30,7 @@ bdb_key_read( DBT key; #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "key_read: enter\n" )); + LDAP_LOG( INDEX, ENTRY, "key_read: enter\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 ); #endif @@ -45,17 +44,15 @@ bdb_key_read( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ERR, - "bdb_key_read: failed (%d)\n", - rc )); + 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", LDAP_LEVEL_DETAIL1, - "bdb_key_read: %ld candidates\n", (long) BDB_IDL_N(ids) )); + 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 ); @@ -80,9 +77,8 @@ bdb_key_change( DBT key; #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_DETAIL1, - "key_change: %s ID %lx\n", - op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long) id )); + 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 ); @@ -103,8 +99,7 @@ bdb_key_change( } #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_RESULTS, - "key_change: return %d\n", rc )); + 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 diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index a6c80c3992..4f052e404c 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -32,7 +32,8 @@ int bdb_modify_internal( Attribute *ap; #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ENTRY,"bdb_modify_internal: 0x%08lx: %s\n", e->e_id, e->e_dn )); + 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); @@ -51,14 +52,15 @@ int bdb_modify_internal( switch ( mod->sm_op ) { case LDAP_MOD_ADD: #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify_internal: add\n" )); + 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, text, textbuf, textlen ); if( err != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: %d %s\n", err, *text )); + 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); @@ -68,7 +70,8 @@ int bdb_modify_internal( case LDAP_MOD_DELETE: #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify_internal: delete\n" )); + 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 @@ -76,7 +79,8 @@ int bdb_modify_internal( assert( err != LDAP_TYPE_OR_VALUE_EXISTS ); if( err != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: %d %s\n", err, *text )); + 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); @@ -86,14 +90,16 @@ int bdb_modify_internal( case LDAP_MOD_REPLACE: #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify_internal: replace\n" )); + 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, text, textbuf, textlen ); if( err != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: %d %s\n", err, *text )); + 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); @@ -103,7 +109,8 @@ int bdb_modify_internal( case SLAP_MOD_SOFTADD: #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify_internal: softadd\n" )); + 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 @@ -119,7 +126,8 @@ int bdb_modify_internal( if( err != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: %d %s\n", err, *text )); + 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); @@ -129,7 +137,8 @@ int bdb_modify_internal( default: #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: invalid op %d\n", mod->sm_op )); + 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); @@ -137,7 +146,8 @@ int bdb_modify_internal( *text = "Invalid modify operation"; err = LDAP_OTHER; #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: %d %s\n", err, *text )); + 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); @@ -173,7 +183,9 @@ int bdb_modify_internal( attrs_free( e->e_attrs ); e->e_attrs = save_attrs; #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: entry failed schema check %s\n", *text )); + 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 ); @@ -192,7 +204,9 @@ int bdb_modify_internal( attrs_free( e->e_attrs ); e->e_attrs = save_attrs; #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: attribute index delete failure\n" )); + LDAP_LOG ( OPERATION, ERR, + "bdb_modify_internal: attribute index delete failure\n", + 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Attribute index delete failure", @@ -213,7 +227,9 @@ int bdb_modify_internal( attrs_free( e->e_attrs ); e->e_attrs = save_attrs; #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify_internal: attribute index add failure\n" )); + LDAP_LOG ( OPERATION, ERR, + "bdb_modify_internal: attribute index add failure\n", + 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Attribute index add failure", @@ -253,7 +269,7 @@ bdb_modify( DB_LOCK lock; #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ENTRY, "bdb_modify: %s\n", dn->bv_val )); + LDAP_LOG ( OPERATION, ENTRY, "bdb_modify: %s\n", dn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "bdb_modify: %s\n", dn->bv_val, 0, 0 ); #endif @@ -265,7 +281,7 @@ retry: /* transaction retry */ bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e); } #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: retrying...\n" )); + LDAP_LOG ( OPERATION, DETAIL1, "bdb_modify: retrying...\n", 0, 0, 0 ); #else Debug(LDAP_DEBUG_TRACE, "bdb_modify: retrying...\n", 0, 0, 0); @@ -287,7 +303,8 @@ retry: /* transaction retry */ text = NULL; if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: txn_begin failed: %s (%d)\n", db_strerror(rc), rc )); + LDAP_LOG ( OPERATION, DETAIL1, + "bdb_modify: txn_begin failed: %s (%d)\n", db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modify: txn_begin failed: %s (%d)\n", @@ -310,7 +327,8 @@ retry: /* transaction retry */ if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: dn2entry failed: (%d)\n", rc )); + LDAP_LOG ( OPERATION, DETAIL1, + "bdb_modify: dn2entry failed: (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modify: dn2entry failed (%d)\n", @@ -365,7 +383,7 @@ retry: /* transaction retry */ conn, op, e ); #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: entry is referral\n" )); + LDAP_LOG ( OPERATION, DETAIL1, "bdb_modify: entry is referral\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modify: entry is referral\n", @@ -385,7 +403,8 @@ retry: /* transaction retry */ if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify: modify failed (%d)\n", rc )); + LDAP_LOG ( OPERATION, ERR, + "bdb_modify: modify failed (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modify: modify failed (%d)\n", @@ -403,7 +422,8 @@ retry: /* transaction retry */ rc = bdb_id2entry_update( be, ltid, e ); if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify: id2entry update failed (%d)\n", rc )); + LDAP_LOG ( OPERATION, ERR, + "bdb_modify: id2entry update failed (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modify: id2entry update failed (%d)\n", @@ -428,7 +448,9 @@ retry: /* transaction retry */ if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_ERR, "bdb_modify: txn_%s failed %s (%d)\n", op->o_noop ? "abort (no_op)" : "commit", db_strerror(rc), rc )); + LDAP_LOG ( OPERATION, ERR, + "bdb_modify: txn_%s failed %s (%d)\n", + op->o_noop ? "abort (no_op)" : "commit", db_strerror(rc), rc ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modify: txn_%s failed: %s (%d)\n", @@ -440,7 +462,9 @@ retry: /* transaction retry */ } else { #ifdef NEW_LOGGING - LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: updated%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no_op)" : "", e->e_id, e->e_dn )); + 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", diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 439fcc2b5d..da4ab3ec95 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -60,9 +60,8 @@ bdb_modrdn( DB_LOCK lock; #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ENTRY, "==>bdb_modrdn(%s,%s,%s)\n", - dn->bv_val,newrdn->bv_val, - newSuperior ? newSuperior->bv_val : "NULL" )); + LDAP_LOG ( OPERATION, ENTRY, "==>bdb_modrdn(%s,%s,%s)\n", + dn->bv_val,newrdn->bv_val, newSuperior ? newSuperior->bv_val : "NULL" ); #else Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn(%s,%s,%s)\n", dn->bv_val, newrdn->bv_val, @@ -90,7 +89,7 @@ retry: /* transaction retry */ bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np); } #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: retrying...\n")); + LDAP_LOG ( OPERATION, DETAIL1, "==>bdb_modrdn: retrying...\n", 0, 0, 0); #else Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn: retrying...\n", 0, 0, 0 ); #endif @@ -111,7 +110,9 @@ retry: /* transaction retry */ text = NULL; if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: txn_begin failed: %s (%d)\n", db_strerror(rc), rc )); + LDAP_LOG ( OPERATION, ERR, + "==>bdb_modrdn: txn_begin failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_delete: txn_begin failed: %s (%d)\n", @@ -181,7 +182,8 @@ retry: /* transaction retry */ conn, op, e ); #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: entry %s is referral \n", e->e_dn )); + 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 ); @@ -224,7 +226,8 @@ retry: /* transaction retry */ if( p == NULL) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: parent does not exist\n" )); + 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); @@ -238,7 +241,8 @@ retry: /* transaction retry */ children, NULL, ACL_WRITE, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no access to parent\n" )); + 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 ); @@ -249,7 +253,8 @@ retry: /* transaction retry */ } #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: wr to children %s is OK\n", p_ndn.bv_val )); + 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", @@ -263,7 +268,8 @@ retry: /* transaction retry */ } #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: parent dn=%s\n", p_dn.bv_val )); + 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", @@ -288,7 +294,8 @@ retry: /* transaction retry */ if ( ! rc ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no access to parent\n" )); + LDAP_LOG ( OPERATION, ERR, + "==>bdb_modrdn: no access to parent\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "no access to parent\n", @@ -301,7 +308,9 @@ retry: /* transaction retry */ } #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: wr to children of entry \"\" OK\n", p_dn.bv_val )); + 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", @@ -312,7 +321,8 @@ retry: /* transaction retry */ p_dn.bv_len = 0; #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: parent dn=\"\" \n" )); + LDAP_LOG ( OPERATION, DETAIL1, + "==>bdb_modrdn: parent dn=\"\" \n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: parent dn=\"\"\n", @@ -321,7 +331,9 @@ retry: /* transaction retry */ } else { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no parent, not root &\"\" is not suffix\n" )); + 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 " @@ -338,7 +350,9 @@ retry: /* transaction retry */ if ( newSuperior != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: new parent \"%s\" requested...\n", newSuperior->bv_val )); + LDAP_LOG ( OPERATION, DETAIL1, + "==>bdb_modrdn: new parent \"%s\" requested...\n", + newSuperior->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new parent \"%s\" requested...\n", @@ -373,7 +387,9 @@ retry: /* transaction retry */ if( np == NULL) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: newSup(ndn=%s) not here!\n", np_ndn->bv_val )); + 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", @@ -384,7 +400,9 @@ retry: /* transaction retry */ } #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: wr to new parent OK np=%p, id=%ld\n", np, (long) np->e_id )); + LDAP_LOG ( OPERATION, DETAIL1, + "==>bdb_modrdn: wr to new parent OK np=%p, id=%ld\n", + np, (long) np->e_id, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: wr to new parent OK np=%p, id=%ld\n", @@ -394,7 +412,8 @@ retry: /* transaction retry */ /* check newSuperior for "children" acl */ if ( !access_allowed( be, conn, op, np, children, NULL, ACL_WRITE, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: no wr to newSup children\n" )); + 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", @@ -408,7 +427,8 @@ retry: /* transaction retry */ if ( is_entry_alias( np ) ) { /* parent is an alias, don't allow add */ #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: entry is alias\n" )); + 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 ); @@ -422,7 +442,8 @@ retry: /* transaction retry */ if ( is_entry_referral( np ) ) { /* parent is a referral, don't allow add */ #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: entry is referral\n" )); + 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 ); @@ -454,7 +475,8 @@ retry: /* transaction retry */ if ( ! rc ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "==>bdb_modrdn: no access to superior\n" )); + 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", @@ -467,7 +489,8 @@ retry: /* transaction retry */ } #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "bdb_modrdn: wr to children entry \"\" OK\n" )); + 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", @@ -476,7 +499,9 @@ retry: /* transaction retry */ } else { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: new superior=\"\", not root & \"\" is not suffix\n" )); + 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 " @@ -489,7 +514,8 @@ retry: /* transaction retry */ } #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "bdb_modrdn: new superior=\"\"\n" )); + LDAP_LOG ( OPERATION, DETAIL1, + "bdb_modrdn: new superior=\"\"\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new superior=\"\"\n", @@ -498,7 +524,8 @@ retry: /* transaction retry */ } #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "bdb_modrdn: wr to new parent's children OK\n" )); + 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", @@ -514,7 +541,8 @@ retry: /* transaction retry */ dnNormalize2( NULL, &new_dn, &new_ndn ); #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: new ndn=%s\n", new_ndn.bv_val )); + 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 ); @@ -537,7 +565,8 @@ retry: /* transaction retry */ } #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: new ndn=%s does not exist\n", new_ndn.bv_val )); + LDAP_LOG ( OPERATION, ERR, + "bdb_modrdn: new ndn=%s does not exist\n", new_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new ndn=%s does not exist\n", @@ -551,7 +580,9 @@ retry: /* transaction retry */ LDAP_DN_FORMAT_LDAP ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: can't figure out type(s)/values(s) of newrdn\n" )); + 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) " @@ -563,7 +594,9 @@ retry: /* transaction retry */ } #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n", new_rdn[0][0]->la_attr.bv_val, new_rdn[0][0]->la_value.bv_val )); + LDAP_LOG ( OPERATION, RESULTS, + "bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n", + new_rdn[0][0]->la_attr.bv_val, new_rdn[0][0]->la_value.bv_val, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n", @@ -574,7 +607,9 @@ retry: /* transaction retry */ LDAP_DN_FORMAT_LDAP ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: can't figure out type(s)/values(s) of old_rdn\n" )); + 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_back_modrdn: can't figure out the old_rdn " @@ -591,7 +626,9 @@ retry: /* transaction retry */ ( const char ** )new_rdn_types ) != 0 ) { /* Not a big deal but we may say something */ #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: old_rdn_type(s)=%s, new_rdn_type(s)=%s do not match\n", old_rdn_types[ 0 ], new_rdn_types[ 0 ] )); + LDAP_LOG ( OPERATION, ERR, + "bdb_modrdn: old_rdn_type(s)=%s, new_rdn_type(s)=%s do not match\n", + old_rdn_types[ 0 ], new_rdn_types[ 0 ], 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: old_rdn_type(s)=%s, new_rdn_type(s)=%s " @@ -611,7 +648,8 @@ retry: /* transaction retry */ if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: %s: %s (new)\n", text, new_rdn[0][a_cnt]->la_attr.bv_val )); + LDAP_LOG ( OPERATION, ERR, "bdb_modrdn: %s: %s (new)\n", + text, new_rdn[0][a_cnt]->la_attr.bv_val, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: %s: %s (new)\n", @@ -624,7 +662,9 @@ retry: /* transaction retry */ if ( !access_allowed( be, conn, op, e, desc, &new_rdn[0][ a_cnt ]->la_value, ACL_WRITE, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: access to attr \"%s\" (new) not allowed\n", new_rdn[0][a_cnt]->la_attr.bv_val )); + LDAP_LOG ( OPERATION, ERR, + "bdb_modrdn: access to attr \"%s\" (new) not allowed\n", + new_rdn[0][a_cnt]->la_attr.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: access to attr \"%s\" " @@ -652,7 +692,9 @@ retry: /* transaction retry */ /* Get value of old rdn */ if ( old_rdn == NULL) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: can't figure out old RDN values(s) from old RDN\n" )); + LDAP_LOG ( OPERATION, ERR, + "bdb_modrdn: can't figure out old RDN values(s) " + "from old RDN\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: can't figure out old RDN value(s) " @@ -673,7 +715,8 @@ retry: /* transaction retry */ if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: %s: %s (old)\n", text, old_rdn[0][d_cnt]->la_attr.bv_val )); + LDAP_LOG ( OPERATION, ERR, "bdb_modrdn: %s: %s (old)\n", + text, old_rdn[0][d_cnt]->la_attr.bv_val, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: %s: %s (old)\n", @@ -686,7 +729,9 @@ retry: /* transaction retry */ if ( !access_allowed( be, conn, op, e, desc, &old_rdn[0][d_cnt]->la_value, ACL_WRITE, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_ERR, "bdb_modrdn: access to attr \"%s\" (old) not allowed\n", old_rdn[0][d_cnt]->la_attr.bv_val )); + LDAP_LOG ( OPERATION, ERR, + "bdb_modrdn: access to attr \"%s\" (old) not allowed\n", + old_rdn[0][d_cnt]->la_attr.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: access to attr \"%s\" " @@ -813,7 +858,9 @@ retry: /* transaction retry */ if( rc == LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn )); + 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", @@ -824,7 +871,8 @@ retry: /* transaction retry */ } else { #ifdef NEW_LOGGING - LDAP_LOG (( "modrdn", LDAP_LEVEL_RESULTS, "bdb_modrdn: %s : %s (%d)\n", text, db_strerror(rc), rc )); + LDAP_LOG ( OPERATION, RESULTS, "bdb_modrdn: %s : %s (%d)\n", + text, db_strerror(rc), rc ); #else Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n", text, db_strerror(rc), rc ); diff --git a/servers/slapd/back-bdb/nextid.c b/servers/slapd/back-bdb/nextid.c index f5d0e618b1..b9e4151b34 100644 --- a/servers/slapd/back-bdb/nextid.c +++ b/servers/slapd/back-bdb/nextid.c @@ -58,9 +58,8 @@ int bdb_last_id( BackendDB *be, DB_TXN *tid ) default: #ifdef NEW_LOGGING - LDAP_LOG (( "nextid", LDAP_LEVEL_ERR, - "bdb_last_id: get failed: %s (%d)\n", - db_strerror(rc), rc )); + 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", diff --git a/servers/slapd/back-bdb/operational.c b/servers/slapd/back-bdb/operational.c index 9cff5cb3fc..cfcf17cdb3 100644 --- a/servers/slapd/back-bdb/operational.c +++ b/servers/slapd/back-bdb/operational.c @@ -33,7 +33,7 @@ bdb_operational( Attribute **aa = a; int rc; DB_TXN *ltid = NULL; - struct bdb_op_info opinfo; + struct bdb_op_info opinfo; assert( e ); @@ -50,8 +50,8 @@ retry: /* transaction retry */ } #endif #ifdef NEW_LOGGING - LDAP_LOG (( "operational", LDAP_LEVEL_DETAIL1, - "=> bdb_operational: retrying...\n" )); + LDAP_LOG ( OPERATION, DETAIL1, + "=> bdb_operational: retrying...\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "==> bdb_operational: retrying...\n", 0, 0, 0 ); @@ -70,9 +70,9 @@ retry: /* transaction retry */ rc = TXN_BEGIN( bdb->bi_dbenv, NULL, <id, bdb->bi_db_opflags ); if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operational", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "=> bdb_operational: txn_begin failed: %s (%d)\n", - db_strerror(rc), rc )); + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_operational: txn_begin failed: %s (%d)\n", @@ -104,9 +104,9 @@ retry: /* transaction retry */ default: #ifdef NEW_LOGGING - LDAP_LOG (( "operational", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "=> bdb_operational: has_children failed: %s (%d)\n", - db_strerror(rc), rc )); + db_strerror(rc), rc, 0 ); #else Debug(LDAP_DEBUG_ARGS, "<=- bdb_operational: has_children failed: %s (%d)\n", diff --git a/servers/slapd/back-bdb/passwd.c b/servers/slapd/back-bdb/passwd.c index 25f0c654ed..17d54cacc5 100644 --- a/servers/slapd/back-bdb/passwd.c +++ b/servers/slapd/back-bdb/passwd.c @@ -51,8 +51,8 @@ bdb_exop_passwd( &id, NULL, &new, text ); #ifdef NEW_LOGGING - LDAP_LOG (( "passwd", LDAP_LEVEL_ENTRY, "==>bdb_exop_passwd: \"%s\"\n", - id.bv_val ? id.bv_val : "" )); + LDAP_LOG ( ACL, ENTRY, + "==>bdb_exop_passwd: \"%s\"\n", id.bv_val ? id.bv_val : "", 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "==> bdb_exop_passwd: \"%s\"\n", id.bv_val ? id.bv_val : "", 0, 0 ); @@ -89,8 +89,8 @@ bdb_exop_passwd( } #ifdef NEW_LOGGING - LDAP_LOG (( "passwd", LDAP_LEVEL_DETAIL1, "bdb_exop_passwd: \"%s\"%s\"\n", - dn.bv_val, id.bv_len ? " (proxy)" : "" )); + LDAP_LOG ( ACL, DETAIL1, "bdb_exop_passwd: \"%s\"%s\"\n", + dn.bv_val, id.bv_len ? " (proxy)" : "", 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_exop_passwd: \"%s\"%s\n", dn.bv_val, id.bv_len ? " (proxy)" : "", 0 ); @@ -115,7 +115,7 @@ retry: /* transaction retry */ bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock); } #ifdef NEW_LOGGING - LDAP_LOG (( "passwd", LDAP_LEVEL_DETAIL1, "bdb_exop_passwd: retrying...\n" )); + LDAP_LOG ( ACL, DETAIL1, "bdb_exop_passwd: retrying...\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_exop_passwd: retrying...\n", 0, 0, 0 ); #endif @@ -136,7 +136,9 @@ retry: /* transaction retry */ *text = NULL; if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "passwd", LDAP_LEVEL_ERR, "bdb_exop_passwd: txn_begin failed: %s (%d)\n", db_strerror(rc), rc )); + LDAP_LOG ( ACL, ERR, + "bdb_exop_passwd: txn_begin failed: %s (%d)\n", + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_exop_passwd: txn_begin failed: %s (%d)\n", diff --git a/servers/slapd/back-bdb/referral.c b/servers/slapd/back-bdb/referral.c index 4d60f68d0e..07c85df4b3 100644 --- a/servers/slapd/back-bdb/referral.c +++ b/servers/slapd/back-bdb/referral.c @@ -66,9 +66,9 @@ dn2entry_retry: goto dn2entry_retry; default: #ifdef NEW_LOGGING - LDAP_LOG (( "referral", LDAP_LEVEL_ERR, - "bdb_referrals: dn2entry failed: %s (%d)\n", - db_strerror(rc), rc )); + 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", @@ -94,9 +94,9 @@ dn2entry_retry: matched_dn = ch_strdup( matched->e_dn ); #ifdef NEW_LOGGING - LDAP_LOG (( "referral", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - (long) op->o_tag, dn->bv_val, matched_dn )); + (long) op->o_tag, dn->bv_val, matched_dn ); #else Debug( LDAP_DEBUG_TRACE, "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", @@ -139,9 +139,9 @@ dn2entry_retry: refs, &e->e_name, dn, LDAP_SCOPE_DEFAULT ); #ifdef NEW_LOGGING - LDAP_LOG (( "referral", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - (long) op->o_tag, dn->bv_val, e->e_dn )); + (long) op->o_tag, dn->bv_val, e->e_dn ); #else Debug( LDAP_DEBUG_TRACE, "bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index a68e17fb64..44076d7abe 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -63,7 +63,7 @@ bdb_search( DB_LOCK lock; #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_ENTRY,"bdb_back_search\n")); + LDAP_LOG ( OPERATION, ENTRY, "bdb_back_search\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> bdb_back_search\n", 0, 0, 0); @@ -175,7 +175,8 @@ dn2entry_retry: } #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: entry is referral\n")); + 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 ); @@ -288,7 +289,7 @@ dn2entry_retry: if ( candidates[0] == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: no candidates\n")); + 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 ); @@ -349,7 +350,8 @@ id2entry_retry: if( !BDB_IDL_IS_RANGE(candidates) ) { /* only complain for non-range IDLs */ #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: candidate %ld not found\n", (long) id)); + 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", @@ -411,7 +413,8 @@ id2entry_retry: } else if ( dnIsSuffix( &e->e_nname, &realbase ) ) { /* alias is within scope */ #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: \"%s\" in subtree\n", e->edn)); + LDAP_LOG ( OPERATION, RESULTS, + "bdb_search: \"%s\" in subtree\n", e->edn, 0, 0); #else Debug( LDAP_DEBUG_TRACE, "bdb_search: \"%s\" in subtree\n", @@ -466,9 +469,9 @@ id2entry_retry: } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL2, + LDAP_LOG(OPERATION, DETAIL2, "bdb_search: candidate referral %ld scope not okay\n", - id )); + id, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "bdb_search: candidate referral %ld scope not okay\n", @@ -536,7 +539,8 @@ id2entry_retry: } } else { #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: %ld scope not okay\n", (long) id)); + 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", @@ -545,7 +549,8 @@ id2entry_retry: } } else { #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_RESULTS,"bdb_search: %ld does match filter\n", (long) id)); + LDAP_LOG ( OPERATION, RESULTS, + "bdb_search: %ld does match filter\n", (long) id, 0, 0); #else Debug( LDAP_DEBUG_TRACE, "bdb_search: %ld does match filter\n", @@ -589,7 +594,8 @@ static int base_candidate( ID *ids ) { #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_ENTRY,"base_candidate: base: \"%s\" (0x%08lx)\n", e->e_dn, (long) e->e_id)); + LDAP_LOG ( OPERATION, ENTRY, + "base_candidate: base: \"%s\" (0x%08lx)\n", e->e_dn, (long) e->e_id, 0); #else Debug(LDAP_DEBUG_ARGS, "base_candidates: base: \"%s\" (0x%08lx)\n", e->e_dn, (long) e->e_id, 0); @@ -669,7 +675,9 @@ static int search_candidates( */ #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_ENTRY,"search_candidates: base=\"%s\" (0x%08lx) scope=%d\n", e->e_dn, (long) e->e_id, scope)); + LDAP_LOG ( OPERATION, ENTRY, + "search_candidates: base=\"%s\" (0x%08lx) scope=%d\n", + e->e_dn, (long) e->e_id, scope); #else Debug(LDAP_DEBUG_TRACE, "search_candidates: base=\"%s\" (0x%08lx) scope=%d\n", @@ -741,7 +749,8 @@ static int search_candidates( if( rc ) { #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_DETAIL1,"bdb_search_candidates: failed (rc=%d)\n", rc)); + 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", @@ -750,7 +759,10 @@ static int search_candidates( } else { #ifdef NEW_LOGGING - LDAP_LOG (( "search", LDAP_LEVEL_DETAIL1,"bdb_search_candidates: id=%ld first=%ld last=%ld\n", (long) ids[0], (long) BDB_IDL_FIRST(ids), (long) BDB_IDL_LAST(ids))); + 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", diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index 0203ef7106..1056944ebd 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -126,9 +126,8 @@ ID bdb_tool_entry_put( assert( text->bv_val[0] == '\0' ); #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ARGS, - "=> bdb_tool_entry_put( %ld, \"%s\" )\n", - (long) e->e_id, e->e_dn )); + 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 ); @@ -141,8 +140,7 @@ ID bdb_tool_entry_put( "txn_begin failed: %s (%d)", db_strerror(rc), rc ); #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val )); + 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", @@ -157,8 +155,8 @@ ID bdb_tool_entry_put( "next_id failed: %s (%d)", db_strerror(rc), rc ); #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val )); + 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 ); @@ -178,8 +176,8 @@ ID bdb_tool_entry_put( "dn2id_add failed: %s (%d)", db_strerror(rc), rc ); #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val )); + 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 ); @@ -194,8 +192,8 @@ ID bdb_tool_entry_put( "id2entry_add failed: %s (%d)", db_strerror(rc), rc ); #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val )); + 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 ); @@ -209,8 +207,8 @@ ID bdb_tool_entry_put( "index_entry_add failed: %s (%d)", db_strerror(rc), rc ); #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val )); + 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 ); @@ -226,8 +224,8 @@ done: "txn_commit failed: %s (%d)", db_strerror(rc), rc ); #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val )); + 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", @@ -242,8 +240,8 @@ done: "txn_aborted! %s (%d)", db_strerror(rc), rc ); #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, - "=> bdb_tool_entry_put: %s\n", text->bv_val )); + 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", @@ -266,8 +264,8 @@ int bdb_tool_entry_reindex( struct berval pdn; #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ARGS, - "=> bdb_tool_entry_reindex( %ld )\n", (long) id )); + 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 ); @@ -277,9 +275,9 @@ int bdb_tool_entry_reindex( if( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( TOOLS, DETAIL1, "bdb_tool_entry_reindex:: could not locate id=%ld\n", - (long) id )); + (long) id, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "bdb_tool_entry_reindex:: could not locate id=%ld\n", @@ -291,9 +289,9 @@ int bdb_tool_entry_reindex( rc = TXN_BEGIN( bi->bi_dbenv, NULL, &tid, bi->bi_db_opflags ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, + LDAP_LOG ( TOOLS, ERR, "=> bdb_tool_entry_reindex: txn_begin failed: %s (%d)\n", - db_strerror(rc), rc )); + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_reindex: txn_begin failed: %s (%d)\n", @@ -310,9 +308,8 @@ int bdb_tool_entry_reindex( */ #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, - "=> bdb_tool_entry_reindex( %ld, \"%s\" )\n", - (long) id, e->e_dn )); + 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 ); @@ -327,9 +324,9 @@ int bdb_tool_entry_reindex( rc = bdb_dn2id_add( be, tid, &pdn, e ); if( rc != 0 && rc != DB_KEYEXIST ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, + LDAP_LOG ( TOOLS, ERR, "=> bdb_tool_entry_reindex: dn2id_add failed: %s (%d)\n", - db_strerror(rc), rc )); + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_reindex: dn2id_add failed: %s (%d)\n", @@ -345,9 +342,9 @@ done: rc = TXN_COMMIT( tid, 0 ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_ERR, + LDAP_LOG ( TOOLS, ERR, "=> bdb_tool_entry_reindex: txn_commit failed: %s (%d)\n", - db_strerror(rc), rc )); + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_reindex: txn_commit failed: %s (%d)\n", @@ -359,9 +356,9 @@ done: } else { TXN_ABORT( tid ); #ifdef NEW_LOGGING - LDAP_LOG (( "tools", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( TOOLS, DETAIL1, "=> bdb_tool_entry_reindex: txn_aborted! %s (%d)\n", - db_strerror(rc), rc )); + db_strerror(rc), rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "=> bdb_tool_entry_reindex: txn_aborted! %s (%d)\n", diff --git a/servers/slapd/back-ldap/add.c b/servers/slapd/back-ldap/add.c index 2eb05502b1..b947441efb 100644 --- a/servers/slapd/back-ldap/add.c +++ b/servers/slapd/back-ldap/add.c @@ -62,8 +62,7 @@ ldap_back_add( struct berval mdn = { 0, NULL }; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, "ldap_back_add: %s\n", - e->e_dn )); + LDAP_LOG( BACK_LDAP, ENTRY, "ldap_back_add: %s\n", e->e_dn, 0, 0 ); #else /* !NEW_LOGGING */ Debug(LDAP_DEBUG_ARGS, "==> ldap_back_add: %s\n", e->e_dn, 0, 0); #endif /* !NEW_LOGGING */ @@ -86,9 +85,8 @@ ldap_back_add( mdn = e->e_name; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] addDn: \"%s\" -> \"%s\"\n", - e->e_dn, mdn.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] addDn: \"%s\" -> \"%s\"\n", e->e_dn, mdn.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> addDn: \"%s\" -> \"%s\"\n%s", e->e_dn, mdn.bv_val, "" ); @@ -202,10 +200,9 @@ ldap_dnattr_rewrite( continue; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] bindDn (in add of dn-valued" - " attr): \"%s\" -> \"%s\"\n", - a_vals->bv_val, mattr )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] bindDn (in add of dn-valued" + " attr): \"%s\" -> \"%s\"\n", a_vals->bv_val, mattr, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> bindDn (in add of dn-valued attr):" diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index c0e532930a..32d432c285 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -84,8 +84,8 @@ ldap_back_bind( mdn.bv_val = ( char * )dn->bv_val; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] bindDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] bindDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> bindDn: \"%s\" -> \"%s\"\n%s", dn->bv_val, mdn.bv_val, "" ); @@ -258,11 +258,11 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) ber_dupbv( &lc->bound_dn, &lc->conn->c_dn ); } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] bindDn: \"%s\" ->" + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] bindDn: \"%s\" ->" " \"%s\"\n%s", - lc->conn->c_dn.bv_val, - lc->bound_dn.bv_val )); + lc->conn->c_dn.bv_val, + lc->bound_dn.bv_val, "" ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> bindDn: \"%s\" ->" @@ -312,9 +312,8 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) ldap_pvt_thread_mutex_unlock( &li->conn_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldap_back_getconn: conn %ld inserted\n", - lc->conn->c_connid )); + LDAP_LOG( BACK_LDAP, INFO, + "ldap_back_getconn: conn %ld inserted\n", lc->conn->c_connid, 0, 0); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>ldap_back_getconn: conn %ld inserted\n%s%s", @@ -330,9 +329,9 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) } } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldap_back_getconn: conn %ld inserted\n", - lc->conn->c_connid )); + LDAP_LOG( BACK_LDAP, INFO, + "ldap_back_getconn: conn %ld inserted\n", + lc->conn->c_connid, 0, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_TRACE, "=>ldap_back_getconn: conn %ld fetched%s%s\n", diff --git a/servers/slapd/back-ldap/compare.c b/servers/slapd/back-ldap/compare.c index b926639b26..d7d1f77f9d 100644 --- a/servers/slapd/back-ldap/compare.c +++ b/servers/slapd/back-ldap/compare.c @@ -75,9 +75,8 @@ ldap_back_compare( mdn.bv_val = ( char * )dn->bv_val; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] compareDn: \"%s\" -> \"%s\"\n", - dn->bv_val, mdn.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] compareDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> compareDn: \"%s\" -> \"%s\"\n%s", dn->bv_val, mdn.bv_val, "" ); diff --git a/servers/slapd/back-ldap/delete.c b/servers/slapd/back-ldap/delete.c index 75873ec517..115252ba31 100644 --- a/servers/slapd/back-ldap/delete.c +++ b/servers/slapd/back-ldap/delete.c @@ -75,8 +75,8 @@ ldap_back_delete( mdn.bv_val = ( char * )dn->bv_val; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] deleteDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] deleteDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> deleteDn: \"%s\" -> \"%s\"\n%s", dn->bv_val, mdn.bv_val, "" ); diff --git a/servers/slapd/back-ldap/group.c b/servers/slapd/back-ldap/group.c index 5d8dd3a173..374ffc2959 100644 --- a/servers/slapd/back-ldap/group.c +++ b/servers/slapd/back-ldap/group.c @@ -100,9 +100,9 @@ ldap_back_group( mop_ndn = *op_ndn; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] bindDn (op ndn in group):" - " \"%s\" -> \"%s\"\n", op_ndn->bv_val, mop_ndn.bv_val )); + LDAP_LOG( BACK_LDAP, 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", @@ -126,9 +126,9 @@ ldap_back_group( mgr_ndn = *gr_ndn; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] searchBase (gr ndn in group):" - " \"%s\" -> \"%s\"\n%s", gr_ndn->bv_val, mgr_ndn.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] searchBase (gr ndn in group): \"%s\" -> \"%s\"\n%s", + gr_ndn->bv_val, mgr_ndn.bv_val, "" ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> searchBase (gr ndn in group):" diff --git a/servers/slapd/back-ldap/modify.c b/servers/slapd/back-ldap/modify.c index 4b46242c78..8e19960fe7 100644 --- a/servers/slapd/back-ldap/modify.c +++ b/servers/slapd/back-ldap/modify.c @@ -79,8 +79,8 @@ ldap_back_modify( mdn.bv_val = ( char * )dn->bv_val; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] modifyDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] modifyDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> modifyDn: \"%s\" -> \"%s\"\n%s", dn->bv_val, mdn.bv_val, "" ); diff --git a/servers/slapd/back-ldap/modrdn.c b/servers/slapd/back-ldap/modrdn.c index 2930ad9a73..5caf780e8c 100644 --- a/servers/slapd/back-ldap/modrdn.c +++ b/servers/slapd/back-ldap/modrdn.c @@ -84,10 +84,9 @@ ldap_back_modrdn( mnewSuperior.bv_val = ( char * )newSuperior; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] newSuperiorDn:" - " \"%s\" -> \"%s\"\n", - newSuperior, mnewSuperior.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] newSuperiorDn:" " \"%s\" -> \"%s\"\n", + newSuperior, mnewSuperior.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> newSuperiorDn:" " \"%s\" -> \"%s\"\n%s", @@ -125,8 +124,8 @@ ldap_back_modrdn( mdn.bv_val = ( char * )dn->bv_val; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] modrDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] modrDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> modrDn: \"%s\" -> \"%s\"\n%s", dn->bv_val, mdn.bv_val, "" ); diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index 4f107a4f38..65d9b81107 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -153,9 +153,9 @@ ldap_back_search( mbase = *base; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] searchBase: \"%s\" -> \"%s\"\n%", - base->bv_val, mbase.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] searchBase: \"%s\" -> \"%s\"\n", + base->bv_val, mbase.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> searchBase: \"%s\" -> \"%s\"\n%s", base->bv_val, mbase.bv_val, "" ); @@ -191,9 +191,9 @@ ldap_back_search( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] searchFilter: \"%s\" -> \"%s\"\n", - filterstr->bv_val, mfilter.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] searchFilter: \"%s\" -> \"%s\"\n", + filterstr->bv_val, mfilter.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> searchFilter: \"%s\" -> \"%s\"\n%s", @@ -300,10 +300,8 @@ fail:; mmatch = ( char * )match; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] matchedDn:" - " \"%s\" -> \"%s\"\n", - match, mmatch )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] matchedDn:" " \"%s\" -> \"%s\"\n", match, mmatch, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> matchedDn:" " \"%s\" -> \"%s\"\n%s", @@ -389,9 +387,9 @@ ldap_send_entry( ent.e_name = bdn; } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] searchResult: \"%s\"" - " -> \"%s\"\n", bdn.bv_val, ent.e_dn )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] searchResult: \"%s\"" " -> \"%s\"\n", + bdn.bv_val, ent.e_dn, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> searchResult: \"%s\"" " -> \"%s\"\n%s", bdn.bv_val, ent.e_dn, "" ); @@ -428,9 +426,8 @@ ldap_send_entry( if (slap_bv2undef_ad(&mapped, &attr->a_desc, &text) != LDAP_SUCCESS) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "slap_bv2undef_ad(%s): " - "%s\n", mapped.bv_val, text )); + 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): " @@ -506,14 +503,10 @@ ldap_send_entry( } newval.bv_len = strlen( newval.bv_val ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", - LDAP_LEVEL_DETAIL1, - "[rw] searchResult on" - " attr=%s:" - " \"%s\" -> \"%s\"\n", - attr->a_desc->ad_type->sat_cname.bv_val, - bv->bv_val, - newval.bv_val )); + LDAP_LOG( BACK_LDAP, DETAIL1, + "[rw] searchResult on attr=%s: \"%s\" -> \"%s\"\n", + attr->a_desc->ad_type->sat_cname.bv_val, + bv->bv_val, newval.bv_val ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> searchResult on attr=%s: \"%s\" -> \"%s\"\n", diff --git a/servers/slapd/back-ldap/suffixmassage.c b/servers/slapd/back-ldap/suffixmassage.c index d24af0e275..c392207b3a 100644 --- a/servers/slapd/back-ldap/suffixmassage.c +++ b/servers/slapd/back-ldap/suffixmassage.c @@ -99,9 +99,9 @@ ldap_back_dn_massage( strncpy( res->bv_val, dn->bv_val, diff ); strcpy( &res->bv_val[diff], li->suffix_massage[i+dst].bv_val ); #ifdef NEW_LOGGING - LDAP_LOG (( "suffixmassage", LDAP_LEVEL_ARGS, + LDAP_LOG ( BACK_LDAP, ARGS, "ldap_back_dn_massage: converted \"%s\" to \"%s\"\n", - dn->bv_val, res->bv_val )); + dn->bv_val, res->bv_val, 0 ); #else Debug( LDAP_DEBUG_ARGS, "ldap_back_dn_massage:" diff --git a/servers/slapd/back-ldap/unbind.c b/servers/slapd/back-ldap/unbind.c index a15452721a..a5aa5f1f92 100644 --- a/servers/slapd/back-ldap/unbind.c +++ b/servers/slapd/back-ldap/unbind.c @@ -55,9 +55,8 @@ ldap_back_conn_destroy( struct ldapconn *lc, lc_curr; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldap_back_conn_destroy: fetching conn %ld\n", - conn->c_connid )); + 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", @@ -72,9 +71,9 @@ ldap_back_conn_destroy( if (lc) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldap_back_conn_destroy: destroying conn %ld\n", - conn->c_connid )); + 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", diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index 876f8deae5..64854753fa 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -35,8 +35,7 @@ ldbm_back_add( size_t textlen = sizeof textbuf; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,"ldbm_back_add: %s\n", - e->e_dn )); + LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_add: %s\n", e->e_dn, 0, 0 ); #else Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", e->e_dn, 0, 0); #endif @@ -59,9 +58,8 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_add: entry (%s) failed schema check.\n", - e->e_dn )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_back_add: entry (%s) failed schema check.\n", e->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "entry failed schema check: %s\n", text, 0, 0 ); @@ -107,9 +105,9 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_add: Parent of (%s) does not exist.\n", - e->e_dn )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_back_add: Parent of (%s) does not exist.\n", + e->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "parent does not exist\n", 0, 0, 0 ); @@ -133,9 +131,9 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_add: No write access to parent (%s).\n", - e->e_dn )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_back_add: No write access to parent (%s).\n", + e->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "no write access to parent\n", 0, 0, 0 ); @@ -155,8 +153,8 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_add: Parent is an alias.\n")); + 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 ); @@ -181,8 +179,8 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_add: Parent is referral.\n" )); + 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 ); @@ -214,9 +212,9 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, + LDAP_LOG( BACK_LDBM, ERR, "ldbm_back_add: No write " - "access to parent (\"\").\n" )); + "access to parent (\"\").\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "no write access to parent\n", @@ -236,10 +234,10 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, + LDAP_LOG( BACK_LDBM, ERR, "ldbm_back_add: %s add denied.\n", pdn.bv_val == NULL ? "suffix" - : "entry at root" )); + : "entry at root", 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "%s add denied\n", pdn.bv_val == NULL ? "suffix" @@ -264,8 +262,8 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_add: next_id failed.\n" )); + 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 ); @@ -291,8 +289,8 @@ ldbm_back_add( ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_add: cache_add_entry_lock failed.\n" )); + 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 ); @@ -310,8 +308,8 @@ ldbm_back_add( /* attribute indexes */ if ( index_entry_add( be, e, e->e_attrs ) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_add: index_entry_add failed.\n" )); + 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 ); @@ -326,8 +324,8 @@ ldbm_back_add( /* dn2id index */ if ( dn2id_add( be, &e->e_nname, e->e_id ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_add: dn2id_add failed.\n" )); + 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 ); @@ -343,8 +341,8 @@ ldbm_back_add( /* id2entry index */ if ( id2entry_add( be, e ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_add: id2entry_add failed.\n" )); + 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 ); diff --git a/servers/slapd/back-ldbm/attr.c b/servers/slapd/back-ldbm/attr.c index 7b570c8197..6bfa9824b4 100644 --- a/servers/slapd/back-ldbm/attr.c +++ b/servers/slapd/back-ldbm/attr.c @@ -15,7 +15,6 @@ #include "slap.h" #include "back-ldbm.h" - /* for the cache of attribute information (which are indexed, etc.) */ typedef struct ldbm_attrinfo { AttributeDescription *ai_desc; /* attribute description cn;lang-en */ @@ -182,9 +181,9 @@ attr_index_config( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "attr_index_config: index %s 0x%04lx\n", - ad->ad_cname.bv_val, mask )); + 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 ); diff --git a/servers/slapd/back-ldbm/attribute.c b/servers/slapd/back-ldbm/attribute.c index eaa8d3e116..0dc5daf03a 100644 --- a/servers/slapd/back-ldbm/attribute.c +++ b/servers/slapd/back-ldbm/attribute.c @@ -16,7 +16,6 @@ #include "back-ldbm.h" #include "proto-back-ldbm.h" - /* return LDAP_SUCCESS IFF we can retrieve the attributes * of entry with e_ndn */ @@ -41,13 +40,12 @@ ldbm_back_attribute( int nvals = 0; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ARGS, - "ldbm_back_attribute: gr dn: \"%s\"\n", entry_ndn->bv_val )); - LDAP_LOG(( "backend", LDAP_LEVEL_ARGS, - "ldbm_back_attribute: at: \"%s\"\n", entry_at_name)); - LDAP_LOG(( "backend", LDAP_LEVEL_ARGS, - "ldbm_back_attribute: tr dn: \"%s\"\n", - target ? target->e_ndn : "" )); + LDAP_LOG( BACK_LDBM, ARGS, + "ldbm_back_attribute: gr dn: \"%s\"\n", entry_ndn->bv_val, 0, 0 ); + LDAP_LOG( BACK_LDBM, ARGS, + "ldbm_back_attribute: at: \"%s\"\n", entry_at_name, 0, 0); + LDAP_LOG( BACK_LDBM, ARGS, "ldbm_back_attribute: tr dn: \"%s\"\n", + target ? target->e_ndn : "", 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "=> ldbm_back_attribute: gr dn: \"%s\"\n", @@ -65,9 +63,9 @@ ldbm_back_attribute( /* we already have a LOCKED copy of the entry */ e = target; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_attribute: target is LOCKED (%s)\n", - entry_ndn->bv_val )); + LDAP_LOG( BACK_LDBM, DETAIL1, + "ldbm_back_attribute: target is LOCKED (%s)\n", + entry_ndn->bv_val, 0, 0); #else Debug( LDAP_DEBUG_ARGS, "=> ldbm_back_attribute: target is entry: \"%s\"\n", @@ -79,9 +77,9 @@ ldbm_back_attribute( /* can we find entry with reader lock */ if ((e = dn2entry_r(be, entry_ndn, NULL )) == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, + LDAP_LOG( BACK_LDBM, INFO, "ldbm_back_attribute: cannot find entry (%s)\n", - entry_ndn->bv_val )); + entry_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "=> ldbm_back_attribute: cannot find entry: \"%s\"\n", @@ -92,9 +90,8 @@ ldbm_back_attribute( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_attribute: found entry (%s)\n", - entry_ndn->bv_val )); + LDAP_LOG( BACK_LDBM, DETAIL1, + "ldbm_back_attribute: found entry (%s)\n", entry_ndn->bv_val, 0, 0); #else Debug( LDAP_DEBUG_ACL, "=> ldbm_back_attribute: found entry: \"%s\"\n", @@ -107,8 +104,8 @@ ldbm_back_attribute( if( is_entry_alias( e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_attribute: entry (%s) is an alias\n", e->e_dn )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_attribute: entry (%s) is an alias\n", e->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_attribute: entry is an alias\n", 0, 0, 0 ); @@ -120,8 +117,8 @@ ldbm_back_attribute( if( is_entry_referral( e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_attribute: entry (%s) is a referral.\n", e->e_dn )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_attribute: entry (%s) is a referral.\n", e->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_attribute: entry is an referral\n", 0, 0, 0 ); @@ -141,8 +138,8 @@ ldbm_back_attribute( if ((attr = attr_find(e->e_attrs, entry_at)) == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_attribute: failed to find %s.\n", entry_at_name )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_attribute: failed to find %s.\n", entry_at_name, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_attribute: failed to find %s\n", @@ -199,9 +196,8 @@ return_results: } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_back_attribute: rc=%d nvals=%d.\n", - rc, nvals )); + LDAP_LOG( BACK_LDBM, ENTRY, + "ldbm_back_attribute: rc=%d nvals=%d.\n", rc, nvals, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_attribute: rc=%d nvals=%d\n", diff --git a/servers/slapd/back-ldbm/bind.c b/servers/slapd/back-ldbm/bind.c index 2ca018d03b..766e31c0c6 100644 --- a/servers/slapd/back-ldbm/bind.c +++ b/servers/slapd/back-ldbm/bind.c @@ -44,8 +44,8 @@ ldbm_back_bind( AttributeDescription *password = slap_schema.si_ad_userPassword; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_back_bind: dn: %s.\n", dn->bv_val )); + LDAP_LOG( BACK_LDBM, ENTRY, + "ldbm_back_bind: dn: %s.\n", dn->bv_val, 0, 0 ); #else Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_bind: dn: %s\n", dn->bv_val, 0, 0); #endif @@ -113,8 +113,8 @@ ldbm_back_bind( if ( is_entry_alias( e ) ) { /* entry is an alias, don't allow bind */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_bind: entry (%s) is an alias.\n", e->e_dn )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_bind: entry (%s) is an alias.\n", e->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0, 0, 0 ); @@ -134,8 +134,8 @@ ldbm_back_bind( conn, op, e ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_bind: entry(%s) is a referral.\n", e->e_dn )); + 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 ); diff --git a/servers/slapd/back-ldbm/cache.c b/servers/slapd/back-ldbm/cache.c index 72ec35e9b7..4a26488a4e 100644 --- a/servers/slapd/back-ldbm/cache.c +++ b/servers/slapd/back-ldbm/cache.c @@ -116,9 +116,9 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw ) ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "cache_return_entry_rw: return (%ld):%s, refcnt=%d\n", - id, rw ? "w" : "r", refcnt )); + id, rw ? "w" : "r", refcnt ); #else Debug( LDAP_DEBUG_TRACE, "====> cache_return_entry_%s( %ld ): created (%d)\n", @@ -131,9 +131,9 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw ) ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "cache_return_entry_rw: %ld, delete pending (%d).\n", - id, refcnt )); + id, refcnt, 0 ); #else Debug( LDAP_DEBUG_TRACE, "====> cache_return_entry_%s( %ld ): delete pending (%d)\n", @@ -150,9 +150,8 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw ) ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "cache_return_entry_rw: (%ld): deleted (%d)\n", - id, refcnt )); + 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", @@ -165,9 +164,9 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw ) ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "cache_return_entry_rw: ID %ld:%s returned (%d)\n", - id, rw ? "w": "r", refcnt )); + id, rw ? "w": "r", refcnt ); #else Debug( LDAP_DEBUG_TRACE, "====> cache_return_entry_%s( %ld ): returned (%d)\n", @@ -218,9 +217,9 @@ cache_add_entry_rw( Entry *ee; #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY, + LDAP_LOG( CACHE, ENTRY, "cache_add_entry_rw: add (%s):%s to cache\n", - e->e_dn, rw ? "w" : "r" )); + e->e_dn, rw ? "w" : "r", 0 ); #endif /* set cache mutex */ ldap_pvt_thread_mutex_lock( &cache->c_mutex ); @@ -232,9 +231,9 @@ cache_add_entry_rw( ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ERR, + LDAP_LOG( CACHE, ERR, "cache_add_entry_rw: add (%s):%ld private init failed!\n", - e->e_dn, e->e_id )); + e->e_dn, e->e_id, 0 ); #else Debug( LDAP_DEBUG_ANY, "====> cache_add_entry( %ld ): \"%s\": private init failed!\n", @@ -251,9 +250,9 @@ cache_add_entry_rw( ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "cache_add_entry: (%s):%ld already in cache.\n", - e->e_dn, e->e_id )); + 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", @@ -270,9 +269,9 @@ cache_add_entry_rw( (AVL_CMP) entry_id_cmp, avl_dup_error ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "cache_add_entry: (%s):%ls already in cache.\n", - e->e_dn, e->e_id )); + 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", @@ -284,9 +283,9 @@ cache_add_entry_rw( (AVL_CMP) entry_dn_cmp ) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "cache_add_entry: can't delete (%s) from cache.\n", - e->e_dn )); + 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 ); @@ -372,9 +371,9 @@ cache_update_entry( (AVL_CMP) entry_dn_cmp, avl_dup_error ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "cache_update_entry: (%s):%ld already in dn cache\n", - e->e_dn, e->e_id )); + e->e_dn, e->e_id, 0 ); #else Debug( LDAP_DEBUG_TRACE, "====> cache_update_entry( %ld ): \"%s\": already in dn cache\n", @@ -391,9 +390,9 @@ cache_update_entry( (AVL_CMP) entry_id_cmp, avl_dup_error ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "cache_update_entry: (%s)%ld already in id cache\n", - e->e_dn, e->e_id )); + e->e_dn, e->e_id, 0 ); #else Debug( LDAP_DEBUG_ANY, "====> cache_update_entry( %ld ): \"%s\": already in id cache\n", @@ -405,9 +404,9 @@ cache_update_entry( (AVL_CMP) entry_dn_cmp ) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "cache_update_entry: can't delete (%s)%ld from dn cache.\n", - e->e_dn, e->e_id )); + 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 ); @@ -511,9 +510,9 @@ try_again: ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, + LDAP_LOG( CACHE, INFO, "cache_find_entry_dn2id: (%s) %ld not ready: %d\n", - ndn->bv_val, id, state )); + ndn->bv_val, id, state ); #else Debug(LDAP_DEBUG_TRACE, "====> cache_find_entry_dn2id(\"%s\"): %ld (not ready) %d\n", @@ -532,9 +531,9 @@ try_again: ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "cache_find_entry_dn2id: (%s): %ld %d tries\n", - ndn->bv_val, id, count )); + ndn->bv_val, id, count ); #else Debug(LDAP_DEBUG_TRACE, "====> cache_find_entry_dn2id(\"%s\"): %ld (%d tries)\n", @@ -594,9 +593,9 @@ try_again: ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, + LDAP_LOG( CACHE, INFO, "cache_find_entry_id: (%ld)->%ld not ready (%d).\n", - id, ep_id, state )); + id, ep_id, state ); #else Debug(LDAP_DEBUG_TRACE, @@ -618,9 +617,9 @@ try_again: ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "cache_find_entry_id: %ld -> %s found %d tries.\n", - ep_id, ep->e_dn, count )); + ep_id, ep->e_dn, count ); #else Debug(LDAP_DEBUG_TRACE, "====> cache_find_entry_id( %ld ) \"%s\" (found) (%d tries)\n", @@ -661,8 +660,8 @@ cache_delete_entry( assert( e->e_private ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY, - "cache_delete_entry: delete %ld.\n", e->e_id )); + 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 ); @@ -723,8 +722,7 @@ cache_release_all( Cache *cache ) ldap_pvt_thread_mutex_lock( &cache->c_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY, - "cache_release_all: enter\n" )); + 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 @@ -740,8 +738,8 @@ cache_release_all( Cache *cache ) if ( cache->c_cursize ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "cache_release_all: Entry cache could not be emptied.\n" )); + 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 diff --git a/servers/slapd/back-ldbm/close.c b/servers/slapd/back-ldbm/close.c index 7a2a83e121..383817a5d9 100644 --- a/servers/slapd/back-ldbm/close.c +++ b/servers/slapd/back-ldbm/close.c @@ -24,16 +24,16 @@ ldbm_back_db_close( Backend *be ) ldap_pvt_thread_join( li->li_dbsynctid, (void *) NULL ); } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_CRIT, - "ldbm_back_db_close: ldbm backend syncing\n" )); + 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(( "backend", LDAP_LEVEL_CRIT, - "ldbm_back_db_close: ldbm backend synch'ed\n" )); + 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 diff --git a/servers/slapd/back-ldbm/compare.c b/servers/slapd/back-ldbm/compare.c index 18b50dbf2e..b96dbd0163 100644 --- a/servers/slapd/back-ldbm/compare.c +++ b/servers/slapd/back-ldbm/compare.c @@ -69,8 +69,8 @@ ldbm_back_compare( conn, op, e ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_compare: entry (%s) is a referral.\n", e->e_dn )); + 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 ); diff --git a/servers/slapd/back-ldbm/config.c b/servers/slapd/back-ldbm/config.c index 2cb64aa675..527f3c4c43 100644 --- a/servers/slapd/back-ldbm/config.c +++ b/servers/slapd/back-ldbm/config.c @@ -107,9 +107,9 @@ ldbm_back_db_config( int i; if ( argc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "config", LDAP_LEVEL_ERR, "ldbm_back_db_config: %s: " + LDAP_LOG ( CONFIG, ERR, "ldbm_back_db_config: %s: " "line %d: missing frequency value in \"dbsync " - "[ [wait-interval]]\" line\n", fname, lineno )); + "[ [wait-interval]]\" line\n", fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing frquency value in \"dbsync [ [wait-interval]]\" line\n", @@ -122,10 +122,11 @@ ldbm_back_db_config( if( i < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "config", LDAP_LEVEL_ERR, "ldbm_back_db_config: %s: " + LDAP_LOG ( CONFIG, ERR, + "ldbm_back_db_config: %s: " "line %d: frequency value (%d) invalid \"dbsync " " [ [wait-interval]]\" line\n", - fname, lineno, i )); + fname, lineno, i ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: frquency value (%d) invalid \"dbsync [ [wait-interval]]\" line\n", @@ -140,10 +141,10 @@ ldbm_back_db_config( i = atoi( argv[2] ); if ( i < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "config",LDAP_LEVEL_ERR, "ldbm_back_db_config: %s: " + LDAP_LOG ( CONFIG,ERR, "ldbm_back_db_config: %s: " "line %d: frequency value (%d) invalid \"dbsync " " [ [wait-interval]]\" line\n", - fname, lineno, i )); + fname, lineno, i ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: frquency value (%d) invalid \"dbsync [ [wait-interval]]\" line\n", @@ -158,10 +159,10 @@ ldbm_back_db_config( i = atoi( argv[3] ); if ( i <= 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "config",LDAP_LEVEL_ERR, "ldbm_back_db_config: %s: " + LDAP_LOG ( CONFIG,ERR, "ldbm_back_db_config: %s: " "line %d: frequency value (%d) invalid \"dbsync " " [ [wait-interval]]\" line\n", - fname, lineno, i )); + fname, lineno, i ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: frquency value (%d) invalid \"dbsync [ [wait-interval]]\" line\n", @@ -177,8 +178,8 @@ ldbm_back_db_config( #else #ifdef NEW_LOGGING - LDAP_LOG (( "config", LDAP_LEVEL_ERR, "ldbm_back_db_config: \"dbsync\"" - " policies not supported in non-threaded environments\n" )); + 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); diff --git a/servers/slapd/back-ldbm/dbcache.c b/servers/slapd/back-ldbm/dbcache.c index 1cf5bf9bd1..b9407f4d1a 100644 --- a/servers/slapd/back-ldbm/dbcache.c +++ b/servers/slapd/back-ldbm/dbcache.c @@ -54,8 +54,8 @@ ldbm_cache_open( } #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ENTRY, - "ldbm_cache_open: \"%s\", %d, %o\n", buf, flags, li->li_mode )); + 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 ); @@ -101,8 +101,8 @@ ldbm_cache_open( } li->li_dbcache[i].dbc_refcnt++; #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "ldbm_cache_open: cache %d\n", i )); + 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 ); @@ -132,8 +132,9 @@ ldbm_cache_open( li->li_dbcache[i].dbc_name = NULL; } else { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_INFO, - "ldbm_cache_open: no unused db to close - waiting\n" )); + 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", @@ -155,10 +156,10 @@ ldbm_cache_open( { int err = errno; #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ERR, - "ldbm_cache_open: \"%s\" failed, errono=%d, reason=%s\n", - buf, err, err > -1 && err < sys_nerr ? sys_errlist[err] : - "unknown" )); + 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", @@ -190,10 +191,10 @@ ldbm_cache_open( assert( li->li_dbcache[i].dbc_maxindirect < 256 ); #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_ARGS, + 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 )); + li->li_dbcache[i].dbc_maxindirect ); #else Debug( LDAP_DEBUG_ARGS, "ldbm_cache_open (blksize %ld) (maxids %d) (maxindirect %d)\n", @@ -202,8 +203,7 @@ ldbm_cache_open( #endif #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, - "<= ldbm_cache_open: (opened %d)\n", i )); + 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 @@ -259,9 +259,9 @@ ldbm_cache_flush_all( Backend *be ) for ( i = 0; i < MAXDBCACHE; i++ ) { if ( li->li_dbcache[i].dbc_name != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "ldbm_cache_flush_all: flushing db (%s)\n", - li->li_dbcache[i].dbc_name )); + 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 ); @@ -271,9 +271,9 @@ ldbm_cache_flush_all( Backend *be ) li->li_dbcache[i].dbc_dirty = 0; if ( li->li_dbcache[i].dbc_refcnt != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_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 )); + 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", @@ -283,9 +283,9 @@ ldbm_cache_flush_all( Backend *be ) } else { #ifdef NEW_LOGGING - LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CACHE, DETAIL1, "ldbm_cache_flush_all: ldbm closing db (%s)\n", - li->li_dbcache[i].dbc_name )); + li->li_dbcache[i].dbc_name, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm closing db (%s)\n", @@ -312,8 +312,8 @@ ldbm_cache_sync( Backend *be ) 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 (( "dbcache", LDAP_LEVEL_DETAIL1, "ldbm_cache_sync: " - "ldbm syncing db (%s)\n", li->li_dbcache[i].dbc_name )); + 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 ); @@ -391,8 +391,8 @@ ldbm_cache_sync_daemon( struct ldbminfo *li = (struct ldbminfo *) be->be_private; #ifdef NEW_LOGGING - LDAP_LOG (( "dbcache", LDAP_LEVEL_ARGS, "ldbm_cache_sync_daemon:" - " synchronizer starting for %s\n", li->li_directory )); + 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 @@ -404,8 +404,8 @@ ldbm_cache_sync_daemon( while (i && ldap_pvt_thread_pool_backload(&connection_pool) != 0) { #ifdef NEW_LOGGING - LDAP_LOG (( "dbcache", LDAP_LEVEL_DETAIL1, "ldbm_cache_sync_daemon:" - " delay syncing %s\n", li->li_directory )); + 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 @@ -415,8 +415,8 @@ ldbm_cache_sync_daemon( if (!li->li_dbshutdown) { #ifdef NEW_LOGGING - LDAP_LOG (( "dbcache", LDAP_LEVEL_DETAIL1, "ldbm_cache_sync_daemon:" - " syncing %s\n", li->li_directory )); + 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 @@ -425,8 +425,8 @@ ldbm_cache_sync_daemon( } #ifdef NEW_LOGGING - LDAP_LOG (( "dbcache", LDAP_LEVEL_DETAIL1, "ldbm_cache_sync_daemon:" - " synchronizer stopping\n" )); + 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 diff --git a/servers/slapd/back-ldbm/delete.c b/servers/slapd/back-ldbm/delete.c index 321799acd2..d33e957f67 100644 --- a/servers/slapd/back-ldbm/delete.c +++ b/servers/slapd/back-ldbm/delete.c @@ -34,8 +34,7 @@ ldbm_back_delete( AttributeDescription *children = slap_schema.si_ad_children; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_back_delete: %s\n", dn->bv_val )); + LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_delete: %s\n", dn->bv_val, 0, 0 ); #else Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_delete: %s\n", dn->bv_val, 0, 0); #endif @@ -49,8 +48,8 @@ ldbm_back_delete( BerVarray refs; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_delete: no such object %s\n", dn->bv_val )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_delete: no such object %s\n", dn->bv_val, 0, 0 ); #else Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: no such object %s\n", dn->bv_val, 0, 0); @@ -86,9 +85,8 @@ ldbm_back_delete( conn, op, e ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_delete: entry (%s) is a referral.\n", - e->e_dn )); + 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 ); @@ -106,8 +104,8 @@ ldbm_back_delete( if ( has_children( be, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_delete: (%s) is a non-leaf node.\n", dn->bv_val )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_back_delete: (%s) is a non-leaf node.\n", dn->bv_val, 0,0); #else Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: non leaf %s\n", dn->bv_val, 0, 0); @@ -123,8 +121,8 @@ ldbm_back_delete( pdn.bv_len) ) { if( (p = dn2entry_w( be, &pdn, NULL )) == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_delete: parent of (%s) does not exist\n", dn )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_back_delete: parent of (%s) does not exist\n", dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_delete: parent does not exist\n", @@ -141,9 +139,9 @@ ldbm_back_delete( children, NULL, ACL_WRITE, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_delete: no access to parent of (%s)\n", - dn->bv_val )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_back_delete: no access to parent of (%s)\n", + dn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_delete: no access to parent\n", 0, @@ -168,9 +166,9 @@ ldbm_back_delete( /* check parent for "children" acl */ if ( ! rc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, + LDAP_LOG( BACK_LDBM, ERR, "ldbm_back_delete: no access " - "to parent of ("")\n" )); + "to parent of ("")\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_delete: no " @@ -185,9 +183,9 @@ ldbm_back_delete( } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, + LDAP_LOG( BACK_LDBM, ERR, "ldbm_back_delete: (%s) has no " - "parent & not a root.\n", dn )); + "parent & not a root.\n", dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_delete: no parent & " @@ -205,9 +203,8 @@ ldbm_back_delete( /* delete from dn2id mapping */ if ( dn2id_delete( be, &e->e_nname, e->e_id ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_delete: (%s) operations error\n", - dn->bv_val )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_back_delete: (%s) operations error\n", dn->bv_val, 0, 0 ); #else Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: operations error %s\n", @@ -222,9 +219,8 @@ ldbm_back_delete( /* delete from disk and cache */ if ( id2entry_delete( be, e ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_delete: (%s) operations error\n", - dn->bv_val )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_back_delete: (%s) operations error\n", dn->bv_val, 0, 0 ); #else Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: operations error %s\n", diff --git a/servers/slapd/back-ldbm/dn2id.c b/servers/slapd/back-ldbm/dn2id.c index 152ab7a7e3..757d4b0f71 100644 --- a/servers/slapd/back-ldbm/dn2id.c +++ b/servers/slapd/back-ldbm/dn2id.c @@ -30,8 +30,7 @@ dn2id_add( struct berval ptr, pdn; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "dn2id_add: (%s):%ld\n", dn->bv_val, id )); + 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 @@ -41,8 +40,8 @@ dn2id_add( if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "dn2id_add: couldn't open/create dn2id%s\n", LDBM_SUFFIX )); + 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 ); @@ -104,8 +103,7 @@ dn2id_add( ldbm_cache_close( be, db ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "dn2id_add: return %d\n", rc )); + 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 @@ -125,8 +123,7 @@ dn2id( Datum key, data; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "dn2id: (%s)\n", dn->bv_val )); + 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 @@ -136,8 +133,7 @@ dn2id( /* first check the cache */ if ( (*idp = cache_find_entry_ndn2id( be, &li->li_cache, dn )) != NOID ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "dn2id: (%s)%ld in cache.\n", dn, *idp )); + 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 ); @@ -149,8 +145,8 @@ dn2id( if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "dn2id: couldn't open dn2id%s\n", LDBM_SUFFIX )); + 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 ); @@ -177,8 +173,7 @@ dn2id( if ( data.dptr == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "dn2id: (%s) NOID\n", dn )); + LDAP_LOG( BACK_LDBM, INFO, "dn2id: (%s) NOID\n", dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= dn2id NOID\n", 0, 0, 0 ); #endif @@ -194,8 +189,7 @@ dn2id( ldbm_datum_free( db->dbc_db, data ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "dn2id: %ld\n", *idp )); + LDAP_LOG( BACK_LDBM, ENTRY, "dn2id: %ld\n", *idp, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld\n", *idp, 0, 0 ); #endif @@ -215,8 +209,7 @@ dn2idl( Datum key; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "dn2idl: \"%c%s\"\n", prefix, dn->bv_val )); + 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 @@ -232,8 +225,8 @@ dn2idl( if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "dn2idl: could not open dn2id%s\n", LDBM_SUFFIX )); + 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 ); @@ -272,8 +265,8 @@ dn2id_delete( struct berval ptr, pdn; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "dn2id_delete: (%s)%ld\n", dn->bv_val, id )); + 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 @@ -284,8 +277,8 @@ dn2id_delete( if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "dn2id_delete: couldn't open db2id%s\n", LDBM_SUFFIX )); + 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, @@ -342,8 +335,7 @@ dn2id_delete( ldbm_cache_close( be, db ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "dn2id_delete: return %d\n", rc )); + 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 @@ -369,9 +361,8 @@ dn2entry_rw( struct berval pdn; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "dn2entry_rw: %s entry %s\n", rw ? "w" : "r", - dn->bv_val )); + 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); @@ -394,9 +385,9 @@ dn2entry_rw( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "dn2entry_rw: no entry for valid id (%ld), dn (%s)\n", - id, dn->bv_val )); + 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", diff --git a/servers/slapd/back-ldbm/filterindex.c b/servers/slapd/back-ldbm/filterindex.c index bc370f239b..c59145e296 100644 --- a/servers/slapd/back-ldbm/filterindex.c +++ b/servers/slapd/back-ldbm/filterindex.c @@ -39,7 +39,7 @@ filter_candidates( ID_BLOCK *result; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, "filter_candidates: enter\n")); + LDAP_LOG( FILTER, ENTRY, "filter_candidates: enter\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> filter_candidates\n", 0, 0, 0 ); #endif @@ -49,8 +49,8 @@ filter_candidates( switch ( f->f_choice ) { case SLAPD_FILTER_DN_ONE: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "filter_candidates: DN ONE (%s)\n", f->f_dn )); + 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 @@ -65,8 +65,8 @@ filter_candidates( case SLAPD_FILTER_DN_SUBTREE: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "filter_candidates: DN SUBTREE (%s)\n", f->f_dn )); + LDAP_LOG( FILTER, DETAIL1, + "filter_candidates: DN SUBTREE (%s)\n", f->f_dn, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tDN SUBTREE\n", 0, 0, 0 ); #endif @@ -81,8 +81,9 @@ filter_candidates( case LDAP_FILTER_PRESENT: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "filter_candidates: Present (%s)\n", f->f_desc->ad_cname.bv_val )); + 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 @@ -92,10 +93,10 @@ filter_candidates( case LDAP_FILTER_EQUALITY: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, + 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 )); + f->f_ava->aa_value.bv_val, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 ); #endif @@ -105,10 +106,10 @@ filter_candidates( case LDAP_FILTER_APPROX: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, + 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 )); + f->f_ava->aa_value.bv_val, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 ); #endif @@ -118,8 +119,8 @@ filter_candidates( case LDAP_FILTER_SUBSTRINGS: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "filter_candidates: SUBSTRINGS\n")); + LDAP_LOG( FILTER, DETAIL1, + "filter_candidates: SUBSTRINGS\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 ); #endif @@ -129,8 +130,7 @@ filter_candidates( case LDAP_FILTER_GE: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "filter_candidates: GE\n")); + LDAP_LOG( FILTER, DETAIL1, "filter_candidates: GE\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 ); #endif @@ -140,8 +140,7 @@ filter_candidates( case LDAP_FILTER_LE: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "filter_candidates: LE\n" )); + LDAP_LOG( FILTER, DETAIL1, "filter_candidates: LE\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 ); #endif @@ -151,8 +150,7 @@ filter_candidates( case LDAP_FILTER_AND: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "filter_candidates: AND\n" )); + LDAP_LOG( FILTER, DETAIL1, "filter_candidates: AND\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 ); #endif @@ -162,8 +160,7 @@ filter_candidates( case LDAP_FILTER_OR: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "filter_candidates: OR\n" )); + LDAP_LOG( FILTER, DETAIL1, "filter_candidates: OR\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 ); #endif @@ -173,8 +170,7 @@ filter_candidates( case LDAP_FILTER_NOT: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "filter_candidates: NOT\n" )); + LDAP_LOG( FILTER, DETAIL1, "filter_candidates: NOT\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 ); #endif @@ -189,8 +185,7 @@ filter_candidates( break; default: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "filter_candidates: UNKNOWN\n" )); + LDAP_LOG( FILTER, DETAIL1, "filter_candidates: UNKNOWN\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "\tUNKNOWN\n", 0, 0, 0 ); #endif @@ -202,9 +197,9 @@ filter_candidates( } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "filter_candidates: return %ld\n", - result ? ID_BLOCK_NIDS(result) : 0 )); + 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 ); @@ -227,8 +222,7 @@ presence_candidates( struct berval prefix = {0}; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "presence_candidates: enter\n" )); + LDAP_LOG( FILTER, ENTRY, "presence_candidates: enter\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> presence_candidates\n", 0, 0, 0 ); #endif @@ -244,9 +238,8 @@ presence_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, - "presence_candidates: index_param returned %d\n", - rc )); + 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", @@ -259,8 +252,7 @@ presence_candidates( if( dbname == NULL ) { /* not indexed */ #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, - "presence_candidates: not indexed\n" )); + LDAP_LOG( FILTER, INFO, "presence_candidates: not indexed\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= presense_candidates: not indexed\n", @@ -274,9 +266,9 @@ presence_candidates( if ( db == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, + LDAP_LOG( FILTER, INFO, "presence_candidates: db open failed (%s%s)\n", - dbname, LDBM_SUFFIX )); + dbname, LDBM_SUFFIX, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= presense_candidates db open failed (%s%s)\n", @@ -294,8 +286,8 @@ presence_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "presence_candidates: key read failed (%d)\n", rc )); + 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", @@ -305,8 +297,7 @@ presence_candidates( } else if( idl == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "presence_candidates: NULL\n" )); + LDAP_LOG( FILTER, DETAIL1, "presence_candidates: NULL\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= presense_candidates NULL\n", @@ -319,9 +310,9 @@ presence_candidates( ldbm_cache_close( be, db ); #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "presence_candidates: return %ld\n", - idl ? ID_BLOCK_NIDS(idl) : 0 )); + 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 ); @@ -347,8 +338,7 @@ equality_candidates( MatchingRule *mr; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "equality_candidates: enter\n" )); + LDAP_LOG( FILTER, ENTRY, "equality_candidates: enter\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> equality_candidates\n", 0, 0, 0 ); #endif @@ -361,8 +351,8 @@ equality_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "equality_candidates: index_param returned %d\n", rc )); + 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", @@ -375,8 +365,7 @@ equality_candidates( if( dbname == NULL ) { /* not indexed */ #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "equality_candidates: not indexed\n" )); + LDAP_LOG( FILTER, ERR, "equality_candidates: not indexed\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= equality_candidates: not indexed\n", @@ -406,9 +395,9 @@ equality_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, + LDAP_LOG( FILTER, ERR, "equality_candidates: (%s%s) MR filter failed (%d\n", - dbname, LDBM_SUFFIX, rc )); + dbname, LDBM_SUFFIX, rc ); #else Debug( LDAP_DEBUG_TRACE, "<= equality_candidates: (%s%s) MR filter failed (%d)\n", @@ -420,9 +409,8 @@ equality_candidates( if( keys == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "equality_candidates: no keys (%s%s)\n", - dbname, LDBM_SUFFIX )); + 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", @@ -436,9 +424,8 @@ equality_candidates( if ( db == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "equality_candidates: db open failed (%s%s)\n", - dbname, LDBM_SUFFIX )); + 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", @@ -458,8 +445,8 @@ equality_candidates( idl_free( idl ); idl = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "equality_candidates: key read failed (%d)\n", rc )); + 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", @@ -473,8 +460,7 @@ equality_candidates( idl_free( idl ); idl = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, - "equality_candidates NULL\n" )); + LDAP_LOG( FILTER, INFO, "equality_candidates NULL\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= equality_candidates NULL\n", @@ -498,9 +484,9 @@ equality_candidates( #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "equality_candidates: return %ld\n", - idl ? ID_BLOCK_NIDS(idl) : 0 )); + 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 ); @@ -526,8 +512,7 @@ approx_candidates( MatchingRule *mr; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "approx_candidates: enter\n" )); + LDAP_LOG( FILTER, ENTRY, "approx_candidates: enter\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> approx_candidates\n", 0, 0, 0 ); #endif @@ -540,8 +525,8 @@ approx_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "approx_candidates: index_param returned %d\n", rc )); + 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", @@ -554,8 +539,7 @@ approx_candidates( if( dbname == NULL ) { /* not indexed */ #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "approx_candidates: not indexed\n" )); + LDAP_LOG( FILTER, ERR, "approx_candidates: not indexed\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= approx_candidates: not indexed\n", @@ -590,9 +574,9 @@ approx_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, + LDAP_LOG( FILTER, ERR, "approx_candidates: (%s%s) MR filter failed (%d)\n", - dbname, LDBM_SUFFIX, rc )); + dbname, LDBM_SUFFIX, rc ); #else Debug( LDAP_DEBUG_TRACE, "<= approx_candidates: (%s%s) MR filter failed (%d)\n", @@ -604,9 +588,9 @@ approx_candidates( if( keys == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, + LDAP_LOG( FILTER, INFO, "approx_candidates: no keys (%s%s)\n", - dbname, LDBM_SUFFIX )); + dbname, LDBM_SUFFIX, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= approx_candidates: no keys (%s%s)\n", @@ -620,9 +604,9 @@ approx_candidates( if ( db == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "approx_candidates db open failed (%s%s)\n", - dbname, LDBM_SUFFIX )); + 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", @@ -642,8 +626,8 @@ approx_candidates( idl_free( idl ); idl = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "approx_candidates: key read failed (%d)\n", rc )); + 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 ); @@ -656,8 +640,7 @@ approx_candidates( idl_free( idl ); idl = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, - "approx_candidates: NULL\n" )); + LDAP_LOG( FILTER, INFO, "approx_candidates: NULL\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= approx_candidates NULL\n", 0, 0, 0 ); @@ -679,9 +662,9 @@ approx_candidates( ldbm_cache_close( be, db ); #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "approx_candidates: return %ld\n", - idl ? ID_BLOCK_NIDS(idl) : 0 )); + 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 ); @@ -701,8 +684,7 @@ list_candidates( Filter *f; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "list_candidates: 0x%x\n", ftype )); + 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 @@ -713,8 +695,7 @@ list_candidates( if ( (tmp = filter_candidates( be, f )) == NULL && ftype == LDAP_FILTER_AND ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, - "list_candidates: NULL\n" )); + LDAP_LOG( FILTER, INFO, "list_candidates: NULL\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= list_candidates NULL\n", 0, 0, 0 ); @@ -739,9 +720,8 @@ list_candidates( } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "list_candidates: return %ld\n", - idl ? ID_BLOCK_NIDS(idl) : 0 )); + 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 ); @@ -767,8 +747,7 @@ substring_candidates( MatchingRule *mr; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "substrings_candidates: enter\n" )); + LDAP_LOG( FILTER, ENTRY, "substrings_candidates: enter\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> substrings_candidates\n", 0, 0, 0 ); #endif @@ -781,8 +760,8 @@ substring_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "substrings_candidates: index_param returned %d\n", rc )); + 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", @@ -795,8 +774,7 @@ substring_candidates( if( dbname == NULL ) { /* not indexed */ #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "substrings_candidates: not indexed\n" )); + LDAP_LOG( FILTER, ERR, "substrings_candidates: not indexed\n", 0, 0, 0); #else Debug( LDAP_DEBUG_ANY, "<= substrings_candidates: not indexed\n", @@ -827,9 +805,9 @@ substring_candidates( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, + LDAP_LOG( FILTER, ERR, "substrings_candidates: (%s%s) MR filter failed (%d)\n", - dbname, LDBM_SUFFIX, rc )); + dbname, LDBM_SUFFIX, rc ); #else Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates: (%s%s) MR filter failed (%d)\n", @@ -841,9 +819,9 @@ substring_candidates( if( keys == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, + LDAP_LOG( FILTER, ERR, "substrings_candidates: (0x%04lx) no keys (%s%s)\n", - mask, dbname, LDBM_SUFFIX )); + mask, dbname, LDBM_SUFFIX ); #else Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates: (0x%04lx) no keys (%s%s)\n", @@ -857,9 +835,9 @@ substring_candidates( if ( db == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, + LDAP_LOG( FILTER, ERR, "substrings_candidates: db open failed (%s%s)\n", - dbname, LDBM_SUFFIX )); + dbname, LDBM_SUFFIX, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= substrings_candidates db open failed (%s%s)\n", @@ -879,9 +857,8 @@ substring_candidates( idl_free( idl ); idl = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "substrings_candidates: key read failed (%d)\n", - rc )); + 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 ); @@ -894,8 +871,7 @@ substring_candidates( idl_free( idl ); idl = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, - "substrings_candidates: NULL\n" )); + LDAP_LOG( FILTER, INFO, "substrings_candidates: NULL\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates NULL\n", 0, 0, 0 ); @@ -917,9 +893,9 @@ substring_candidates( ldbm_cache_close( be, db ); #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, + LDAP_LOG( FILTER, ENTRY, "substrings_candidates: return %ld\n", - idl ? ID_BLOCK_NIDS(idl) : 0 )); + 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 ); diff --git a/servers/slapd/back-ldbm/group.c b/servers/slapd/back-ldbm/group.c index 11f857b381..f8d5074bc8 100644 --- a/servers/slapd/back-ldbm/group.c +++ b/servers/slapd/back-ldbm/group.c @@ -48,9 +48,9 @@ ldbm_back_group( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, + LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_group: check (%s) member of (%s), oc %s\n", - op_ndn->bv_val, gr_ndn->bv_val, group_oc_name )); + op_ndn->bv_val, gr_ndn->bv_val, group_oc_name ); #else Debug( LDAP_DEBUG_ARGS, "=> ldbm_back_group: gr dn: \"%s\"\n", @@ -72,9 +72,8 @@ ldbm_back_group( /* we already have a LOCKED copy of the entry */ e = target; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_group: target is group (%s)\n", - gr_ndn->bv_val )); + LDAP_LOG( BACK_LDBM, DETAIL1, + "ldbm_back_group: target is group (%s)\n", gr_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "=> ldbm_back_group: target is group: \"%s\"\n", @@ -86,9 +85,9 @@ ldbm_back_group( /* can we find group entry with reader lock */ if ((e = dn2entry_r(be, gr_ndn, NULL )) == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_group: cannot find group (%s)\n", - gr_ndn->bv_val )); + LDAP_LOG( BACK_LDBM, DETAIL1, + "ldbm_back_group: cannot find group (%s)\n", + gr_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "=> ldbm_back_group: cannot find group: \"%s\"\n", @@ -99,8 +98,8 @@ ldbm_back_group( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_group: found group (%s)\n", gr_ndn->bv_val )); + LDAP_LOG( BACK_LDBM, DETAIL1, + "ldbm_back_group: found group (%s)\n", gr_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "=> ldbm_back_group: found group: \"%s\"\n", @@ -119,9 +118,8 @@ ldbm_back_group( if( is_entry_alias( e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_group: group (%s) is an alias\n", - gr_ndn->bv_val )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_group: group (%s) is an alias\n", gr_ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_group: group is an alias\n", 0, 0, 0 ); @@ -132,9 +130,8 @@ ldbm_back_group( if( is_entry_referral( e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_group: group (%s) is a referral.\n", - gr_ndn->bv_val )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_group: group (%s) is a referral.\n", gr_ndn->bv_val,0,0); #else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_group: group is an referral\n", 0, 0, 0 ); @@ -145,9 +142,9 @@ ldbm_back_group( if( !is_entry_objectclass( e, group_oc, 0 ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, + LDAP_LOG( BACK_LDBM, ERR, "ldbm_back_group: failed to find %s in objectClass.\n", - group_oc_name )); + group_oc_name, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_group: failed to find %s in objectClass\n", @@ -159,8 +156,8 @@ ldbm_back_group( if ((attr = attr_find(e->e_attrs, group_at)) == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_group: failed to find %s\n", group_at_name )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_group: failed to find %s\n", group_at_name, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_group: failed to find %s\n", @@ -171,9 +168,9 @@ ldbm_back_group( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, + LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_group: found objectClass %s and %s\n", - group_oc_name, group_at_name )); + group_oc_name, group_at_name, 0 ); #else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_group: found objectClass %s and %s\n", @@ -183,9 +180,9 @@ ldbm_back_group( if( value_find( group_at, attr->a_vals, op_ndn ) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, + LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_group: \"%s\" not in \"%s\": %s\n", - op_ndn->bv_val, gr_ndn->bv_val, group_at_name )); + op_ndn->bv_val, gr_ndn->bv_val, group_at_name ); #else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_group: \"%s\" not in \"%s\": %s\n", @@ -197,9 +194,9 @@ ldbm_back_group( #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, + LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_group: %s is in %s: %s\n", - op_ndn->bv_val, gr_ndn->bv_val, group_at_name )); + op_ndn->bv_val, gr_ndn->bv_val, group_at_name ); #else Debug( LDAP_DEBUG_ACL, "<= ldbm_back_group: \"%s\" is in \"%s\": %s\n", @@ -216,8 +213,7 @@ return_results: } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_back_group: rc=%d\n", rc )); + LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_group: rc=%d\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_group: rc=%d\n", rc, 0, 0 ); #endif diff --git a/servers/slapd/back-ldbm/id2children.c b/servers/slapd/back-ldbm/id2children.c index c27496d573..8c375a6c16 100644 --- a/servers/slapd/back-ldbm/id2children.c +++ b/servers/slapd/back-ldbm/id2children.c @@ -15,7 +15,6 @@ #include "slap.h" #include "back-ldbm.h" - int has_children( Backend *be, @@ -30,8 +29,7 @@ has_children( ldbm_datum_init( key ); #ifdef NEW_LOGGING - LDAP_LOG(( "id2children", LDAP_LEVEL_ENTRY, - "has_children: enter %ld\n", p->e_id )); + 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 @@ -40,9 +38,8 @@ has_children( if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "id2children", LDAP_LEVEL_ERR, - "has_children: could not open \"dn2id%s\"\n", - LDBM_SUFFIX )); + 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", @@ -68,9 +65,9 @@ has_children( } #ifdef NEW_LOGGING - LDAP_LOG(( "id2children", LDAP_LEVEL_ENTRY, + LDAP_LOG( INDEX, ENTRY, "has_children: id (%ld) %s children.\n", - p->e_id, rc ? "has" : "doesn't have" )); + 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 ); diff --git a/servers/slapd/back-ldbm/id2entry.c b/servers/slapd/back-ldbm/id2entry.c index 0bcde14620..2f071b8442 100644 --- a/servers/slapd/back-ldbm/id2entry.c +++ b/servers/slapd/back-ldbm/id2entry.c @@ -33,8 +33,7 @@ id2entry_add( Backend *be, Entry *e ) ldbm_datum_init( data ); #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY, - "id2entry_add: (%s)%ld\n", e->e_dn, e->e_id )); + 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 ); @@ -44,9 +43,9 @@ id2entry_add( Backend *be, Entry *e ) if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR, - "id2entry_add: could not open/create id2entry%s\n", - LDBM_SUFFIX )); + 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 ); @@ -76,8 +75,7 @@ id2entry_add( Backend *be, Entry *e ) ldbm_cache_close( be, db ); #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY, - "id2entry_add: return %d\n", rc )); + 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 @@ -98,8 +96,7 @@ id2entry_delete( Backend *be, Entry *e ) #endif #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY, - "id2entry_delete: (%s)%ld\n", e->e_dn, e->e_id )); + 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 ); @@ -118,9 +115,9 @@ id2entry_delete( Backend *be, Entry *e ) if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR, + LDAP_LOG( INDEX, ERR, "id2entry_delete: could not open/create id2entry%s\n", - LDBM_SUFFIX )); + LDBM_SUFFIX, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry%s\n", LDBM_SUFFIX, 0, 0 ); @@ -131,9 +128,9 @@ id2entry_delete( Backend *be, Entry *e ) if ( cache_delete_entry( &li->li_cache, e ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR, + LDAP_LOG( INDEX, ERR, "id2entry_delete: Could not delete (%s)%ld from cache\n", - e->e_dn, e->e_id )); + 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 ); @@ -154,8 +151,7 @@ id2entry_delete( Backend *be, Entry *e ) ldbm_cache_close( be, db ); #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY, - "id2entry_delete: return %d\n", rc )); + 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 @@ -179,9 +175,8 @@ id2entry_rw( Backend *be, ID id, int rw ) ldbm_datum_init( data ); #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY, - "id2entry_rw: %s (%ld)\n", - rw ? "write" : "read", id )); + 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 ); @@ -190,9 +185,9 @@ id2entry_rw( Backend *be, ID id, int rw ) if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_DETAIL1, + LDAP_LOG( INDEX, DETAIL1, "id2entry_rw: %s (%ld) 0x%lx (cache).\n", - rw ? "write" : "read", id, (unsigned long)e )); + 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 ); @@ -204,8 +199,8 @@ id2entry_rw( Backend *be, ID id, int rw ) if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR, - "id2entry_rw: could not open id2entry%s\n", LDBM_SUFFIX )); + 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 ); @@ -226,8 +221,8 @@ id2entry_rw( Backend *be, ID id, int rw ) if ( data.dptr == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR, - "id2entry_rw: (%ld) not found\n", id )); + 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 ); @@ -243,9 +238,8 @@ id2entry_rw( Backend *be, ID id, int rw ) if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR, - "id2entry_rw: %s of %ld failed\n", - rw ? "write" : "read", id )); + 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 ); @@ -265,9 +259,9 @@ id2entry_rw( Backend *be, ID id, int rw ) */ if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_DETAIL1, + LDAP_LOG( INDEX, DETAIL1, "id2entry_rw: %s of %ld 0x%lx (cache)\n", - rw ? "write" : "read", id, (unsigned long)e )); + 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 ); @@ -277,9 +271,9 @@ id2entry_rw( Backend *be, ID id, int rw ) } #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ERR, + LDAP_LOG( INDEX, ERR, "id2entry_rw: %s of %ld (cache add failed)\n", - rw ? "write" : "read", id )); + rw ? "write" : "read", id, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) (cache add failed)\n", rw ? "w" : "r", id, 0 ); @@ -289,9 +283,9 @@ id2entry_rw( Backend *be, ID id, int rw ) } #ifdef NEW_LOGGING - LDAP_LOG(( "id2entry", LDAP_LEVEL_ENTRY, + LDAP_LOG( INDEX, ENTRY, "id2entry_rw: %s of %ld 0x%lx (disk)\n", - rw ? "write" : "read", id, (unsigned long)e )); + 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 ); diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index 60ca3e6594..a070f46adf 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -104,8 +104,7 @@ idl_free( ID_BLOCK *idl ) { if ( idl == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_INFO, - "idl_free: called with NULL pointer\n" )); + 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", @@ -217,8 +216,8 @@ idl_fetch( if ( (tmp[i] = idl_fetch_one( be, db, data )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_INFO, - "idl_fetch: idl_fetch_one returned NULL\n" )); + 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 ); @@ -259,9 +258,9 @@ idl_fetch( #endif #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ENTRY, + LDAP_LOG( INDEX, ENTRY, "idl_fetch: %ld ids (%ld max)\n", - ID_BLOCK_NIDS(idl), ID_BLOCK_NMAXN(idl) )); + 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 ); @@ -408,8 +407,8 @@ idl_change_first( /* delete old key block */ if ( (rc = ldbm_cache_delete( db, bkey )) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_INFO, - "idl_change_first: ldbm_cache_delete returned %d\n", rc )); + 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", @@ -424,8 +423,8 @@ idl_change_first( if ( (rc = idl_store( be, db, bkey, b )) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_INFO, - "idl_change_first: idl_store returned %d\n", rc )); + 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 ); @@ -438,8 +437,8 @@ idl_change_first( ID_BLOCK_ID(h, pos) = ID_BLOCK_ID(b, 0); if ( (rc = idl_store( be, db, hkey, h )) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_INFO, - "idl_change_first: idl_store returned %s\n", rc )); + 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 ); @@ -572,8 +571,8 @@ idl_insert_key( if ( (tmp = idl_fetch_one( be, db, k2 )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, - "idl_insert_key: nonexistent continuation block\n" )); + 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 ); @@ -589,8 +588,8 @@ idl_insert_key( case 0: /* id inserted ok */ if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, - "ids_insert_key: idl_store returned %d\n", rc )); + 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 ); @@ -632,8 +631,8 @@ idl_insert_key( cont_id( &k2, ID_BLOCK_ID(idl, i) ); if ( (tmp2 = idl_fetch_one( be, db, k2 )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, - "idl_insert_key: idl_fetch_one returned NULL\n")); + 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", @@ -661,8 +660,8 @@ idl_insert_key( if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_ERR, - "idl_insert_key: idl_store returned %d\n", rc )); + 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 ); @@ -692,9 +691,9 @@ idl_insert_key( */ if ( rc == 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_INFO, + LDAP_LOG( INDEX, INFO, "idl_insert_key: id %ld is already in next block\n", - id )); + id, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "idl_insert_key: id %ld already in next block\n", @@ -947,8 +946,8 @@ idl_delete_key ( if ( (tmp = idl_fetch_one( be, db, data )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "idl", LDAP_LEVEL_INFO, - "idl_delete_key: idl_fetch_one returned NULL\n" )); + 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 ); diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 9257ebaabc..f5078c0051 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -160,9 +160,8 @@ static int indexer( if ( db == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ERR, - "index_read: Could not open db %s%s\n", - dbname, LDBM_SUFFIX )); + 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", @@ -299,10 +298,9 @@ index_entry( Attribute *ap ) { #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "index_entry: %s (%s)%ld\n", - op == SLAP_INDEX_ADD_OP ? "add" : "del", - e->e_dn, e->e_id )); + LDAP_LOG( INDEX, ENTRY, + "index_entry: %s (%s)%ld\n", op == SLAP_INDEX_ADD_OP ? "add" : "del", + e->e_dn, e->e_id ); #else Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n", op == SLAP_INDEX_ADD_OP ? "add" : "del", @@ -315,8 +313,7 @@ index_entry( } #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "index_entry: success\n" )); + LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n", op == SLAP_INDEX_ADD_OP ? "add" : "del", diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index d3e16e31c9..be55fac73c 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -202,8 +202,8 @@ ldbm_back_db_open( if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "init", LDAP_LEVEL_ERR, "ldbm_back_db_open: sync " - "ldap_pvt_thread_create failed (%d)\n", rc )); + 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 ); diff --git a/servers/slapd/back-ldbm/key.c b/servers/slapd/back-ldbm/key.c index f84dd62790..0ea188a473 100644 --- a/servers/slapd/back-ldbm/key.c +++ b/servers/slapd/back-ldbm/key.c @@ -28,8 +28,7 @@ key_read( ID_BLOCK *idl; #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "key_read: enter\n" )); + LDAP_LOG( INDEX, ENTRY, "key_read: enter\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 ); #endif @@ -42,9 +41,8 @@ key_read( idl = idl_fetch( be, db, key ); #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "key_read: %ld candidates\n", - idl ? ID_BLOCK_NIDS(idl) : 0 )); + 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 ); @@ -69,9 +67,8 @@ key_change( Datum key; #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "key_change: %s ID %lx\n", - op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long)id )); + 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 ); @@ -95,8 +92,7 @@ key_change( #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "key_change: return %d\n", rc )); + 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 diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 03f81b1687..a34cc06e97 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -41,8 +41,7 @@ int ldbm_modify_internal( Attribute *ap; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_modify_internal: %s\n", dn )); + LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_modify_internal: %s\n", dn, 0, 0 ); #else Debug(LDAP_DEBUG_TRACE, "ldbm_modify_internal: %s\n", dn, 0, 0); #endif @@ -61,8 +60,7 @@ int ldbm_modify_internal( switch ( mod->sm_op ) { case LDAP_MOD_ADD: #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_modify_internal: add\n" )); + 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 @@ -70,9 +68,8 @@ int ldbm_modify_internal( rc = modify_add_values( e, mod, text, textbuf, textlen ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_modify_internal: failed %d (%s)\n", - rc, *text )); + 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); @@ -82,8 +79,7 @@ int ldbm_modify_internal( case LDAP_MOD_DELETE: #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_modify_internal: delete\n" )); + 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 @@ -92,8 +88,8 @@ int ldbm_modify_internal( assert( rc != LDAP_TYPE_OR_VALUE_EXISTS ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_modify_internal: failed %d (%s)\n", rc, *text )); + 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); @@ -103,8 +99,7 @@ int ldbm_modify_internal( case LDAP_MOD_REPLACE: #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_modify_internal: replace\n" )); + 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 @@ -112,8 +107,8 @@ int ldbm_modify_internal( rc = modify_replace_values( e, mod, text, textbuf, textlen ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_modify_internal: failed %d (%s)\n", rc, *text )); + 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); @@ -123,8 +118,8 @@ int ldbm_modify_internal( case SLAP_MOD_SOFTADD: #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_modify_internal: softadd\n" )); + 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 @@ -141,8 +136,8 @@ int ldbm_modify_internal( if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_modify_internal: failed %d (%s)\n", rc, *text )); + 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); @@ -152,8 +147,8 @@ int ldbm_modify_internal( default: #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_modify_internal: invalid op %d\n", mod->sm_op )); + 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); @@ -162,8 +157,8 @@ int ldbm_modify_internal( rc = LDAP_OTHER; *text = "Invalid modify operation"; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_modify_internal: %d (%s)\n", rc, *text )); + 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); @@ -194,9 +189,9 @@ int ldbm_modify_internal( rc = entry_schema_check( be, e, save_attrs, text, textbuf, textlen ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_modify_internal: entry failed schema check: %s\n", - *text )); + 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 ); @@ -220,8 +215,9 @@ int ldbm_modify_internal( SLAP_INDEX_DELETE_OP ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_modify_internal: Attribute index delete failure\n" )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_modify_internal: Attribute index delete failure\n", + 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Attribute index delete failure", @@ -240,8 +236,9 @@ int ldbm_modify_internal( SLAP_INDEX_ADD_OP ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_modify_internal: Attribute index add failure\n" )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_modify_internal: Attribute index add failure\n", + 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Attribute index add failure", @@ -287,8 +284,7 @@ ldbm_back_modify( size_t textlen = sizeof textbuf; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_back_modify: enter\n" )); + 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 @@ -329,8 +325,8 @@ ldbm_back_modify( conn, op, e ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modify: entry (%s) is referral\n", ndn->bv_val )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_modify: entry (%s) is referral\n", ndn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0, 0, 0 ); diff --git a/servers/slapd/back-ldbm/modrdn.c b/servers/slapd/back-ldbm/modrdn.c index 59aee6894c..eb01cee71d 100644 --- a/servers/slapd/back-ldbm/modrdn.c +++ b/servers/slapd/back-ldbm/modrdn.c @@ -74,11 +74,10 @@ ldbm_back_modrdn( int manageDSAit = get_manageDSAit( op ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, + LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_modrdn: dn: %s newSuperior=%s\n", dn->bv_len ? dn->bv_val : "NULL", - ( newSuperior && newSuperior->bv_len ) - ? newSuperior->bv_val : "NULL" )); + ( newSuperior && newSuperior->bv_len ) ? newSuperior->bv_val : "NULL",0 ); #else Debug( LDAP_DEBUG_TRACE, "==>ldbm_back_modrdn: dn: %s newSuperior=%s\n", @@ -124,8 +123,8 @@ ldbm_back_modrdn( conn, op, e ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: entry %s is a referral\n", e->e_dn )); + 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 ); @@ -140,8 +139,8 @@ ldbm_back_modrdn( if ( has_children( be, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: entry %s has children\n", e->e_dn )); + 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 ); @@ -165,8 +164,9 @@ ldbm_back_modrdn( if( (p = dn2entry_w( be, &p_ndn, NULL )) == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: parent of %s does not exist\n", e->e_ndn )); + 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); @@ -183,8 +183,9 @@ ldbm_back_modrdn( children, NULL, ACL_WRITE, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: no access to parent of (%s)\n", e->e_dn )); + 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 ); @@ -196,9 +197,9 @@ ldbm_back_modrdn( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_modrdn: wr to children of entry %s OK\n", - p_ndn.bv_val )); + 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", @@ -212,8 +213,8 @@ ldbm_back_modrdn( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_modrdn: parent dn=%s\n", p_dn.bv_val )); + 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 ); @@ -233,9 +234,8 @@ ldbm_back_modrdn( /* check parent for "children" acl */ if ( ! rc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_modrdn: no access " - "to parent \"\"\n" )); + 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 " @@ -250,9 +250,9 @@ ldbm_back_modrdn( } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_modrdn: (%s) has no " - "parent & not a root.\n", dn )); + LDAP_LOG( BACK_LDBM, ERR, + "ldbm_back_modrdn: (%s) has no parent & not a root.\n", + dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_modrdn: no parent & " @@ -267,8 +267,8 @@ ldbm_back_modrdn( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: (%s) no parent, locked root.\n", e->e_dn )); + 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", @@ -280,9 +280,9 @@ ldbm_back_modrdn( if ( newSuperior != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, + LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_modrdn: new parent \"%s\" requested\n", - newSuperior->bv_val )); + newSuperior->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: new parent \"%s\" requested...\n", @@ -294,10 +294,9 @@ ldbm_back_modrdn( /* newSuperior == oldParent? */ if ( dn_match( &p_ndn, np_ndn ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, "ldbm_back_modrdn: " + LDAP_LOG( BACK_LDBM, INFO, "ldbm_back_modrdn: " "new parent\"%s\" seems to be the same as the " - "old parent \"%s\"\n", - newSuperior->bv_val, p_dn.bv_val )); + "old parent \"%s\"\n", newSuperior->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 " @@ -316,8 +315,9 @@ ldbm_back_modrdn( if ( nnewSuperior->bv_len ) { if( (np = dn2entry_w( be, np_ndn, NULL )) == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_modrdn: newSup(ndn=%s) not found.\n", np_ndn->bv_val )); + 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", @@ -330,9 +330,9 @@ ldbm_back_modrdn( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, + LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_modrdn: wr to new parent OK np=%p, id=%ld\n", - np, np->e_id )); + np, np->e_id, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: wr to new parent OK np=%p, id=%ld\n", @@ -344,8 +344,8 @@ ldbm_back_modrdn( ACL_WRITE, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: no wr to newSup children.\n" )); + 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", @@ -360,8 +360,8 @@ ldbm_back_modrdn( if ( is_entry_alias( np ) ) { /* parent is an alias, don't allow add */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: entry (%s) is an alias.\n", np->e_dn )); + 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 @@ -376,9 +376,9 @@ ldbm_back_modrdn( if ( is_entry_referral( np ) ) { /* parent is a referral, don't allow add */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, + LDAP_LOG( BACK_LDBM, INFO, "ldbm_back_modrdn: entry (%s) is a referral\n", - np->e_dn )); + np->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "entry (%s) is referral\n", np->e_dn, 0, 0 ); @@ -408,9 +408,9 @@ ldbm_back_modrdn( /* check parent for "children" acl */ if ( ! rc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, + LDAP_LOG( BACK_LDBM, ERR, "ldbm_back_modrdn: no access " - "to new superior \"\"\n" )); + "to new superior \"\"\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<=- ldbm_back_modrdn: no " @@ -425,9 +425,9 @@ ldbm_back_modrdn( } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "ldbm_back_modrdn: \"\" " - "not allowed as new superior\n" )); + 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: \"\" " @@ -444,8 +444,8 @@ ldbm_back_modrdn( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_modrdn: wr to new parent's children OK.\n" )); + 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", @@ -460,8 +460,8 @@ ldbm_back_modrdn( dnNormalize2( NULL, &new_dn, &new_ndn ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_modrdn: new ndn=%s\n", new_ndn.bv_val )); + 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 ); @@ -481,8 +481,8 @@ ldbm_back_modrdn( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: new ndn (%s) does not exist\n", new_ndn.bv_val )); + 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", @@ -497,8 +497,9 @@ ldbm_back_modrdn( LDAP_DN_FORMAT_LDAP ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: can't figure out type(s)/value(s) of newrdn\n" )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_modrdn: can't figure out type(s)/value(s) of newrdn\n", + 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: can't figure out type(s)/value(s) of newrdn\n", @@ -511,9 +512,9 @@ ldbm_back_modrdn( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n", - new_rdn[0][0]->la_attr.bv_val, new_rdn[0][0]->la_value.bv_val )); + LDAP_LOG( BACK_LDBM, DETAIL1, + "ldbm_back_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n", + new_rdn[0][0]->la_attr.bv_val, new_rdn[0][0]->la_value.bv_val, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n", @@ -525,8 +526,9 @@ ldbm_back_modrdn( LDAP_DN_FORMAT_LDAP ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: can't figure out the old_rdn type(s)/value(s).\n" )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_modrdn: can't figure out the old_rdn " + "type(s)/value(s).\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: can't figure out the old_rdn type(s)/value(s)\n", @@ -544,9 +546,9 @@ ldbm_back_modrdn( { /* Not a big deal but we may say something */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, + LDAP_LOG( BACK_LDBM, INFO, "ldbm_back_modrdn: old_rdn_type=%s new_rdn_type=%s\n", - old_rdn_types[0], new_rdn_types[0] )); + old_rdn_types[0], new_rdn_types[0], 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: old_rdn_type=%s, new_rdn_type=%s!\n", @@ -556,8 +558,7 @@ ldbm_back_modrdn( #endif #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_modrdn: DN_X500\n" )); + 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 ); @@ -573,9 +574,9 @@ ldbm_back_modrdn( if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: slap_bv2ad error: %s (%s)\n", - text, new_rdn[0][a_cnt]->la_attr.bv_val )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_modrdn: slap_bv2ad error: %s (%s)\n", + text, new_rdn[0][a_cnt]->la_attr.bv_val, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: %s: %s (new)\n", @@ -591,10 +592,9 @@ ldbm_back_modrdn( if ( ! access_allowed( be, conn, op, e, desc, &new_rdn[0][a_cnt]->la_value, ACL_WRITE, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: access " - "not allowed to attr \"%s\"\n", - new_rdn[0][a_cnt]->la_attr.bv_val )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_modrdn: access not allowed to attr \"%s\"\n", + new_rdn[0][a_cnt]->la_attr.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: access not allowed " @@ -624,8 +624,9 @@ ldbm_back_modrdn( /* Get value of old rdn */ if ( old_rdn == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: can't figure out old RDN value(s) from old RDN\n" )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_modrdn: can't figure out old RDN value(s) " + "from old RDN\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: can't figure out oldRDN value(s) from old RDN\n", @@ -646,9 +647,9 @@ ldbm_back_modrdn( if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: %s: %s (old)\n", - text, old_rdn[0][d_cnt]->la_attr.bv_val )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_modrdn: %s: %s (old)\n", + text, old_rdn[0][d_cnt]->la_attr.bv_val, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: %s: %s (old)\n", @@ -664,10 +665,9 @@ ldbm_back_modrdn( if ( ! access_allowed( be, conn, op, e, desc, &old_rdn[0][d_cnt]->la_value, ACL_WRITE, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_back_modrdn: access " - "not allowed to attr \"%s\"\n", - old_rdn[0][d_cnt]->la_attr.bv_val )); + LDAP_LOG( BACK_LDBM, INFO, + "ldbm_back_modrdn: access not allowed to attr \"%s\"\n", + old_rdn[0][d_cnt]->la_attr.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: access not allowed " @@ -693,8 +693,9 @@ ldbm_back_modrdn( mod = mod_tmp; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_back_modrdn: removing old_rdn_val=%s\n", old_rdn[0][d_cnt]->la_value.bv_val )); + LDAP_LOG( BACK_LDBM, DETAIL1, + "ldbm_back_modrdn: removing old_rdn_val=%s\n", + old_rdn[0][d_cnt]->la_value.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: removing old_rdn_val=%s\n", diff --git a/servers/slapd/back-ldbm/nextid.c b/servers/slapd/back-ldbm/nextid.c index 80f6f0f61f..8159ccf39b 100644 --- a/servers/slapd/back-ldbm/nextid.c +++ b/servers/slapd/back-ldbm/nextid.c @@ -27,8 +27,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(( "backend", LDAP_LEVEL_CRIT, - "next_id_read: could not open/create nextid%s\n", LDBM_SUFFIX )); + 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 ); @@ -66,8 +66,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(( "backend", LDAP_LEVEL_CRIT, - "next_id_write: Could not open/create nextid%s\n", LDBM_SUFFIX )); + 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 ); diff --git a/servers/slapd/back-ldbm/passwd.c b/servers/slapd/back-ldbm/passwd.c index ae0f245858..e7df1ae28f 100644 --- a/servers/slapd/back-ldbm/passwd.c +++ b/servers/slapd/back-ldbm/passwd.c @@ -48,9 +48,8 @@ ldbm_back_exop_passwd( &id, NULL, &new, text ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_back_exop_passwd: \"%s\"\n", - id.bv_val ? id.bv_val : "" )); + LDAP_LOG( BACK_LDBM, ENTRY, + "ldbm_back_exop_passwd: \"%s\"\n", id.bv_val ? id.bv_val : "", 0,0 ); #else Debug( LDAP_DEBUG_ARGS, "==> ldbm_back_exop_passwd: \"%s\"\n", id.bv_val ? id.bv_val : "", 0, 0 ); @@ -88,9 +87,9 @@ ldbm_back_exop_passwd( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, + LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_exop_passwd: \"%s\"%s\n", - dn.bv_val, id.bv_len ? " (proxy)" : "" )); + dn.bv_val, id.bv_len ? " (proxy)" : "", 0 ); #else Debug( LDAP_DEBUG_TRACE, "passwd: \"%s\"%s\n", dn.bv_val, id.bv_len ? " (proxy)" : "", 0 ); diff --git a/servers/slapd/back-ldbm/referral.c b/servers/slapd/back-ldbm/referral.c index 48bb7886cc..a1e34bd5b8 100644 --- a/servers/slapd/back-ldbm/referral.c +++ b/servers/slapd/back-ldbm/referral.c @@ -51,9 +51,9 @@ ldbm_back_referrals( matched_dn = ch_strdup( matched->e_dn ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, + LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - op->o_tag, dn->bv_val, matched_dn )); + op->o_tag, dn->bv_val, matched_dn ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", @@ -98,9 +98,9 @@ ldbm_back_referrals( refs, &e->e_name, dn, LDAP_SCOPE_DEFAULT ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, + LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", - op->o_tag, dn->bv_val, e->e_dn )); + op->o_tag, dn->bv_val, e->e_dn ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n", diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 91549f1b8b..87f4b9278b 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -58,8 +58,7 @@ ldbm_back_search( int isroot = 0; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_back_search: enter\n" )); + 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 @@ -142,9 +141,9 @@ ldbm_back_search( ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, + LDAP_LOG( BACK_LDBM, INFO, "ldbm_search: entry (%s) is a referral.\n", - e->e_dn )); + e->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_search: entry is referral\n", @@ -198,8 +197,8 @@ searchit: if ( candidates == NULL ) { /* no candidates */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_search: no candidates\n" )); + 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 ); @@ -313,8 +312,8 @@ searchit: if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_search: candidate %ld not found.\n", id )); + 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", @@ -352,8 +351,8 @@ searchit: } else if ( dnIsSuffix( &e->e_nname, &realbase ) ) { /* alias is within scope */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "ldbm_search: alias \"%s\" in subtree\n", e->e_dn )); + 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", @@ -408,9 +407,9 @@ searchit: } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL2, + LDAP_LOG( BACK_LDBM, DETAIL2, "ldbm_search: candidate referral %ld scope not okay\n", - id )); + id, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "ldbm_search: candidate referral %ld scope not okay\n", @@ -470,8 +469,9 @@ searchit: } } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL2, - "ldbm_search: candidate entry %ld scope not okay\n", id )); + 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", @@ -481,8 +481,9 @@ searchit: } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL2, - "ldbm_search: candidate entry %ld does not match filter\n", id )); + 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", @@ -525,8 +526,7 @@ base_candidate( ID_BLOCK *idl; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "base_candidate: base (%s)\n", e->e_dn )); + 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); @@ -555,9 +555,9 @@ search_candidates( struct berval bv_alias = { sizeof("ALIAS")-1, "ALIAS" }; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, + LDAP_LOG( BACK_LDBM, DETAIL1, "search_candidates: base (%s) scope %d deref %d\n", - e->e_ndn, scope, deref )); + e->e_ndn, scope, deref ); #else Debug(LDAP_DEBUG_TRACE, "search_candidates: base=\"%s\" s=%d d=%d\n", diff --git a/servers/slapd/back-ldbm/tools.c b/servers/slapd/back-ldbm/tools.c index f8858c485b..5d0855bfe5 100644 --- a/servers/slapd/back-ldbm/tools.c +++ b/servers/slapd/back-ldbm/tools.c @@ -47,8 +47,8 @@ int ldbm_tool_entry_open( if ( (id2entry = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, flags )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_CRIT, - "Could not open/create id2entry%s\n", LDBM_SUFFIX )); + 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 ); @@ -189,8 +189,8 @@ ID ldbm_tool_entry_put( e->e_id = li->li_nextid++; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_tool_entry_put: (%s)%ld\n", e->e_dn, e->e_id )); + 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 ); @@ -204,9 +204,9 @@ ID ldbm_tool_entry_put( if( id != NOID ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, + LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_tool_entry_put: \"%s\" already exists (id=%ld)\n", - e->e_dn, id )); + e->e_dn, id, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= ldbm_tool_entry_put: \"%s\" already exists (id=%ld)\n", @@ -262,8 +262,8 @@ int ldbm_tool_entry_reindex( Entry *e; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_tool_entry_reindex: ID=%ld\n", (long)id )); + 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 ); @@ -274,9 +274,9 @@ int ldbm_tool_entry_reindex( if( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "ldbm_tool_entry_reindex: could not locate id %ld\n", - (long)id )); + 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", @@ -294,8 +294,8 @@ int ldbm_tool_entry_reindex( */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "ldbm_tool_entry_reindex: (%s) %ld\n", e->e_dn, id )); + 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 ); diff --git a/servers/slapd/back-meta/add.c b/servers/slapd/back-meta/add.c index 07806e6ea8..ce3d73fecd 100644 --- a/servers/slapd/back-meta/add.c +++ b/servers/slapd/back-meta/add.c @@ -92,8 +92,7 @@ meta_back_add( struct berval mdn = { 0, NULL }, mapped; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, "meta_back_add: %s\n", - e->e_dn )); + LDAP_LOG( BACK_META, ENTRY, "meta_back_add: %s\n", e->e_dn, 0, 0 ); #else /* !NEW_LOGGING */ Debug(LDAP_DEBUG_ARGS, "==> meta_back_add: %s\n%s%s", e->e_dn, "", ""); #endif /* !NEW_LOGGING */ @@ -122,9 +121,8 @@ meta_back_add( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] addDn: \"%s\" -> \"%s\"\n", - e->e_dn, mdn.bv_val )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] addDn: \"%s\" -> \"%s\"\n", e->e_dn, mdn.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> addDn: \"%s\" -> \"%s\"\n%s", e->e_dn, mdn.bv_val, "" ); diff --git a/servers/slapd/back-meta/bind.c b/servers/slapd/back-meta/bind.c index 808bb68909..9dc738a873 100644 --- a/servers/slapd/back-meta/bind.c +++ b/servers/slapd/back-meta/bind.c @@ -102,8 +102,8 @@ meta_back_bind( int realmethod = method; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "meta_back_bind: dn: %s.\n", dn->bv_val )); + LDAP_LOG( BACK_META, ENTRY, + "meta_back_bind: dn: %s.\n", dn->bv_val, 0, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "meta_back_bind: dn: %s.\n%s%s", dn->bv_val, "", "" ); #endif /* !NEW_LOGGING */ @@ -117,9 +117,8 @@ meta_back_bind( lc = meta_back_getconn( li, conn, op, op_type, ndn, NULL ); if ( !lc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_NOTICE, - "meta_back_bind: no target for dn %s.\n", - dn->bv_val )); + LDAP_LOG( BACK_META, NOTICE, + "meta_back_bind: no target for dn %s.\n", dn->bv_val, 0, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "meta_back_bind: no target for dn %s.\n%s%s", @@ -153,10 +152,10 @@ meta_back_bind( * ONE CANDIDATE ONLY! */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_WARNING, + LDAP_LOG( BACK_META, WARNING, "==>meta_back_bind: more than one" " candidate is attempting to bind" - " ...\n" )); + " ...\n" , 0, 0, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "==>meta_back_bind: more than one" @@ -248,8 +247,8 @@ meta_back_do_single_bind( mdn = *dn; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] bindDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] bindDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> bindDn: \"%s\" -> \"%s\"\n%s", @@ -334,12 +333,12 @@ meta_back_dobind( struct metaconn *lc, Operation *op ) if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_WARNING, + LDAP_LOG( BACK_META, WARNING, "meta_back_dobind: (anonymous)" " bind as \"%s\" failed" " with error \"%s\"\n", lsc[ 0 ]->bound_dn.bv_val, - ldap_err2string( rc ) )); + ldap_err2string( rc ), 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "==>meta_back_dobind: (anonymous)" @@ -424,12 +423,12 @@ meta_back_op_result( struct metaconn *lc, Operation *op ) err = ldap_back_map_result( err ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_RESULTS, + LDAP_LOG( BACK_META, RESULTS, "meta_back_op_result: target" " <%d> sending msg \"%s\"" " (matched \"%s\")\n", i, ( msg ? msg : "" ), - ( match ? match : "" ) )); + ( match ? match : "" ) ); #else /* !NEW_LOGGING */ Debug(LDAP_DEBUG_ANY, "==> meta_back_op_result: target" diff --git a/servers/slapd/back-meta/compare.c b/servers/slapd/back-meta/compare.c index 653a951e24..40cc65159a 100644 --- a/servers/slapd/back-meta/compare.c +++ b/servers/slapd/back-meta/compare.c @@ -127,9 +127,8 @@ meta_back_compare( mdn = ( char * )dn->bv_val; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] compareDn: \"%s\" -> \"%s\"\n", - dn->bv_val, mdn )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] compareDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> compareDn: \"%s\" -> \"%s\"\n%s", @@ -314,9 +313,8 @@ finish:; mmatch = ( char * )match; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] matchedDn: \"%s\" -> \"%s\"\n", - match, mmatch )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] matchedDn: \"%s\" -> \"%s\"\n", match, mmatch, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> matchedDn:" " \"%s\" -> \"%s\"\n%s", diff --git a/servers/slapd/back-meta/conn.c b/servers/slapd/back-meta/conn.c index 8f17f60590..739af0e44b 100644 --- a/servers/slapd/back-meta/conn.c +++ b/servers/slapd/back-meta/conn.c @@ -289,9 +289,9 @@ init_one_conn( ber_dupbv( &lsc->bound_dn, &conn->c_dn ); } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] bindDn: \"%s\" -> \"%s\"\n", - conn->c_dn.bv_val, lsc->bound_dn.bv_val )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] bindDn: \"%s\" -> \"%s\"\n", + conn->c_dn.bv_val, lsc->bound_dn.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> bindDn: \"%s\" -> \"%s\"\n", @@ -402,10 +402,9 @@ meta_back_getconn( } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "meta_back_getconn: got target %d" - " for ndn=\"%s\" from cache\n", - i, ndn->bv_val )); + 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", @@ -513,9 +512,8 @@ meta_back_getconn( ldap_pvt_thread_mutex_unlock( &li->conn_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "meta_back_getconn: conn %ld inserted\n", - lc->conn->c_connid )); + 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", @@ -533,9 +531,8 @@ meta_back_getconn( } } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "meta_back_getconn: conn %ld fetched\n", - lc->conn->c_connid )); + 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", diff --git a/servers/slapd/back-meta/delete.c b/servers/slapd/back-meta/delete.c index 7f2087347b..21613c591d 100644 --- a/servers/slapd/back-meta/delete.c +++ b/servers/slapd/back-meta/delete.c @@ -108,9 +108,8 @@ meta_back_delete( mdn = ( char * )dn->bv_val; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] deleteDn: \"%s\" -> \"%s\"\n", - dn->bv_val, mdn )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] deleteDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> deleteDn: \"%s\" -> \"%s\"\n%s", dn->bv_val, mdn, "" ); diff --git a/servers/slapd/back-meta/group.c b/servers/slapd/back-meta/group.c index 53b5ed5aee..14d624aa30 100644 --- a/servers/slapd/back-meta/group.c +++ b/servers/slapd/back-meta/group.c @@ -75,7 +75,6 @@ #include "../back-ldap/back-ldap.h" #include "back-meta.h" - /* return 0 IFF op_dn is a value in group_at (member) attribute * of entry with gr_dn AND that entry has an objectClass * value of group_oc (groupOfNames) @@ -171,10 +170,9 @@ meta_back_group( mop_ndn = *op_ndn; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] bindDn (op ndn in group):" - " \"%s\" -> \"%s\"\n", - op_ndn->bv_val, mop_ndn.bv_val)); + 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):" @@ -203,10 +201,9 @@ meta_back_group( mgr_ndn = *gr_ndn; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] searchBase (gr ndn in group):" - " \"%s\" -> \"%s\"\n", - gr_ndn->bv_val, mgr_ndn.bv_val )); + 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):" diff --git a/servers/slapd/back-meta/modify.c b/servers/slapd/back-meta/modify.c index fb1b676e01..9a2813e38c 100644 --- a/servers/slapd/back-meta/modify.c +++ b/servers/slapd/back-meta/modify.c @@ -112,9 +112,8 @@ meta_back_modify( mdn = ( char * )dn->bv_val; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] modifyDn: \"%s\" -> \"%s\"\n", - dn->bv_val, mdn )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] modifyDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> modifyDn: \"%s\" -> \"%s\"\n%s", dn->bv_val, mdn, "" ); diff --git a/servers/slapd/back-meta/modrdn.c b/servers/slapd/back-meta/modrdn.c index c790e52bf5..1ce1c53146 100644 --- a/servers/slapd/back-meta/modrdn.c +++ b/servers/slapd/back-meta/modrdn.c @@ -143,10 +143,9 @@ meta_back_modrdn( mnewSuperior = ( char * )newSuperior; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] newSuperiorDn:" - " \"%s\" -> \"%s\"\n", - newSuperior, mnewSuperior )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] newSuperiorDn: \"%s\" -> \"%s\"\n", + newSuperior, mnewSuperior, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> newSuperiorDn:" " \"%s\" -> \"%s\"\n%s", @@ -176,9 +175,8 @@ meta_back_modrdn( mdn = ( char * )dn->bv_val; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] modrDn: \"%s\" -> \"%s\"\n", - dn->bv_val, mdn )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] modrDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> modrDn: \"%s\" -> \"%s\"\n%s", dn->bv_val, mdn, "" ); diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 7d00e2a2ff..55c05a746d 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -77,6 +77,7 @@ #include "back-meta.h" #include "ldap_pvt.h" #undef ldap_debug /* silence a warning in ldap-int.h */ +#include "ldap_log.h" #include "../../../libraries/libldap/ldap-int.h" static void @@ -277,9 +278,8 @@ meta_back_search( mbase = realbase; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] searchBase: \"%s\" -> \"%s\"\n", - base->bv_val, mbase )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] searchBase: \"%s\" -> \"%s\"\n", base->bv_val, mbase, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> searchBase: \"%s\" -> \"%s\"\n%s", base->bv_val, mbase, "" ); @@ -317,9 +317,9 @@ meta_back_search( mfilter = *filterstr; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] searchFilter: \"%s\" -> \"%s\"\n", - filterstr->bv_val, mfilter.bv_val )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] searchFilter: \"%s\" -> \"%s\"\n", + filterstr->bv_val, mfilter.bv_val, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> searchFilter: \"%s\" -> \"%s\"\n%s", @@ -464,10 +464,9 @@ meta_back_search( LDAP_OPT_MATCHED_DN, &match ); #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "meta_back_search [%d]" - " match=\"%s\" err=\"%s\"\n", - i, match, err )); + LDAP_LOG( BACK_META, ERR, + "meta_back_search [%d] match=\"%s\" err=\"%s\"\n", + i, match, err ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "=>meta_back_search [%d] match=\"%s\" err=\"%s\"\n", @@ -521,9 +520,8 @@ meta_back_search( mmatch = ( char * )match; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] matchedDn: \"%s\" -> \"%s\"\n", - match, mmatch )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] matchedDn: \"%s\" -> \"%s\"\n", match, mmatch, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> matchedDn:" " \"%s\" -> \"%s\"\n%s", @@ -602,10 +600,9 @@ meta_send_entry( } else { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "[rw] searchResult[%d]:" - " \"%s\" -> \"%s\"\n", - target, bdn.bv_val, ent.e_name.bv_val )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] searchResult[%d]: \"%s\" -> \"%s\"\n", + target, bdn.bv_val, ent.e_name.bv_val ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> searchResult[%d]: \"%s\"" " -> \"%s\"\n", target, bdn.bv_val, ent.e_name.bv_val ); @@ -653,9 +650,8 @@ meta_send_entry( if ( slap_bv2undef_ad( &mapped, &attr->a_desc, &text ) != LDAP_SUCCESS) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "slap_bv2undef_ad(%s): " - "%s\n", mapped.bv_val, text )); + 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): " @@ -723,13 +719,10 @@ meta_send_entry( break; } #ifdef NEW_LOGGING - LDAP_LOG(( "backend", - LDAP_LEVEL_DETAIL1, - "[rw] searchResult on" - " attr=%s:" - " \"%s\" -> \"%s\"\n", - attr->a_desc->ad_type->sat_cname.bv_val, - bv->bv_val, newval )); + LDAP_LOG( BACK_META, DETAIL1, + "[rw] searchResult on attr=%s: \"%s\" -> \"%s\"\n", + attr->a_desc->ad_type->sat_cname.bv_val, + bv->bv_val, newval ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ARGS, "rw> searchResult on attr=%s:" diff --git a/servers/slapd/back-meta/unbind.c b/servers/slapd/back-meta/unbind.c index 7460a020f0..84b36adb21 100644 --- a/servers/slapd/back-meta/unbind.c +++ b/servers/slapd/back-meta/unbind.c @@ -85,9 +85,8 @@ meta_back_conn_destroy( struct metaconn *lc, lc_curr; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "meta_back_conn_destroy: fetching conn %ld\n", - conn->c_connid )); + 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", @@ -105,9 +104,9 @@ meta_back_conn_destroy( int i; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "meta_back_conn_destroy: destroying conn %ld\n", - lc->conn->c_connid )); + 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", diff --git a/servers/slapd/back-monitor/backend.c b/servers/slapd/back-monitor/backend.c index bd65f90639..d147929abe 100644 --- a/servers/slapd/back-monitor/backend.c +++ b/servers/slapd/back-monitor/backend.c @@ -58,10 +58,10 @@ monitor_subsys_backend_init( &monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn, &e_backend ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_backend_init: " "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_backend_init: " @@ -91,11 +91,10 @@ monitor_subsys_backend_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_backend_init: " @@ -124,11 +123,10 @@ monitor_subsys_backend_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_backend_init: " diff --git a/servers/slapd/back-monitor/bind.c b/servers/slapd/back-monitor/bind.c index ab2576a417..9c0cd468ba 100644 --- a/servers/slapd/back-monitor/bind.c +++ b/servers/slapd/back-monitor/bind.c @@ -60,8 +60,8 @@ monitor_back_bind( #endif #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "monitor_back_bind: dn: %s.\n", dn->bv_val )); + LDAP_LOG( BACK_MON, ENTRY, + "monitor_back_bind: dn: %s.\n", dn->bv_val, 0, 0 ); #else Debug(LDAP_DEBUG_ARGS, "==> monitor_back_bind: dn: %s\n%s%s", dn->bv_val, "", ""); diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index 43ba3dc4e4..685df216d4 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -59,10 +59,10 @@ monitor_subsys_conn_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn, &e_conn ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_conn_init: " "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_init: " @@ -87,10 +87,10 @@ monitor_subsys_conn_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_init: " @@ -117,10 +117,10 @@ monitor_subsys_conn_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_init: " @@ -145,10 +145,10 @@ monitor_subsys_conn_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_init: " @@ -175,10 +175,10 @@ monitor_subsys_conn_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_init: " @@ -273,12 +273,11 @@ conn_create( if ( e == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_create: " diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 66b0b0bce4..2ed5225faa 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -61,10 +61,10 @@ monitor_subsys_database_init( &monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn, &e_database ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_database_init: " "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_database_init: " @@ -99,11 +99,10 @@ monitor_subsys_database_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_database_init: " @@ -155,11 +154,10 @@ monitor_subsys_database_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_database_init: " diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index b8637dd0d8..240f64e111 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -236,8 +236,8 @@ monitor_back_db_init( */ if ( be_monitor ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "only one monitor backend is allowed\n" )); + 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%s%s%s", @@ -256,8 +256,8 @@ monitor_back_db_init( rc = dnNormalize2( NULL, &dn, &ndn ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "monitor DN \"" SLAPD_MONITOR_DN "\" backend is allowed\n" )); + LDAP_LOG( OPERATION, CRIT, + "monitor DN \"" SLAPD_MONITOR_DN "\" backend is allowed\n" , 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor DN \"" SLAPD_MONITOR_DN "\" backend is allowed\n", @@ -275,8 +275,8 @@ monitor_back_db_init( if ( slap_str2ad( "description", &monitor_ad_desc, &text ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "monitor_back_db_init: %s\n", text )); + LDAP_LOG( OPERATION, CRIT, + "monitor_back_db_init: %s\n", text, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_backend_init: %s\n%s%s", @@ -302,9 +302,9 @@ monitor_back_db_init( free( dn.bv_val ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor RDN \"%s\" is invalid\n", - dn.bv_val )); + dn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor RDN \"%s\" is invalid\n", @@ -322,9 +322,9 @@ monitor_back_db_init( free( dn.bv_val ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor DN \"%s\" is invalid\n", - dn.bv_val )); + dn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor DN \"%s\" is invalid\n", @@ -344,9 +344,9 @@ monitor_back_db_init( if ( e == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "unable to create '%s' entry\n", - monitor_subsys[ i ].mss_dn.bv_val )); + monitor_subsys[ i ].mss_dn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "unable to create '%s' entry\n", @@ -364,9 +364,9 @@ monitor_back_db_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "unable to add entry '%s' to cache\n", - monitor_subsys[ i ].mss_dn.bv_val )); + monitor_subsys[ i ].mss_dn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "unable to add entry '%s' to cache\n", @@ -392,9 +392,9 @@ monitor_back_db_init( e = str2entry( buf ); if ( e == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "unable to create '%s' entry\n", - SLAPD_MONITOR_DN )); + SLAPD_MONITOR_DN, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "unable to create '%s' entry\n%s%s", @@ -412,9 +412,9 @@ monitor_back_db_init( } if ( attr_merge( e, monitor_ad_desc, bv ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "unable to add description to '%s' entry\n", - SLAPD_MONITOR_DN )); + SLAPD_MONITOR_DN, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "unable to add description to '%s' entry\n%s%s", @@ -432,9 +432,9 @@ monitor_back_db_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "unable to add entry '%s' to cache\n", - SLAPD_MONITOR_DN )); + SLAPD_MONITOR_DN, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "unable to add entry '%s' to cache\n%s%s", @@ -465,8 +465,8 @@ monitor_back_open( rc = dnNormalize2( NULL, &dn, &ndn ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "monitor DN \"" SLAPD_MONITOR_DN "\" is invalid\n" )); + LDAP_LOG( OPERATION, CRIT, + "monitor DN \"" SLAPD_MONITOR_DN "\" is invalid\n" , 0, 0, 0); #else Debug( LDAP_DEBUG_ANY, "monitor DN \"" SLAPD_MONITOR_DN "\" is invalid\n", @@ -480,8 +480,8 @@ monitor_back_open( if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "unable to get monitor backend\n" )); + LDAP_LOG( OPERATION, CRIT, + "unable to get monitor backend\n" , 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "unable to get monitor backend\n", 0, 0, 0 ); @@ -523,8 +523,8 @@ monitor_back_db_config( ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "line %d of file '%s' will be ignored\n", lineno, fname )); + LDAP_LOG( CONFIG, INFO, + "line %d of file '%s' will be ignored\n", lineno, fname, 0 ); #else Debug( LDAP_DEBUG_CONFIG, "line %d of file '%s' will be ignored\n%s", lineno, fname, "" ); diff --git a/servers/slapd/back-monitor/listener.c b/servers/slapd/back-monitor/listener.c index 7dc98bed55..2f8b3b8037 100644 --- a/servers/slapd/back-monitor/listener.c +++ b/servers/slapd/back-monitor/listener.c @@ -58,10 +58,10 @@ monitor_subsys_listener_init( &monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn, &e_listener ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_listener_init: " "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_listener_init: " @@ -74,9 +74,9 @@ monitor_subsys_listener_init( if ( ( l = slapd_get_listeners() ) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_listener_init: " - "unable to get listeners\n" )); + "unable to get listeners\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_listener_init: " @@ -106,11 +106,10 @@ monitor_subsys_listener_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_listener_init: " @@ -151,11 +150,10 @@ monitor_subsys_listener_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_listener_init: " diff --git a/servers/slapd/back-monitor/log.c b/servers/slapd/back-monitor/log.c index aef5d34caa..1c12104b2f 100644 --- a/servers/slapd/back-monitor/log.c +++ b/servers/slapd/back-monitor/log.c @@ -95,10 +95,10 @@ monitor_subsys_log_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn, &e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_log_init: " "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_log_init: " diff --git a/servers/slapd/back-monitor/modify.c b/servers/slapd/back-monitor/modify.c index de6485d2d2..5cf4e29c8f 100644 --- a/servers/slapd/back-monitor/modify.c +++ b/servers/slapd/back-monitor/modify.c @@ -58,8 +58,8 @@ monitor_back_modify( Entry *e; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "monitor_back_modify: enter\n" )); + 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 diff --git a/servers/slapd/back-monitor/operation.c b/servers/slapd/back-monitor/operation.c index b8a0ff4fb4..7686bde2bb 100644 --- a/servers/slapd/back-monitor/operation.c +++ b/servers/slapd/back-monitor/operation.c @@ -75,10 +75,10 @@ monitor_subsys_ops_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn, &e_op ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_ops_init: " "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " @@ -105,11 +105,11 @@ monitor_subsys_ops_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_ops_init: " "unable to create entry 'cn=%s,%s'\n", bv_initiated.bv_val, - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " @@ -136,11 +136,11 @@ monitor_subsys_ops_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_ops_init: " "unable to add entry 'cn=%s,%s'\n", bv_initiated.bv_val, - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " @@ -172,12 +172,12 @@ monitor_subsys_ops_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_ops_init: " "unable to create entry 'cn=%s,cn=%s,%s'\n", bv_op[ i ].bv_val, bv_initiated.bv_val, - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " @@ -204,12 +204,12 @@ monitor_subsys_ops_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_ops_init: " "unable to add entry 'cn=%s,cn=%s,%s'\n", bv_op[ i ].bv_val, bv_initiated.bv_val, - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " @@ -241,11 +241,11 @@ monitor_subsys_ops_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_ops_init: " "unable to create entry 'cn=%s,%s'\n", bv_completed.bv_val, - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " @@ -271,11 +271,11 @@ monitor_subsys_ops_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_ops_init: " "unable to add entry 'cn=%s,%s'\n", bv_completed.bv_val, - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " @@ -307,12 +307,12 @@ monitor_subsys_ops_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_ops_init: " "unable to create entry 'cn=%s,cn=%s,%s'\n", bv_op[ i ].bv_val, bv_completed.bv_val, - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " @@ -338,12 +338,12 @@ monitor_subsys_ops_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_ops_init: " "unable to add entry 'cn=%s,cn=%s,%s'\n", bv_op[ i ].bv_val, bv_completed.bv_val, - monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_ops_init: " diff --git a/servers/slapd/back-monitor/search.c b/servers/slapd/back-monitor/search.c index cfc199e4fd..16d49e8495 100644 --- a/servers/slapd/back-monitor/search.c +++ b/servers/slapd/back-monitor/search.c @@ -157,8 +157,8 @@ monitor_back_search( int nentries = 0; #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "monitor_back_search: enter\n" )); + 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 diff --git a/servers/slapd/back-monitor/sent.c b/servers/slapd/back-monitor/sent.c index 39926e338d..673fd63a12 100644 --- a/servers/slapd/back-monitor/sent.c +++ b/servers/slapd/back-monitor/sent.c @@ -57,10 +57,10 @@ monitor_subsys_sent_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn, &e_sent ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_sent_init: " "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " @@ -85,10 +85,10 @@ monitor_subsys_sent_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " @@ -114,10 +114,10 @@ monitor_subsys_sent_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " @@ -142,10 +142,10 @@ monitor_subsys_sent_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " @@ -170,10 +170,10 @@ monitor_subsys_sent_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " @@ -198,10 +198,10 @@ monitor_subsys_sent_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " @@ -226,10 +226,10 @@ monitor_subsys_sent_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " @@ -254,10 +254,10 @@ monitor_subsys_sent_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " @@ -282,10 +282,10 @@ monitor_subsys_sent_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_sent_init: " diff --git a/servers/slapd/back-monitor/thread.c b/servers/slapd/back-monitor/thread.c index 63b7476270..112ada7efc 100644 --- a/servers/slapd/back-monitor/thread.c +++ b/servers/slapd/back-monitor/thread.c @@ -57,9 +57,9 @@ monitor_subsys_thread_init( &monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn, &e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_thread_init: unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val )); + 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", diff --git a/servers/slapd/back-monitor/time.c b/servers/slapd/back-monitor/time.c index 8bd0b8045d..ea76d6ee8d 100644 --- a/servers/slapd/back-monitor/time.c +++ b/servers/slapd/back-monitor/time.c @@ -73,10 +73,10 @@ monitor_subsys_time_init( if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn, &e_time ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + LDAP_LOG( OPERATION, CRIT, "monitor_subsys_time_init: " "unable to get entry '%s'\n", - monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val )); + monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_time_init: " @@ -118,10 +118,10 @@ monitor_subsys_time_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_time_init: " @@ -142,10 +142,10 @@ monitor_subsys_time_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_time_init: " @@ -179,10 +179,10 @@ monitor_subsys_time_init( e = str2entry( buf ); if ( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_time_init: " @@ -203,10 +203,10 @@ monitor_subsys_time_init( if ( monitor_cache_add( mi, e ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, + 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 )); + monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_time_init: " diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index a962aabd06..a9d5253785 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -124,8 +124,8 @@ int backend_init(void) if((nBackendInfo != 0) || (backendInfo != NULL)) { /* already initialized */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "backend_init: backend already initialized\n" )); + 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 ); @@ -141,9 +141,9 @@ int backend_init(void) if(rc != 0) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, + LDAP_LOG( BACKEND, INFO, "backend_init: initialized for type \"%s\"\n", - binfo[nBackendInfo].bi_type )); + binfo[nBackendInfo].bi_type, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "backend_init: initialized for type \"%s\"\n", @@ -173,8 +173,7 @@ int backend_init(void) #else #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, - "backend_init: failed\n" )); + LDAP_LOG( BACKEND, ERR, "backend_init: failed\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "backend_init: failed\n", @@ -191,9 +190,9 @@ int backend_add(BackendInfo *aBackendInfo) if ((rc = aBackendInfo->bi_init(aBackendInfo)) != 0) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_ERR, + LDAP_LOG( BACKEND, ERR, "backend_add: initialization for type \"%s\" failed\n", - aBackendInfo->bi_type )); + aBackendInfo->bi_type, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "backend_add: initialization for type \"%s\" failed\n", @@ -232,9 +231,8 @@ int backend_startup(Backend *be) if( ! ( nBackendDB > 0 ) ) { /* no databases */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_INFO, - "backend_startup: %d databases to startup. \n", - nBackendDB )); + 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", @@ -246,9 +244,8 @@ int backend_startup(Backend *be) if(be != NULL) { /* startup a specific backend database */ #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1, - "backend_startup: starting \"%s\"\n", - be->be_suffix[0].bv_val )); + LDAP_LOG( BACKEND, DETAIL1, "backend_startup: starting \"%s\"\n", + be->be_suffix[0].bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "backend_startup: starting \"%s\"\n", @@ -261,8 +258,7 @@ int backend_startup(Backend *be) if(rc != 0) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_CRIT, - "backend_startup: bi_open failed!\n" )); + LDAP_LOG( BACKEND, CRIT, "backend_startup: bi_open failed!\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "backend_startup: bi_open failed!\n", @@ -278,8 +274,8 @@ int backend_startup(Backend *be) if(rc != 0) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_CRIT, - "backend_startup: bi_db_open failed! (%d)\n", rc )); + 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", @@ -305,8 +301,8 @@ int backend_startup(Backend *be) if(rc != 0) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_CRIT, - "backend_startup: bi_open %d failed!\n", i )); + 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", @@ -328,9 +324,8 @@ int backend_startup(Backend *be) if(rc != 0) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_CRIT, - "backend_startup: bi_db_open(%d) failed! (%d)\n", - i, rc )); + LDAP_LOG( BACKEND, CRIT, + "backend_startup: bi_db_open(%d) failed! (%d)\n", i, rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "backend_startup: bi_db_open(%d) failed! (%d)\n", @@ -388,9 +383,9 @@ int backend_shutdown( Backend *be ) if(rc != 0) { #ifdef NEW_LOGGING - LDAP_LOG(( "backend", LDAP_LEVEL_NOTICE, - "backend_shutdown: bi_close %s failed!\n", - backendDB[i].be_type )); + LDAP_LOG( BACKEND, NOTICE, + "backend_shutdown: bi_close %s failed!\n", + backendDB[i].be_type, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "backend_close: bi_close %s failed!\n", diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index 15055120b4..45c2fab3fb 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -48,8 +48,7 @@ do_bind( Backend *be; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "do_bind: conn %d\n", conn->c_connid )); + LDAP_LOG( OPERATION, ENTRY, "do_bind: conn %d\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "do_bind\n", 0, 0, 0 ); #endif @@ -97,8 +96,8 @@ do_bind( if ( tag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_bind: conn %d ber_scanf failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_bind: conn %d ber_scanf failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "bind: ber_scanf failed\n", 0, 0, 0 ); #endif @@ -144,8 +143,8 @@ do_bind( if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "do_bind: conn %d get_ctrls failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, INFO, + "do_bind: conn %d get_ctrls failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_bind: get_ctrls failed\n", 0, 0, 0 ); #endif @@ -155,9 +154,9 @@ do_bind( rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "do_bind: conn %d invalid dn (%s)\n", - conn->c_connid, dn.bv_val )); + LDAP_LOG( OPERATION, INFO, + "do_bind: conn %d invalid dn (%s)\n", + conn->c_connid, dn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "bind: invalid dn (%s)\n", dn.bv_val, 0, 0 ); @@ -169,9 +168,9 @@ do_bind( if( method == LDAP_AUTH_SASL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "do_sasl_bind: conn %d dn (%s) mech %s\n", conn->c_connid, - pdn.bv_val, mech.bv_val )); + LDAP_LOG( OPERATION, DETAIL1, + "do_sasl_bind: conn %d dn (%s) mech %s\n", + conn->c_connid, pdn.bv_val, mech.bv_val ); #else Debug( LDAP_DEBUG_TRACE, "do_sasl_bind: dn (%s) mech %s\n", pdn.bv_val, mech.bv_val, NULL ); @@ -179,10 +178,9 @@ do_bind( } else { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "do_bind: conn %d version=%ld dn=\"%s\" method=%ld\n", - conn->c_connid, (unsigned long) version, - pdn.bv_val, (unsigned long)method )); + LDAP_LOG( OPERATION, DETAIL1, + "do_bind: version=%ld dn=\"%s\" method=%ld\n", + (unsigned long) version, pdn.bv_val, (unsigned long)method ); #else Debug( LDAP_DEBUG_TRACE, "do_bind: version=%ld dn=\"%s\" method=%ld\n", @@ -196,9 +194,9 @@ do_bind( if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_bind: conn %d unknown version = %ld\n", - conn->c_connid, (unsigned long)version )); + conn->c_connid, (unsigned long)version, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_bind: unknown version=%ld\n", (unsigned long) version, 0, 0 ); @@ -236,9 +234,9 @@ do_bind( if ( version < LDAP_VERSION3 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_bind: conn %d sasl with LDAPv%ld\n", - conn->c_connid, (unsigned long)version )); + conn->c_connid, (unsigned long)version , 0 ); #else Debug( LDAP_DEBUG_ANY, "do_bind: sasl with LDAPv%ld\n", (unsigned long) version, 0, 0 ); @@ -251,9 +249,9 @@ do_bind( if( mech.bv_len == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_bind: conn %d no SASL mechanism provided\n", - conn->c_connid )); + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_bind: no sasl mechanism provided\n", @@ -378,9 +376,9 @@ do_bind( send_ldap_result( conn, op, rc, NULL, text, NULL, NULL ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, + LDAP_LOG( OPERATION, DETAIL1, "do_bind: conn %d v%d anonymous bind\n", - conn->c_connid, version )); + conn->c_connid, version , 0 ); #else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d anonymous bind\n", version, 0, 0 ); @@ -395,9 +393,9 @@ do_bind( send_ldap_result( conn, op, rc, NULL, text, NULL, NULL ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_bind: conn %d v%d simple bind(%s) disallowed\n", - conn->c_connid, version, ndn.bv_val )); + conn->c_connid, version, ndn.bv_val ); #else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d simple bind(%s) disallowed\n", @@ -416,9 +414,9 @@ do_bind( NULL, text, NULL, NULL ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "do_bind: conn %d " + LDAP_LOG( OPERATION, INFO, "do_bind: conn %d " "v%d unprotected simple bind(%s) disallowed\n", - conn->c_connid, version, ndn.bv_val )); + conn->c_connid, version, ndn.bv_val ); #else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d unprotected simple bind(%s) disallowed\n", @@ -437,9 +435,9 @@ do_bind( send_ldap_result( conn, op, rc, NULL, text, NULL, NULL ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, + LDAP_LOG( OPERATION, DETAIL1, "do_bind: conn %d v%d Kerberos V4 bind\n", - conn->c_connid, version )); + conn->c_connid, version , 0 ); #else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d Kerberos V4 bind\n", version, 0, 0 ); @@ -455,9 +453,9 @@ do_bind( send_ldap_result( conn, op, rc, NULL, text, NULL, NULL ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_bind: conn %ld v%d unknown authentication method (%ld)\n", - conn->c_connid, version, method )); + conn->c_connid, version, method ); #else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d unknown authentication method (%ld)\n", @@ -534,9 +532,9 @@ do_bind( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "do_bind: conn %d v%d bind: \"%s\" to \"%s\" \n", - conn->c_connid, version, dn.bv_val, conn->c_dn.bv_val )); + LDAP_LOG( OPERATION, DETAIL1, + "do_bind: v%d bind: \"%s\" to \"%s\" \n", + version, conn->c_dn.bv_val, conn->c_dn.bv_val ); #else Debug( LDAP_DEBUG_TRACE, "do_bind: v%d bind: \"%s\" to \"%s\"\n", diff --git a/servers/slapd/ch_malloc.c b/servers/slapd/ch_malloc.c index a1ea2d31ce..c9af173946 100644 --- a/servers/slapd/ch_malloc.c +++ b/servers/slapd/ch_malloc.c @@ -29,9 +29,8 @@ ch_malloc( if ( (new = (void *) ber_memalloc( size )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "ch_malloc: allocation of %lu bytes failed\n", - (long)size )); + 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 ); @@ -61,8 +60,8 @@ ch_realloc( if ( (new = (void *) ber_memrealloc( block, size )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "ch_realloc: reallocation of %lu bytes failed\n", (long)size )); + 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 ); @@ -84,9 +83,9 @@ ch_calloc( if ( (new = (void *) ber_memcalloc( nelem, size )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, + LDAP_LOG( OPERATION, ERR, "ch_calloc: allocation of %lu elements of %lu bytes faild\n", - (long)nelem, (long)size )); + (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 ); @@ -107,8 +106,8 @@ ch_strdup( if ( (new = ber_strdup( string )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "chr_strdup: duplication of \"%s\" failed\n", string )); + 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 diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index ead4af626e..b62d69dc4a 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -50,8 +50,7 @@ do_compare( ava.aa_desc = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "do_compare: conn %d\n", conn->c_connid )); + LDAP_LOG( OPERATION, ENTRY, "do_compare: conn %d\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "do_compare\n", 0, 0, 0 ); #endif @@ -69,8 +68,8 @@ do_compare( if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_compare: conn %d ber_scanf failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_compare: conn %d ber_scanf failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); #endif @@ -81,8 +80,8 @@ do_compare( if ( ber_scanf( op->o_ber, "{mm}", &desc, &value ) == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_compare: conn %d get ava failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_compare: conn %d get ava failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_compare: get ava failed\n", 0, 0, 0 ); #endif @@ -94,8 +93,8 @@ do_compare( if ( ber_scanf( op->o_ber, /*{*/ "}" ) == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_compare: conn %d ber_scanf failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_compare: conn %d ber_scanf failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); #endif @@ -107,8 +106,8 @@ do_compare( if( ( rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "do_compare: conn %d get_ctrls failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, INFO, + "do_compare: conn %d get_ctrls failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_compare: get_ctrls failed\n", 0, 0, 0 ); #endif @@ -118,9 +117,9 @@ do_compare( rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_compare: conn %d invalid dn (%s)\n", - conn->c_connid, dn.bv_val )); + conn->c_connid, dn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_compare: invalid dn (%s)\n", dn.bv_val, 0, 0 ); @@ -145,10 +144,9 @@ do_compare( if( strcasecmp( ndn.bv_val, LDAP_ROOT_DSE ) == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "do_compare: conn %d dn (%s) attr(%s) value (%s)\n", - conn->c_connid, pdn.bv_val, - ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val )); + LDAP_LOG( OPERATION, ARGS, + "do_compare: dn (%s) attr(%s) value (%s)\n", + pdn.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", pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); @@ -173,10 +171,10 @@ do_compare( } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "do_compare: conn %d dn (%s) attr(%s) value (%s)\n", - conn->c_connid, pdn.bv_val, ava.aa_desc->ad_cname.bv_val, - ava.aa_value.bv_val )); + LDAP_LOG( OPERATION, ARGS, + "do_compare: dn (%s) attr(%s) value (%s)\n", + pdn.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", pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); @@ -249,10 +247,9 @@ do_compare( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "do_compare: conn %d dn (%s) attr(%s) value (%s)\n", - conn->c_connid, pdn.bv_val, ava.aa_desc->ad_cname.bv_val, - ava.aa_value.bv_val )); + LDAP_LOG( OPERATION, ARGS, + "do_compare: dn (%s) attr(%s) value (%s)\n", + pdn.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", pdn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val ); diff --git a/servers/slapd/config.c b/servers/slapd/config.c index d3619af889..656fb12d71 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -96,9 +96,9 @@ read_config( const char *fname ) if ( (fp = fopen( fname, "r" )) == NULL ) { ldap_syslog = 1; #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_ENTRY, "read_config: " - "could not open config file \"%s\": %s (%d)\n", - fname, strerror(errno), errno )); + 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", @@ -108,8 +108,8 @@ read_config( const char *fname ) } #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_ENTRY, - "read_config: reading config file %s\n", fname )); + 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 @@ -132,9 +132,8 @@ read_config( const char *fname ) if ( cargc < 1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: bad config line (ignored)\n", - fname, lineno )); + 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", @@ -147,9 +146,9 @@ read_config( const char *fname ) if ( strcasecmp( cargv[0], "backend" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s : line %d: missing type in \"backend\" line.\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing type in \"backend \" line\n", @@ -161,9 +160,9 @@ read_config( const char *fname ) if( be != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: backend line must appear before any " - "database definition.\n", fname, lineno )); + "database definition.\n", fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: backend line must appear before any database definition\n", @@ -177,9 +176,9 @@ read_config( const char *fname ) if( bi == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "read_config: backend %s initialization failed.\n", - cargv[1] )); + cargv[1], 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "backend %s initialization failed.\n", @@ -191,9 +190,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "database" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing type in \"database \" line\n", - fname, lineno )); + 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", @@ -208,9 +207,8 @@ read_config( const char *fname ) if( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "database %s initialization failed.\n", - cargv[1] )); + LDAP_LOG( CONFIG, CRIT, + "database %s initialization failed.\n", cargv[1], 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "database %s initialization failed.\n", @@ -225,9 +223,9 @@ read_config( const char *fname ) int c; if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing level in \"concurrency \" line\n", @@ -241,10 +239,9 @@ read_config( const char *fname ) if( c < 1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: invalid level (%d) in " - "\"concurrency \" line.\n", - fname, lineno, c )); + 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", @@ -261,9 +258,9 @@ read_config( const char *fname ) long max; if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing max in \"sockbuf_max_incoming \" line\n", - fname, lineno )); + 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", @@ -277,10 +274,10 @@ read_config( const char *fname ) if( max < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: invalid max value (%ld) in " "\"sockbuf_max_incoming \" line.\n", - fname, lineno, max )); + fname, lineno, max ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid max value (%ld) in " @@ -298,9 +295,9 @@ read_config( const char *fname ) long max; if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing max in \"sockbuf_max_incoming_auth \" line\n", - fname, lineno )); + 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", @@ -314,10 +311,10 @@ read_config( const char *fname ) if( max < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: invalid max value (%ld) in " "\"sockbuf_max_incoming_auth \" line.\n", - fname, lineno, max )); + fname, lineno, max ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid max value (%ld) in " @@ -334,9 +331,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "defaultSearchBase" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing dn in \"defaultSearchBase \" line\n", @@ -347,10 +344,10 @@ read_config( const char *fname ) } else if ( cargc > 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: extra cruft after in " "\"defaultSearchBase %s\" line (ignored)\n", - fname, lineno, cargv[1] )); + fname, lineno, cargv[1] ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "extra cruft after in \"defaultSearchBase %s\", " @@ -361,10 +358,10 @@ read_config( const char *fname ) if ( bi != NULL || be != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: defaultSearchBase line must appear " "prior to any backend or database definitions\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "defaultSearchBaase line must appear prior to " @@ -377,10 +374,10 @@ read_config( const char *fname ) if ( default_search_nbase.bv_len ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: " + LDAP_LOG( CONFIG, INFO, "%s: line %d: " "default search base \"%s\" already defined " "(discarding old)\n", fname, lineno, - default_search_base.bv_val )); + default_search_base.bv_val ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "default search base \"%s\" already defined " @@ -406,9 +403,9 @@ read_config( const char *fname ) if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: defaultSearchBase DN is invalid.\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: defaultSearchBase DN is invalid\n", @@ -423,9 +420,9 @@ read_config( const char *fname ) int c; if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing count in \"threads \" line\n", - fname, lineno )); + 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", @@ -439,9 +436,9 @@ read_config( const char *fname ) if( c < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: invalid level (%d) in \"threads \"" - "line\n",fname, lineno, c )); + "line\n", fname, lineno, c ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid level (%d) in \"threads \" line\n", @@ -460,9 +457,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "pidfile" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d missing file name in \"pidfile \" line.\n", - fname, lineno )); + 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", @@ -478,10 +475,10 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "argsfile" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: %d: missing file name in " "\"argsfile \" line.\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing file name in \"argsfile \" line\n", @@ -497,10 +494,10 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "password-hash" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing hash in " "\"password-hash \" line.\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing hash in \"password-hash \" line\n", @@ -511,9 +508,9 @@ read_config( const char *fname ) } if ( default_passwd_hash != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: already set default password_hash!\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: already set default password_hash!\n", @@ -526,9 +523,9 @@ read_config( const char *fname ) if ( lutil_passwd_scheme( cargv[1] ) == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: password scheme \"%s\" not available\n", - fname, lineno, cargv[1] )); + fname, lineno, cargv[1] ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: password scheme \"%s\" not available\n", @@ -543,10 +540,10 @@ read_config( const char *fname ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing format in " "\"password-crypt-salt-format \" line\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing format in " "\"password-crypt-salt-format \" line\n", @@ -570,10 +567,9 @@ read_config( const char *fname ) int err; if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing path in " - "\"ucdata-path \" line.\n", - fname, lineno )); + "\"ucdata-path \" line.\n", fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing path in \"ucdata-path \" line\n", @@ -587,11 +583,10 @@ read_config( const char *fname ) if ( err <= 0 ) { if ( err == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + 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 )); + "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", @@ -609,9 +604,9 @@ read_config( const char *fname ) if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing limit in \"sizelimit \" line.\n", - fname, lineno )); + 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", @@ -637,12 +632,10 @@ read_config( const char *fname ) if ( rc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: unable " - "to parse value \"%s\" " - "in \"sizelimit " - "\" line.\n", - fname, lineno, cargv[i] )); + 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 " @@ -661,9 +654,9 @@ read_config( const char *fname ) if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d missing limit in \"timelimit \" line.\n", - fname, lineno )); + 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", @@ -689,12 +682,10 @@ read_config( const char *fname ) if ( rc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: unable " - "to parse value \"%s\" " - "in \"timelimit " - "\" line.\n", - fname, lineno, cargv[i] )); + 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 " @@ -710,9 +701,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "limits" ) == 0 ) { if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_WARNING, - "%s: line %d \"limits\" allowed only in database environment.\n", - fname, lineno )); + 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", @@ -729,9 +720,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "subordinate" ) == 0 ) { if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: " + LDAP_LOG( CONFIG, INFO, "%s: line %d: " "subordinate keyword must appear inside a database " - "definition.\n", fname, lineno )); + "definition.\n", fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix line " "must appear inside a database definition.\n", @@ -751,9 +742,9 @@ read_config( const char *fname ) if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing dn in \"suffix \" line.\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "missing dn in \"suffix \" line\n", @@ -764,9 +755,9 @@ read_config( const char *fname ) } else if ( cargc > 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: extra cruft after in \"suffix %s\"" - " line (ignored).\n", fname, lineno, cargv[1] )); + " line (ignored).\n", fname, lineno, cargv[1] ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: extra cruft " "after in \"suffix %s\" line (ignored)\n", @@ -776,9 +767,9 @@ read_config( const char *fname ) if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: suffix line must appear inside a database " - "definition.\n", fname, lineno )); + "definition.\n", fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix line " "must appear inside a database definition\n", @@ -790,9 +781,9 @@ read_config( const char *fname ) /* "cn=Monitor" is reserved for monitoring slap */ } else if ( strcasecmp( cargv[1], SLAPD_MONITOR_DN ) == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: \"" + LDAP_LOG( CONFIG, CRIT, "%s: line %d: \"" SLAPD_MONITOR_DN "\" is reserved for monitoring slapd\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: \"" SLAPD_MONITOR_DN "\" is reserved for monitoring slapd\n", @@ -810,9 +801,9 @@ read_config( const char *fname ) rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: suffix DN is invalid.\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix DN is invalid\n", @@ -824,9 +815,9 @@ read_config( const char *fname ) tmp_be = select_backend( &ndn, 0, 0 ); if ( tmp_be == be ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: suffix already served by this backend " - "(ignored)\n", fname, lineno )); + "(ignored)\n", fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix " "already served by this backend (ignored)\n", @@ -837,10 +828,10 @@ read_config( const char *fname ) } else if ( tmp_be != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + 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 )); + tmp_be->be_suffix[0].bv_val ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix " "already served by a preceeding backend \"%s\"\n", @@ -852,10 +843,10 @@ read_config( const char *fname ) } else if( pdn.bv_len == 0 && default_search_nbase.bv_len ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + 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 )); + fname, lineno, default_search_base.bv_val ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "suffix DN empty and default " @@ -875,10 +866,10 @@ read_config( const char *fname ) if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing alias and aliased_dn in " "\"suffixAlias \" line.\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing alias and aliased_dn in " @@ -889,10 +880,10 @@ read_config( const char *fname ) return( 1 ); } else if ( cargc < 3 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing aliased_dn in " "\"suffixAlias \" line\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing aliased_dn in " @@ -903,9 +894,9 @@ read_config( const char *fname ) } else if ( cargc > 3 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: extra cruft in suffixAlias line (ignored)\n", - fname, lineno )); + fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: extra cruft in suffixAlias line (ignored)\n", @@ -915,9 +906,9 @@ read_config( const char *fname ) if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: suffixAlias line must appear inside a " - "database definition.\n", fname, lineno )); + 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: suffixAlias line" @@ -935,9 +926,8 @@ read_config( const char *fname ) rc = dnPrettyNormal( NULL, &alias, &palias, &nalias ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: alias DN is invalid.\n", - fname, lineno )); + LDAP_LOG( CONFIG, CRIT, + "%s: line %d: alias DN is invalid.\n", fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: alias DN is invalid\n", @@ -950,10 +940,10 @@ read_config( const char *fname ) free( nalias.bv_val ); if ( tmp_be && tmp_be != be ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: suffixAlias served by a preceeding " - "backend \"%s\"\n", - fname, lineno, tmp_be->be_suffix[0].bv_val )); + "backend \"%s\"\n", fname, lineno, + tmp_be->be_suffix[0].bv_val ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffixAlias served by" @@ -970,9 +960,8 @@ read_config( const char *fname ) rc = dnPrettyNormal( NULL, &aliased, &paliased, &naliased ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: aliased DN is invalid.\n", - fname, lineno )); + LDAP_LOG( CONFIG, CRIT, + "%s: line %d: aliased DN is invalid.\n", fname, lineno,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: aliased DN is invalid\n", @@ -986,10 +975,10 @@ read_config( const char *fname ) free( naliased.bv_val ); if ( tmp_be && tmp_be != be ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: suffixAlias derefs to a different backend " "a preceeding backend \"%s\"\n", - fname, lineno, tmp_be->be_suffix[0].bv_val )); + fname, lineno, tmp_be->be_suffix[0].bv_val ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: suffixAlias derefs to differnet backend" @@ -1009,9 +998,9 @@ read_config( const char *fname ) int i; if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing depth in \"maxDerefDepth \"" - " line\n", fname, lineno )); + " line\n", fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing depth in \"maxDerefDepth \" line\n", @@ -1022,9 +1011,9 @@ read_config( const char *fname ) } if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: depth line must appear inside a database " - "definition.\n", fname, lineno )); + "definition.\n", fname, lineno ,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: depth line must appear inside a database definition.\n", @@ -1034,9 +1023,9 @@ read_config( const char *fname ) } else if ((i = atoi(cargv[1])) < 0) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: depth must be positive.\n", - fname, lineno )); + fname, lineno ,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: depth must be positive.\n", @@ -1054,9 +1043,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "rootdn" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: missing dn in \"rootdn \" line.\n", - fname, lineno )); + fname, lineno ,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing dn in \"rootdn \" line\n", @@ -1068,9 +1057,9 @@ read_config( const char *fname ) if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: rootdn line must appear inside a database " - "definition.\n", fname, lineno )); + "definition.\n", fname, lineno ,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: rootdn line must appear inside a database definition.\n", @@ -1092,9 +1081,9 @@ read_config( const char *fname ) if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: rootdn DN is invalid.\n", - fname, lineno )); + 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", @@ -1108,9 +1097,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "rootpw" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing passwd in \"rootpw \"" - " line\n", fname, lineno )); + " line\n", fname, lineno ,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "missing passwd in \"rootpw \" line\n", @@ -1122,9 +1111,9 @@ read_config( const char *fname ) if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: " + LDAP_LOG( CONFIG, INFO, "%s: line %d: " "rootpw line must appear inside a database " - "definition.\n", fname, lineno )); + "definition.\n", fname, lineno ,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "rootpw line must appear inside a database " @@ -1138,10 +1127,10 @@ read_config( const char *fname ) if( tmp_be != be ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: " - "rootpw can only be set when rootdn is under suffix\n" - fname, lineno )); + "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", @@ -1158,9 +1147,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "readonly" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing on|off in \"readonly \" line.\n", - fname, lineno )); + 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", @@ -1192,9 +1181,9 @@ read_config( const char *fname ) if ( be != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: allow line must appear prior to " - "database definitions.\n", fname, lineno )); + "database definitions.\n", fname, lineno ,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: allow line must appear prior to database definitions\n", @@ -1205,9 +1194,9 @@ read_config( const char *fname ) if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing feature(s) in \"allow \"" - " line\n", fname, lineno )); + " line\n", fname, lineno ,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing feature(s) in \"allow \" line\n", @@ -1231,10 +1220,10 @@ read_config( const char *fname ) } else if( strcasecmp( cargv[i], "none" ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: unknown feature %s in " "\"allow \" line.\n", - fname, lineno, cargv[1] )); + fname, lineno, cargv[1] ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown feature %s in \"allow \" line\n", @@ -1255,9 +1244,9 @@ read_config( const char *fname ) if ( be != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: disallow line must appear prior to " - "database definitions.\n", fname, lineno )); + "database definitions.\n", fname, lineno ,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: disallow line must appear prior to database definitions\n", @@ -1268,9 +1257,9 @@ read_config( const char *fname ) if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing feature(s) in \"disallow \"" - " line.\n", fname, lineno )); + 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", @@ -1303,10 +1292,10 @@ read_config( const char *fname ) } else if( strcasecmp( cargv[i], "none" ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: unknown feature %s in " "\"disallow \" line.\n", - fname, lineno, cargv[i] )); + fname, lineno, cargv[i] ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown feature %s in \"disallow \" line\n", @@ -1327,9 +1316,9 @@ read_config( const char *fname ) if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing feature(s) in " - "\"require \" line.\n", fname, lineno )); + "\"require \" line.\n", fname, lineno ,0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing feature(s) in \"require \" line\n", @@ -1359,10 +1348,10 @@ read_config( const char *fname ) } else if( strcasecmp( cargv[i], "none" ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: unknown feature %s in " - "\"require \" line.\n", - fname, lineno )); + "\"require \" line.\n", + fname, lineno , cargv[i] ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown feature %s in \"require \" line\n", @@ -1385,9 +1374,9 @@ read_config( const char *fname ) if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing factor(s) in \"security \"" - " line.\n", fname, lineno )); + 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", @@ -1454,10 +1443,10 @@ read_config( const char *fname ) } else { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: unknown factor %S in " "\"security \" line.\n", - fname, lineno, cargv[1] )); + fname, lineno, cargv[1] ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown factor %s in \"security \" line\n", @@ -1471,9 +1460,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "referral" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing URL in \"referral \"" - " line.\n", fname, lineno )); + 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", @@ -1485,9 +1474,9 @@ read_config( const char *fname ) if( validate_global_referral( cargv[1] ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: " - "invalid URL (%s) in \"referral\" line.\n", - fname, lineno, cargv[1] )); + 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", @@ -1505,9 +1494,9 @@ read_config( const char *fname ) FILE *logfile; if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: Error in logfile directive, " - "\"logfile \"\n", fname, lineno )); + 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", @@ -1517,7 +1506,7 @@ read_config( const char *fname ) return( 1 ); } logfile = fopen( cargv[1], "w" ); - if ( logfile != NULL ) lutil_debug_file( logfile ); + if ( logfile != NULL ) lutil_debug_file( logfile ); #endif /* start of a new database definition */ @@ -1525,9 +1514,9 @@ read_config( const char *fname ) int level; if ( cargc < 3 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: Error in debug directive, " - "\"debug \"\n", fname, lineno )); + "\"debug \"\n", fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: Error in debug directive, \"debug subsys level\"\n", @@ -1554,9 +1543,9 @@ read_config( const char *fname ) } else { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: old objectclass format not supported\n", - fname, lineno )); + 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", @@ -1576,9 +1565,9 @@ read_config( const char *fname ) } else { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: old attribute type format not supported.\n", - fname, lineno )); + 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", @@ -1591,10 +1580,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "schemacheck" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing on|off in " - "\"schemacheck \" line.\n", - fname, lineno )); + 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", @@ -1605,9 +1593,9 @@ read_config( const char *fname ) } if ( strcasecmp( cargv[1], "off" ) == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: schema checking disabled! your mileage may vary!\n", - fname, lineno )); + 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", @@ -1626,9 +1614,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "loglevel" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing level in \"loglevel \"" - " line.\n", fname, lineno )); + LDAP_LOG( CONFIG, CRIT, + "%s: line %d: missing level in \"loglevel \"" + " line.\n", fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing level in \"loglevel \" line\n", @@ -1648,9 +1636,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "replica" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing host in \"replica " - " \" line\n", @@ -1661,9 +1649,9 @@ read_config( const char *fname ) } if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: replica line must appear inside " - "a database definition.\n", fname, lineno )); + 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", @@ -1684,9 +1672,9 @@ read_config( const char *fname ) } if ( i == cargc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: missing host in \"replica\" line\n", - fname, lineno )); + LDAP_LOG( CONFIG, INFO, + "%s: line %d: missing host in \"replica\" line\n", + fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing host in \"replica\" line\n", @@ -1696,11 +1684,11 @@ read_config( const char *fname ) } else if ( nr == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, + LDAP_LOG( CONFIG, INFO, "%s: line %d: unable to add" - " replica \"%s\"\n", + " replica \"%s\"\n", fname, lineno, - cargv[i] + 5 )); + cargv[i] + 5 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to add replica \"%s\"\n", @@ -1714,9 +1702,10 @@ read_config( const char *fname ) switch ( add_replica_suffix( be, nr, cargv[i] + 7 ) ) { case 1: #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: suffix \"%s\" in \"replica\" line is not valid for backend (ignored)\n", - fname, lineno, cargv[i] + 7 )); + 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", @@ -1726,9 +1715,10 @@ read_config( const char *fname ) case 2: #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: unable to normalize suffix in \"replica\" line (ignored)\n", - fname, lineno )); + 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", @@ -1752,9 +1742,10 @@ read_config( const char *fname ) if ( add_replica_attrs( be, nr, arg + 1, exclude ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: attribute \"%s\" in \"replica\" line is unknown\n", - fname, lineno, arg + 1 )); + 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", @@ -1771,9 +1762,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "updatedn" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing dn in \"updatedn \"" - " line.\n", fname, lineno )); + 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", @@ -1784,10 +1775,10 @@ read_config( const char *fname ) } if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: updatedn line must appear inside " - "a database definition\n", - fname, lineno )); + 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", @@ -1806,9 +1797,9 @@ read_config( const char *fname ) rc = dnNormalize2( NULL, &dn, &be->be_update_ndn ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: updatedn DN is invalid.\n", - fname, lineno )); + fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: updatedn DN is invalid\n", @@ -1821,9 +1812,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "updateref" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: " + LDAP_LOG( CONFIG, CRIT, "%s: line %d: " "missing url in \"updateref \" line.\n", - fname, lineno )); + fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "missing url in \"updateref \" line\n", @@ -1834,9 +1825,9 @@ read_config( const char *fname ) } if ( be == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: updateref" + LDAP_LOG( CONFIG, INFO, "%s: line %d: updateref" " line must appear inside a database definition\n", - fname, lineno )); + fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: updateref" " line must appear inside a database definition\n", @@ -1846,9 +1837,9 @@ read_config( const char *fname ) } else if ( !be->be_update_ndn.bv_len ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, "%s: line %d: " + LDAP_LOG( CONFIG, INFO, "%s: line %d: " "updateref line must come after updatedn.\n", - fname, lineno )); + fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "updateref line must after updatedn.\n", @@ -1859,9 +1850,9 @@ read_config( const char *fname ) if( validate_global_referral( cargv[1] ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: " + LDAP_LOG( CONFIG, CRIT, "%s: line %d: " "invalid URL (%s) in \"updateref\" line.\n", - fname, lineno, cargv[1] )); + fname, lineno, cargv[1] ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "invalid URL (%s) in \"updateref\" line.\n", @@ -1878,9 +1869,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "replogfile" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing filename in \"replogfile \"" - " line.\n", fname, lineno )); + 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", @@ -1899,9 +1890,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "rootDSE" ) == 0) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: " + LDAP_LOG( CONFIG, CRIT, "%s: line %d: " "missing filename in \"rootDSE \" line.\n", - fname, lineno )); + fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "missing filename in \"rootDSE \" line.\n", @@ -1912,9 +1903,9 @@ read_config( const char *fname ) if( read_root_dse_file( cargv[1] ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, "%s: line %d: " + LDAP_LOG( CONFIG, CRIT, "%s: line %d: " "could not read \"rootDSE \" line.\n", - fname, lineno )); + fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: " "could not read \"rootDSE \" line\n", @@ -1927,9 +1918,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "lastmod" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing on|off in \"lastmod \"" - " line.\n", fname, lineno )); + " line.\n", fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing on|off in \"lastmod \" line\n", @@ -1973,9 +1964,9 @@ read_config( const char *fname ) int i; if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing timeout value in " - "\"idletimeout \" line.\n", fname, lineno )); + 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", @@ -1989,10 +1980,9 @@ read_config( const char *fname ) if( i < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: timeout value (%d) invalid " - "\"idletimeout \" line.\n", - fname, lineno, i )); + 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", @@ -2008,9 +1998,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "include" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing filename in \"include " - "\" line.\n", fname, lineno )); + 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", @@ -2033,9 +2023,9 @@ read_config( const char *fname ) } else if ( strcasecmp( cargv[0], "srvtab" ) == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: missing filename in \"srvtab " - "\" line.\n", fname, lineno )); + 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", @@ -2050,9 +2040,9 @@ read_config( const char *fname ) } else if (strcasecmp( cargv[0], "moduleload") == 0 ) { if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: missing filename in \"moduleload " - "\" line.\n", fname, lineno )); + 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", @@ -2063,9 +2053,9 @@ read_config( const char *fname ) } if (module_load(cargv[1], cargc - 2, (cargc > 2) ? cargv + 2 : NULL)) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: failed to load or initialize module %s\n", - fname, lineno, cargv[1] )); + 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", @@ -2077,9 +2067,9 @@ read_config( const char *fname ) } else if (strcasecmp( cargv[0], "modulepath") == 0 ) { if ( cargc != 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: missing path in \"modulepath \"" - " line\n", fname, lineno )); + 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", @@ -2090,9 +2080,9 @@ read_config( const char *fname ) } if (module_path( cargv[1] )) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "%s: line %d: failed to set module search path to %s.\n", - fname, lineno, cargv[1] )); + 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", @@ -2167,10 +2157,9 @@ read_config( const char *fname ) #ifdef SLAPD_RLOOKUPS if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: reverse-lookup: " - "missing \"on\" or \"off\"\n", - fname, lineno )); + 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", @@ -2185,11 +2174,9 @@ read_config( const char *fname ) use_reverse_lookup = 0; } else { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: reverse-lookup: " - "must be \"on\" (default) " - "or \"off\"\n", - fname, lineno )); + 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", @@ -2200,10 +2187,9 @@ read_config( const char *fname ) #else /* !SLAPD_RLOOKUPS */ #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: reverse lookups " - "are not configured (ignored).\n", - fname, lineno )); + 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", @@ -2216,10 +2202,10 @@ read_config( const char *fname ) if ( bi != NULL ) { if ( bi->bi_config == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: unknown directive \"%s\" inside " - "backend info definition (ignored).\n", - fname, lineno, cargv[0] )); + 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", @@ -2236,10 +2222,10 @@ read_config( const char *fname ) } else if ( be != NULL ) { if ( be->be_config == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: uknown directive \"%s\" inside " - "backend database definition (ignored).\n", - fname, lineno, cargv[0] )); + LDAP_LOG( CONFIG, INFO, + "%s: line %d: uknown 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", @@ -2255,10 +2241,10 @@ read_config( const char *fname ) } } else { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_INFO, - "%s: line %d: unknown directive \"%s\" outside backend " - "info and database definitions (ignored).\n", - fname, lineno, cargv[0] )); + LDAP_LOG( CONFIG, INFO, + "%s: line %d: unknown directive \"%s\" outside backend " + "info and database definitions (ignored).\n", + fname, lineno, cargv[0] ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown directive \"%s\" outside backend info and database definitions (ignored)\n", @@ -2299,8 +2285,7 @@ fp_parse_line( if ( strtok_quote_ptr ) *strtok_quote_ptr = ' '; #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_DETAIL1, - "line %d (%s)\n", lineno, logline )); + LDAP_LOG( CONFIG, DETAIL1, "line %d (%s)\n", lineno, logline , 0 ); #else Debug( LDAP_DEBUG_CONFIG, "line %d (%s)\n", lineno, logline, 0 ); #endif @@ -2314,9 +2299,7 @@ fp_parse_line( sizeof(*cargv) ); if ( tmp == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_ERR, - "line %d: out of memory\n", - lineno )); + LDAP_LOG( CONFIG, ERR, "line %d: out of memory\n", lineno, 0,0 ); #else Debug( LDAP_DEBUG_ANY, "line %d: out of memory\n", @@ -2469,8 +2452,8 @@ load_ucdata( char *path ) err = ucdata_load( path ? path : SLAPD_DEFAULT_UCDATA, UCDATA_ALL ); if ( err ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "load_ucdata: Error %d loading ucdata.\n", err )); + 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 ); diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 6425e199f2..8570a4a163 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -74,8 +74,8 @@ int connections_init(void) if( connections != NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "connections_init: already initialized.\n" )); + 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 ); @@ -90,9 +90,9 @@ int connections_init(void) if( connections == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "connections_init: allocation (%d * %ld) of connection array failed\n", - dtblsize, (long) sizeof(Connection) )); + 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", @@ -123,8 +123,8 @@ int connections_destroy(void) if( connections == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "connections_destroy: nothing to destroy.\n")); + 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 ); @@ -208,8 +208,7 @@ static Connection* connection_get( ber_socket_t s ) Connection *c; #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ENTRY, - "connection_get: socket %ld\n", (long)s )); + LDAP_LOG( CONNECTION, ENTRY, "connection_get: socket %ld\n", (long)s, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "connection_get(%ld)\n", @@ -273,8 +272,8 @@ static Connection* connection_get( ber_socket_t s ) assert( sd == AC_SOCKET_INVALID ); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ARGS, - "connection_get: connection %d not used\n", s )); + 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", @@ -286,8 +285,8 @@ static Connection* connection_get( ber_socket_t s ) } #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_RESULTS, - "connection_get: get for %d got connid %lu\n", s, c->c_connid )); + 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", @@ -342,8 +341,8 @@ long connection_init( if( s == AC_SOCKET_INVALID ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "connection_init: init of socket %ld invalid.\n", (long)s )); + LDAP_LOG( CONNECTION, INFO, + "connection_init: init of socket %ld invalid.\n", (long)s, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "connection_init(%ld): invalid.\n", @@ -394,9 +393,9 @@ long connection_init( if( c == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, + LDAP_LOG( CONNECTION, INFO, "connection_init: skt %d connection table full (%d/%d)\n", - s, i, dtblsize )); + s, i, dtblsize ); #else Debug( LDAP_DEBUG_ANY, "connection_init(%d): connection table full (%d/%d)\n", @@ -529,9 +528,9 @@ long connection_init( c /* non-NULL */ ) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, + LDAP_LOG( CONNECTION, INFO, "connection_init: conn %lu set nonblocking failed\n", - c->c_connid )); + c->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "connection_init(%d, %s): set nonblocking failed\n", @@ -753,9 +752,9 @@ void connection_closing( Connection *c ) ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd ); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CONNECTION, DETAIL1, "connection_closing: conn %lu readying socket %d for close.\n", - c->c_connid, sd )); + c->c_connid, sd, 0 ); #else Debug( LDAP_DEBUG_TRACE, "connection_closing: readying conn=%lu sd=%d for close\n", @@ -790,9 +789,9 @@ 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", LDAP_LEVEL_DETAIL1, + LDAP_LOG( CONNECTION, DETAIL1, "connection_close: conn %lu deferring sd %d\n", - c->c_connid, sd )); + c->c_connid, sd, 0 ); #else Debug( LDAP_DEBUG_TRACE, "connection_close: deferring conn=%lu sd=%d\n", @@ -802,9 +801,8 @@ static void connection_close( Connection *c ) } #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_RESULTS, - "connection_close: conn %lu sd %d\n", - c->c_connid, sd )); + 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 ); @@ -922,9 +920,9 @@ connection_operation( void *arg_v ) if( conn->c_sasl_bind_in_progress && tag != LDAP_REQ_BIND ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "connection_operation: conn %lu SASL bind in progress (tag=%ld).\n", - conn->c_connid, (long)tag )); + 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", @@ -989,9 +987,9 @@ connection_operation( void *arg_v ) default: #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, + LDAP_LOG( CONNECTION, INFO, "connection_operation: conn %lu unknown LDAP request 0x%lx\n", - conn->c_connid, tag )); + conn->c_connid, tag, 0 ); #else Debug( LDAP_DEBUG_ANY, "unknown LDAP request 0x%lx\n", tag, 0, 0 ); @@ -1087,6 +1085,7 @@ int connection_read(ber_socket_t s) { int rc = 0; Connection *c; + assert( connections != NULL ); ldap_pvt_thread_mutex_lock( &connections_mutex ); @@ -1096,9 +1095,8 @@ int connection_read(ber_socket_t s) if( c == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "connection_read: sock %ld no connection\n", - (long)s )); + 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", @@ -1114,9 +1112,9 @@ int connection_read(ber_socket_t s) if( c->c_conn_state == SLAP_C_CLOSING ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "connection_read: conn %lu connection closing, ignoring input\n", - c->c_connid)); + 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", @@ -1128,8 +1126,9 @@ int connection_read(ber_socket_t s) } #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1, - "connection_read: conn %lu checking for input.\n", c->c_connid )); + 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", @@ -1146,9 +1145,9 @@ int connection_read(ber_socket_t s) #endif #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, + LDAP_LOG( CONNECTION, ERR, "connection_read: conn %lu TLS accept error, error %d\n", - c->c_connid, rc )); + c->c_connid, rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "connection_read(%d): TLS accept error " @@ -1192,9 +1191,9 @@ int connection_read(ber_socket_t s) rc = dnX509peerNormalize( ssl, &authid ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "connection_read: conn %lu unable to get TLS client DN, error %d\n", - c->c_connid, rc)); + 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 " @@ -1225,9 +1224,9 @@ int connection_read(ber_socket_t s) if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "connection_read: conn %lu SASL install error %d, closing\n", - c->c_connid, rc )); + 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 " @@ -1258,9 +1257,9 @@ int connection_read(ber_socket_t s) if( rc < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "connection_read: conn %lu input error %d, closing.\n", - c->c_connid, rc )); + 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", @@ -1305,9 +1304,9 @@ connection_input( if ( conn->c_currentber == NULL && (conn->c_currentber = ber_alloc()) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "connection_input: conn %lu ber_alloc failed.\n", - conn->c_connid )); + 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 @@ -1340,9 +1339,9 @@ connection_input( ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_GET_FD, &sd ); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "connection_input: conn %lu ber_get_next failed, errno %d (%s).\n", - conn->c_connid, err, sock_errstr(err) )); + 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", @@ -1364,9 +1363,9 @@ connection_input( if ( (tag = ber_get_int( ber, &msgid )) != LDAP_TAG_MSGID ) { /* log, close and send error */ #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "connection_input: conn %lu ber_get_int returns 0x%lx.\n", - conn->c_connid, tag )); + 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 ); @@ -1378,9 +1377,9 @@ connection_input( if ( (tag = ber_peek_tag( ber, &len )) == LBER_ERROR ) { /* log, close and send error */ #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, + LDAP_LOG( CONNECTION, ERR, "connection_input: conn %lu ber_peek_tag returns 0x%lx.\n", - conn->c_connid, tag )); + conn->c_connid, tag, 0 ); #else Debug( LDAP_DEBUG_ANY, "ber_peek_tag returns 0x%lx\n", tag, 0, 0 ); @@ -1398,9 +1397,9 @@ connection_input( } if (tag != LDAP_REQ_ABANDON && tag != LDAP_REQ_SEARCH) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, + LDAP_LOG( CONNECTION, ERR, "connection_input: conn %lu invalid req for UDP 0x%lx.\n", - conn->c_connid, tag )); + conn->c_connid, tag, 0 ); #else Debug( LDAP_DEBUG_ANY, "invalid req for UDP 0x%lx\n", tag, 0, 0 ); @@ -1432,9 +1431,9 @@ connection_input( || conn->c_conn_state == SLAP_C_CLOSING ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "connection_input: conn %lu deferring operation\n", - conn->c_connid )); + LDAP_LOG( CONNECTION, INFO, + "connection_input: conn %lu deferring operation\n", + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "deferring operation\n", 0, 0, 0 ); #endif @@ -1472,9 +1471,9 @@ connection_resched( Connection *conn ) if( rc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1, - "connection_resched: conn %lu reaquiring locks.\n", - conn->c_connid )); + 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", @@ -1492,9 +1491,9 @@ connection_resched( Connection *conn ) if( conn->c_conn_state != SLAP_C_CLOSING ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "connection_resched: conn %lu closed by other thread.\n", - conn->c_connid )); + 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", @@ -1502,9 +1501,9 @@ connection_resched( Connection *conn ) #endif } else { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1, - "connection_resched: conn %lu attempting closing.\n", - conn->c_connid )); + 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", @@ -1577,9 +1576,9 @@ static int connection_op_activate( Connection *conn, Operation *op ) if ( status != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "connection_op_activate: conn %lu thread pool submit failed.\n", - conn->c_connid )); + LDAP_LOG( CONNECTION, ERR, + "connection_op_activate: conn %lu thread pool submit failed.\n", + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "ldap_pvt_thread_pool_submit failed (%d)\n", status, 0, 0 ); @@ -1593,6 +1592,7 @@ static int connection_op_activate( Connection *conn, Operation *op ) int connection_write(ber_socket_t s) { Connection *c; + assert( connections != NULL ); ldap_pvt_thread_mutex_lock( &connections_mutex ); @@ -1603,8 +1603,8 @@ int connection_write(ber_socket_t s) if( c == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "connection_write: sock %ld no connection!\n",(long)s)); + 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", @@ -1618,9 +1618,8 @@ int connection_write(ber_socket_t s) c->c_n_write++; #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1, - "connection_write conn %lu waking output.\n", - c->c_connid )); + 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", diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 16ea8cb6cc..535345c2e2 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -132,8 +132,7 @@ int get_ctrls( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "get_ctrls: conn %lu\n", conn->c_connid )); + LDAP_LOG( OPERATION, ENTRY, "get_ctrls: conn %lu\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> get_ctrls\n", 0, 0, 0 ); #endif @@ -203,9 +202,8 @@ int get_ctrls( if( tag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "get_ctrls: conn %lu get OID failed.\n", - conn->c_connid )); + LDAP_LOG( OPERATION, INFO, "get_ctrls: conn %lu get OID failed.\n", + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get oid failed.\n", 0, 0, 0 ); @@ -225,9 +223,9 @@ int get_ctrls( if( tag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "get_ctrls: conn %lu get crit failed.\n", - conn->c_connid )); + LDAP_LOG( OPERATION, INFO, + "get_ctrls: conn %lu get crit failed.\n", + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get crit failed.\n", 0, 0, 0 ); @@ -248,11 +246,10 @@ int get_ctrls( if( tag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "get_ctrls: conn %lu: " + LDAP_LOG( OPERATION, INFO, "get_ctrls: conn %lu: " "%s (%scritical): get value failed.\n", - conn->c_connid, - c->ldctl_oid ? c->ldctl_oid : "(NULL)", - c->ldctl_iscritical ? "" : "non" )); + conn->c_connid, c->ldctl_oid ? c->ldctl_oid : "(NULL)", + c->ldctl_iscritical ? "" : "non" ); #else Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: conn %lu: " "%s (%scritical): get value failed.\n", @@ -269,11 +266,10 @@ int get_ctrls( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "get_ctrls: conn %lu oid=\"%s\" (%scritical)\n", - conn->c_connid, - c->ldctl_oid ? c->ldctl_oid : "(NULL)", - c->ldctl_iscritical ? "" : "non" )); + conn->c_connid, c->ldctl_oid ? c->ldctl_oid : "(NULL)", + c->ldctl_iscritical ? "" : "non" ); #else Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: oid=\"%s\" (%scritical)\n", c->ldctl_oid ? c->ldctl_oid : "(NULL)", @@ -355,9 +351,8 @@ int get_ctrls( return_results: #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_RESULTS, - "get_ctrls: conn=%lu n=%d rc=%d err=%s\n", - conn->c_connid, nctrls, rc, errmsg ? errmsg : "" )); + LDAP_LOG( OPERATION, RESULTS, + "get_ctrls: n=%d rc=%d err=%s\n", nctrls, rc, errmsg ? errmsg : "" ); #else Debug( LDAP_DEBUG_TRACE, "<= get_ctrls: n=%d rc=%d err=%s\n", nctrls, rc, errmsg ? errmsg : ""); @@ -576,9 +571,9 @@ int parseValuesReturnFilter ( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "parseValuesReturnFilter: conn %d vrFilter: %s\n", conn->c_connid, - fstr.bv_len ? fstr.bv_val : "empty" )); + LDAP_LOG( OPERATION, ARGS, + "parseValuesReturnFilter: conn %d vrFilter: %s\n", + conn->c_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 ); diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 1a72f5b070..dcddb01a8e 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -200,11 +200,10 @@ static void slapd_add(ber_socket_t s) { FD_SET( s, &slap_daemon.sd_readers ); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_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" : "" )); + 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, @@ -223,11 +222,10 @@ void slapd_remove(ber_socket_t s, int wake) { slap_daemon.sd_nactives--; #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_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" : "" )); + 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, @@ -286,8 +284,7 @@ void slapd_set_read(ber_socket_t s, int wake) { static void slapd_close(ber_socket_t s) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1, - "slapd_close: closing %ld\n", (long)s )); + 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 ); @@ -391,9 +388,9 @@ static int slap_get_listener_addresses( if ( strlen(host) > (sizeof(((struct sockaddr_un *)*sap)->sun_path) - 1) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slap_get_listener_addresses: domain socket path (%s) too long in URL\n", - host )); + 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", @@ -421,9 +418,9 @@ static int slap_get_listener_addresses( if ( (err = getaddrinfo(host, serv, &hints, &res)) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, + LDAP_LOG( CONNECTION, INFO, "slap_get_listener_addresses: getaddrinfo failed: %s\n", - AC_GAI_STRERROR(err) )); + AC_GAI_STRERROR(err), 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "daemon: getaddrinfo failed: %s\n", AC_GAI_STRERROR(err), 0, 0); @@ -446,9 +443,9 @@ 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", LDAP_LEVEL_INFO, + LDAP_LOG( CONNECTION, INFO, "slap_get_listener_addresses: " - "getaddrinfo ai_addr is NULL?\n" )); + "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 ); @@ -503,9 +500,8 @@ static int slap_get_listener_addresses( he = gethostbyname( host ); if( he == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slap_get_listener_addresses: invalid host %s\n", - host )); + 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); @@ -560,6 +556,7 @@ static int slap_open_listener( int err, addrlen = 0; struct sockaddr **sal, **psal; int socktype = SOCK_STREAM; /* default to COTS */ + #ifdef LDAP_PF_LOCAL mode_t perms = S_IRWXU; int crit = 1; @@ -569,9 +566,9 @@ static int slap_open_listener( if( rc != LDAP_URL_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "slap_open_listener: listen URL \"%s\" parse error %d\n", - url, rc )); + 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", @@ -583,9 +580,8 @@ static int slap_open_listener( #ifndef HAVE_TLS if( ldap_pvt_url_scheme2tls( lud->lud_scheme ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slap_open_listener: TLS is not supported (%s)\n", - url )); + 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", @@ -624,9 +620,8 @@ static int slap_open_listener( #else #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slap_open_listener: URL scheme is not supported: %s\n", - url )); + 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); @@ -684,9 +679,9 @@ static int slap_open_listener( if ( l.sl_sd == AC_SOCKET_INVALID ) { int err = sock_errno(); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "slap_open_listener: socket() failed errno=%d (%s)\n", - err, sock_errstr(err) )); + LDAP_LOG( CONNECTION, ERR, + "slap_open_listener: socket() failed errno=%d (%s)\n", + err, sock_errstr(err), 0 ); #else Debug( LDAP_DEBUG_ANY, "daemon: socket() failed errno=%d (%s)\n", err, @@ -698,9 +693,9 @@ static int slap_open_listener( #ifndef HAVE_WINSOCK if ( l.sl_sd >= dtblsize ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "slap_open_listener: listener descriptor %ld is too great %ld\n", - (long)l.sl_sd, (long)dtblsize )); + 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", @@ -725,9 +720,10 @@ static int slap_open_listener( if ( rc == AC_SOCKET_ERROR ) { int err = sock_errno(); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slap_open_listener: setsockopt( %ld, SO_REUSEADDR ) failed errno %d (%s)\n", - (long)l.sl_sd, err, sock_errstr(err) )); + 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", @@ -751,9 +747,9 @@ static int slap_open_listener( if ( rc == AC_SOCKET_ERROR ) { int err = sock_errno(); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, + LDAP_LOG( CONNECTION, INFO, "slap_open_listener: setsockopt( %ld, IPV6_V6ONLY ) failed errno %d (%s)\n", - (long)l.sl_sd, err, sock_errstr(err) )); + (long)l.sl_sd, err, sock_errstr(err) ); #else Debug( LDAP_DEBUG_ANY, "slapd(%ld): setsockopt(IPV6_V6ONLY) failed errno=%d (%s)\n", @@ -774,9 +770,9 @@ static int slap_open_listener( if (bind(l.sl_sd, *sal, addrlen)) { err = sock_errno(); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slap_open_listener: bind(%ld) failed errno=%d (%s)\n", - (long)l.sl_sd, err, sock_errstr(err) )); + 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) ); @@ -793,9 +789,9 @@ static int slap_open_listener( if ( chmod( addr, perms ) < 0 && crit ) { int err = sock_errno(); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slap_open_listener: fchmod(%ld) failed errno=%d (%s)\n", - (long)l.sl_sd, err, sock_errstr(err) )); + 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) ); @@ -838,9 +834,9 @@ static int slap_open_listener( default: #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slap_open_listener: unsupported address family (%d)\n", - (int)(*sal)->sa_family )); + 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 ); @@ -862,8 +858,8 @@ static int slap_open_listener( #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_RESULTS, - "slap_open_listener: daemon initialized %s\n", l.sl_url )); + LDAP_LOG( CONNECTION, RESULTS, + "slap_open_listener: daemon initialzed %s\n", l.sl_url, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "daemon: initialized %s\n", l.sl_url, 0, 0 ); @@ -880,9 +876,8 @@ int slapd_daemon_init( const char *urls ) char **u; #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ARGS, - "slapd_daemon_init: %s\n", - urls ? urls : "" )); + 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 ); @@ -912,8 +907,8 @@ int slapd_daemon_init( const char *urls ) */ if( (rc = lutil_pair( wake_sds )) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "slap_daemon_init: lutil_pair() failed rc=%d\n", rc )); + 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 ); @@ -932,8 +927,8 @@ int slapd_daemon_init( const char *urls ) if( u == NULL || u[0] == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "slap_daemon_init: no urls (%s) provided.\n", urls )); + 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 ); @@ -943,8 +938,8 @@ int slapd_daemon_init( const char *urls ) for( i=0; u[i] != NULL; i++ ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1, - "slap_daemon_init: listen on %s\n.", u[i] )); + 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 ); @@ -953,8 +948,8 @@ int slapd_daemon_init( const char *urls ) if( i == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slap_daemon_init: no listeners to open (%s)\n", urls )); + 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 ); @@ -964,8 +959,8 @@ int slapd_daemon_init( const char *urls ) } #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slap_daemon_init: %d listeners to open...\n", i )); + 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 ); @@ -981,8 +976,8 @@ int slapd_daemon_init( const char *urls ) slap_listeners[j] = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1, - "slap_daemon_init: %d listeners opened\n", i )); + 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 ); @@ -1096,8 +1091,8 @@ slapd_daemon_task( if ( i < l ) { /* We are already listening to in6addr_any */ #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_WARNING, - "slapd_daemon_task: Attempt to listen to 0.0.0.0 failed, already listening on ::, assuming IPv4 included\n" )); + 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", @@ -1111,9 +1106,9 @@ slapd_daemon_task( } #endif #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "slapd_daemon_task: listen( %s, 5 ) failed errno=%d (%s)\n", - slap_listeners[l]->sl_url, err, sock_errstr(err) )); + LDAP_LOG( CONNECTION, ERR, + "slapd_daemon_task: listen( %s, 5 ) failed errno=%d (%s)\n", + slap_listeners[l]->sl_url, err, sock_errstr(err) ); #else Debug( LDAP_DEBUG_ANY, "daemon: listen(%s, 5) failed errno=%d (%s)\n", @@ -1240,9 +1235,10 @@ slapd_daemon_task( continue; #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1, - "slapd_daemon_task: select: listen=%d active_threads=%d tvp=%s\n", - slap_listeners[l]->sl_sd, at, tvp == NULL ? "NULL" : "zero" )); + 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", @@ -1275,9 +1271,9 @@ slapd_daemon_task( if( err != EINTR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slapd_daemon_task: select failed (%d): %s\n", - err, sock_errstr(err) )); + 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", @@ -1291,8 +1287,8 @@ slapd_daemon_task( case 0: /* timeout - let threads run */ ebadf = 0; #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2, - "slapd_daemon_task: select timeout - yielding\n" )); + 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 ); @@ -1305,8 +1301,8 @@ slapd_daemon_task( ebadf = 0; #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2, - "slapd_daemon_task: activity on %d descriptors\n", ns )); + 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 ); @@ -1389,9 +1385,10 @@ slapd_daemon_task( if( emfile < 3 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, + LDAP_LOG( CONNECTION, ERR, "slapd_daemon_task: accept(%ld) failed errno=%d (%s)\n", - (long)slap_listeners[l]->sl_sd, err, sock_errstr(err) )); + (long)slap_listeners[l]->sl_sd, + err, sock_errstr(err) ); #else Debug( LDAP_DEBUG_ANY, "daemon: accept(%ld) failed errno=%d (%s)\n", @@ -1416,9 +1413,9 @@ slapd_daemon_task( /* make sure descriptor number isn't too great */ if ( s >= dtblsize ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, + LDAP_LOG( CONNECTION, ERR, "slapd_daemon_task: %ld beyond descriptor table size %ld\n", - (long)s, (long)dtblsize )); + (long)s, (long)dtblsize, 0 ); #else Debug( LDAP_DEBUG_ANY, "daemon: %ld beyond descriptor table size %ld\n", @@ -1458,9 +1455,10 @@ slapd_daemon_task( if ( rc == AC_SOCKET_ERROR ) { int err = sock_errno(); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "slapd_daemon_task: setsockopt( %ld, SO_KEEPALIVE) failed errno=%d (%s)\n", - (long)s, err, sock_errstr(err) )); + 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 " @@ -1476,9 +1474,10 @@ slapd_daemon_task( if ( rc == AC_SOCKET_ERROR ) { int err = sock_errno(); #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "slapd_daemon_task: setsockopt( %ld, TCP_NODELAY) failed errno=%d (%s)\n", - (long)s, err, sock_errstr(err) )); + 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 " @@ -1490,8 +1489,8 @@ slapd_daemon_task( #endif #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL1, - "slapd_daemon_task: new connection on %ld\n", (long)s )); + 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 ); @@ -1599,9 +1598,9 @@ slapd_daemon_task( if( id < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_INFO, - "slapd_daemon_task: connection_init(%ld, %s, %s) failed.\n", - (long)s, peername, slap_listeners[l]->sl_name )); + LDAP_LOG( CONNECTION, INFO, + "slapd_daemon_task: connection_init(%ld, %s, %s) failed.\n", + (long)s, peername, slap_listeners[l]->sl_name ); #else Debug( LDAP_DEBUG_ANY, "daemon: connection_init(%ld, %s, %s) failed.\n", @@ -1626,16 +1625,16 @@ slapd_daemon_task( #ifdef LDAP_DEBUG #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2, - "slapd_daemon_task: activity on " )); + 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", LDAP_LEVEL_DETAIL2, - " %d%s", readfds.fd_array[i], "r", 0 )); + 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 ); @@ -1643,8 +1642,8 @@ slapd_daemon_task( } for ( i = 0; i < writefds.fd_count; i++ ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2, - " %d%s", writefds.fd_array[i], "w" )); + 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 ); @@ -1676,9 +1675,8 @@ slapd_daemon_task( w = FD_ISSET( i, &writefds ); if ( r || w ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2, - " %d%s%s", i, - r ? "r" : "", w ? "w" : "" )); + 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" : "" ); @@ -1687,7 +1685,7 @@ slapd_daemon_task( } #endif #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2, "\n" )); + LDAP_LOG( CONNECTION, DETAIL2, "\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 ); #endif @@ -1726,8 +1724,8 @@ slapd_daemon_task( continue; } #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2, - "slapd_daemon_task: write active on %d\n", wd )); + 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", @@ -1779,8 +1777,8 @@ slapd_daemon_task( } #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_DETAIL2, - "slapd_daemon_task: read activity on %d\n", rd )); + 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 ); @@ -1801,8 +1799,8 @@ slapd_daemon_task( if( slapd_shutdown == 1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, - "slapd_daemon_task: shutdown requested and initiated.\n")); + 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", @@ -1812,8 +1810,9 @@ slapd_daemon_task( } else if ( slapd_shutdown == 2 ) { #ifdef HAVE_NT_SERVICE_MANAGER #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, - "slapd_daemon_task: shutdown initiated by Service Manager.\n")); + 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", @@ -1821,8 +1820,9 @@ slapd_daemon_task( #endif #else /* !HAVE_NT_SERVICE_MANAGER */ #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, - "slapd_daemon_task: abnormal condition, shutdown initiated.\n" )); + 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", @@ -1831,8 +1831,9 @@ slapd_daemon_task( #endif /* !HAVE_NT_SERVICE_MANAGER */ } else { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, - "slapd_daemon_task: no active streams, shutdown initiated.\n" )); + 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", @@ -1846,9 +1847,9 @@ slapd_daemon_task( slap_listeners = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, - "slapd_daemon_task: shutdown waiting for %d threads to terminate.\n", - ldap_pvt_thread_pool_backload(&connection_pool) )); + 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", @@ -1877,8 +1878,9 @@ int slapd_daemon( void ) if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_ERR, - "slapd_daemon: listener ldap_pvt_thread_create failed (%d).\n", rc )); + 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 ); @@ -1951,8 +1953,8 @@ RETSIGTYPE slap_sig_shutdown( int sig ) { #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, - "slap_sig_shutdown: signal %d\n", sig )); + 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 @@ -1966,8 +1968,8 @@ slap_sig_shutdown( int sig ) #if HAVE_NT_SERVICE_MANAGER && SIGBREAK if (is_NT_Service && sig == SIGBREAK) #ifdef NEW_LOGGING - LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, - "slap_sig_shutdown: SIGBREAK ignored.\n" )); + LDAP_LOG( CONNECTION, CRIT, + "slap_sig_shutdown: SIGBREAK ignored.\n", 0, 0, 0 ); #else Debug(LDAP_DEBUG_TRACE, "slap_sig_shutdown: SIGBREAK ignored.\n", 0, 0, 0); diff --git a/servers/slapd/delete.c b/servers/slapd/delete.c index 37a59aa1ea..89e405c43f 100644 --- a/servers/slapd/delete.c +++ b/servers/slapd/delete.c @@ -40,8 +40,8 @@ do_delete( int manageDSAit; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "do_delete: conn %d\n", conn->c_connid )); + LDAP_LOG( OPERATION, ENTRY, + "do_delete: conn %d\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 ); #endif @@ -54,8 +54,8 @@ do_delete( if ( ber_scanf( op->o_ber, "m", &dn ) == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_delete: conn: %d ber_scanf failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_delete: conn: %d ber_scanf failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); #endif @@ -66,8 +66,8 @@ do_delete( if( ( rc = get_ctrls( conn, op, 1 ) ) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_delete: conn %d get_ctrls failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_delete: conn %d get_ctrls failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_delete: get_ctrls failed\n", 0, 0, 0 ); #endif @@ -77,9 +77,9 @@ do_delete( rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_delete: conn %d invalid dn (%s)\n", - conn->c_connid, dn.bv_val )); + conn->c_connid, dn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_delete: invalid dn (%s)\n", dn.bv_val, 0, 0 ); @@ -91,8 +91,9 @@ do_delete( if( ndn.bv_len == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "do_delete: conn %d: " - "Attempt to delete root DSE.\n", conn->c_connid )); + LDAP_LOG( OPERATION, INFO, + "do_delete: conn %d: Attempt to delete root DSE.\n", + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_delete: root dse!\n", 0, 0, 0 ); #endif @@ -105,8 +106,8 @@ do_delete( } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "do_delete: conn %d: " - "Attempt to delete subschema subentry.\n", conn->c_connid )); + LDAP_LOG( OPERATION, INFO, "do_delete: conn %d: " + "Attempt to delete subschema subentry.\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_delete: subschema subentry!\n", 0, 0, 0 ); #endif diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index 75a349b433..346817765b 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -439,7 +439,11 @@ dnPretty2( 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( out, val ); @@ -496,7 +500,11 @@ dnPrettyNormal( struct berval *pretty, struct berval *normal) { +#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 ); @@ -562,8 +570,13 @@ 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; } @@ -595,9 +608,8 @@ dnMatch( } #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "dnMatch: %d\n %s\n %s\n", match, - value->bv_val, asserted->bv_val )); + 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 ); diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index f5829d395a..98f5842f8a 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -63,8 +63,7 @@ str2entry( char *s ) */ #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "str2entry: \"%s\"\n", s ? s : "NULL" )); + LDAP_LOG( OPERATION, DETAIL1, "str2entry: \"%s\"\n", s ? s : "NULL", 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> str2entry\n", s ? s : "NULL", 0, 0 ); @@ -75,8 +74,7 @@ str2entry( char *s ) if( e == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "str2entry: entry allocation failed.\n" )); + LDAP_LOG( OPERATION, ERR, "str2entry: entry allocation failed.\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= str2entry NULL (entry allocation failed)\n", @@ -99,8 +97,7 @@ str2entry( char *s ) if ( ldif_parse_line( s, &type, &vals[0].bv_val, &vals[0].bv_len ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "str2entry: NULL (parse_line)\n" )); + 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 ); @@ -113,10 +110,10 @@ str2entry( char *s ) if ( e->e_dn != NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: " + 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 != NULL ? vals[0].bv_val : "" )); + vals[0].bv_val != NULL ? vals[0].bv_val : "" ); #else Debug( LDAP_DEBUG_ANY, "str2entry: " "entry %ld has multiple DNs \"%s\" and \"%s\"\n", @@ -131,9 +128,9 @@ str2entry( char *s ) rc = dnPrettyNormal( NULL, &vals[0], &e->e_name, &e->e_nname ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: " - "entry %ld has invalid DN \"%s\"\n", - (long) e->e_id, vals[0].bv_val )); + 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", @@ -152,8 +149,8 @@ str2entry( char *s ) if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "str2entry: str2ad(%s): %s\n", type, text )); + LDAP_LOG( OPERATION, DETAIL1, + "str2entry: str2ad(%s): %s\n", type, text, 0 ); #else Debug( slapMode & SLAP_TOOL_MODE ? LDAP_DEBUG_ANY : LDAP_DEBUG_TRACE, @@ -169,8 +166,8 @@ str2entry( char *s ) rc = slap_str2undef_ad( type, &ad, &text ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "str2entry: str2undef_ad(%s): %s\n", type, text )); + LDAP_LOG( OPERATION, DETAIL1, + "str2entry: str2undef_ad(%s): %s\n", type, text, 0 ); #else Debug( LDAP_DEBUG_ANY, "<= str2entry: str2undef_ad(%s): %s\n", @@ -202,9 +199,9 @@ str2entry( char *s ) } else { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "str2entry: no validator for syntax %s\n", - ad->ad_type->sat_syntax->ssyn_oid )); + ad->ad_type->sat_syntax->ssyn_oid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "str2entry: no validator for syntax %s\n", @@ -218,9 +215,9 @@ str2entry( char *s ) if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, + LDAP_LOG( OPERATION, ERR, "str2entry: invalid value for syntax %s\n", - ad->ad_type->sat_syntax->ssyn_oid )); + ad->ad_type->sat_syntax->ssyn_oid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "str2entry: invalid value for syntax %s\n", @@ -241,8 +238,8 @@ str2entry( char *s ) rc = attr_merge( e, ad, vals ); if( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "str2entry: NULL (attr_merge)\n" )); + 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 ); @@ -260,9 +257,8 @@ str2entry( char *s ) /* check to make sure there was a dn: line */ if ( e->e_dn == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "str2entry: entry %ld has no dn.\n", - (long) e->e_id )); + 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 ); @@ -272,8 +268,8 @@ str2entry( char *s ) } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL2, - "str2entry(%s) -> 0x%lx\n", e->e_dn, (unsigned long)e )); + 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 ); @@ -477,9 +473,8 @@ int entry_encode(Entry *e, struct berval *bv) unsigned char *ptr; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "entry_encode: id: 0x%08lx \"%s\"\n", - (long) e->e_id, e->e_dn )); + 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 ); @@ -572,8 +567,7 @@ int entry_decode(struct berval *bv, Entry **e) x->e_nname.bv_len = i; ptr += i+1; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL2, - "entry_decode: \"%s\"\n", x->e_dn )); + LDAP_LOG( OPERATION, DETAIL2, "entry_decode: \"%s\"\n", x->e_dn, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "entry_decode: \"%s\"\n", @@ -601,8 +595,8 @@ int entry_decode(struct berval *bv, Entry **e) if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "entry_decode: str2ad(%s): %s\n", ptr, text )); + 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 ); @@ -611,8 +605,8 @@ int entry_decode(struct berval *bv, Entry **e) if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "entry_decode: str2undef_ad(%s): %s\n", ptr, text)); + 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", @@ -643,8 +637,7 @@ int entry_decode(struct berval *bv, Entry **e) if (a) a->a_next = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "entry_decode: %s\n", x->e_dn )); + 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 ); diff --git a/servers/slapd/extended.c b/servers/slapd/extended.c index 63f46bd2b2..2d315f36ce 100644 --- a/servers/slapd/extended.c +++ b/servers/slapd/extended.c @@ -103,17 +103,15 @@ do_extended( LDAPControl **rspctrls; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "do_extended: conn %d\n", conn->c_connid )); + LDAP_LOG( OPERATION, ENTRY, "do_extended: conn %d\n", conn->c_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", LDAP_LEVEL_ERR, - "do_extended: protocol version (%d) too low.\n", - op->o_protocol )); + 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", @@ -127,8 +125,8 @@ do_extended( if ( ber_scanf( op->o_ber, "{m" /*}*/, &reqoid ) == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_extended: conn %d ber_scanf failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, "do_extended: conn %d ber_scanf failed\n", + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_extended: ber_scanf failed\n", 0, 0 ,0 ); #endif @@ -140,9 +138,9 @@ do_extended( if( !(ext = find_extop(supp_ext_list, &reqoid)) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, + LDAP_LOG( OPERATION, ERR, "do_extended: conn %d unsupported operation \"%s\"\n", - conn->c_connid, reqoid.bv_val )); + conn->c_connid, reqoid.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_extended: unsupported operation \"%s\"\n", reqoid.bv_val, 0 ,0 ); @@ -157,8 +155,9 @@ 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", LDAP_LEVEL_ERR, - "do_extended: conn %d ber_scanf failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_extended: conn %d ber_scanf failed\n", + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_extended: ber_scanf failed\n", 0, 0 ,0 ); #endif @@ -171,8 +170,8 @@ do_extended( if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_extended: conn %d get_ctrls failed\n", conn->c_connid )); + LDAP_LOG( OPERATION, ERR, + "do_extended: conn %d get_ctrls failed\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_extended: get_ctrls failed\n", 0, 0 ,0 ); #endif @@ -189,8 +188,8 @@ do_extended( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "do_extended: conn %d oid=%d\n.", conn->c_connid, reqoid.bv_val )); + LDAP_LOG( OPERATION, DETAIL1, + "do_extended: conn %d oid=%d\n.", conn->c_connid, reqoid.bv_val, 0 ); #else Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n", reqoid.bv_val, 0 ,0 ); #endif diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index e4905493a6..69a26bf34b 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -54,8 +54,7 @@ get_filter( Filter *f; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, "get_filter: conn %d\n", - conn->c_connid )); + LDAP_LOG( FILTER, ENTRY, "get_filter: conn %d\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "begin get_filter\n", 0, 0, 0 ); #endif @@ -108,8 +107,8 @@ get_filter( switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL2, - "get_filter: conn %d EQUALITY\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL2, + "get_filter: conn %d EQUALITY\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 ); #endif @@ -123,8 +122,8 @@ get_filter( case LDAP_FILTER_SUBSTRINGS: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_filter: conn %d SUBSTRINGS\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_filter: conn %d SUBSTRINGS\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "SUBSTRINGS\n", 0, 0, 0 ); #endif @@ -133,8 +132,8 @@ get_filter( case LDAP_FILTER_GE: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_filter: conn %d GE\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_filter: conn %d GE\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "GE\n", 0, 0, 0 ); #endif @@ -146,8 +145,8 @@ get_filter( case LDAP_FILTER_LE: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_filter: conn %d LE\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_filter: conn %d LE\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "LE\n", 0, 0, 0 ); #endif @@ -161,8 +160,8 @@ get_filter( struct berval type; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_filter: conn %d PRESENT\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_filter: conn %d PRESENT\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 ); #endif @@ -186,8 +185,8 @@ get_filter( case LDAP_FILTER_APPROX: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_filter: conn %d APPROX\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_filter: conn %d APPROX\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "APPROX\n", 0, 0, 0 ); #endif @@ -199,8 +198,8 @@ get_filter( case LDAP_FILTER_AND: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_filter: conn %d AND\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_filter: conn %d AND\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 ); #endif @@ -212,8 +211,8 @@ get_filter( case LDAP_FILTER_OR: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_filter: conn %d OR\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_filter: conn %d OR\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 ); #endif @@ -225,8 +224,8 @@ get_filter( case LDAP_FILTER_NOT: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_filter: conn %d NOT\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_filter: conn %d NOT\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 ); #endif @@ -239,8 +238,8 @@ get_filter( case LDAP_FILTER_EXT: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_filter: conn %d EXTENSIBLE\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_filter: conn %d EXTENSIBLE\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "EXTENSIBLE\n", 0, 0, 0 ); #endif @@ -256,9 +255,9 @@ get_filter( default: (void) ber_scanf( ber, "x" ); /* skip the element */ #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, + LDAP_LOG( FILTER, ERR, "get_filter: conn %d unknown filter type=%lu\n", - conn->c_connid, f->f_choice )); + conn->c_connid, f->f_choice, 0 ); #else Debug( LDAP_DEBUG_ANY, "get_filter: unknown filter type=%lu\n", f->f_choice, 0, 0 ); @@ -285,8 +284,8 @@ get_filter( } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL2, - "get_filter: conn %d exit\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL2, + "get_filter: conn %d exit\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "end get_filter %d\n", err, 0, 0 ); #endif @@ -305,8 +304,8 @@ get_filter_list( Connection *conn, BerElement *ber, char *last; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "get_filter_list: conn %d start\n", conn->c_connid )); + LDAP_LOG( FILTER, ENTRY, + "get_filter_list: conn %d start\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "begin get_filter_list\n", 0, 0, 0 ); #endif @@ -322,8 +321,8 @@ get_filter_list( Connection *conn, BerElement *ber, *new = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "get_filter_list: conn %d exit\n", conn->c_connid )); + LDAP_LOG( FILTER, ENTRY, + "get_filter_list: conn %d exit\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "end get_filter_list\n", 0, 0, 0 ); #endif @@ -346,8 +345,8 @@ get_substring_filter( *text = "error decoding filter"; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "get_substring_filter: conn %d begin\n", conn->c_connid )); + LDAP_LOG( FILTER, ENTRY, + "get_substring_filter: conn %d begin\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 ); #endif @@ -404,9 +403,9 @@ get_substring_filter( rc = LDAP_PROTOCOL_ERROR; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, + LDAP_LOG( FILTER, ERR, "get_filter_substring: conn %d unknown substring choice=%ld\n", - conn->c_connid, (long)tag )); + conn->c_connid, (long)tag, 0 ); #else Debug( LDAP_DEBUG_FILTER, " unknown substring choice=%ld\n", @@ -435,9 +434,8 @@ get_substring_filter( switch ( tag ) { case LDAP_SUBSTRING_INITIAL: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_substring_filter: conn %d INITIAL\n", - conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_substring_filter: conn %d INITIAL\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " INITIAL\n", 0, 0, 0 ); #endif @@ -455,9 +453,8 @@ get_substring_filter( case LDAP_SUBSTRING_ANY: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_substring_filter: conn %d ANY\n", - conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_substring_filter: conn %d ANY\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " ANY\n", 0, 0, 0 ); #endif @@ -472,9 +469,8 @@ get_substring_filter( case LDAP_SUBSTRING_FINAL: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_substring_filter: conn %d FINAL\n", - conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_substring_filter: conn %d FINAL\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " FINAL\n", 0, 0, 0 ); #endif @@ -489,9 +485,9 @@ get_substring_filter( default: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, + LDAP_LOG( FILTER, INFO, "get_substring_filter: conn %d unknown substring type %ld\n", - conn->c_connid, (long)tag )); + conn->c_connid, (long)tag, 0 ); #else Debug( LDAP_DEBUG_FILTER, " unknown substring type=%ld\n", @@ -502,9 +498,9 @@ get_substring_filter( return_error: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, + LDAP_LOG( FILTER, INFO, "get_substring_filter: conn %d error %ld\n", - conn->c_connid, (long)rc )); + conn->c_connid, (long)rc, 0 ); #else Debug( LDAP_DEBUG_FILTER, " error=%ld\n", (long) rc, 0, 0 ); @@ -518,8 +514,8 @@ return_error: } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "get_substring_filter: conn %d exit\n", conn->c_connid )); + LDAP_LOG( FILTER, ENTRY, + "get_substring_filter: conn %d exit\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "end get_substring_filter\n", 0, 0, 0 ); #endif @@ -575,8 +571,8 @@ filter_free( Filter *f ) default: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "filter_free: unknown filter type %lu\n", f->f_choice )); + 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 ); @@ -821,8 +817,8 @@ get_simple_vrFilter( ValuesReturnFilter *f; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, "get_simple_vrFilter: conn %d\n", - conn->c_connid )); + LDAP_LOG( FILTER, ENTRY, + "get_simple_vrFilter: conn %d\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "begin get_simple_vrFilter\n", 0, 0, 0 ); #endif @@ -843,8 +839,8 @@ get_simple_vrFilter( switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL2, - "get_simple_vrFilter: conn %d EQUALITY\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL2, + "get_simple_vrFilter: conn %d EQUALITY\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 ); #endif @@ -858,8 +854,8 @@ get_simple_vrFilter( case LDAP_FILTER_SUBSTRINGS: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_simple_vrFilter: conn %d SUBSTRINGS\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_simple_vrFilter: conn %d SUBSTRINGS\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "SUBSTRINGS\n", 0, 0, 0 ); #endif @@ -868,8 +864,8 @@ get_simple_vrFilter( case LDAP_FILTER_GE: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_simple_vrFilter: conn %d GE\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_simple_vrFilter: conn %d GE\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "GE\n", 0, 0, 0 ); #endif @@ -881,8 +877,8 @@ get_simple_vrFilter( case LDAP_FILTER_LE: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_simple_vrFilter: conn %d LE\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_simple_vrFilter: conn %d LE\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "LE\n", 0, 0, 0 ); #endif @@ -896,8 +892,8 @@ get_simple_vrFilter( struct berval type; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_simple_vrFilter: conn %d PRESENT\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_simple_vrFilter: conn %d PRESENT\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 ); #endif @@ -921,8 +917,8 @@ get_simple_vrFilter( case LDAP_FILTER_APPROX: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_simple_vrFilter: conn %d APPROX\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_simple_vrFilter: conn %d APPROX\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "APPROX\n", 0, 0, 0 ); #endif @@ -934,8 +930,8 @@ get_simple_vrFilter( case LDAP_FILTER_EXT: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_simple_vrFilter: conn %d EXTENSIBLE\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_simple_vrFilter: conn %d EXTENSIBLE\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "EXTENSIBLE\n", 0, 0, 0 ); #endif @@ -951,9 +947,9 @@ get_simple_vrFilter( default: (void) ber_scanf( ber, "x" ); /* skip the element */ #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, + LDAP_LOG( FILTER, ERR, "get_simple_vrFilter: conn %d unknown filter type=%lu\n", - conn->c_connid, f->f_choice )); + conn->c_connid, f->f_choice, 0 ); #else Debug( LDAP_DEBUG_ANY, "get_simple_vrFilter: unknown filter type=%lu\n", f->f_choice, 0, 0 ); @@ -980,8 +976,8 @@ get_simple_vrFilter( } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL2, - "get_simple_vrFilter: conn %d exit\n", conn->c_connid )); + LDAP_LOG( FILTER, DETAIL2, + "get_simple_vrFilter: conn %d exit\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "end get_simple_vrFilter %d\n", err, 0, 0 ); #endif @@ -1028,8 +1024,8 @@ get_vrFilter( Connection *conn, BerElement *ber, char *last; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "get_vrFilter: conn %d start\n", conn->c_connid )); + LDAP_LOG( FILTER, ENTRY, + "get_vrFilter: conn %d start\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "begin get_vrFilter\n", 0, 0, 0 ); #endif @@ -1058,8 +1054,8 @@ get_vrFilter( Connection *conn, BerElement *ber, *new = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "get_vrFilter: conn %d exit\n", conn->c_connid )); + LDAP_LOG( FILTER, ENTRY, + "get_vrFilter: conn %d exit\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "end get_vrFilter\n", 0, 0, 0 ); #endif @@ -1109,8 +1105,8 @@ vrFilter_free( ValuesReturnFilter *f ) default: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, - "filter_free: unknown filter type %lu\n", f->f_choice )); + 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 ); @@ -1340,8 +1336,8 @@ get_substring_vrFilter( *text = "error decoding filter"; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "get_substring_filter: conn %d begin\n", conn->c_connid )); + LDAP_LOG( FILTER, ENTRY, + "get_substring_filter: conn %d begin\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 ); #endif @@ -1398,9 +1394,9 @@ get_substring_vrFilter( rc = LDAP_PROTOCOL_ERROR; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ERR, + LDAP_LOG( FILTER, ERR, "get_filter_substring: conn %d unknown substring choice=%ld\n", - conn->c_connid, (long)tag )); + conn->c_connid, (long)tag, 0 ); #else Debug( LDAP_DEBUG_FILTER, " unknown substring choice=%ld\n", @@ -1429,9 +1425,9 @@ get_substring_vrFilter( switch ( tag ) { case LDAP_SUBSTRING_INITIAL: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_substring_filter: conn %d INITIAL\n", - conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_substring_filter: conn %d INITIAL\n", + conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " INITIAL\n", 0, 0, 0 ); #endif @@ -1449,9 +1445,8 @@ get_substring_vrFilter( case LDAP_SUBSTRING_ANY: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_substring_filter: conn %d ANY\n", - conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_substring_filter: conn %d ANY\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " ANY\n", 0, 0, 0 ); #endif @@ -1466,9 +1461,8 @@ get_substring_vrFilter( case LDAP_SUBSTRING_FINAL: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "get_substring_filter: conn %d FINAL\n", - conn->c_connid )); + LDAP_LOG( FILTER, DETAIL1, + "get_substring_filter: conn %d FINAL\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " FINAL\n", 0, 0, 0 ); #endif @@ -1483,9 +1477,9 @@ get_substring_vrFilter( default: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, + LDAP_LOG( FILTER, INFO, "get_substring_filter: conn %d unknown substring type %ld\n", - conn->c_connid, (long)tag )); + conn->c_connid, (long)tag, 0 ); #else Debug( LDAP_DEBUG_FILTER, " unknown substring type=%ld\n", @@ -1496,9 +1490,9 @@ get_substring_vrFilter( return_error: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, + LDAP_LOG( FILTER, INFO, "get_substring_filter: conn %d error %ld\n", - conn->c_connid, (long)rc )); + conn->c_connid, (long)rc, 0 ); #else Debug( LDAP_DEBUG_FILTER, " error=%ld\n", (long) rc, 0, 0 ); @@ -1512,8 +1506,8 @@ return_error: } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "get_substring_filter: conn %d exit\n", conn->c_connid )); + LDAP_LOG( FILTER, ENTRY, + "get_substring_filter: conn %d exit\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "end get_substring_filter\n", 0, 0, 0 ); #endif diff --git a/servers/slapd/filterentry.c b/servers/slapd/filterentry.c index af513e29c5..672915cb8c 100644 --- a/servers/slapd/filterentry.c +++ b/servers/slapd/filterentry.c @@ -56,8 +56,7 @@ test_filter( int rc; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "test_filter: begin\n" )); + LDAP_LOG( FILTER, ENTRY, "test_filter: begin\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, "=> test_filter\n", 0, 0, 0 ); #endif @@ -66,13 +65,12 @@ test_filter( switch ( f->f_choice ) { case SLAPD_FILTER_COMPUTED: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_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 )); + 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" : @@ -86,8 +84,7 @@ test_filter( case LDAP_FILTER_EQUALITY: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_filter: EQUALITY\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_filter: EQUALITY\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " EQUALITY\n", 0, 0, 0 ); #endif @@ -98,8 +95,7 @@ test_filter( case LDAP_FILTER_SUBSTRINGS: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_filter SUBSTRINGS\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_filter SUBSTRINGS\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " SUBSTRINGS\n", 0, 0, 0 ); #endif @@ -119,8 +115,7 @@ test_filter( case LDAP_FILTER_PRESENT: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_filter: PRESENT\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_filter: PRESENT\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " PRESENT\n", 0, 0, 0 ); #endif @@ -130,8 +125,7 @@ test_filter( case LDAP_FILTER_APPROX: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_filter: APPROX\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_filter: APPROX\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " APPROX\n", 0, 0, 0 ); #endif @@ -141,8 +135,7 @@ test_filter( case LDAP_FILTER_AND: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_filter: AND\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_filter: AND\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " AND\n", 0, 0, 0 ); #endif @@ -152,8 +145,7 @@ test_filter( case LDAP_FILTER_OR: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_filter: OR\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_filter: OR\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " OR\n", 0, 0, 0 ); #endif @@ -163,8 +155,7 @@ test_filter( case LDAP_FILTER_NOT: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_filter: NOT\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_filter: NOT\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " NOT\n", 0, 0, 0 ); #endif @@ -186,8 +177,7 @@ test_filter( case LDAP_FILTER_EXT: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_filter: EXT\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_filter: EXT\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " EXT\n", 0, 0, 0 ); #endif @@ -197,9 +187,8 @@ test_filter( default: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, - "test_filter: unknown filter type %lu\n", - f->f_choice )); + 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 ); @@ -209,8 +198,7 @@ test_filter( } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "test_filter: return=%d\n", rc )); + 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 @@ -382,8 +370,7 @@ test_filter_and( int rtn = LDAP_COMPARE_TRUE; /* True if empty */ #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "test_filter_and: begin\n" )); + 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 @@ -405,8 +392,7 @@ test_filter_and( } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "test_filter_and: rc=%d\n", rtn )); + 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 @@ -427,8 +413,7 @@ test_filter_or( int rtn = LDAP_COMPARE_FALSE; /* False if empty */ #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "test_filter_or: begin\n" )); + 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 @@ -450,8 +435,7 @@ test_filter_or( } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "test_filter_or: result=%d\n", rtn )); + 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 @@ -472,8 +456,7 @@ test_substrings_filter( Attribute *a; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "test_substrings_filter: begin\n" )); + 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 @@ -516,8 +499,7 @@ test_substrings_filter( } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "test_substrings_filter: return FALSE\n" )); + 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 diff --git a/servers/slapd/init.c b/servers/slapd/init.c index c96040e392..b860b3f673 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -75,9 +75,9 @@ slap_init( int mode, const char *name ) if( slapMode != SLAP_UNDEFINED_MODE ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "init: %s init called twice (old=%d, new=%d)\n", - name, slapMode, mode )); + 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", @@ -93,9 +93,10 @@ slap_init( int mode, const char *name ) case SLAP_SERVER_MODE: case SLAP_TOOL_MODE: #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "init: %s initiation, initiated %s.\n", - name, (mode & SLAP_MODE) == SLAP_TOOL_MODE ? "tool" : "server" )); + 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, @@ -139,8 +140,8 @@ slap_init( int mode, const char *name ) default: #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "init: %s init, undefined mode (%d).\n", name, mode )); + 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 ); @@ -158,8 +159,7 @@ int slap_startup( Backend *be ) int rc; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "slap_startup: %s started\n", slap_name )); + LDAP_LOG( OPERATION, CRIT, "slap_startup: %s started\n", slap_name, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "%s startup: initiated.\n", @@ -177,8 +177,8 @@ int slap_shutdown( Backend *be ) int rc; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "slap_shutdown: %s shutdown initiated.\n", slap_name)); + LDAP_LOG( OPERATION, CRIT, + "slap_shutdown: %s shutdown initiated.\n", slap_name, 0, 0); #else Debug( LDAP_DEBUG_TRACE, "%s shutdown: initiated\n", @@ -199,9 +199,8 @@ int slap_destroy(void) int rc; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "slap_destroy: %s freeing system resources.\n", - slap_name )); + 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", diff --git a/servers/slapd/limits.c b/servers/slapd/limits.c index c33726e711..c34e848821 100644 --- a/servers/slapd/limits.c +++ b/servers/slapd/limits.c @@ -223,10 +223,9 @@ parse_limits( if ( argc < 3 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s : line %d: missing arg(s) in " - "\"limits \" line.\n", - fname, lineno )); + "\"limits \" line.\n", fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s : line %d: missing arg(s) in " @@ -328,13 +327,11 @@ parse_limits( default: if ( pattern[0] != '=' ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s : line %d: missing '=' in " "\"dn[.{exact|base|one|subtree" - "|children|regex|anonymous}]" - "=\" in " - "\"limits \" line.\n", - fname, lineno )); + "|children|regex|anonymous}]" "=\" in " + "\"limits \" line.\n", fname, lineno, 0 ); #else Debug( LDAP_DEBUG_ANY, "%s : line %d: missing '=' in " @@ -369,10 +366,10 @@ parse_limits( if ( parse_limit( argv[i], &limit ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s : line %d: unknown limit type \"%s\" in " "\"limits \" line.\n", - fname, lineno, argv[i] )); + fname, lineno, argv[i] ); #else Debug( LDAP_DEBUG_ANY, "%s : line %d: unknown limit type \"%s\" in " diff --git a/servers/slapd/lock.c b/servers/slapd/lock.c index bc8a4fc8a4..29d89ad270 100644 --- a/servers/slapd/lock.c +++ b/servers/slapd/lock.c @@ -30,8 +30,8 @@ lock_fopen( const char *fname, const char *type, FILE **lfp ) strcpy(slap_strcopy( buf, fname ), ".lock" ); if ( (*lfp = fopen( buf, "w" )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "lock_fopen: could not open lock file \"%s\".\n", buf )); + 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 @@ -45,8 +45,8 @@ 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", LDAP_LEVEL_ERR, - "lock_fopen: could not open log file \"%s\".\n", buf )); + 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 diff --git a/servers/slapd/main.c b/servers/slapd/main.c index cea889cf7a..de931e4908 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -177,8 +177,10 @@ int main( int argc, char **argv ) { slap_debug = *i; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "main: new debug level from registry is: %d\n", slap_debug )); + 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 @@ -192,8 +194,8 @@ int main( int argc, char **argv ) urls = ch_strdup(newUrls); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "main: new urls from registry: %s\n", urls )); + 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); @@ -206,8 +208,8 @@ int main( int argc, char **argv ) { configfile = newConfigFile; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "main: new config file from registry is: %s\n", configfile )); + 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 @@ -310,16 +312,15 @@ int main( int argc, char **argv ) #ifdef NEW_LOGGING lutil_log_initialize( argc, argv ); -#endif - +#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 #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "%s", Versionstr )); + LDAP_LOG( SLAPD, INFO, "%s", Versionstr, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "%s", Versionstr, 0, 0 ); #endif @@ -384,8 +385,7 @@ int main( int argc, char **argv ) if ( slap_schema_init( ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "main: schema initialization error\n" )); + LDAP_LOG( OPERATION, CRIT, "main: schema initialization error\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "schema initialization error\n", @@ -424,8 +424,7 @@ int main( int argc, char **argv ) if ( glue_sub_init( ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "main: subordinate config error\n")); + LDAP_LOG( SLAPD, CRIT, "main: subordinate config error\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "subordinate config error\n", @@ -436,8 +435,7 @@ int main( int argc, char **argv ) if ( slap_schema_check( ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "main: schema prep error\n")); + LDAP_LOG( SLAPD, CRIT, "main: schema prep error\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "schema prep error\n", @@ -451,8 +449,7 @@ int main( int argc, char **argv ) rc = ldap_pvt_tls_init(); if( rc != 0) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "main: tls init failed: %d\n", rc )); + LDAP_LOG( SLAPD, CRIT, "main: tls init failed: %d\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "main: TLS init failed: %d\n", @@ -466,8 +463,7 @@ int main( int argc, char **argv ) rc = ldap_pvt_tls_init_def_ctx(); if( rc != 0) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "main: tls init def ctx failed: %d\n", rc )); + 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", @@ -516,8 +512,7 @@ int main( int argc, char **argv ) FILE *fp; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "main: slapd starting.\n" )); + LDAP_LOG( SLAPD, INFO, "main: slapd starting.\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 ); #endif @@ -575,8 +570,7 @@ stop: #endif #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, - "main: slapd stopped.\n" )); + LDAP_LOG( SLAPD, CRIT, "main: slapd stopped.\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "slapd stopped.\n", 0, 0, 0 ); #endif diff --git a/servers/slapd/matchedValues.c b/servers/slapd/matchedValues.c index 56bd29667b..483a14956d 100644 --- a/servers/slapd/matchedValues.c +++ b/servers/slapd/matchedValues.c @@ -73,8 +73,7 @@ filter_matched_values( int rc = LDAP_SUCCESS; #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "filter_matched_values: begin\n" )); + 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 @@ -83,13 +82,12 @@ filter_matched_values( switch ( f->f_choice ) { case SLAPD_FILTER_COMPUTED: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, + LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: 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 )); + "error", f->f_result, 0 ); #else Debug( LDAP_DEBUG_FILTER, " COMPUTED %s (%d)\n", f->f_result == LDAP_COMPARE_FALSE ? "false" : @@ -103,8 +101,7 @@ filter_matched_values( case LDAP_FILTER_EQUALITY: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_vrFilter: EQUALITY\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: EQUALITY\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " EQUALITY\n", 0, 0, 0 ); #endif @@ -117,8 +114,7 @@ filter_matched_values( case LDAP_FILTER_SUBSTRINGS: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_vrFilter SUBSTRINGS\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_vrFilter SUBSTRINGS\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " SUBSTRINGS\n", 0, 0, 0 ); #endif @@ -132,8 +128,7 @@ filter_matched_values( case LDAP_FILTER_PRESENT: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_vrFilter: PRESENT\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: PRESENT\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " PRESENT\n", 0, 0, 0 ); #endif @@ -162,8 +157,7 @@ filter_matched_values( case LDAP_FILTER_EXT: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_DETAIL1, - "test_vrFilter: EXT\n" )); + LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: EXT\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_FILTER, " EXT\n", 0, 0, 0 ); #endif @@ -176,9 +170,8 @@ filter_matched_values( default: #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_INFO, - "test_vrFilter: unknown filter type %lu\n", - f->f_choice )); + LDAP_LOG( FILTER, INFO, + "test_vrFilter: 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 ); @@ -188,8 +181,7 @@ filter_matched_values( } #ifdef NEW_LOGGING - LDAP_LOG(( "filter", LDAP_LEVEL_ENTRY, - "filter_matched_values: return=%d\n", rc )); + 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 diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index fcbe86a46c..391fa3bf4c 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -50,8 +50,7 @@ do_modify( int manageDSAit; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "do_modify: enter\n" )); + LDAP_LOG( OPERATION, ENTRY, "do_modify: enter\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 ); #endif @@ -77,8 +76,7 @@ do_modify( if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modify: ber_scanf failed\n" )); + 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 @@ -89,8 +87,7 @@ do_modify( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "do_modify: dn (%s)\n", dn.bv_val )); + 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 @@ -128,9 +125,9 @@ do_modify( case LDAP_MOD_ADD: if ( mod->sml_bvalues == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, + LDAP_LOG( OPERATION, ERR, "do_modify: modify/add operation (%ld) requires values\n", - (long)mop )); + (long)mop, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_modify: modify/add operation (%ld) requires values\n", @@ -152,9 +149,8 @@ do_modify( default: { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modify: invalid modify operation (%ld)\n", - (long)mop )); + LDAP_LOG( OPERATION, ERR, + "do_modify: invalid modify operation (%ld)\n", (long)mop, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_modify: invalid modify operation (%ld)\n", @@ -174,8 +170,7 @@ do_modify( if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modify: get_ctrls failed\n" )); + 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 @@ -186,9 +181,8 @@ do_modify( rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "do_modify: conn %d invalid dn (%s)\n", - conn->c_connid, dn.bv_val )); + LDAP_LOG( OPERATION, INFO, "do_modify: conn %d invalid dn (%s)\n", + conn->c_connid, dn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_modify: invalid dn (%s)\n", dn.bv_val, 0, 0 ); @@ -200,8 +194,8 @@ do_modify( if( ndn.bv_len == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modify: attempt to modify root DSE.\n" )); + 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 @@ -213,8 +207,8 @@ do_modify( #if defined( SLAPD_SCHEMA_DN ) } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modify: attempt to modify subschema subentry.\n" )); + 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 @@ -228,31 +222,26 @@ do_modify( #ifdef LDAP_DEBUG #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "do_modify: modifications:\n" )); + 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", LDAP_LEVEL_DETAIL1, - "\t%s: %s\n", tmp->sml_op == LDAP_MOD_ADD ? - "add" : (tmp->sml_op == LDAP_MOD_DELETE ? - "delete" : "replace"), tmp->sml_type.bv_val )); + LDAP_LOG( OPERATION, DETAIL1, "\t%s: %s\n", + tmp->sml_op == LDAP_MOD_ADD ? + "add" : (tmp->sml_op == LDAP_MOD_DELETE ? + "delete" : "replace"), tmp->sml_type.bv_val, 0 ); if ( tmp->sml_bvalues == NULL ) { - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "\t\tno values" )); + LDAP_LOG( OPERATION, DETAIL1, "\t\tno values", 0, 0, 0 ); } else if ( tmp->sml_bvalues[0].bv_val == NULL ) { - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "\t\tzero values" )); + LDAP_LOG( OPERATION, DETAIL1, "\t\tzero values", 0, 0, 0 ); } else if ( tmp->sml_bvalues[1].bv_val == NULL ) { - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "\t\tone value" )); + LDAP_LOG( OPERATION, DETAIL1, "\t\tone value", 0, 0, 0 ); } else { - LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, - "\t\tmultiple values" )); + LDAP_LOG( OPERATION, DETAIL1, "\t\tmultiple values", 0, 0, 0 ); } #else diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index eca68cace5..8cb8a2737d 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -65,8 +65,7 @@ do_modrdn( int manageDSAit; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "do_modrdn: begin\n" )); + LDAP_LOG( OPERATION, ENTRY, "do_modrdn: begin\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 ); #endif @@ -87,8 +86,7 @@ do_modrdn( == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modrdn: ber_scanf failed\n" )); + 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 @@ -106,8 +104,8 @@ do_modrdn( * newSuperior is present: report error. */ #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modrdn: (v2) invalid field newSuperior.\n" )); + 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", @@ -124,8 +122,8 @@ do_modrdn( == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modrdn: ber_scanf(\"m\") failed\n" )); + 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 ); @@ -141,10 +139,10 @@ do_modrdn( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, + 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 : "" )); + newSuperior.bv_len ? newSuperior.bv_val : "" ); #else Debug( LDAP_DEBUG_ARGS, "do_modrdn: dn (%s) newrdn (%s) newsuperior (%s)\n", @@ -154,8 +152,7 @@ do_modrdn( if ( ber_scanf( op->o_ber, /*{*/ "}") == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modrdn: ber_scanf failed\n" )); + 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 @@ -168,8 +165,7 @@ do_modrdn( if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modrdn: get_ctrls failed\n" )); + 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 @@ -181,9 +177,9 @@ do_modrdn( rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_modrdn: conn %d invalid dn (%s)\n", - conn->c_connid, dn.bv_val )); + conn->c_connid, dn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid dn (%s)\n", dn.bv_val, 0, 0 ); @@ -195,8 +191,8 @@ do_modrdn( if( ndn.bv_len == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modrdn: attempt to modify root DSE.\n" )); + 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 @@ -208,8 +204,8 @@ do_modrdn( #ifdef SLAPD_SCHEMA_DN } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modrdn: attempt to modify subschema subentry\n" )); + LDAP_LOG( OPERATION, ERR, + "do_modrdn: attempt to modify subschema subentry\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_modrdn: subschema subentry!\n", 0, 0, 0 ); #endif @@ -225,9 +221,9 @@ do_modrdn( rc = dnPrettyNormal( NULL, &newrdn, &pnewrdn, &nnewrdn ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_modrdn: conn %d invalid newrdn (%s)\n", - conn->c_connid, newrdn.bv_val )); + conn->c_connid, newrdn.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid newrdn (%s)\n", newrdn.bv_val, 0, 0 ); @@ -239,8 +235,8 @@ do_modrdn( if( rdnValidate( &pnewrdn ) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "do_modrdn: invalid rdn (%s).\n", pnewrdn.bv_val )); + LDAP_LOG( OPERATION, ERR, + "do_modrdn: invalid rdn (%s).\n", pnewrdn.bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid rdn (%s)\n", pnewrdn.bv_val, 0, 0 ); @@ -256,9 +252,9 @@ do_modrdn( &nnewSuperior ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_modrdn: conn %d invalid newSuperior (%s)\n", - conn->c_connid, newSuperior.bv_val )); + conn->c_connid, newSuperior.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid newSuperior (%s)\n", diff --git a/servers/slapd/module.c b/servers/slapd/module.c index 4a58714d5f..12375773cf 100644 --- a/servers/slapd/module.c +++ b/servers/slapd/module.c @@ -41,8 +41,8 @@ int module_init (void) if (lt_dlinit()) { const char *error = lt_dlerror(); #ifdef NEW_LOGGING - LDAP_LOG(( "module", LDAP_LEVEL_CRIT, - "module_init: lt_ldinit failed: %s\n", error )); + LDAP_LOG( SLAPD, CRIT, + "module_init: lt_ldinit failed: %s\n", error, 0, 0 ); #else Debug(LDAP_DEBUG_ANY, "lt_dlinit failed: %s\n", error, 0, 0); #endif @@ -62,8 +62,8 @@ int module_kill (void) if (lt_dlexit()) { const char *error = lt_dlerror(); #ifdef NEW_LOGGING - LDAP_LOG(( "module", LDAP_LEVEL_CRIT, - "module_kill: lt_dlexit failed: %s\n", error )); + 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 @@ -83,8 +83,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(( "module", LDAP_LEVEL_CRIT, - "module_load: (%s) out of memory.\n", file_name )); + 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); @@ -101,9 +101,9 @@ int module_load(const char* file_name, int argc, char *argv[]) if ((module->lib = lt_dlopen(file_name)) == NULL) { error = lt_dlerror(); #ifdef NEW_LOGGING - LDAP_LOG(( "module", LDAP_LEVEL_CRIT, - "module_load: lt_dlopen failed: (%s) %s.\n", - file_name, error )); + LDAP_LOG( SLAPD, CRIT, + "module_load: lt_dlopen failed: (%s) %s.\n", + file_name, error, 0 ); #else Debug(LDAP_DEBUG_ANY, "lt_dlopen failed: (%s) %s\n", file_name, error, 0); @@ -114,8 +114,7 @@ int module_load(const char* file_name, int argc, char *argv[]) } #ifdef NEW_LOGGING - LDAP_LOG(( "module", LDAP_LEVEL_INFO, - "module_load: loaded module %s\n", file_name )); + 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 @@ -123,9 +122,9 @@ int module_load(const char* file_name, int argc, char *argv[]) if ((initialize = lt_dlsym(module->lib, "init_module")) == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "module", LDAP_LEVEL_ERR, - "module_load: module %s : no init_module() function found\n", - file_name )); + 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); @@ -154,8 +153,8 @@ int module_load(const char* file_name, int argc, char *argv[]) rc = initialize(argc, argv); if (rc == -1) { #ifdef NEW_LOGGING - LDAP_LOG(( "module", LDAP_LEVEL_ERR, - "module_load: module %s init_module() failed\n", file_name)); + 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); @@ -170,8 +169,9 @@ int module_load(const char* file_name, int argc, char *argv[]) || module_regtable[rc].proc == NULL) { #ifdef NEW_LOGGING - LDAP_LOG(( "module", LDAP_LEVEL_ERR, - "module_load: module %s: unknown registration type (%d).\n", file_name)); + LDAP_LOG( SLAPD, ERR, + "module_load: module %s: unknown registration type (%d).\n", + file_name, 0); #else Debug(LDAP_DEBUG_CONFIG, "module %s: unknown registration type (%d)\n", file_name, rc, 0); @@ -184,9 +184,9 @@ 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(( "module", LDAP_LEVEL_ERR, - "module_load: module %s:%s could not be registered.\n", - file_name, module_regtable[rc].type )); + 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); @@ -200,9 +200,9 @@ int module_load(const char* file_name, int argc, char *argv[]) module_list = module; #ifdef NEW_LOGGING - LDAP_LOG(( "module", LDAP_LEVEL_INFO, - "module_load: module %s:%s registered\n", file_name, - module_regtable[rc].type )); + 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); diff --git a/servers/slapd/mr.c b/servers/slapd/mr.c index f8e788b6e0..dfa34c95d8 100644 --- a/servers/slapd/mr.c +++ b/servers/slapd/mr.c @@ -16,7 +16,6 @@ #include "slap.h" #include "ldap_pvt.h" - struct mindexrec { struct berval mir_name; MatchingRule *mir_mr; @@ -198,8 +197,8 @@ register_matching_rule( if( usage == SLAP_MR_NONE ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "register_matching_rule: %s not usable\n", desc )); + LDAP_LOG( OPERATION, ERR, + "register_matching_rule: %s not usable\n", desc, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "register_matching_rule: not usable %s\n", desc, 0, 0 ); @@ -216,9 +215,9 @@ register_matching_rule( if( amr == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "register_matching_rule: could not locate associated matching rule %s for %s\n", - associated, desc )); + LDAP_LOG( OPERATION, ERR, + "register_matching_rule: could not locate associated " + "matching rule %s for %s\n", associated, desc, 0 ); #else Debug( LDAP_DEBUG_ANY, "register_matching_rule: could not locate " "associated matching rule %s for %s\n", @@ -234,9 +233,9 @@ register_matching_rule( mr = ldap_str2matchingrule( desc, &code, &err, LDAP_SCHEMA_ALLOW_ALL); if ( !mr ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "register_matching_rule: %s before %s in %s.\n", - ldap_scherr2str(code), err, desc )); + LDAP_LOG( OPERATION, ERR, + "register_matching_rule: %s before %s in %s.\n", + ldap_scherr2str(code), err, desc ); #else Debug( LDAP_DEBUG_ANY, "Error in register_matching_rule: %s before %s in %s\n", ldap_scherr2str(code), err, desc ); @@ -253,9 +252,9 @@ register_matching_rule( if ( code ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "register_matching_rule: %s for %s in %s.\n", - scherr2str(code), err, desc )); + LDAP_LOG( OPERATION, ERR, + "register_matching_rule: %s for %s in %s.\n", + scherr2str(code), err, desc ); #else Debug( LDAP_DEBUG_ANY, "Error in register_matching_rule: %s for %s in %s\n", scherr2str(code), err, desc ); diff --git a/servers/slapd/mra.c b/servers/slapd/mra.c index 81db86ae76..eca939b026 100644 --- a/servers/slapd/mra.c +++ b/servers/slapd/mra.c @@ -14,7 +14,6 @@ #include "slap.h" - void mra_free( MatchingRuleAssertion *mra, @@ -53,8 +52,8 @@ get_mra( if( rtag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "get_mra: ber_scanf (\"{t\") failure\n" )); + 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 @@ -68,8 +67,8 @@ get_mra( rtag = ber_scanf( ber, "m", &ma->ma_rule_text ); if ( rtag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "get_mra: ber_scanf(\"o\") failure.\n" )); + 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 @@ -82,8 +81,8 @@ get_mra( rtag = ber_scanf( ber, "t", &tag ); if( rtag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "get_mra: ber_scanf (\"t\") failure\n" )); + 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 @@ -98,8 +97,8 @@ get_mra( rtag = ber_scanf( ber, "m", &type ); if ( rtag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "get_mra: ber_scanf (\"o\") failure.\n" )); + 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 @@ -111,8 +110,8 @@ get_mra( rtag = ber_scanf( ber, "t", &tag ); if( rtag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "get_mra: ber_scanf (\"t\") failure.\n" )); + 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 @@ -125,8 +124,8 @@ get_mra( if ( tag != LDAP_FILTER_EXT_VALUE ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "get_mra: ber_scanf missing value\n" )); + 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 @@ -140,8 +139,8 @@ get_mra( if( rtag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "get_mra: ber_scanf (\"o\") failure.\n" )); + 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 @@ -161,8 +160,7 @@ get_mra( if( rtag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "get_mra: ber_scanf failure\n")); + 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 diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index 02f6ea4022..2d7c6ce097 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -25,8 +25,14 @@ int is_object_subclass( if( sub == NULL || sup == NULL ) return 0; #if 1 +#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 ) { @@ -72,10 +78,10 @@ int is_entry_objectclass( if( attr == NULL ) { /* no objectClass attribute */ #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, "is_entry_objectclass: " - "dn(%s), oid (%s), no objectClass attribute.\n", - e->e_dn == NULL ? "" : e->e_dn, - oc->soc_oclass.oc_oid )); + 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", diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index 06cc1586a8..f45b974272 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -119,8 +119,8 @@ int slap_passwd_parse( struct berval *reqdata, if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_ID ) { if( id == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "slap_passwd_parse: ID not allowed.\n")); + 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 ); @@ -135,8 +135,8 @@ int slap_passwd_parse( struct berval *reqdata, if( tag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "slap_passwd_parse: ID parse failed.\n")); + 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 ); @@ -151,8 +151,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", LDAP_LEVEL_ERR, - "slap_passwd_parse: OLD not allowed.\n" )); + 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 ); @@ -167,8 +167,8 @@ int slap_passwd_parse( struct berval *reqdata, if( tag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "slap_passwd_parse: ID parse failed.\n" )); + 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 ); @@ -183,8 +183,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", LDAP_LEVEL_ERR, - "slap_passwd_parse: NEW not allowed.\n" )); + 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 ); @@ -199,8 +199,8 @@ int slap_passwd_parse( struct berval *reqdata, if( tag == LBER_ERROR ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "slap_passwd_parse: OLD parse failed.\n")); + 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 ); @@ -215,8 +215,8 @@ int slap_passwd_parse( struct berval *reqdata, if( len != 0 ) { decoding_error: #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "slap_passwd_parse: decoding error, len=%ld\n", (long)len )); + 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", @@ -243,8 +243,8 @@ struct berval * slap_passwd_return( assert( cred != NULL ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "slap_passwd_return: %ld\n",(long)cred->bv_len )); + 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 ); @@ -302,8 +302,7 @@ slap_passwd_generate( struct berval *pass ) { struct berval *tmp; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "slap_passwd_generate: begin\n" )); + 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 diff --git a/servers/slapd/referral.c b/servers/slapd/referral.c index 53edf251fb..a836657fe1 100644 --- a/servers/slapd/referral.c +++ b/servers/slapd/referral.c @@ -152,9 +152,9 @@ int validate_global_referral( const char *url ) default: /* other error, bail */ #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "referral: invalid URL (%s): %s (%d)\n", - url, "" /* ldap_url_error2str(rc) */, rc )); + url, "" /* ldap_url_error2str(rc) */, rc ); #else Debug( LDAP_DEBUG_ANY, "referral: invalid URL (%s): %s (%d)\n", @@ -167,9 +167,7 @@ int validate_global_referral( const char *url ) if( lurl->lud_dn && *lurl->lud_dn ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "referral: URL (%s): contains DN\n", - url )); + LDAP_LOG( CONFIG, CRIT, "referral: URL (%s): contains DN\n", url, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "referral: URL (%s): contains DN\n", @@ -179,9 +177,8 @@ int validate_global_referral( const char *url ) } else if( lurl->lud_attrs ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "referral: URL (%s): requests attributes\n", - url )); + LDAP_LOG( CONFIG, CRIT, + "referral: URL (%s): requests attributes\n", url, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "referral: URL (%s): requests attributes\n", @@ -191,9 +188,8 @@ int validate_global_referral( const char *url ) } else if( lurl->lud_scope != LDAP_SCOPE_DEFAULT ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "referral: URL (%s): contains explicit scope\n", - url )); + 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", @@ -203,9 +199,8 @@ int validate_global_referral( const char *url ) } else if( lurl->lud_filter ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, - "referral: URL (%s): contains explicit filter\n", - url )); + 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", diff --git a/servers/slapd/result.c b/servers/slapd/result.c index d2def63547..8ed77725da 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -133,9 +133,9 @@ static long send_ldap_ber( */ #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_ldap_ber: conn %lu ber_flush failed err=%d (%s)\n", - conn ? conn->c_connid : 0, err, sock_errstr(err) )); + 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 ); @@ -197,9 +197,9 @@ send_ldap_response( ber_init_w_nullc( ber, LBER_USE_DER ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "send_ldap_response: conn %lu msgid=%d tag=%lu err=%d\n", - conn ? conn->c_connid : 0, msgid, tag, err )); + LDAP_LOG( OPERATION, ENTRY, + "send_ldap_response: msgid=%d tag=%lu err=%d\n", + msgid, tag, err ); #else Debug( LDAP_DEBUG_TRACE, "send_ldap_response: msgid=%d tag=%lu err=%d\n", @@ -208,10 +208,10 @@ send_ldap_response( if( ref ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "send_ldap_response: conn %lu ref=\"%s\"\n", - conn ? conn->c_connid : 0, - ref[0].bv_val ? ref[0].bv_val : "NULL" )); + LDAP_LOG( OPERATION, ARGS, + "send_ldap_response: conn %lu ref=\"%s\"\n", + conn ? conn->c_connid : 0, + ref[0].bv_val ? ref[0].bv_val : "NULL" , 0 ); #else Debug( LDAP_DEBUG_ARGS, "send_ldap_response: ref=\"%s\"\n", ref[0].bv_val ? ref[0].bv_val : "NULL", @@ -225,9 +225,9 @@ send_ldap_response( rc = ber_write(ber, (char *)&op->o_peeraddr, sizeof(struct sockaddr), 0); if (rc != sizeof(struct sockaddr)) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_ldap_response: conn %lu ber_write failed\n", - conn ? conn->c_connid : 0 )); + LDAP_LOG( OPERATION, ERR, + "send_ldap_response: conn %lu ber_write failed\n", + conn ? conn->c_connid : 0 , 0, 0); #else Debug( LDAP_DEBUG_ANY, "ber_write failed\n", 0, 0, 0 ); #endif @@ -285,9 +285,9 @@ send_ldap_response( if ( rc == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_ldap_response: conn %lu ber_printf failed\n", - conn ? conn->c_connid : 0 )); + LDAP_LOG( OPERATION, ERR, + "send_ldap_response: conn %lu ber_printf failed\n", + conn ? conn->c_connid : 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); #endif @@ -302,9 +302,9 @@ send_ldap_response( if ( bytes < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_ldap_response: conn %lu ber write failed\n", - conn ? conn->c_connid : 0 )); + LDAP_LOG( OPERATION, ERR, + "send_ldap_response: conn %lu ber write failed\n", + conn ? conn->c_connid : 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "send_ldap_response: ber write failed\n", @@ -342,9 +342,9 @@ send_ldap_disconnect( assert( LDAP_UNSOLICITED_ERROR( err ) ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "send_ldap_disconnect: conn %lu %d:%s\n", - conn ? conn->c_connid : 0, err, text ? text : "" )); + LDAP_LOG( OPERATION, ENTRY, + "send_ldap_disconnect: conn %lu %d:%s\n", + conn ? conn->c_connid : 0, err, text ? text : "" ); #else Debug( LDAP_DEBUG_TRACE, "send_ldap_disconnect %d:%s\n", @@ -390,9 +390,9 @@ send_ldap_result( assert( !LDAP_API_ERROR( err ) ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "send_ldap_result : conn %lu op=%lu p=%d\n", - op->o_connid, op->o_opid, op->o_protocol )); + 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", @@ -400,9 +400,9 @@ send_ldap_result( #endif #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "send_ldap_result: conn=%lu err=%d matched=\"%s\" text=\"%s\"\n", - op->o_connid, err, matched ? matched : "", text ? text : "" )); + LDAP_LOG( OPERATION, ARGS, + "send_ldap_result: err=%d matched=\"%s\" text=\"%s\"\n", + err, matched ? matched : "", text ? text : "" ); #else Debug( LDAP_DEBUG_ARGS, "send_ldap_result: err=%d matched=\"%s\" text=\"%s\"\n", @@ -412,9 +412,9 @@ send_ldap_result( if( ref ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, + LDAP_LOG( OPERATION, ARGS, "send_ldap_result: referral=\"%s\"\n", - ref[0].bv_val ? ref[0].bv_val : "NULL" )); + ref[0].bv_val ? ref[0].bv_val : "NULL", 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "send_ldap_result: referral=\"%s\"\n", @@ -471,9 +471,9 @@ send_ldap_sasl( ber_int_t msgid; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "send_ldap_sasl: conn %lu err=%d len=%lu\n", - op->o_connid, err, cred ? cred->bv_len : -1 )); + LDAP_LOG( OPERATION, ENTRY, + "send_ldap_sasl: conn %lu err=%d len=%lu\n", + op->o_connid, err, cred ? cred->bv_len : -1 ); #else Debug( LDAP_DEBUG_TRACE, "send_ldap_sasl: err=%d len=%ld\n", err, cred ? (long) cred->bv_len : -1, NULL ); @@ -505,10 +505,10 @@ send_ldap_extended( ber_int_t msgid; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "send_ldap_extended: conn %lu err=%d oid=%s len=%ld\n", - op->o_connid, err, rspoid ? rspoid : "", - rspdata != NULL ? rspdata->bv_len : 0 )); + LDAP_LOG( OPERATION, ENTRY, + "send_ldap_extended: err=%d oid=%s len=%ld\n", + err, rspoid ? rspoid : "", + rspdata != NULL ? rspdata->bv_len : 0 ); #else Debug( LDAP_DEBUG_TRACE, "send_ldap_extended err=%d oid=%s len=%ld\n", @@ -552,11 +552,9 @@ send_search_result( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "send_search_result: conn %lu err=%d " - "matched=\"%s\" text=\"%s\"\n", - op->o_connid, err, matched ? matched : "", - text ? text : "" )); + LDAP_LOG( OPERATION, ENTRY, + "send_search_result: err=%d matched=\"%s\" text=\"%s\"\n", + err, matched ? matched : "", text ? text : "" ); #else Debug( LDAP_DEBUG_TRACE, "send_search_result: err=%d matched=\"%s\" text=\"%s\"\n", @@ -647,10 +645,9 @@ send_search_entry( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "send_search_entry: conn %lu dn=\"%s\"%s\n", - op->o_connid, e->e_dn, - attrsonly ? " (attrsOnly)" : "" )); + LDAP_LOG( OPERATION, ENTRY, + "send_search_entry: conn %lu dn=\"%s\"%s\n", + op->o_connid, e->e_dn, attrsonly ? " (attrsOnly)" : "" ); #else Debug( LDAP_DEBUG_TRACE, "=> send_search_entry: dn=\"%s\"%s\n", @@ -661,10 +658,9 @@ send_search_entry( ad_entry, NULL, ACL_READ, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_INFO, - "send_search_entry: conn %lu access " - "to entry (%s) not allowed\n", - op->o_connid, e->e_dn )); + LDAP_LOG( ACL, INFO, + "send_search_entry: conn %lu access to entry (%s) not allowed\n", + op->o_connid, e->e_dn, 0 ); #else Debug( LDAP_DEBUG_ACL, "send_search_entry: access to entry not allowed\n", @@ -683,9 +679,9 @@ send_search_entry( rc = ber_write(ber, (char *)&op->o_peeraddr, sizeof(struct sockaddr), 0); if (rc != sizeof(struct sockaddr)) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_search_entry: conn %lu ber_printf failed\n", - conn ? conn->c_connid : 0 )); + LDAP_LOG( OPERATION, ERR, + "send_search_entry: conn %lu ber_printf failed\n", + conn ? conn->c_connid : 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); #endif @@ -705,9 +701,9 @@ send_search_entry( if ( rc == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_search_entry: conn %lu ber_printf failed\n", - op->o_connid )); + 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 @@ -753,10 +749,9 @@ send_search_entry( if ( rc == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_search_entry: conn %lu " - "matched values filtering failed\n", - conn ? conn->c_connid : 0 )); + LDAP_LOG( OPERATION, ERR, + "send_search_entry: conn %lu matched values filtering failed\n", + conn ? conn->c_connid : 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "matched values filtering failed\n", 0, 0, 0 ); @@ -805,10 +800,9 @@ send_search_entry( ACL_READ, &acl_state ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_INFO, "send_search_entry: " - "conn %lu access to attribute %s " - "not allowed\n", - op->o_connid, desc->ad_cname.bv_val )); + 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, "acl: " "access to attribute %s not allowed\n", @@ -819,10 +813,9 @@ send_search_entry( if (( rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname )) == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_search_entry: " - "conn %lu ber_printf failed\n", - op->o_connid )); + 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 @@ -844,12 +837,10 @@ send_search_entry( desc, &a->a_vals[i], ACL_READ, &acl_state ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_INFO, + 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 )); + "access to attribute %s, value %d not allowed\n", + op->o_connid, desc->ad_cname.bv_val, i ); #else Debug( LDAP_DEBUG_ACL, "acl: access to attribute %s, " @@ -866,10 +857,9 @@ send_search_entry( if (( rc = ber_printf( ber, "O", &a->a_vals[i] )) == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, + LDAP_LOG( OPERATION, ERR, "send_search_entry: conn %lu " - "ber_printf failed.\n", - op->o_connid )); + "ber_printf failed.\n", op->o_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); @@ -891,10 +881,9 @@ send_search_entry( if (( rc = ber_printf( ber, /*{[*/ "]N}" )) == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_search_entry: conn %lu " - "ber_printf failed\n", - op->o_connid )); + 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 @@ -940,10 +929,10 @@ send_search_entry( if ( rc == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, + LDAP_LOG( OPERATION, ERR, "send_search_entry: conn %lu " - "matched values filtering failed\n", - conn ? conn->c_connid : 0 )); + "matched values filtering failed\n", + conn ? conn->c_connid : 0, 0, 0); #else Debug( LDAP_DEBUG_ANY, "matched values filtering failed\n", 0, 0, 0 ); @@ -992,10 +981,10 @@ send_search_entry( ACL_READ, &acl_state ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_INFO, + LDAP_LOG( ACL, INFO, "send_search_entry: conn %lu " "access to attribute %s not allowed\n", - op->o_connid, desc->ad_cname.bv_val )); + op->o_connid, desc->ad_cname.bv_val, 0 ); #else Debug( LDAP_DEBUG_ACL, "acl: access to attribute %s " "not allowed\n", @@ -1008,10 +997,9 @@ send_search_entry( rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname ); if ( rc == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, + LDAP_LOG( OPERATION, ERR, "send_search_entry: conn %lu " - "ber_printf failed\n", - op->o_connid )); + "ber_printf failed\n", op->o_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); #endif @@ -1035,12 +1023,10 @@ send_search_entry( desc, &a->a_vals[i], ACL_READ, &acl_state ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_INFO, + 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 )); + "access to %s, value %d not allowed\n", + op->o_connid, desc->ad_cname.bv_val, i ); #else Debug( LDAP_DEBUG_ACL, "acl: access to attribute %s, " @@ -1057,11 +1043,9 @@ send_search_entry( if (( rc = ber_printf( ber, "O", &a->a_vals[i] )) == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_search_entry: " - "conn %lu ber_printf " - "failed\n", - op->o_connid )); + 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 ); @@ -1085,10 +1069,9 @@ send_search_entry( if (( rc = ber_printf( ber, /*{[*/ "]N}" )) == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_search_entry: conn %lu " - "ber_printf failed\n", - op->o_connid )); + 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 @@ -1122,9 +1105,9 @@ send_search_entry( #endif if ( rc == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_search_entry: conn %lu ber_printf failed\n", - op->o_connid )); + 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 @@ -1140,9 +1123,9 @@ send_search_entry( if ( bytes < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, - "send_search_entry: conn %lu ber write failed.\n", - op->o_connid )); + 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: ber write failed\n", @@ -1162,9 +1145,8 @@ send_search_entry( conn->c_connid, op->o_opid, e->e_dn, 0, 0 ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "send_search_entry: conn %lu exit.\n", - op->o_connid )); + LDAP_LOG( OPERATION, ENTRY, + "send_search_entry: conn %lu exit.\n", op->o_connid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= send_search_entry\n", 0, 0, 0 ); #endif @@ -1195,9 +1177,9 @@ send_search_reference( AttributeDescription *ad_entry = slap_schema.si_ad_entry; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "send_search_reference: conn %lu dn=\"%s\"\n", - op->o_connid, e->e_dn )); + LDAP_LOG( OPERATION, ENTRY, + "send_search_reference: conn %lu dn=\"%s\"\n", + op->o_connid, e->e_dn, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> send_search_reference: dn=\"%s\"\n", @@ -1209,10 +1191,9 @@ send_search_reference( ad_entry, NULL, ACL_READ, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_INFO, + LDAP_LOG( ACL, INFO, "send_search_reference: conn %lu " - "access to entry %s not allowed\n", - op->o_connid, e->e_dn )); + "access to entry %s not allowed\n", op->o_connid, e->e_dn, 0 ); #else Debug( LDAP_DEBUG_ACL, "send_search_reference: access to entry not allowed\n", @@ -1226,10 +1207,9 @@ send_search_reference( ad_ref, NULL, ACL_READ, NULL ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "acl", LDAP_LEVEL_INFO, + LDAP_LOG( ACL, INFO, "send_search_reference: conn %lu access " - "to reference not allowed.\n", - op->o_connid )); + "to reference not allowed.\n", op->o_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ACL, "send_search_reference: access " @@ -1242,9 +1222,9 @@ send_search_reference( if( refs == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, + LDAP_LOG( OPERATION, ERR, "send_search_reference: conn %lu null ref in (%s).\n", - op->o_connid, e->e_dn )); + op->o_connid, e->e_dn, 0 ); #else Debug( LDAP_DEBUG_ANY, "send_search_reference: null ref in (%s)\n", @@ -1269,10 +1249,9 @@ send_search_reference( if ( rc == -1 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ERR, + LDAP_LOG( OPERATION, ERR, "send_search_reference: conn %lu " - "ber_printf failed.\n", - op->o_connid )); + "ber_printf failed.\n", op->o_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "send_search_reference: ber_printf failed\n", 0, 0, 0 ); @@ -1297,8 +1276,8 @@ send_search_reference( conn->c_connid, op->o_opid, e->e_dn, 0, 0 ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "send_search_reference: conn %lu exit.\n", op->o_connid )); + 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 @@ -1324,8 +1303,8 @@ str2result( if ( strncasecmp( s, "RESULT", 6 ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "str2result: (%s), expecting \"RESULT\"\n", s )); + 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 ); @@ -1358,8 +1337,7 @@ str2result( } } else { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "str2result: (%s) unknown.\n", s )); + LDAP_LOG( OPERATION, INFO, "str2result: (%s) unknown.\n", s, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "str2result (%s) unknown\n", s, 0, 0 ); diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 13088088af..d386bccc38 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -276,10 +276,8 @@ slap_sasl_log( } #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "SASL [conn=%ld] %s: %s\n", - conn ? conn->c_connid : -1, - label, message )); + 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, @@ -315,10 +313,9 @@ int slap_sasl_getdn( Connection *conn, char *id, int len, struct berval dn2; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, + LDAP_LOG( TRANSPORT, ENTRY, "slap_sasl_getdn: conn %d id=%s\n", - conn ? conn->c_connid : -1, - id ? (*id ? id : "") : "NULL" )); + conn ? conn->c_connid : -1, id ? (*id ? id : "") : "NULL" ); #else Debug( LDAP_DEBUG_ARGS, "slap_sasl_getdn: id=%s\n", id?(*id?id:""):"NULL",0,0 ); @@ -424,8 +421,8 @@ int slap_sasl_getdn( Connection *conn, char *id, int len, dn->bv_len = p - dn->bv_val; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_getdn: u:id converted to %s.\n", dn->bv_val )); + LDAP_LOG( TRANSPORT, ENTRY, + "slap_sasl_getdn: u:id converted to %s.\n", dn->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "getdn: u:id converted to %s\n", dn->bv_val,0,0 ); #endif @@ -453,8 +450,8 @@ int slap_sasl_getdn( Connection *conn, char *id, int len, ch_free( dn->bv_val ); *dn = dn2; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_getdn: dn:id converted to %s.\n", dn->bv_val )); + 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 ); @@ -523,8 +520,8 @@ slap_auxprop_lookup( rc = slap_str2ad( name, &ad, &text ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_DETAIL1, - "slap_auxprop: str2ad(%s): %s\n", name, text )); + LDAP_LOG( TRANSPORT, DETAIL1, + "slap_auxprop: str2ad(%s): %s\n", name, text, 0 ); #else Debug( LDAP_DEBUG_TRACE, "slap_auxprop: str2ad(%s): %s\n", name, text, 0 ); @@ -664,11 +661,10 @@ slap_sasl_canonicalize( *out_len = 0; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, + 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 : "" )); + 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", @@ -723,10 +719,9 @@ slap_sasl_canonicalize( prop_set( props, names[0], (char *)&dn, sizeof( dn ) ); #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, + LDAP_LOG( TRANSPORT, ENTRY, "slap_sasl_canonicalize: conn %d %s=\"%s\"\n", - conn ? conn->c_connid : -1, - names[0]+1, dn.bv_val )); + conn ? conn->c_connid : -1, names[0]+1, dn.bv_val ); #else Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: " "%s=\"%s\"\n", @@ -759,9 +754,9 @@ slap_sasl_authorize( int rc; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, + LDAP_LOG( TRANSPORT, ENTRY, "slap_sasl_authorize: conn %d authcid=\"%s\" authzid=\"%s\"\n", - conn ? conn->c_connid : -1, auth_identity, requested_user)); + conn ? conn->c_connid : -1, auth_identity, requested_user); #else Debug( LDAP_DEBUG_ARGS, "SASL Authorize [conn=%ld]: " "authcid=\"%s\" authzid=\"%s\"\n", @@ -789,9 +784,9 @@ slap_sasl_authorize( ch_free( authcDN.bv_val ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_INFO, - "slap_sasl_authorize: conn %ld authorization disallowed (%d)\n", - (long)(conn ? conn->c_connid : -1), rc )); + LDAP_LOG( TRANSPORT, INFO, + "slap_sasl_authorize: conn %ld authorization disallowed (%d)\n", + (long)(conn ? conn->c_connid : -1), rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: " " authorization disallowed (%d)\n", @@ -806,9 +801,9 @@ slap_sasl_authorize( conn->c_sasl_dn = authzDN; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_authorize: conn %d authorization allowed\n", - (long)(conn ? conn->c_connid : -1 ) )); + LDAP_LOG( TRANSPORT, ENTRY, + "slap_sasl_authorize: conn %d authorization allowed\n", + (long)(conn ? conn->c_connid : -1), 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: " " authorization allowed\n", @@ -838,11 +833,10 @@ slap_sasl_authorize( } #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_authorize: conn %d authcid=\"%s\" authzid=\"%s\"\n", - conn ? conn->c_connid : -1, - authcid ? authcid : "", - authzid ? authzid : "" )); + 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", @@ -855,8 +849,8 @@ slap_sasl_authorize( rc = sasl_getprop( conn->c_sasl_context, SASL_REALM, (void **)&realm ); if( rc != SASL_OK && rc != SASL_NOTDONE ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ERR, - "slap_sasl_authorize: getprop(REALM) failed.\n" )); + 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); @@ -874,9 +868,9 @@ slap_sasl_authorize( } if( ( authzid == NULL ) || !strcmp( authcid,authzid ) ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_authorize: conn %d Using authcDN=%s\n", - conn ? conn->c_connid : -1, authcDN.bv_val )); + 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 ); @@ -897,9 +891,9 @@ slap_sasl_authorize( ch_free( authcDN.bv_val ); if( rc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_INFO, - "slap_sasl_authorize: conn %ld authorization disallowed (%d)\n", - (long)(conn ? conn->c_connid : -1), rc )); + LDAP_LOG( TRANSPORT, INFO, + "slap_sasl_authorize: conn %ld authorization disallowed (%d)\n", + (long)(conn ? conn->c_connid : -1), rc, 0 ); #else Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: " " authorization disallowed (%d)\n", @@ -912,9 +906,9 @@ slap_sasl_authorize( } #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_authorize: conn %d authorization allowed\n", - (long)(conn ? conn->c_connid : -1 ) )); + LDAP_LOG( TRANSPORT, RESULTS, + "slap_sasl_authorize: conn %d authorization allowed\n", + (long)(conn ? conn->c_connid : -1 ), 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: " " authorization allowed\n", @@ -995,8 +989,7 @@ int slap_sasl_init( void ) if( rc != SASL_OK ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_INFO, - "slap_sasl_init: init failed.\n" )); + 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 ); @@ -1006,8 +999,7 @@ int slap_sasl_init( void ) } #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_INFO, - "slap_sasl_init: initialized!\n")); + 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 ); @@ -1129,8 +1121,8 @@ int slap_sasl_open( Connection *conn ) if( sc != SASL_OK ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ERR, - "slap_sasl_open: sasl_server_new failed: %d\n", sc )); + 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 ); @@ -1147,8 +1139,8 @@ int slap_sasl_open( Connection *conn ) if( sc != SASL_OK ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ERR, - "slap_sasl_open: sasl_setprop failed: %d \n", sc )); + 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 ); @@ -1242,8 +1234,8 @@ char ** slap_sasl_mechs( Connection *conn ) if( sc != SASL_OK ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ERR, - "slap_sasl_mechs: sasl_listmech failed: %d\n", sc )); + 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 ); @@ -1300,12 +1292,12 @@ int slap_sasl_bind( int sc; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "sasl_bind: conn %ld dn=\"%s\" mech=%s datalen=%ld\n", - conn->c_connid, + LDAP_LOG( TRANSPORT, ENTRY, + "sasl_bind: dn=\"%s\" mech=%s datalen=%ld\n", dn->bv_len ? dn->bv_val : "", - conn->c_sasl_bind_in_progress ? "" : conn->c_sasl_bind_mech.bv_val, - cred ? cred->bv_len : 0 )); + conn->c_sasl_bind_in_progress ? "" : + conn->c_sasl_bind_mech.bv_val, + cred ? cred->bv_len : 0 ); #else Debug(LDAP_DEBUG_ARGS, "==> sasl_bind: dn=\"%s\" mech=%s datalen=%ld\n", @@ -1389,8 +1381,7 @@ int slap_sasl_bind( #endif #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_bind: rc=%d\n", rc )); + LDAP_LOG( TRANSPORT, RESULTS, "slap_sasl_bind: rc=%d\n", rc, 0, 0 ); #else Debug(LDAP_DEBUG_TRACE, "<== slap_sasl_bind: rc=%d\n", rc, 0, 0); #endif diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index 601d0245c8..b6a9cd9420 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -96,8 +96,8 @@ static int slap_parseURI( struct berval *uri, } #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_parseURI: parsing %s\n", uri->bv_val )); + 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 @@ -170,10 +170,9 @@ static int slap_sasl_rx_off(char *rep, int *off) if ( *c == '$' ) { if ( n == SASLREGEX_REPLACE ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ERR, + LDAP_LOG( TRANSPORT, ERR, "slap_sasl_regexp_config: \"%s\" has too many $n " - "placeholders (max %d)\n", - rep, SASLREGEX_REPLACE )); + "placeholders (max %d)\n", rep, SASLREGEX_REPLACE, 0 ); #else Debug( LDAP_DEBUG_ANY, "SASL replace pattern %s has too many $n " @@ -212,9 +211,9 @@ int slap_sasl_regexp_config( const char *match, const char *replace ) rc = dnNormalize2( NULL, &bv, &nbv ); if ( rc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ERR, - "slap_sasl_regexp_config: \"%s\" could not be normalized.\n", - match )); + LDAP_LOG( TRANSPORT, ERR, + "slap_sasl_regexp_config: \"%s\" could not be normalized.\n", + match, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "SASL match pattern %s could not be normalized.\n", @@ -230,9 +229,9 @@ int slap_sasl_regexp_config( const char *match, const char *replace ) if ( filter ) filter_free( filter ); if ( rc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ERR, - "slap_sasl_regexp_config: \"%s\" could not be parsed.\n", - replace )); + LDAP_LOG( TRANSPORT, ERR, + "slap_sasl_regexp_config: \"%s\" could not be parsed.\n", + replace, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "SASL replace pattern %s could not be parsed.\n", @@ -245,9 +244,9 @@ int slap_sasl_regexp_config( const char *match, const char *replace ) rc = regcomp( ®->sr_workspace, reg->sr_match, REG_EXTENDED|REG_ICASE ); if ( rc ) { #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ERR, - "slap_sasl_regexp_config: \"%s\" could not be compiled.\n", - reg->sr_match )); + 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", @@ -334,8 +333,8 @@ static int slap_sasl_regexp( struct berval *in, SaslUri_t *out ) memset( out, 0, sizeof( *out ) ); #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_regexp: converting SASL name %s\n", saslname )); + LDAP_LOG( TRANSPORT, ENTRY, + "slap_sasl_regexp: converting SASL name %s\n", saslname, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "slap_sasl_regexp: converting SASL name %s\n", saslname, 0, 0 ); @@ -369,10 +368,10 @@ static int slap_sasl_regexp( struct berval *in, SaslUri_t *out ) out->scope = reg->sr_replace.scope; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, + LDAP_LOG( TRANSPORT, ENTRY, "slap_sasl_regexp: converted SASL name to ldap:///%s??%s?%s\n", out->dn.bv_val, scope[out->scope], out->filter.bv_val ? - out->filter.bv_val : "" )); + out->filter.bv_val : "" ); #else Debug( LDAP_DEBUG_TRACE, "slap_sasl_regexp: converted SASL name to ldap:///%s??%s?%s\n", @@ -409,8 +408,8 @@ static int sasl_sc_sasl2dn( BackendDB *be, Connection *conn, Operation *o, ndn->bv_val = NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_DETAIL1, - "slap_sasl2dn: search DN returned more than 1 entry\n" )); + LDAP_LOG( TRANSPORT, DETAIL1, + "slap_sasl2dn: search DN returned more than 1 entry\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "slap_sasl2dn: search DN returned more than 1 entry\n", 0,0,0 ); @@ -441,8 +440,8 @@ void slap_sasl2dn( Connection *conn, struct berval *saslname, struct berval *dn SaslUri_t uri; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl2dn: converting SASL name %s to DN.\n", saslname->bv_val )); + 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 ); @@ -472,9 +471,9 @@ void slap_sasl2dn( Connection *conn, struct berval *saslname, struct berval *dn } #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_DETAIL1, + LDAP_LOG( TRANSPORT, DETAIL1, "slap_sasl2dn: performing internal search (base=%s, scope=%d)\n", - uri.dn.bv_val, uri.scope )); + uri.dn.bv_val, uri.scope, 0 ); #else Debug( LDAP_DEBUG_TRACE, "slap_sasl2dn: performing internal search (base=%s, scope=%d)\n", @@ -506,9 +505,9 @@ FINISHED: if( filter ) filter_free( filter ); #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, + LDAP_LOG( TRANSPORT, ENTRY, "slap_sasl2dn: Converted SASL name to %s\n", - dn->bv_len ? dn->bv_val : "" )); + dn->bv_len ? dn->bv_val : "", 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<==slap_sasl2dn: Converted SASL name to %s\n", dn->bv_len ? dn->bv_val : "", 0, 0 ); @@ -557,8 +556,9 @@ int slap_sasl_match( struct berval *rule, struct berval *assertDN, struct berval Operation op = {0}; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_match: comparing DN %s to rule %s\n", assertDN->bv_val, rule->bv_val )); + 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 ); @@ -586,9 +586,9 @@ int slap_sasl_match( struct berval *rule, struct berval *assertDN, struct berval /* Must run an internal search. */ #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_DETAIL1, + LDAP_LOG( TRANSPORT, DETAIL1, "slap_sasl_match: performing internal search (base=%s, scope=%d)\n", - searchbase.bv_val, scope )); + searchbase.bv_val, scope,0 ); #else Debug( LDAP_DEBUG_TRACE, "slap_sasl_match: performing internal search (base=%s, scope=%d)\n", @@ -625,8 +625,8 @@ CONCLUDED: if( searchbase.bv_len ) ch_free( searchbase.bv_val ); if( filter ) filter_free( filter ); #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_match: comparison returned %d\n", rc )); + 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); @@ -651,9 +651,9 @@ slap_sasl_check_authz(struct berval *searchDN, struct berval *assertDN, Attribut BerVarray vals=NULL; #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, + 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 )); + 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", @@ -676,8 +676,9 @@ COMPLETE: if( vals ) ber_bvarray_free( vals ); #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_check_authz: %s check returning %s\n", ad->ad_cname.bv_val, rc )); + LDAP_LOG( TRANSPORT, RESULTS, + "slap_sasl_check_authz: %s check returning %s\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); @@ -704,8 +705,9 @@ int slap_sasl_authorized( struct berval *authcDN, struct berval *authzDN ) } #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_authorized: can %s become %s?\n", authcDN->bv_val, authzDN->bv_val )); + 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 ); @@ -741,8 +743,7 @@ DONE: #endif #ifdef NEW_LOGGING - LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY, - "slap_sasl_authorized: return %d\n", rc )); + 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 ); diff --git a/servers/slapd/schema_check.c b/servers/slapd/schema_check.c index 405a47e548..a92d44214b 100644 --- a/servers/slapd/schema_check.c +++ b/servers/slapd/schema_check.c @@ -84,9 +84,8 @@ entry_schema_check( type ); #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_INFO, - "entry_schema_check: dn=\"%s\" %s\n", - e->e_dn, textbuf )); + 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", @@ -104,9 +103,9 @@ entry_schema_check( asc = attr_find( e->e_attrs, ad_structuralObjectClass ); if ( asc == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_INFO, "entry_schema_check: " - "No structuralObjectClass for entry (%s)\n", - e->e_dn )); + 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", @@ -128,9 +127,8 @@ entry_schema_check( asc->a_vals[0].bv_val ); #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_INFO, - "entry_schema_check: dn (%s), %s\n", - e->e_dn, textbuf )); + 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", @@ -146,9 +144,8 @@ entry_schema_check( asc->a_vals[0].bv_val ); #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_INFO, - "entry_schema_check: dn (%s), %s\n", - e->e_dn, textbuf )); + 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", @@ -162,9 +159,9 @@ entry_schema_check( aoc = attr_find( e->e_attrs, ad_objectClass ); if ( aoc == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_INFO, - "entry_schema_check: No objectClass for entry (%s).\n", - e->e_dn )); + 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 ); @@ -207,9 +204,8 @@ entry_schema_check( aoc->a_vals[i].bv_val ); #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_INFO, - "entry_schema_check: dn (%s), %s\n", - e->e_dn, textbuf )); + 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", @@ -243,9 +239,9 @@ entry_schema_check( aoc->a_vals[i].bv_val ); #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "entry_schema_check: dn (%s), %s\n", - e->e_dn, textbuf )); + e->e_dn, textbuf, 0 ); #else Debug( LDAP_DEBUG_ANY, "entry_check_schema(%s): %s\n", @@ -277,9 +273,9 @@ entry_schema_check( aoc->a_vals[i].bv_val ); #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_INFO, - "entry_schema_check: dn (%s), %s\n", - e->e_dn, textbuf )); + 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", @@ -299,9 +295,8 @@ entry_schema_check( aoc->a_vals[i].bv_val, s ); #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_INFO, - "entry_schema_check: dn=\"%s\" %s", - e->e_dn, textbuf )); + LDAP_LOG( OPERATION, INFO, + "entry_schema_check: dn=\"%s\" %s", e->e_dn, textbuf, 0 ); #else Debug( LDAP_DEBUG_ANY, "Entry (%s): %s\n", @@ -332,9 +327,8 @@ entry_schema_check( type ); #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_INFO, - "entry_schema_check: dn=\"%s\" %s\n", - e->e_dn, textbuf )); + 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", @@ -359,9 +353,9 @@ oc_check_required( Attribute *a; #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "oc_check_required: dn (%s), objectClass \"%s\"\n", - e->e_dn, ocname->bv_val )); + 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", @@ -400,8 +394,8 @@ int oc_check_allowed( int i, j; #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "oc_check_allowed: type \"%s\"\n", at->sat_cname.bv_val )); + 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", diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index f0ad77cb51..cc92297a54 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -3367,9 +3367,9 @@ objectIdentifierFirstComponentMatch( } #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "objectIdentifierFirstComponentMatch: %d\n %s\n %s\n", - match, value->bv_val, asserted->bv_val )); + LDAP_LOG( CONFIG, ENTRY, + "objectIdentifierFirstComponentMatch: %d\n %s\n %s\n", + match, value->bv_val, asserted->bv_val ); #else Debug( LDAP_DEBUG_ARGS, "objectIdentifierFirstComponentMatch " "%d\n\t\"%s\"\n\t\"%s\"\n", @@ -3516,9 +3516,9 @@ certificateExactConvert( xcert = d2i_X509(NULL, &p, in->bv_len); if ( !xcert ) { #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "certificateExactConvert: error parsing cert: %s\n", - ERR_error_string(ERR_get_error(),NULL))); + LDAP_LOG( CONFIG, ENTRY, + "certificateExactConvert: error parsing cert: %s\n", + ERR_error_string(ERR_get_error(),NULL), 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "certificateExactConvert: " "error parsing cert: %s\n", @@ -3551,9 +3551,8 @@ certificateExactConvert( *p++ = '\0'; #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "certificateExactConvert: \n %s\n", - out->bv_val)); + LDAP_LOG( CONFIG, ARGS, + "certificateExactConvert: \n %s\n", out->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "certificateExactConvert " "\n\t\"%s\"\n", @@ -3633,9 +3632,9 @@ certificateExactMatch( xcert = d2i_X509(NULL, &p, value->bv_len); if ( !xcert ) { #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "certificateExactMatch: error parsing cert: %s\n", - ERR_error_string(ERR_get_error(),NULL))); + LDAP_LOG( CONFIG, ENTRY, + "certificateExactMatch: error parsing cert: %s\n", + ERR_error_string(ERR_get_error(),NULL), 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "certificateExactMatch: " "error parsing cert: %s\n", @@ -3674,10 +3673,12 @@ certificateExactMatch( } #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "certificateExactMatch: %d\n %s $ %s\n %s $ %s\n", - *matchp, serial.bv_val, issuer_dn.bv_val, - asserted_serial.bv_val, asserted_issuer_dn.bv_val)); + LDAP_LOG( CONFIG, ARGS, "certificateExactMatch " + "%d\n\t\"%s $ %s\"\n", + *matchp, serial.bv_val, issuer_dn.bv_val ); + LDAP_LOG( CONFIG, ARGS, "\t\"%s $ %s\"\n", + asserted_serial.bv_val, asserted_issuer_dn.bv_val, + 0 ); #else Debug( LDAP_DEBUG_ARGS, "certificateExactMatch " "%d\n\t\"%s $ %s\"\n", @@ -3729,9 +3730,9 @@ static int certificateExactIndexer( xcert = d2i_X509(NULL, &p, values[i].bv_len); if ( !xcert ) { #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "certificateExactIndexer: error parsing cert: %s\n", - ERR_error_string(ERR_get_error(),NULL))); + LDAP_LOG( CONFIG, ENTRY, + "certificateExactIndexer: error parsing cert: %s\n", + ERR_error_string(ERR_get_error(),NULL), 0, 0); #else Debug( LDAP_DEBUG_ARGS, "certificateExactIndexer: " "error parsing cert: %s\n", @@ -3749,9 +3750,8 @@ static int certificateExactIndexer( &keys[i] ); ber_memfree(serial.bv_val); #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "certificateExactIndexer: returning: %s\n", - keys[i].bv_val)); + LDAP_LOG( CONFIG, ENTRY, + "certificateExactIndexer: returning: %s\n", keys[i].bv_val, 0, 0); #else Debug( LDAP_DEBUG_ARGS, "certificateExactIndexer: " "returning: %s\n", @@ -4627,7 +4627,7 @@ int slap_schema_init( void ) { int res; - int i; + int i = 0; /* we should only be called once (from main) */ assert( schema_init_done == 0 ); diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index 5813aa52c0..50dd5e94f8 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -36,9 +36,8 @@ objectClassMatch( #if 1 #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "> objectClassMatch(%s, %s)\n", - value->bv_val, a->bv_val )); + LDAP_LOG( CONFIG, ENTRY, + "> objectClassMatch(%s, %s)\n", value->bv_val, a->bv_val, 0 ); #else Debug( LDAP_DEBUG_TRACE, "> objectClassMatch(%s,%s)\n", value->bv_val, a->bv_val, 0 ); @@ -69,9 +68,9 @@ objectClassMatch( #if 1 #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "< objectClassMatch(%s, %s) = %d\n", - value->bv_val, a->bv_val, *matchp )); + LDAP_LOG( CONFIG, ENTRY, + "< objectClassMatch(%s, %s) = %d\n", + value->bv_val, a->bv_val, *matchp ); #else Debug( LDAP_DEBUG_TRACE, "< objectClassMatch(%s,%s) = %d\n", value->bv_val, a->bv_val, *matchp ); @@ -99,9 +98,8 @@ structuralObjectClassMatch( #if 1 #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "> structuralObjectClassMatch(%s, %s)\n", - value->bv_val, a->bv_val )); + LDAP_LOG( CONFIG, ENTRY, + "> structuralObjectClassMatch(%s, %s)\n", value->bv_val, a->bv_val, 0 ); #else Debug( LDAP_DEBUG_TRACE, "> structuralObjectClassMatch(%s,%s)\n", value->bv_val, a->bv_val, 0 ); @@ -128,9 +126,9 @@ structuralObjectClassMatch( #if 1 #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, - "< structuralObjectClassMatch( %s, %s ) = %d\n", - value->bv_val, a->bv_val, *matchp )); + LDAP_LOG( CONFIG, ENTRY, + "< structuralObjectClassMatch( %s, %s ) = %d\n", + value->bv_val, a->bv_val, *matchp ); #else Debug( LDAP_DEBUG_TRACE, "< structuralObjectClassMatch(%s,%s) = %d\n", value->bv_val, a->bv_val, *matchp ); diff --git a/servers/slapd/search.c b/servers/slapd/search.c index c4db3e52e6..7e36a3d748 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -45,8 +45,7 @@ do_search( int manageDSAit; #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "do_search: conn %d\n", conn->c_connid )); + LDAP_LOG( OPERATION, ENTRY, "do_search: conn %d\n", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 ); #endif @@ -112,9 +111,9 @@ do_search( rc = dnPrettyNormal( NULL, &base, &pbase, &nbase ); if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, ERR, "do_search: conn %d invalid dn (%s)\n", - conn->c_connid, base.bv_val )); + conn->c_connid, base.bv_val, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_search: invalid dn (%s)\n", base.bv_val, 0, 0 ); @@ -125,9 +124,10 @@ do_search( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "do_search \"%s\" %d %d %d %d %d\n", base.bv_val, scope, - deref, sizelimit, timelimit, attrsonly )); + LDAP_LOG( OPERATION, ARGS, "SRCH \"%s\" %d %d", + base.bv_val, scope, deref ); + LDAP_LOG( OPERATION, ARGS, " %d %d %d\n", + sizelimit, timelimit, attrsonly); #else Debug( LDAP_DEBUG_ARGS, "SRCH \"%s\" %d %d", base.bv_val, scope, deref ); @@ -152,9 +152,9 @@ do_search( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "do_search: conn %d filter: %s\n", conn->c_connid, - fstr.bv_len ? fstr.bv_val : "empty" )); + LDAP_LOG( OPERATION, ARGS, + "do_search: conn %d filter: %s\n", + conn->c_connid, fstr.bv_len ? fstr.bv_val : "empty", 0 ); #else Debug( LDAP_DEBUG_ARGS, " filter: %s\n", fstr.bv_len ? fstr.bv_val : "empty", 0, 0 ); @@ -177,9 +177,9 @@ do_search( if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, + LDAP_LOG( OPERATION, INFO, "do_search: conn %d get_ctrls failed (%d)\n", - conn->c_connid, rc )); + conn->c_connid, rc, 0 ); #else Debug( LDAP_DEBUG_ANY, "do_search: get_ctrls failed\n", 0, 0, 0 ); #endif @@ -188,8 +188,8 @@ do_search( } #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ARGS, - "do_search: conn %d attrs:", conn->c_connid )); + LDAP_LOG( OPERATION, ARGS, + "do_search: conn %d attrs:", conn->c_connid, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, " attrs:", 0, 0, 0 ); #endif @@ -197,8 +197,8 @@ do_search( if ( siz != 0 ) { for ( i = 0; ibv_val, oldDN, diff ); strcpy( &dn->bv_val[diff], be->be_suffixAlias[i+1].bv_val ); #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "suffix_alias: converted \"%s\" to \"%s\"\n", - oldDN, dn->bv_val )); + LDAP_LOG( OPERATION, INFO, + "suffix_alias: converted \"%s\" to \"%s\"\n", + oldDN, dn->bv_val, 0 ); #else Debug( LDAP_DEBUG_ARGS, "suffix_alias: converted \"%s\" to \"%s\"\n", diff --git a/servers/slapd/syntax.c b/servers/slapd/syntax.c index eea2e1b110..98f53d433b 100644 --- a/servers/slapd/syntax.c +++ b/servers/slapd/syntax.c @@ -16,7 +16,6 @@ #include "slap.h" #include "ldap_pvt.h" - struct sindexrec { char *sir_name; Syntax *sir_syn; @@ -164,9 +163,9 @@ register_syntax( syn = ldap_str2syntax( desc, &code, &err, LDAP_SCHEMA_ALLOW_ALL); if ( !syn ) { #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ERR, - "register_syntax: Error - %s before %s in %s.\n", - ldap_scherr2str(code), err, desc )); + LDAP_LOG( CONFIG, ERR, + "register_syntax: Error - %s before %s in %s.\n", + ldap_scherr2str(code), err, desc ); #else Debug( LDAP_DEBUG_ANY, "Error in register_syntax: %s before %s in %s\n", ldap_scherr2str(code), err, desc ); @@ -181,9 +180,9 @@ register_syntax( if ( code ) { #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ERR, - "register_syntax: Error - %s %s in %s\n", - scherr2str(code), err, desc )); + LDAP_LOG( CONFIG, ERR, + "register_syntax: Error - %s %s in %s\n", + scherr2str(code), err, desc ); #else Debug( LDAP_DEBUG_ANY, "Error in register_syntax: %s %s in %s\n", scherr2str(code), err, desc ); @@ -222,9 +221,9 @@ syn_schema_info( Entry *e ) } #if 0 #ifdef NEW_LOGGING - LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY, + LDAP_LOG( config, ENTRY, "syn_schema_info: Merging syn [%ld] %s\n", - (long)vals[0].bv_len, vals[0].bv_val )); + (long)vals[0].bv_len, vals[0].bv_val, 0 ); #else Debug( LDAP_DEBUG_TRACE, "Merging syn [%ld] %s\n", (long) vals[0].bv_len, vals[0].bv_val, 0 ); diff --git a/servers/slapd/tools/slapadd.c b/servers/slapd/tools/slapadd.c index d14114c50c..7710127740 100644 --- a/servers/slapd/tools/slapadd.c +++ b/servers/slapd/tools/slapadd.c @@ -31,6 +31,9 @@ main( int argc, char **argv ) char textbuf[SLAP_TEXT_BUFLEN] = { '\0' }; size_t textlen = sizeof textbuf; +#ifdef NEW_LOGGING + lutil_log_initialize(argc, argv ); +#endif slap_tool_init( "slapadd", SLAPADD, argc, argv ); if( !be->be_entry_open || diff --git a/servers/slapd/unbind.c b/servers/slapd/unbind.c index 40457cfe9a..c4c4f18542 100644 --- a/servers/slapd/unbind.c +++ b/servers/slapd/unbind.c @@ -26,7 +26,6 @@ #include "slap.h" - int do_unbind( Connection *conn, @@ -34,8 +33,8 @@ do_unbind( ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, - "do_unbind: conn %d\n", conn ? conn->c_connid : -1 )); + LDAP_LOG( OPERATION, ENTRY, + "do_unbind: conn %d\n", conn ? conn->c_connid : -1, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "do_unbind\n", 0, 0, 0 ); #endif diff --git a/servers/slapd/user.c b/servers/slapd/user.c index e12c6032a3..8df425bc38 100644 --- a/servers/slapd/user.c +++ b/servers/slapd/user.c @@ -34,7 +34,6 @@ #include "slap.h" - /* * Set real and effective user id and group id, and group access list * The user and group arguments are freed. @@ -64,9 +63,8 @@ slap_init_user( char *user, char *group ) did_getpw: if ( pwd == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "slap_init_user: No passwd entry for user %s\n", - user )); + 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 ); @@ -104,8 +102,8 @@ slap_init_user( char *user, char *group ) did_group: if ( grp == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "slap_init_user: No group entry for group %s\n", group)); + 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 ); @@ -121,8 +119,9 @@ slap_init_user( char *user, char *group ) if ( user ) { if ( getuid() == 0 && initgroups( user, gid ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "slap_init_user: Could not set the group access (gid) list.\n" )); + 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 ); @@ -140,8 +139,9 @@ slap_init_user( char *user, char *group ) if ( got_gid ) { if ( setgid( gid ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "slap_init_user: could not set real group id to %d\n", (int)gid)); + 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 ); @@ -152,8 +152,9 @@ slap_init_user( char *user, char *group ) #ifdef HAVE_SETEGID if ( setegid( gid ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "slap_init_user: Could not set effective group id to %d\n",(int)gid)); + 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 ); @@ -167,8 +168,9 @@ slap_init_user( char *user, char *group ) if ( got_uid ) { if ( setuid( uid ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "slap_init_user: Could not set real user id to %d\n", (int)uid )); + 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 ); @@ -179,8 +181,9 @@ slap_init_user( char *user, char *group ) #ifdef HAVE_SETEUID if ( seteuid( uid ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "operation", LDAP_LEVEL_INFO, - "slap_init_user: Could not set effective user id to %d\n", (int)uid )); + 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 ); diff --git a/servers/slurpd/config.c b/servers/slurpd/config.c index bd47c26a61..cff7704899 100644 --- a/servers/slurpd/config.c +++ b/servers/slurpd/config.c @@ -67,8 +67,9 @@ slurpd_read_config( cargv_size = ARGS_STEP + 1; #ifdef NEW_LOGGING - LDAP_LOG (( "config", LDAP_LEVEL_ARGS, - "slurpd_read_config: Config: opening config file \"%s\"\n", fname )); + 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 ); @@ -87,8 +88,8 @@ slurpd_read_config( } #ifdef NEW_LOGGING - LDAP_LOG (( "config", LDAP_LEVEL_DETAIL1, - "slurpd_read_config: Config: (%s)\n", line )); + 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 @@ -132,9 +133,9 @@ slurpd_read_config( if ( cargc < 2 ) { #ifdef NEW_LOGGING - LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + LDAP_LOG( CONFIG, CRIT, "%s: line %d: missing filename in \"include " - "\" line.\n", fname, lineno )); + "\" line.\n", fname, lineno , 0 ); #else Debug( LDAP_DEBUG_ANY, "%s: line %d: missing filename in \"include \" line\n", @@ -156,9 +157,9 @@ slurpd_read_config( } fclose( fp ); #ifdef NEW_LOGGING - LDAP_LOG (( "config", LDAP_LEVEL_RESULTS, + LDAP_LOG ( CONFIG, RESULTS, "slurpd_read_config: Config: " - "** configuration file successfully read and parsed\n" )); + "** configuration file successfully read and parsed\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_CONFIG, "Config: ** configuration file successfully read and parsed\n", @@ -344,11 +345,11 @@ add_replica( sglob->num_replicas--; } else { #ifdef NEW_LOGGING - LDAP_LOG (( "config", LDAP_LEVEL_RESULTS, + 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 )); + sglob->replicas[ nr - 1 ]->ri_port, 0 ); #else Debug( LDAP_DEBUG_CONFIG, "Config: ** successfully added replica \"%s:%d\"\n", diff --git a/servers/slurpd/fm.c b/servers/slurpd/fm.c index 36fab6540e..30ac5845d6 100644 --- a/servers/slurpd/fm.c +++ b/servers/slurpd/fm.c @@ -92,8 +92,8 @@ fm( if ( file_nonempty( sglob->slapd_replogfile )) { /* New work found - copy to slurpd replog file */ #ifdef NEW_LOGGING - LDAP_LOG (( "fm", LDAP_LEVEL_ARGS, - "fm: new work in %s\n", sglob->slapd_replogfile )); + 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 ); @@ -104,8 +104,8 @@ fm( } else { if ( rc < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "fm", LDAP_LEVEL_CRIT, - "fm: Fatal error while copying replication log\n" )); + 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", @@ -127,9 +127,9 @@ fm( if (( rc = acquire_lock( sglob->slurpd_replogfile, &fp, &lfp )) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "fm", LDAP_LEVEL_ERR, + LDAP_LOG ( SLURPD, ERR, "fm: Error: cannot acquire lock on \"%s\" for trimming\n", - sglob->slurpd_replogfile )); + sglob->slurpd_replogfile, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: cannot acquire lock on \"%s\" for trimming\n", @@ -142,7 +142,7 @@ fm( } } #ifdef NEW_LOGGING - LDAP_LOG (( "fm", LDAP_LEVEL_RESULTS, "fm: exiting\n" )); + LDAP_LOG ( SLURPD, RESULTS, "fm: exiting\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ARGS, "fm: exiting\n", 0, 0, 0 ); #endif @@ -200,9 +200,9 @@ populate_queue( if ( acquire_lock( f, &fp, &lfp ) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "fm", LDAP_LEVEL_ERR, + LDAP_LOG ( SLURPD, ERR, "populate_queue: error: can't lock file \"%s\": %s\n", - f, sys_errlist[ errno ] )); + f, sys_errlist[ errno ], 0 ); #else Debug( LDAP_DEBUG_ANY, "error: can't lock file \"%s\": %s\n", @@ -217,9 +217,9 @@ populate_queue( */ if ( fseek( fp, sglob->srpos, 0 ) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "fm", LDAP_LEVEL_ERR, + LDAP_LOG ( SLURPD, ERR, "populate_queue: error: can't seek to offset %ld in file \"%s\"\n", - sglob->srpos, f )); + sglob->srpos, f, 0 ); #else Debug( LDAP_DEBUG_ANY, "error: can't seek to offset %ld in file \"%s\"\n", @@ -234,9 +234,9 @@ populate_queue( *t = '\0'; } #ifdef NEW_LOGGING - LDAP_LOG (( "fm", LDAP_LEVEL_ERR, + LDAP_LOG ( SLURPD, ERR, "populate_queue: error: malformed replog entry " - "(begins with \"%s\")\n", p )); + "(begins with \"%s\")\n", p, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "error: malformed replog entry (begins with \"%s\")\n", diff --git a/servers/slurpd/ldap_op.c b/servers/slurpd/ldap_op.c index 577950e4b0..38882a1b42 100644 --- a/servers/slurpd/ldap_op.c +++ b/servers/slurpd/ldap_op.c @@ -85,9 +85,10 @@ do_ldap( lderr = op_ldap_add( ri, re, errmsg ); if ( lderr != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_ldap: " + LDAP_LOG ( OPERATION, ERR, "do_ldap: " "Error: ldap_add_s failed adding \"%s\": %s\n", - *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn )); + *errmsg ? *errmsg : ldap_err2string( lderr ), + re->re_dn, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: ldap_add_s failed adding \"%s\": %s\n", @@ -101,9 +102,10 @@ do_ldap( lderr = op_ldap_modify( ri, re, errmsg ); if ( lderr != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_ldap: " + LDAP_LOG ( OPERATION, ERR, "do_ldap: " "Error: ldap_modify_s failed modifying \"%s\": %s\n", - *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn )); + *errmsg ? *errmsg : ldap_err2string( lderr ), + re->re_dn, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: ldap_modify_s failed modifying \"%s\": %s\n", @@ -117,9 +119,10 @@ do_ldap( lderr = op_ldap_delete( ri, re, errmsg ); if ( lderr != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_ldap: " + LDAP_LOG ( OPERATION, ERR, "do_ldap: " "Error: ldap_delete_s failed deleting \"%s\": %s\n", - *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn )); + *errmsg ? *errmsg : ldap_err2string( lderr ), + re->re_dn, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: ldap_delete_s failed deleting \"%s\": %s\n", @@ -133,9 +136,10 @@ do_ldap( lderr = op_ldap_modrdn( ri, re, errmsg ); if ( lderr != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_ldap: " + LDAP_LOG ( OPERATION, ERR, "do_ldap: " "Error: ldap_modrdn_s failed modifying %s: %s\n", - *errmsg ? *errmsg : ldap_err2string( lderr ), re->re_dn )); + *errmsg ? *errmsg : ldap_err2string( lderr ), + re->re_dn, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: ldap_modrdn_s failed modifying %s: %s\n", @@ -147,9 +151,9 @@ do_ldap( default: #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_ldap: " + LDAP_LOG ( OPERATION, ERR, "do_ldap: " "Error: bad op \"%d\", dn = \"%s\"\n", - re->re_changetype, re->re_dn )); + re->re_changetype, re->re_dn, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: do_ldap: bad op \"%d\", dn = \"%s\"\n", @@ -221,9 +225,9 @@ op_ldap_add( /* Perform the operation */ #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, + LDAP_LOG ( OPERATION, ARGS, "op_ldap_add: replica %s:%d - add dn \"%s\"\n", - ri->ri_hostname, ri->ri_port, re->re_dn )); + 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 ); @@ -235,8 +239,8 @@ op_ldap_add( } else { *errmsg = "No modifications to do"; #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, - "op_ldap_add: Error: no mods to do (%s)!\n", re->re_dn )); + 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 ); @@ -277,8 +281,8 @@ op_ldap_modify( if ( re->re_mods == NULL ) { *errmsg = "No arguments given"; #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, - "op_ldap_modify: Error: no arguments\n" )); + 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 ); @@ -330,8 +334,8 @@ op_ldap_modify( default: if ( state == AWAITING_OP ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, - "op_ldap_modify: Error: unknown mod type \"%s\"\n", type )); + 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", @@ -348,10 +352,10 @@ op_ldap_modify( */ if ( strcasecmp( type, ldm->mod_type )) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "op_ldap_modify: Error: " "malformed modify op, %s: %s (expecting \"%s\")\n", - type, value, ldm->mod_type )); + type, value, ldm->mod_type ); #else Debug( LDAP_DEBUG_ANY, "Error: malformed modify op, %s: %s (expecting %s:)\n", @@ -375,9 +379,9 @@ op_ldap_modify( if ( nops > 0 ) { /* Actually perform the LDAP operation */ #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_DETAIL1, + LDAP_LOG ( OPERATION, DETAIL1, "op_ldap_modify: replica %s:%d - modify dn \"%s\"\n", - ri->ri_hostname, ri->ri_port, re->re_dn )); + 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 ); @@ -404,9 +408,9 @@ op_ldap_delete( int rc; #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, + LDAP_LOG ( OPERATION, ARGS, "op_ldap_delete: replica %s:%d - delete dn \"%s\"\n", - ri->ri_hostname, ri->ri_port, re->re_dn )); + 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 ); @@ -447,8 +451,8 @@ op_ldap_modrdn( if ( re->re_mods == NULL ) { *errmsg = "No arguments given"; #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, - "op_ldap_modrdn: Error: no arguments\n" )); + 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 ); @@ -463,9 +467,9 @@ op_ldap_modrdn( if ( !strcmp( mi[ i ].mi_type, T_NEWRDNSTR )) { if( state & GOT_NEWRDN ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "op_ldap_modrdn: Error: multiple newrdn arg \"%s\"\n", - mi[ i ].mi_val )); + mi[ i ].mi_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: multiple newrdn arg \"%s\"\n", @@ -481,9 +485,9 @@ op_ldap_modrdn( } else if ( !strcmp( mi[ i ].mi_type, T_DELOLDRDNSTR )) { if( state & GOT_DELOLDRDN ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "op_ldap_modrdn: Error: multiple deleteoldrdn arg \"%s\"\n", - mi[ i ].mi_val )); + mi[ i ].mi_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: multiple deleteoldrdn arg \"%s\"\n", @@ -500,9 +504,9 @@ op_ldap_modrdn( drdnflag = 1; } else { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "op_ldap_modrdn: Error: bad deleteoldrdn arg \"%s\"\n", - mi[ i ].mi_val )); + mi[ i ].mi_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: bad deleteoldrdn arg \"%s\"\n", @@ -515,9 +519,9 @@ op_ldap_modrdn( } else if ( !strcmp( mi[ i ].mi_type, T_NEWSUPSTR )) { if( state & GOT_NEWSUP ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "op_ldap_modrdn: Error: multiple newsuperior arg \"%s\"\n", - mi[ i ].mi_val )); + mi[ i ].mi_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: multiple newsuperior arg \"%s\"\n", @@ -532,9 +536,9 @@ op_ldap_modrdn( } else { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "op_ldap_modrdn: Error: bad type \"%s\"\n", - mi[ i ].mi_type )); + 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 ); @@ -549,8 +553,8 @@ op_ldap_modrdn( */ if ( !GOT_ALL_MODDN(state) ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, - "op_ldap_modrdn: Error: missing arguments\n" )); + 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 ); @@ -571,9 +575,9 @@ op_ldap_modrdn( snprintf( buf2, buf2len, "(\"%s\" -> \"%s\")", re->re_dn, mi->mi_val ); #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, + LDAP_LOG ( OPERATION, ARGS, "op_ldap_modrdn: replica %s - modify rdn %s (flag: %d)\n", - buf, buf2, drdnflag )); + buf, buf2, drdnflag ); #else Debug( LDAP_DEBUG_ARGS, "replica %s - modify rdn %s (flag: %d)\n", @@ -712,9 +716,9 @@ do_unbind( rc = ldap_unbind( ri->ri_ldp ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "do_unbind: ldap_unbind failed for %s:%d: %s\n", - ri->ri_hostname, ri->ri_port, ldap_err2string( rc ) )); + 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", @@ -751,7 +755,7 @@ do_bind( if ( ri == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: null ri ptr\n" )); + 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 @@ -762,8 +766,8 @@ do_bind( ldrc = ldap_unbind( ri->ri_ldp ); if ( ldrc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, - "do_bind: ldap_unbind failed: %s\n", ldap_err2string( ldrc ) )); + 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", @@ -774,9 +778,9 @@ do_bind( } #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, + LDAP_LOG ( OPERATION, ARGS, "do_bind: Initializing session to %s:%d\n", - ri->ri_hostname, ri->ri_port )); + 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 ); @@ -785,9 +789,9 @@ do_bind( ri->ri_ldp = ldap_init( ri->ri_hostname, ri->ri_port ); if ( ri->ri_ldp == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, + LDAP_LOG ( OPERATION, ERR, "do_bind: ldap_init (%s, %d) failed: %s\n", - ri->ri_hostname, ri->ri_port, sys_errlist[ errno ] )); + 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 ] ); @@ -802,9 +806,9 @@ do_bind( if( err != LDAP_OPT_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: ", + LDAP_LOG ( OPERATION, ERR, "do_bind: " "Error: ldap_set_option(%s, LDAP_OPT_VERSION, 3) failed!\n", - ri->ri_hostname )); + ri->ri_hostname, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option(%s, LDAP_OPT_VERSION, 3) failed!\n", @@ -827,9 +831,9 @@ do_bind( if( err != LDAP_OPT_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: ", + LDAP_LOG ( OPERATION, ERR, "do_bind: " "Error: ldap_set_option(%s, REFERRALS, OFF) failed!\n", - ri->ri_hostname )); + ri->ri_hostname, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option(%s,REFERRALS, OFF) failed!\n", @@ -848,10 +852,10 @@ do_bind( if( err != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: ", + 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 )); + ldap_err2string( err ), err ); #else Debug( LDAP_DEBUG_ANY, "%s: ldap_start_tls failed: %s (%d)\n", @@ -873,9 +877,9 @@ do_bind( * Bind with a plaintext password. */ #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, + LDAP_LOG ( OPERATION, ARGS, "do_bind: bind to %s:%d as %s (simple)\n", - ri->ri_hostname, ri->ri_port, ri->ri_bind_dn )); + 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 ); @@ -884,9 +888,9 @@ do_bind( ri->ri_password ); if ( ldrc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: " + 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 ) )); + 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", @@ -901,11 +905,11 @@ do_bind( case AUTH_SASL: #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ARGS, + 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 )); + ri->ri_saslmech ); #else Debug( LDAP_DEBUG_ARGS, "bind to %s as %s via %s (SASL)\n", ri->ri_hostname, @@ -921,9 +925,9 @@ do_bind( if( err != LDAP_OPT_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: " + LDAP_LOG ( OPERATION, ERR, "do_bind: " "Error: ldap_set_option(%s,SECPROPS,\"%s\") failed!\n", - ri->ri_hostname, ri->ri_secprops )); + ri->ri_hostname, ri->ri_secprops, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option(%s,SECPROPS,\"%s\") failed!\n", @@ -945,9 +949,9 @@ do_bind( LDAP_SASL_QUIET, lutil_sasl_interact, defaults ); if ( ldrc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: " + LDAP_LOG ( OPERATION, ERR, "do_bind: " "Error: LDAP SASL for %s:%d failed: %s\n", - ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ) )); + 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 )); @@ -964,9 +968,9 @@ do_bind( break; #else #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: " + LDAP_LOG ( OPERATION, ERR, "do_bind: " "Error: do_bind: SASL not supported %s:%d\n", - ri->ri_hostname, ri->ri_port )); + ri->ri_hostname, ri->ri_port, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: do_bind: SASL not supported %s:%d\n", @@ -979,9 +983,9 @@ do_bind( default: #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: " + 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 )); + 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", @@ -1008,9 +1012,9 @@ do_bind( if( err != LDAP_OPT_SUCCESS ) { #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_ERR, "do_bind: " + LDAP_LOG ( OPERATION, ERR, "do_bind: " "ldap_set_option(%s, SERVER_CONTROLS, ManageDSAit) failed!\n", - ri->ri_hostname )); + ri->ri_hostname, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: " "ldap_set_option(%s, SERVER_CONTROLS, ManageDSAit) failed!\n", @@ -1045,15 +1049,15 @@ dump_ldm_array( for ( i = 0; ldmarr[ i ] != NULL; i++ ) { ldm = ldmarr[ i ]; #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_INFO, "dump_ldm_array: " + LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: " "Trace (%ld): *** ldmarr[ %d ] contents:\n", - (long) getpid(), i )); - LDAP_LOG (( "operation", LDAP_LEVEL_INFO, "dump_ldm_array: " + (long) getpid(), i, 0 ); + LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: " "Trace (%ld): *** ldm->mod_op: %d\n", - (long) getpid(), ldm->mod_op )); - LDAP_LOG (( "operation", LDAP_LEVEL_INFO, "dump_ldm_array: " + (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 )); + (long) getpid(), ldm->mod_type, 0 ); #else Debug( LDAP_DEBUG_TRACE, "Trace (%ld): *** ldmarr[ %d ] contents:\n", @@ -1071,8 +1075,8 @@ dump_ldm_array( sprintf( msgbuf, "***** bv[ %d ] len = %ld, val = <%s>", j, b->bv_len, b->bv_val ); #ifdef NEW_LOGGING - LDAP_LOG (( "operation", LDAP_LEVEL_INFO, "dump_ldm_array: " - "Trace (%ld):%s\n", (long) getpid(), msgbuf )); + 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 ); diff --git a/servers/slurpd/lock.c b/servers/slurpd/lock.c index d457cdfc21..ce6fffb031 100644 --- a/servers/slurpd/lock.c +++ b/servers/slurpd/lock.c @@ -51,8 +51,8 @@ lock_fopen( strcat( buf, ".lock" ); if ( (*lfp = fopen( buf, "w" )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "lock", LDAP_LEVEL_ERR, "lock_fopen: " - "Error: could not open \"%s\"\n", buf )); + 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 ); @@ -66,8 +66,8 @@ lock_fopen( /* open the log file */ if ( (fp = fopen( fname, type )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "lock", LDAP_LEVEL_ERR, "lock_fopen: " - "Error: could not open \"%s\"\n", fname )); + 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 ); @@ -110,9 +110,9 @@ acquire_lock( { if (( *rfp = lock_fopen( file, "r+", lfp )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "lock", LDAP_LEVEL_ERR, "acquire_lock: " + LDAP_LOG ( SLURPD, ERR, "acquire_lock: " "Error: acquire_lock(%ld): Could not acquire lock on \"%s\"\n", - (long) getpid(), file )); + (long) getpid(), file, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: acquire_lock(%ld): Could not acquire lock on \"%s\"\n", @@ -138,9 +138,9 @@ relinquish_lock( { if ( lock_fclose( rfp, lfp ) == EOF ) { #ifdef NEW_LOGGING - LDAP_LOG (( "lock", LDAP_LEVEL_ERR, "relinguish_lock: " + LDAP_LOG ( SLURPD, ERR, "relinguish_lock: " "Error: relinquish_lock (%ld): Error closing \"%s\"\n", - (long) getpid(), file )); + (long) getpid(), file, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: relinquish_lock (%ld): Error closing \"%s\"\n", diff --git a/servers/slurpd/main.c b/servers/slurpd/main.c index 8965ff0f79..5054b43ca5 100644 --- a/servers/slurpd/main.c +++ b/servers/slurpd/main.c @@ -123,8 +123,8 @@ main( 0, fm, (void *) NULL ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "main", LDAP_LEVEL_ERR, - "main: file manager ldap_pvt_thread_create failed\n" )); + 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 ); @@ -165,8 +165,7 @@ main( ldap_pvt_thread_destroy(); #ifdef NEW_LOGGING - LDAP_LOG (( "main", LDAP_LEVEL_RESULTS, - "main: slurpd terminated\n" )); + LDAP_LOG ( SLURPD, RESULTS, "main: slurpd terminated\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "slurpd: terminated.\n", 0, 0, 0 ); #endif diff --git a/servers/slurpd/re.c b/servers/slurpd/re.c index b921728ef0..dbde0bc43d 100644 --- a/servers/slurpd/re.c +++ b/servers/slurpd/re.c @@ -83,8 +83,8 @@ Re_free( } if ( re->re_refcnt > 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_WARNING, "Re_free: " - "Warning: freeing re (dn: %s) with nonzero refcnt\n", re->re_dn )); + 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", @@ -142,7 +142,7 @@ Re_parse( if ( re == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_ERR, "Re_parse: Error: re is NULL\n" )); + 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 @@ -150,7 +150,7 @@ Re_parse( } if ( replbuf == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_ERR, "Re_parse: Error: replbuf is NULL\n" )); + 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 @@ -179,8 +179,8 @@ Re_parse( buflen = strlen( buf ); if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_ERR, - "Re_parse: Error: malformed replog file\n" )); + 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", @@ -213,8 +213,8 @@ Re_parse( default: if ( !( state == GOT_ALL )) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_ERR, - "Re_parse: Error: bad type <%s>\n", type )); + 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", @@ -233,8 +233,8 @@ Re_parse( if ( state != GOT_ALL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_ERR, - "Re_parse: Error: malformed replog file\n" )); + 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", @@ -256,8 +256,8 @@ Re_parse( } else { if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_ERR, - "Re_parse: Error: malformed replog line \"%s\"\n", buf )); + 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", @@ -375,8 +375,8 @@ get_repl_hosts( rh = (Rh *) ch_realloc((char *) rh, ( nreplicas + 2 ) * sizeof( Rh )); if ( rh == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_ERR, - "get_repl_hosts: Out of memory\n" )); + 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 ); @@ -497,7 +497,7 @@ Re_dump( if ( re == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_ERR, "Re_dump: re is NULL\n" )); + 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 @@ -567,8 +567,8 @@ Re_write( if ( re == NULL || fp == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_ERR, - "Re_write: Internal error: NULL argument\n" )); + 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 ); @@ -661,8 +661,8 @@ Re_write( bad: if ( rc != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_ERR, - "Re_write: Error while writing: %s\n", sys_errlist[ errno ] )); + 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 ); @@ -804,9 +804,9 @@ warn_unknown_replica( } if ( !found ) { #ifdef NEW_LOGGING - LDAP_LOG (( "re", LDAP_LEVEL_WARNING, "warn_unknown_replica: " + LDAP_LOG ( SLURPD, WARNING, "warn_unknown_replica: " "Warning: unknown replica %s:%d found in replication log\n", - host, port )); + host, port, 0 ); #else Debug( LDAP_DEBUG_ANY, "Warning: unknown replica %s:%d found in replication log\n", diff --git a/servers/slurpd/reject.c b/servers/slurpd/reject.c index a8f2f657b7..91e1c6a11e 100644 --- a/servers/slurpd/reject.c +++ b/servers/slurpd/reject.c @@ -66,9 +66,9 @@ write_reject( if (( rjfd = open( rejfile, O_RDWR | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP )) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "reject", LDAP_LEVEL_ERR, "write_reject: " + LDAP_LOG ( SLURPD, ERR, "write_reject: " "Error: Cannot create \"%s\":%s\n", - rejfile, sys_errlist[ errno ] )); + rejfile, sys_errlist[ errno ], 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: write_reject: Cannot create \"%s\": %s\n", @@ -82,8 +82,8 @@ write_reject( } if (( rc = acquire_lock( rejfile, &rfp, &lfp )) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "reject", LDAP_LEVEL_ERR, "write_reject: " - "Error: Cannot open reject file \"%s\"\n", rejfile )); + 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 ); @@ -97,8 +97,8 @@ write_reject( } if ((rc = re->re_write( ri, re, rfp )) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "reject", LDAP_LEVEL_ERR, "write_reject: " - "Error: Cannot write reject file \"%s\"\n", rejfile )); + 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", @@ -107,8 +107,9 @@ write_reject( } (void) relinquish_lock( rejfile, rfp, lfp ); #ifdef NEW_LOGGING - LDAP_LOG (( "reject", LDAP_LEVEL_ERR, "write_reject: " - "Error: ldap operation failed, data written to \"%s\"\n", rejfile )); + 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", diff --git a/servers/slurpd/replica.c b/servers/slurpd/replica.c index f5bf393cb1..49fc9e178e 100644 --- a/servers/slurpd/replica.c +++ b/servers/slurpd/replica.c @@ -28,7 +28,6 @@ #include "slurp.h" #include "globals.h" - /* * Just invoke the Ri's process() member function, and log the start and * finish. @@ -41,9 +40,9 @@ replicate( Ri *ri = (Ri *) ri_arg; #ifdef NEW_LOGGING - LDAP_LOG (( "replica", LDAP_LEVEL_ARGS, "replicate: " + LDAP_LOG ( SLURPD, ARGS, "replicate: " "begin replication thread for %s:%d\n", - ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port )); + ((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 ); @@ -52,9 +51,9 @@ replicate( ri->ri_process( ri ); #ifdef NEW_LOGGING - LDAP_LOG (( "replica", LDAP_LEVEL_ARGS, "replicate: " + LDAP_LOG ( SLURPD, ARGS, "replicate: " "begin replication thread for %s:%d\n", - ri->ri_hostname, ri->ri_port )); + 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 ); @@ -76,9 +75,9 @@ start_replica_thread( if ( ldap_pvt_thread_create( &(ri->ri_tid), 0, replicate, (void *) ri ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "replica", LDAP_LEVEL_ERR, "start_replica_thread: " + LDAP_LOG ( SLURPD, ERR, "start_replica_thread: " "replica %s:%d ldap_pvt_thread_create failed\n", - ri->ri_hostname, ri->ri_port )); + 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 ); diff --git a/servers/slurpd/replog.c b/servers/slurpd/replog.c index f43965b8e7..d1f63a2295 100644 --- a/servers/slurpd/replog.c +++ b/servers/slurpd/replog.c @@ -59,8 +59,8 @@ copy_replog( char *p; #ifdef NEW_LOGGING - LDAP_LOG (( "replog", LDAP_LEVEL_ARGS, "copy_replog: " - "copy replog \"%s\" to \"%s\"\n", src, dst )); + 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", @@ -79,9 +79,9 @@ copy_replog( } if ( access( buf, W_OK ) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " + LDAP_LOG ( SLURPD, ERR, "copy_replog: " "Error: (%ld): Directory %s is not writable\n", - (long) getpid(), buf )); + (long) getpid(), buf, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: copy_replog (%ld): Directory %s is not writable\n", @@ -97,9 +97,9 @@ copy_replog( } if ( access( buf, W_OK ) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " + LDAP_LOG ( SLURPD, ERR, "copy_replog: " "Error: (%ld): Directory %s is not writable\n", - (long) getpid(), buf )); + (long) getpid(), buf, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: copy_replog (%ld): Directory %s is not writable\n", @@ -112,9 +112,9 @@ copy_replog( rfp = lock_fopen( src, "r", &lfp ); if ( rfp == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " + LDAP_LOG ( SLURPD, ERR, "copy_replog: " "Error: Can't lock replog \"%s\" for read: %s\n", - src, sys_errlist[ errno ] )); + src, sys_errlist[ errno ], 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Can't lock replog \"%s\" for read: %s\n", @@ -127,9 +127,9 @@ copy_replog( dfp = lock_fopen( dst, "a", &dlfp ); if ( dfp == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " + LDAP_LOG ( SLURPD, ERR, "copy_replog: " "Error: Can't lock replog \"%s\" for write: %s\n", - src, sys_errlist[ errno ] )); + src, sys_errlist[ errno ], 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Can't lock replog \"%s\" for write: %s\n", @@ -153,8 +153,8 @@ copy_replog( if ( lock_fclose( dfp, dlfp ) == EOF ) { #ifdef NEW_LOGGING - LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " - "Error: Error closing \"%s\"\n", src )); + 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", @@ -163,8 +163,8 @@ copy_replog( } if ( lock_fclose( rfp, lfp ) == EOF ) { #ifdef NEW_LOGGING - LDAP_LOG (( "replog", LDAP_LEVEL_ERR, "copy_replog: " - "Error: Error closing \"%s\"\n", src )); + 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", diff --git a/servers/slurpd/ri.c b/servers/slurpd/ri.c index f7f2227875..c9f0a4ffa1 100644 --- a/servers/slurpd/ri.c +++ b/servers/slurpd/ri.c @@ -58,8 +58,8 @@ Ri_process( #endif if ( ri == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "ri", LDAP_LEVEL_ERR, "Ri_process: " - "Error: ri == NULL!\n" )); + 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 @@ -93,9 +93,9 @@ Ri_process( if ( !ismine( ri, re )) { /* The Re doesn't list my host:port */ #ifdef NEW_LOGGING - LDAP_LOG (( "ri", LDAP_LEVEL_DETAIL1, "Ri_process: " + 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 )); + 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", @@ -104,9 +104,9 @@ Ri_process( } else if ( !isnew( ri, re )) { /* This Re is older than my saved status information */ #ifdef NEW_LOGGING - LDAP_LOG (( "ri", LDAP_LEVEL_DETAIL1, "Ri_process: " + 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 )); + ri->ri_hostname, ri->ri_port, re->re_dn ); #else Debug( LDAP_DEBUG_TRACE, "Replica %s:%d, skip repl record for %s (old)\n", @@ -118,9 +118,9 @@ Ri_process( case DO_LDAP_ERR_RETRYABLE: ldap_pvt_thread_sleep( RETRY_SLEEP_TIME ); #ifdef NEW_LOGGING - LDAP_LOG (( "ri", LDAP_LEVEL_DETAIL1, "Ri_process: " + 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 )); + re->re_dn, ri->ri_hostname, ri->ri_port ); #else Debug( LDAP_DEBUG_ANY, "Retrying operation for DN %s on replica %s:%d\n", @@ -148,8 +148,8 @@ Ri_process( } } else { #ifdef NEW_LOGGING - LDAP_LOG (( "ri", LDAP_LEVEL_ERR, "Ri_process: " - "Error: re is null in Ri_process\n" )); + 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 ); diff --git a/servers/slurpd/rq.c b/servers/slurpd/rq.c index 37098c9f36..87f2daeb59 100644 --- a/servers/slurpd/rq.c +++ b/servers/slurpd/rq.c @@ -55,7 +55,6 @@ #include "slurp.h" #include "globals.h" - /* * Lock the replication queue. */ @@ -134,8 +133,8 @@ Rq_delhead( if ( savedhead->re_getrefcnt( savedhead ) != 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "rq", LDAP_LEVEL_WARNING, "Rq_delhead: " - "Warning: attempt to delete when refcnt != 0\n" )); + 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 ); @@ -223,7 +222,7 @@ Rq_gc( { if ( rq == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "rq", LDAP_LEVEL_DETAIL1, "Rq_gc: rq is NULL!\n" )); + 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 @@ -255,7 +254,7 @@ Rq_dump( if ( rq == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "rq", LDAP_LEVEL_ARGS, "Rq_dump: rq is NULL!\n" )); + 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 @@ -264,8 +263,8 @@ Rq_dump( if (unlink(SLURPD_DUMPFILE) == -1 && errno != ENOENT) { #ifdef NEW_LOGGING - LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_dump: " - "\"%s\" exists, cannot unlink\n", SLURPD_DUMPFILE )); + 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 ); @@ -274,8 +273,8 @@ Rq_dump( } if (( tmpfd = open(SLURPD_DUMPFILE, O_CREAT|O_RDWR|O_EXCL, 0600)) == -1) { #ifdef NEW_LOGGING - LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_dump: " - "cannot open \"%s\" for write\n", SLURPD_DUMPFILE )); + 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 ); @@ -284,8 +283,8 @@ Rq_dump( } if (( fp = fdopen( tmpfd, "w" )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_dump: " - "cannot fdopen \"%s\" for write\n", SLURPD_DUMPFILE )); + 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 ); @@ -322,8 +321,8 @@ Rq_write( } #ifdef NEW_LOGGING - LDAP_LOG (( "rq", LDAP_LEVEL_ENTRY, "Rq_write: " - "re-write on-disk replication log\n" )); + 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 ); @@ -346,8 +345,8 @@ Rq_write( /* and truncate to correct len */ if ( ftruncate( fileno( fp ), sglob->srpos ) < 0 ) { #ifdef NEW_LOGGING - LDAP_LOG (( "rq", LDAP_LEVEL_ERR, "Rq_write: " - "Error truncating replication log: %s\n", sys_errlist[ errno ] )); + 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 ); diff --git a/servers/slurpd/st.c b/servers/slurpd/st.c index ffe150ea24..f6cc685fff 100644 --- a/servers/slurpd/st.c +++ b/servers/slurpd/st.c @@ -98,9 +98,9 @@ St_write ( &(st->st_lfp))) < 0 ) { if ( !st->st_err_logged ) { #ifdef NEW_LOGGING - LDAP_LOG (( "st", LDAP_LEVEL_ERR, "St_write: " + LDAP_LOG ( SLURPD, ERR, "St_write: " "Error: cannot open status file \"%s\":%s\n", - sglob->slurpd_status_file, sys_errlist[ errno ] )); + sglob->slurpd_status_file, sys_errlist[ errno ], 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: cannot open status file \"%s\": %s\n", @@ -184,9 +184,9 @@ St_read( */ if (( fp = fopen( sglob->slurpd_status_file, "w" )) == NULL ) { #ifdef NEW_LOGGING - LDAP_LOG (( "st", LDAP_LEVEL_ERR, "St_write: " + LDAP_LOG ( SLURPD, ERR, "St_write: " "Error: cannot create status file \"%s\"\n", - sglob->slurpd_status_file )); + sglob->slurpd_status_file, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, "Error: cannot create status file \"%s\"\n", sglob->slurpd_status_file, 0, 0 ); @@ -197,8 +197,8 @@ St_read( (void) fclose( fp ); ldap_pvt_thread_mutex_unlock( &(st->st_mutex )); #ifdef NEW_LOGGING - LDAP_LOG (( "st", LDAP_LEVEL_DETAIL1, "St_write: " - "No status file found, defaulting values\n" )); + 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 ); @@ -248,17 +248,17 @@ St_read( sprintf( tbuf, "%s:%s (timestamp %s.%s)", hostname, port, timestamp, seq ); #ifdef NEW_LOGGING - LDAP_LOG (( "st", LDAP_LEVEL_DETAIL1, "St_write: " - "Retrieved state information for %s\n", tbuf )); + 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 (( "st", LDAP_LEVEL_WARNING, "St_write: " + LDAP_LOG ( SLURPD, WARNING, "St_write: " "Warning: saved state for %s:%s, not a known replica\n", - hostname, port )); + hostname, port, 0 ); #else Debug( LDAP_DEBUG_ANY, "Warning: saved state for %s:%s, not a known replica\n", -- 2.39.5