unifdef -UNEW_LOGGING

This commit is contained in:
Kurt Zeilenga 2004-09-04 04:54:28 +00:00
parent e0a9ea2f50
commit d611a4b49a
187 changed files with 0 additions and 10086 deletions

View file

@ -229,81 +229,6 @@ ber_bprint(
(*ber_pvt_log_print)( line );
}
#ifdef NEW_LOGGING
int ber_output_dump(
const char *subsys,
int level,
BerElement *ber,
int inout )
{
static const char hexdig[] = "0123456789abcdef";
char buf[132];
ber_len_t len;
char line[ BP_LEN ];
ber_len_t i;
char *data = ber->ber_ptr;
if ( inout == 1 ) {
len = ber_pvt_ber_remaining(ber);
} else {
len = ber_pvt_ber_write(ber);
}
sprintf( buf, "ber_dump: buf=0x%08lx ptr=0x%08lx end=0x%08lx len=%ld\n",
(long) ber->ber_buf,
(long) ber->ber_ptr,
(long) ber->ber_end,
(long) len );
(void) ber_pvt_log_output( subsys, level, "%s", buf );
#define BP_OFFSET 9
#define BP_GRAPH 60
#define BP_LEN 80
assert( data != NULL );
/* in case len is zero */
line[0] = '\n';
line[1] = '\0';
for ( i = 0 ; i < len ; i++ ) {
int n = i % 16;
unsigned off;
if( !n ) {
if( i ) {
(void) ber_pvt_log_output( subsys, level, "%s", line );
}
memset( line, ' ', sizeof(line)-2 );
line[sizeof(line)-2] = '\n';
line[sizeof(line)-1] = '\0';
off = i % 0x0ffffU;
line[2] = hexdig[0x0f & (off >> 12)];
line[3] = hexdig[0x0f & (off >> 8)];
line[4] = hexdig[0x0f & (off >> 4)];
line[5] = hexdig[0x0f & off ];
line[6] = ':';
}
off = BP_OFFSET + n*3 + ((n >= 8)?1:0);
line[off] = hexdig[ 0x0f & ( data[i] >> 4 ) ];
line[off+1] = hexdig[ 0x0f & data[i] ];
off = BP_GRAPH + n + ((n >= 8)?1:0);
if ( isprint( (unsigned char) data[i] )) {
line[BP_GRAPH + n] = data[i];
} else {
line[BP_GRAPH + n] = '.';
}
}
return ber_pvt_log_output( subsys, level, "%s", line );
}
#endif
int
ber_log_dump(

View file

@ -669,17 +669,9 @@ ber_scanf ( BerElement *ber,
fmt_reset = fmt;
#ifdef NEW_LOGGING
LDAP_LOG( BER, ENTRY, "ber_scanf fmt (%s) ber:\n", fmt, 0, 0 );
if ( LDAP_LOGS_TEST(BER, DETAIL2 )) {
BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
}
#else
ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug,
"ber_scanf fmt (%s) ber:\n", fmt );
ber_log_dump( LDAP_DEBUG_BER, ber->ber_debug, ber, 1 );
#endif
for ( rc = 0; *fmt && rc != LBER_DEFAULT; fmt++ ) {
/* When this is modified, remember to update
@ -824,13 +816,8 @@ ber_scanf ( BerElement *ber,
default:
if( ber->ber_debug ) {
#ifdef NEW_LOGGING
LDAP_LOG( BER, ERR,
"ber_scanf: unknown fmt %c\n", *fmt, 0, 0 );
#else
ber_log_printf( LDAP_DEBUG_ANY, ber->ber_debug,
"ber_scanf: unknown fmt %c\n", *fmt );
#endif
}
rc = LBER_DEFAULT;
break;

View file

@ -818,13 +818,8 @@ ber_printf( BerElement *ber, LDAP_CONST char *fmt, ... )
default:
if( ber->ber_debug ) {
#ifdef NEW_LOGGING
LDAP_LOG( BER, ERR,
"ber_printf: unknown fmt %c\n", *fmt, 0, 0 );
#else
ber_log_printf( LDAP_DEBUG_ANY, ber->ber_debug,
"ber_printf: unknown fmt %c\n", *fmt );
#endif
}
rc = -1;
break;

View file

@ -216,23 +216,12 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit )
towrite = ber->ber_ptr - ber->ber_rwptr;
if ( sb->sb_debug ) {
#ifdef NEW_LOGGING
LDAP_LOG( BER, DETAIL1,
"ber_flush: %ld bytes to sd %ld%s\n",
towrite, (long)sb->sb_fd,
ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" );
if(LDAP_LOGS_TEST(BER, DETAIL2))
BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
#else
ber_log_printf( LDAP_DEBUG_TRACE, sb->sb_debug,
"ber_flush: %ld bytes to sd %ld%s\n",
towrite, (long) sb->sb_fd,
ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" );
ber_log_bprint( LDAP_DEBUG_PACKETS, sb->sb_debug,
ber->ber_rwptr, towrite );
#endif
}
while ( towrite > 0 ) {
@ -484,12 +473,8 @@ ber_get_next(
assert( SOCKBUF_VALID( sb ) );
assert( LBER_VALID( ber ) );
#ifdef NEW_LOGGING
LDAP_LOG( BER, ENTRY, "ber_get_next: enter\n", 0, 0, 0 );
#else
ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug,
"ber_get_next\n" );
#endif
/*
* Any ber element looks like this: tag length contents.
@ -622,15 +607,9 @@ ber_get_next(
}
if ( sb->sb_max_incoming && ber->ber_len > sb->sb_max_incoming ) {
#ifdef NEW_LOGGING
LDAP_LOG( BER, ERR,
"ber_get_next: sockbuf_max_incoming exceeded "
"(%d > %d)\n", ber->ber_len, sb->sb_max_incoming, 0 );
#else
ber_log_printf( LDAP_DEBUG_CONNS, ber->ber_debug,
"ber_get_next: sockbuf_max_incoming exceeded "
"(%ld > %ld)\n", ber->ber_len, sb->sb_max_incoming );
#endif
errno = ERANGE;
return LBER_DEFAULT;
}
@ -691,18 +670,10 @@ done:
ber->ber_rwptr = NULL;
*len = ber->ber_len;
if ( ber->ber_debug ) {
#ifdef NEW_LOGGING
LDAP_LOG( BER, DETAIL1,
"ber_get_next: tag 0x%lx len %ld\n",
ber->ber_tag, ber->ber_len, 0 );
if(LDAP_LOGS_TEST(BER, DETAIL2))
BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
#else
ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug,
"ber_get_next: tag 0x%lx len %ld contents:\n",
ber->ber_tag, ber->ber_len );
ber_log_dump( LDAP_DEBUG_BER, ber->ber_debug, ber, 1 );
#endif
}
return (ber->ber_tag);
}

View file

@ -45,23 +45,6 @@ struct lber_options {
long lbo_meminuse;
};
#ifdef NEW_LOGGING
/*
# ifdef LDAP_DEBUG
# ifdef LDAP_LOG
# undef LDAP_LOG
# endif
# define LDAP_LOG(a) ber_pvt_log_output a
*/
# define BER_DUMP(a) ber_output_dump a
/*
# else
# define LDAP_LOG(a)
# define BER_DUMP(a)
# endif
*/
#endif
LBER_F( int ) ber_pvt_log_output(
const char *subsystem,
int level,
@ -142,15 +125,6 @@ LBER_F (void) ber_rewind LDAP_P(( BerElement * ));
*/
#define ber_log_printf ber_pvt_log_printf
#ifdef NEW_LOGGING
LBER_F( int )
ber_output_dump LDAP_P((
const char *subsys,
int level,
BerElement *ber,
int inout ));
#endif
LBER_F( int )
ber_log_bprint LDAP_P((
int errlvl,

View file

@ -67,11 +67,7 @@ ldap_abandon_ext(
LDAPControl **cctrls )
{
int rc;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "ldap_abandon_ext %d\n", msgid, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_abandon_ext %d\n", msgid, 0, 0 );
#endif
/* check client controls */
#ifdef LDAP_R_COMPILE
@ -102,11 +98,7 @@ ldap_abandon_ext(
int
ldap_abandon( LDAP *ld, int msgid )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "ldap_abandon %d\n", msgid, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_abandon %d\n", msgid, 0, 0 );
#endif
return ldap_abandon_ext( ld, msgid, NULL, NULL ) == LDAP_SUCCESS
? 0 : -1;
}
@ -126,12 +118,8 @@ do_abandon(
Sockbuf *sb;
LDAPRequest *lr;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "do_abandon %d, msgid %d\n", origid, msgid, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "do_abandon origid %d, msgid %d\n",
origid, msgid, 0 );
#endif
sendabandon = 1;

View file

@ -110,11 +110,7 @@ ldap_add_ext(
int i, rc;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_add_ext\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_add_ext\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
assert( dn != NULL );

View file

@ -70,11 +70,7 @@
int
ldap_bind( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd, int authmethod )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_bind\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_bind\n", 0, 0, 0 );
#endif
switch ( authmethod ) {
case LDAP_AUTH_SIMPLE:
@ -119,11 +115,7 @@ ldap_bind_s(
LDAP_CONST char *passwd,
int authmethod )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_bind_s\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_bind_s\n", 0, 0, 0 );
#endif
switch ( authmethod ) {
case LDAP_AUTH_SIMPLE:

View file

@ -65,11 +65,7 @@ ldap_compare_ext(
BerElement *ber;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_compare\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_compare\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );

View file

@ -80,17 +80,10 @@ int ldap_int_sasl_init( void )
sprintf( version, "%u.%d.%d", (unsigned)rc >> 24, (rc >> 16) & 0xff,
rc & 0xffff );
#ifdef NEW_LOGGING
LDAP_LOG( TRANSPORT, INFO,
"ldap_int_sasl_init: SASL library version mismatch:"
" expected " SASL_VERSION_STRING ","
" got %s\n", version, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"ldap_int_sasl_init: SASL library version mismatch:"
" expected " SASL_VERSION_STRING ","
" got %s\n", version, 0, 0 );
#endif
return -1;
}
}
@ -416,12 +409,8 @@ Sockbuf_IO ldap_pvt_sockbuf_io_sasl = {
int ldap_pvt_sasl_install( Sockbuf *sb, void *ctx_arg )
{
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ENTRY, "ldap_pvt_sasl_install\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_install\n",
0, 0, 0 );
#endif
/* don't install the stuff unless security has been negotiated */
@ -526,13 +515,8 @@ ldap_int_sasl_open(
return ld->ld_errno;
}
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1, "ldap_int_sasl_open: host=%s\n",
host, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: host=%s\n",
host, 0, 0 );
#endif
lc->lconn_sasl_authctx = ctx;
@ -580,13 +564,8 @@ ldap_int_sasl_bind(
ber_socket_t sd;
void *ssl;
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ARGS, "ldap_int_sasl_bind: %s\n",
mechs ? mechs : "<null>", 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n",
mechs ? mechs : "<null>", 0, 0 );
#endif
/* do a quick !LDAPv3 check... ldap_sasl_bind will do the rest. */
if (ld->ld_version < LDAP_VERSION3) {
@ -721,15 +700,9 @@ ldap_int_sasl_bind(
if ( rc != LDAP_SUCCESS && rc != LDAP_SASL_BIND_IN_PROGRESS ) {
if( scred && scred->bv_len ) {
/* and server provided us with data? */
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1,
"ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
rc, saslrc, scred->bv_len );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
rc, saslrc, scred->bv_len );
#endif
ber_bvfree( scred );
}
rc = ld->ld_errno;
@ -740,15 +713,9 @@ ldap_int_sasl_bind(
/* we're done, no need to step */
if( scred && scred->bv_len ) {
/* but server provided us with data! */
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1,
"ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
rc, saslrc, scred->bv_len );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
rc, saslrc, scred->bv_len );
#endif
ber_bvfree( scred );
rc = ld->ld_errno = LDAP_LOCAL_ERROR;
goto done;
@ -764,13 +731,8 @@ ldap_int_sasl_bind(
(SASL_CONST char **)&ccred.bv_val,
&credlen );
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1,
"ldap_int_sasl_bind: sasl_client_step: %d\n", saslrc,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "sasl_client_step: %d\n",
saslrc, 0, 0 );
#endif
if( saslrc == SASL_INTERACT ) {
int res;

View file

@ -59,11 +59,7 @@ ldap_delete_ext(
BerElement *ber;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_delete_ext\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_delete_ext\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -151,11 +147,7 @@ ldap_delete( LDAP *ld, LDAP_CONST char *dn )
* DelRequet ::= DistinguishedName,
*/
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_delete\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_delete\n", 0, 0, 0 );
#endif
return ldap_delete_ext( ld, dn, NULL, NULL, &msgid ) == LDAP_SUCCESS
? msgid : -1 ;

View file

@ -143,11 +143,7 @@ ldap_err2string( int err )
{
const struct ldaperror *e;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_err2string\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_err2string\n", 0, 0, 0 );
#endif
e = ldap_int_error( err );
@ -160,11 +156,7 @@ ldap_perror( LDAP *ld, LDAP_CONST char *str )
{
int i;
const struct ldaperror *e;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_perror\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_perror\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -247,11 +239,7 @@ ldap_parse_result(
ber_tag_t tag;
BerElement *ber;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_result\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_parse_result\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );

View file

@ -57,11 +57,7 @@ ldap_extended_operation(
int rc;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_extended_operation\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_extended_operation\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -131,11 +127,7 @@ ldap_extended_operation_s(
int msgid;
LDAPMessage *res;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_extended_operation_s\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_extended_operation_s\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -187,11 +179,7 @@ ldap_parse_extended_result (
assert( LDAP_VALID( ld ) );
assert( res != NULL );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_extended_result\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_parse_extended_result\n", 0, 0, 0 );
#endif
if( ld->ld_version < LDAP_VERSION3 ) {
ld->ld_errno = LDAP_NOT_SUPPORTED;
@ -314,11 +302,7 @@ ldap_parse_intermediate (
assert( LDAP_VALID( ld ) );
assert( res != NULL );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_intermediate\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_parse_intermediate\n", 0, 0, 0 );
#endif
if( ld->ld_version < LDAP_VERSION3 ) {
ld->ld_errno = LDAP_NOT_SUPPORTED;

View file

@ -366,11 +366,7 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
* Note: tags in a choice are always explicit
*/
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, ARGS, "ldap_pvt_put_filter: \"%s\"\n", str_in,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_filter: \"%s\"\n", str_in, 0, 0 );
#endif
freeme = LDAP_STRDUP( str_in );
if( freeme == NULL ) return LDAP_NO_MEMORY;
@ -388,12 +384,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
switch ( *str ) {
case '&':
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: AND\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_filter: AND\n",
0, 0, 0 );
#endif
str = put_complex_filter( ber, str,
LDAP_FILTER_AND, 0 );
@ -406,12 +398,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
break;
case '|':
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: OR\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_filter: OR\n",
0, 0, 0 );
#endif
str = put_complex_filter( ber, str,
LDAP_FILTER_OR, 0 );
@ -424,12 +412,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
break;
case '!':
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: NOT\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_filter: NOT\n",
0, 0, 0 );
#endif
str = put_complex_filter( ber, str,
LDAP_FILTER_NOT, 0 );
@ -442,12 +426,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: simple\n", 0,0,0);
#else
Debug( LDAP_DEBUG_TRACE, "put_filter: simple\n",
0, 0, 0 );
#endif
balance = 1;
escape = 0;
@ -492,12 +472,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
break;
case /*'('*/ ')':
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: end\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_filter: end\n",
0, 0, 0 );
#endif
if ( ber_printf( ber, /*"["*/ "]" ) == -1 ) {
rc = -1;
goto done;
@ -511,12 +487,8 @@ ldap_pvt_put_filter( BerElement *ber, const char *str_in )
break;
default: /* assume it's a simple type=value filter */
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: default\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_filter: default\n",
0, 0, 0 );
#endif
next = strchr( str, '\0' );
if ( put_simple_filter( ber, str ) == -1 ) {
rc = -1;
@ -544,12 +516,8 @@ put_filter_list( BerElement *ber, char *str, ber_tag_t tag )
char *next = NULL;
char save;
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, ARGS, "put_filter_list \"%s\"\n", str,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_filter_list \"%s\"\n",
str, 0, 0 );
#endif
while ( *str ) {
while ( *str && LDAP_SPACE( (unsigned char) *str ) ) {
@ -588,12 +556,8 @@ put_simple_filter(
ber_tag_t ftype;
int rc = -1;
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, ARGS, "put_simple_filter: \"%s\"\n", str,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_simple_filter: \"%s\"\n",
str, 0, 0 );
#endif
str = LDAP_STRDUP( str );
if( str == NULL ) return -1;
@ -759,12 +723,8 @@ put_substring_filter( BerElement *ber, char *type, char *val )
int gotstar = 0;
ber_tag_t ftype = LDAP_FILTER_SUBSTRINGS;
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, ARGS, "put_substring_filter \"%s=%s\"\n", type, val, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_substring_filter \"%s=%s\"\n",
type, val, 0 );
#endif
if ( ber_printf( ber, "t{s{" /*"}}"*/, ftype, type ) == -1 ) {
return -1;
@ -846,11 +806,7 @@ put_vrFilter( BerElement *ber, const char *str_in )
* matchValue [3] AssertionValue }
*/
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, ARGS, "put_vrFilter: \"%s\"\n", str_in, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_vrFilter: \"%s\"\n", str_in, 0, 0 );
#endif
freeme = LDAP_STRDUP( str_in );
if( freeme == NULL ) return LDAP_NO_MEMORY;
@ -890,13 +846,8 @@ put_vrFilter( BerElement *ber, const char *str_in )
default:
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, DETAIL1,
"put_vrFilter: simple\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_vrFilter: simple\n",
0, 0, 0 );
#endif
balance = 1;
escape = 0;
@ -941,12 +892,8 @@ put_vrFilter( BerElement *ber, const char *str_in )
break;
case /*'('*/ ')':
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, DETAIL1, "put_vrFilter: end\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_vrFilter: end\n",
0, 0, 0 );
#endif
if ( ber_printf( ber, /*"["*/ "]" ) == -1 ) {
rc = -1;
goto done;
@ -960,13 +907,8 @@ put_vrFilter( BerElement *ber, const char *str_in )
break;
default: /* assume it's a simple type=value filter */
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, DETAIL1, "put_vrFilter: default\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_vrFilter: default\n",
0, 0, 0 );
#endif
next = strchr( str, '\0' );
if ( put_simple_vrFilter( ber, str ) == -1 ) {
rc = -1;
@ -1008,12 +950,8 @@ put_vrFilter_list( BerElement *ber, char *str )
char *next = NULL;
char save;
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, ARGS, "put_vrFilter_list \"%s\"\n", str, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_vrFilter_list \"%s\"\n",
str, 0, 0 );
#endif
while ( *str ) {
while ( *str && LDAP_SPACE( (unsigned char) *str ) ) {
@ -1046,12 +984,8 @@ put_simple_vrFilter(
ber_tag_t ftype;
int rc = -1;
#ifdef NEW_LOGGING
LDAP_LOG ( FILTER, ARGS, "put_simple_vrFilter: \"%s\"\n", str, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "put_simple_vrFilter: \"%s\"\n",
str, 0, 0 );
#endif
str = LDAP_STRDUP( str );
if( str == NULL ) return -1;

View file

@ -36,11 +36,7 @@ ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **berout )
char *attr;
BerElement *ber;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_first_attribute\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -102,11 +98,7 @@ ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
ber_tag_t tag;
char *attr;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_next_attribute\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -139,11 +131,7 @@ ldap_get_attribute_ber( LDAP *ld, LDAPMessage *entry, BerElement *ber,
ber_tag_t tag;
int rc = LDAP_SUCCESS;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_get_attribute_ber\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_get_attribute_ber\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );

View file

@ -89,11 +89,7 @@ ldap_get_dn( LDAP *ld, LDAPMessage *entry )
char *dn;
BerElement tmp;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_get_dn\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_get_dn\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID(ld) );
@ -116,11 +112,7 @@ ldap_get_dn_ber( LDAP *ld, LDAPMessage *entry, BerElement **berout,
ber_len_t len = 0;
int rc = LDAP_SUCCESS;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_get_dn_ber\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_get_dn_ber\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID(ld) );
@ -167,11 +159,7 @@ ldap_dn2ufn( LDAP_CONST char *dn )
{
char *out = NULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2ufn\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_dn2ufn\n", 0, 0, 0 );
#endif
( void )ldap_dn_normalize( dn, LDAP_DN_FORMAT_LDAP,
&out, LDAP_DN_FORMAT_UFN );
@ -190,11 +178,7 @@ ldap_explode_dn( LDAP_CONST char *dn, int notypes )
int iRDN;
unsigned flag = notypes ? LDAP_DN_FORMAT_UFN : LDAP_DN_FORMAT_LDAPV3;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_explode_dn\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_explode_dn\n", 0, 0, 0 );
#endif
if ( ldap_str2dn( dn, &tmpDN, LDAP_DN_FORMAT_LDAP )
!= LDAP_SUCCESS ) {
@ -234,11 +218,7 @@ ldap_explode_rdn( LDAP_CONST char *rdn, int notypes )
const char *p;
int iAVA;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_explode_rdn\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_explode_rdn\n", 0, 0, 0 );
#endif
/*
* we only parse the first rdn
@ -319,11 +299,7 @@ ldap_dn2dcedn( LDAP_CONST char *dn )
{
char *out = NULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2dcedn\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_dn2dcedn\n", 0, 0, 0 );
#endif
( void )ldap_dn_normalize( dn, LDAP_DN_FORMAT_LDAP,
&out, LDAP_DN_FORMAT_DCE );
@ -336,11 +312,7 @@ ldap_dcedn2dn( LDAP_CONST char *dce )
{
char *out = NULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_dcedn2dn\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_dcedn2dn\n", 0, 0, 0 );
#endif
( void )ldap_dn_normalize( dce, LDAP_DN_FORMAT_DCE, &out, LDAP_DN_FORMAT_LDAPV3 );
@ -352,11 +324,7 @@ ldap_dn2ad_canonical( LDAP_CONST char *dn )
{
char *out = NULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_dn2ad_canonical\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_dn2ad_canonical\n", 0, 0, 0 );
#endif
( void )ldap_dn_normalize( dn, LDAP_DN_FORMAT_LDAP,
&out, LDAP_DN_FORMAT_AD_CANONICAL );
@ -388,11 +356,7 @@ ldap_dn_normalize( LDAP_CONST char *dnin,
int rc;
LDAPDN tmpDN = NULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_dn_normalize\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_dn_normalize\n", 0, 0, 0 );
#endif
assert( dnout );
@ -755,11 +719,7 @@ ldap_bv2dn_x( struct berval *bvin, LDAPDN *dn, unsigned flags, void *ctx )
str = bv->bv_val;
end = str + bv->bv_len;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "ldap_bv2dn(%s,%u)\n", str, flags, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> ldap_bv2dn(%s,%u)\n", str, flags, 0 );
#endif
*dn = NULL;
@ -941,13 +901,8 @@ return_result:;
LDAP_FREEX( tmpDN, ctx );
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS, "<= ldap_bv2dn(%s)=%d %s\n",
str, rc, ldap_err2string( rc ) );
#else
Debug( LDAP_DEBUG_TRACE, "<= ldap_bv2dn(%s)=%d %s\n", str, rc,
ldap_err2string( rc ) );
#endif
*dn = newDN;
return( rc );
@ -3057,11 +3012,7 @@ int ldap_dn2bv_x( LDAPDN dn, struct berval *bv, unsigned flags, void *ctx )
bv->bv_len = 0;
bv->bv_val = NULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "=> ldap_dn2bv(%u)\n", flags, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> ldap_dn2bv(%u)\n", flags, 0, 0 );
#endif
/*
* a null dn means an empty dn string
@ -3370,13 +3321,8 @@ int ldap_dn2bv_x( LDAPDN dn, struct berval *bv, unsigned flags, void *ctx )
return LDAP_PARAM_ERROR;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS, "<= ldap_dn2bv(%s)=%d %s\n",
bv->bv_val, rc, ldap_err2string( rc ) );
#else
Debug( LDAP_DEBUG_TRACE, "<= ldap_dn2bv(%s)=%d %s\n",
bv->bv_val, rc, ldap_err2string( rc ) );
#endif
return_results:;
return( rc );

View file

@ -42,11 +42,7 @@ ldap_get_values( LDAP *ld, LDAPMessage *entry, LDAP_CONST char *target )
assert( entry != NULL );
assert( target != NULL );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_get_values\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_get_values\n", 0, 0, 0 );
#endif
ber = *entry->lm_ber;
@ -103,11 +99,7 @@ ldap_get_values_len( LDAP *ld, LDAPMessage *entry, LDAP_CONST char *target )
assert( entry != NULL );
assert( target != NULL );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_get_values_len\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_get_values_len\n", 0, 0, 0 );
#endif
ber = *entry->lm_ber;

View file

@ -40,11 +40,7 @@ int ldap_grouping_create(
BerElement *ber = NULL;
struct berval bv = BER_BVNULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_grouping_create\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_grouping_create\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -90,11 +86,7 @@ int ldap_grouping_create_s(
int msgid;
LDAPMessage *res;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_grouping_create_s\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_grouping_create_s\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );

View file

@ -124,12 +124,7 @@ static void openldap_ldap_init_w_conf(
return;
}
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, DETAIL1,
"openldap_init_w_conf: trying %s\n", file, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "ldap_init: trying %s\n", file, 0, 0);
#endif
fp = fopen(file, "r");
if(fp == NULL) {
@ -137,11 +132,7 @@ static void openldap_ldap_init_w_conf(
return;
}
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, DETAIL1, "openldap_init_w_conf: using %s\n", file, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "ldap_init: using %s\n", file, 0, 0);
#endif
while((start = fgets(linebuf, sizeof(linebuf), fp)) != NULL) {
/* skip lines starting with '#' */
@ -269,22 +260,12 @@ static void openldap_ldap_init_w_userconf(const char *file)
home = getenv("HOME");
if (home != NULL) {
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, ARGS,
"openldap_init_w_userconf: HOME env is %s\n", home, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "ldap_init: HOME env is %s\n",
home, 0, 0);
#endif
path = LDAP_MALLOC(strlen(home) + strlen(file) + sizeof( LDAP_DIRSEP "."));
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, ARGS, "openldap_init_w_userconf: HOME env is NULL\n",
0, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "ldap_init: HOME env is NULL\n",
0, 0, 0);
#endif
}
if(home != NULL && path != NULL) {
@ -566,50 +547,26 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
char *altfile = getenv(LDAP_ENV_PREFIX "CONF");
if( altfile != NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, DETAIL1,
"openldap_init_w_userconf: %sCONF env is %s\n",
LDAP_ENV_PREFIX, altfile, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is %s\n",
LDAP_ENV_PREFIX "CONF", altfile, 0);
#endif
openldap_ldap_init_w_sysconf( altfile );
}
else
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, DETAIL1,
"openldap_init_w_userconf: %sCONF env is NULL\n",
LDAP_ENV_PREFIX, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is NULL\n",
LDAP_ENV_PREFIX "CONF", 0, 0);
#endif
}
{
char *altfile = getenv(LDAP_ENV_PREFIX "RC");
if( altfile != NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, DETAIL1,
"openldap_init_w_userconf: %sRC env is %s\n",
LDAP_ENV_PREFIX, altfile, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is %s\n",
LDAP_ENV_PREFIX "RC", altfile, 0);
#endif
openldap_ldap_init_w_userconf( altfile );
}
else
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, DETAIL1,
"openldap_init_w_userconf: %sRC env is NULL\n",
LDAP_ENV_PREFIX, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "ldap_init: %s env is NULL\n",
LDAP_ENV_PREFIX "RC", 0, 0);
#endif
}
openldap_ldap_init_w_env(gopts, NULL);

View file

@ -73,11 +73,7 @@ ldap_kerberos_bind1( LDAP *ld, LDAP_CONST char *dn )
ber_len_t credlen;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind1\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind1\n", 0, 0, 0 );
#endif
if( ld->ld_version > LDAP_VERSION2 ) {
ld->ld_errno = LDAP_NOT_SUPPORTED;
@ -123,11 +119,7 @@ ldap_kerberos_bind1_s( LDAP *ld, LDAP_CONST char *dn )
int msgid;
LDAPMessage *res;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind1_s\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind1_s\n", 0, 0, 0 );
#endif
/* initiate the bind */
if ( (msgid = ldap_kerberos_bind1( ld, dn )) == -1 )
@ -161,11 +153,7 @@ ldap_kerberos_bind2( LDAP *ld, LDAP_CONST char *dn )
ber_len_t credlen;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind2\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind2\n", 0, 0, 0 );
#endif
if( ld->ld_version > LDAP_VERSION2 ) {
ld->ld_errno = LDAP_NOT_SUPPORTED;
@ -210,11 +198,7 @@ ldap_kerberos_bind2_s( LDAP *ld, LDAP_CONST char *dn )
int msgid;
LDAPMessage *res;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind2_s\n" , 0, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind2_s\n", 0, 0, 0 );
#endif
/* initiate the bind */
if ( (msgid = ldap_kerberos_bind2( ld, dn )) == -1 )
@ -235,11 +219,7 @@ ldap_kerberos_bind_s( LDAP *ld, LDAP_CONST char *dn )
{
int err;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_kerberos_bind_s\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind_s\n", 0, 0, 0 );
#endif
if ( (err = ldap_kerberos_bind1_s( ld, dn )) != LDAP_SUCCESS )
return( err );
@ -266,21 +246,11 @@ ldap_get_kerberosv4_credentials(
int err;
char realm[REALM_SZ], *cred, *krbinstance;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 );
#endif
if ( (err = krb_get_tf_realm( tkt_string(), realm )) != KSUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"ldap_get_kerberosv4_credentials: krb_get_tf_realm failed: %s\n",
krb_err_txt[err], 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "ldap_get_kerberosv4_credentials: "
"krb_get_tf_realm failed: %s\n", krb_err_txt[err], 0, 0 );
#endif
ld->ld_errno = LDAP_AUTH_UNKNOWN;
return( NULL );
}
@ -297,14 +267,8 @@ ldap_get_kerberosv4_credentials(
if ( (err = krb_mk_req( &ktxt, service, krbinstance, realm, 0 ))
!= KSUCCESS )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"ldap_get_kerberosv4_credentials: krb_mk_req failed: %s\n",
krb_err_txt[err], 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "ldap_get_kerberosv4_credentials: "
"krb_mk_req failed (%s)\n", krb_err_txt[err], 0, 0 );
#endif
ld->ld_errno = LDAP_AUTH_UNKNOWN;
return( NULL );
}

View file

@ -84,11 +84,7 @@ ldap_modify_ext( LDAP *ld,
* }
*/
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_modify_ext\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_modify_ext\n", 0, 0, 0 );
#endif
/* check client controls */
rc = ldap_int_client_controls( ld, cctrls );
@ -175,11 +171,7 @@ ldap_modify( LDAP *ld, LDAP_CONST char *dn, LDAPMod **mods )
{
int rc, msgid;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_modify\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_modify\n", 0, 0, 0 );
#endif
rc = ldap_modify_ext( ld, dn, mods, NULL, NULL, &msgid );

View file

@ -79,11 +79,7 @@ ldap_rename(
int rc;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_rename\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_rename\n", 0, 0, 0 );
#endif
/* check client controls */
rc = ldap_int_client_controls( ld, cctrls );
@ -166,11 +162,7 @@ ldap_rename2(
int msgid;
int rc;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_rename2\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_rename2\n", 0, 0, 0 );
#endif
rc = ldap_rename( ld, dn, newrdn, newSuperior,
deleteoldrdn, NULL, NULL, &msgid );

View file

@ -63,12 +63,8 @@ ldap_open( LDAP_CONST char *host, int port )
int rc;
LDAP *ld;
#ifdef NEW_LOGGING
LDAP_LOG ( CONNECTION, ARGS, "ldap_open(%s, %d)\n", host, port, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_open(%s, %d)\n",
host, port, 0 );
#endif
ld = ldap_init( host, port );
if ( ld == NULL ) {
@ -82,13 +78,8 @@ ldap_open( LDAP_CONST char *host, int port )
ld = NULL;
}
#ifdef NEW_LOGGING
LDAP_LOG ( CONNECTION, RESULTS, "ldap_open: %s\n",
ld == NULL ? "succeeded" : "failed", 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_open: %s\n",
ld == NULL ? "succeeded" : "failed", 0, 0 );
#endif
return ld;
}
@ -114,11 +105,7 @@ ldap_create( LDAP **ldp )
return LDAP_LOCAL_ERROR;
}
#ifdef NEW_LOGGING
LDAP_LOG ( CONNECTION, ENTRY, "ldap_create\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_create\n", 0, 0, 0 );
#endif
if ( (ld = (LDAP *) LDAP_CALLOC( 1, sizeof(LDAP) )) == NULL ) {
return( LDAP_NO_MEMORY );
@ -246,11 +233,7 @@ ldap_int_open_connection(
char *host;
int port, proto;
#ifdef NEW_LOGGING
LDAP_LOG ( CONNECTION, ENTRY, "ldap_int_open_connection\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_int_open_connection\n", 0, 0, 0 );
#endif
switch ( proto = ldap_pvt_url_scheme2proto( srv->lud_scheme ) ) {
case LDAP_PROTO_TCP:

View file

@ -768,11 +768,7 @@ ldap_int_select( LDAP *ld, struct timeval *timeout )
{
struct selectinfo *sip;
#ifdef NEW_LOGGING
LDAP_LOG ( CONNECTION, ENTRY, "ldap_int_select\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_int_select\n", 0, 0, 0 );
#endif
#ifndef HAVE_POLL
if ( ldap_int_tblsize == 0 ) ldap_int_ip_init();

View file

@ -95,11 +95,7 @@ ldap_send_initial_request(
LDAPURLDesc *servers;
int rc;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_send_initial_request\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_send_initial_request\n", 0, 0, 0 );
#endif
if ( ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_GET_FD, NULL ) == -1 ) {
/* not connected yet */
@ -110,15 +106,9 @@ ldap_send_initial_request(
return( -1 );
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"ldap_send_initial_request: ldap_open_defconn: successful\n" ,
0, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_open_defconn: successful\n",
0, 0, 0 );
#endif
}
{
@ -201,11 +191,7 @@ ldap_send_server_request(
LDAPRequest *lr;
int incparent, rc;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_send_server_request\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_send_server_request\n", 0, 0, 0 );
#endif
incparent = 0;
ld->ld_errno = LDAP_SUCCESS; /* optimistic */
@ -305,11 +291,7 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb,
LDAPURLDesc *srv;
Sockbuf *sb = NULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_new_connection\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_new_connection\n", 0, 0, 0 );
#endif
/*
* make a new LDAP server connection
* XXX open connection synchronously for now
@ -371,13 +353,7 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb,
++lc->lconn_refcnt; /* avoid premature free */
ld->ld_defconn = lc;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"ldap_new_connection: Call application rebind_proc\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "Call application rebind_proc\n", 0, 0, 0);
#endif
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
ldap_pvt_thread_mutex_unlock( &ld->ld_res_mutex );
@ -405,13 +381,7 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb,
++lc->lconn_refcnt; /* avoid premature free */
ld->ld_defconn = lc;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"ldap_new_connection: anonymous rebind via ldap_bind_s\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "anonymous rebind via ldap_bind_s\n", 0, 0, 0);
#endif
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
ldap_pvt_thread_mutex_unlock( &ld->ld_res_mutex );
@ -490,11 +460,7 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind )
{
LDAPConn *tmplc, *prevlc;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_free_connection\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_free_connection\n", 0, 0, 0 );
#endif
if ( force || --lc->lconn_refcnt <= 0 ) {
if ( lc->lconn_status == LDAP_CONNST_CONNECTED ) {
@ -540,22 +506,12 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind )
LDAP_FREE( lc->lconn_rebind_queue);
}
LDAP_FREE( lc );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"ldap_free_connection: actually freed\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_free_connection: actually freed\n",
0, 0, 0 );
#endif
} else {
lc->lconn_lastused = time( NULL );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS, "ldap_free_connection: refcnt %d\n",
lc->lconn_refcnt, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_free_connection: refcnt %d\n",
lc->lconn_refcnt, 0, 0 );
#endif
}
}
@ -685,13 +641,8 @@ ldap_free_request( LDAP *ld, LDAPRequest *lr )
{
LDAPRequest **ttmplr;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "ldap_free_request (origid %d, msgid %d)\n",
lr->lr_origid, lr->lr_msgid, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_free_request (origid %d, msgid %d)\n",
lr->lr_origid, lr->lr_msgid, 0 );
#endif
/* free all referrals (child requests) */
while ( lr->lr_child )
@ -737,11 +688,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
ld->ld_errno = LDAP_SUCCESS; /* optimistic */
*hadrefp = 0;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_chase_v3referrals\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_chase_v3referrals\n", 0, 0, 0 );
#endif
unfollowed = NULL;
rc = count = 0;
@ -754,14 +701,8 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
/* Check for hop limit exceeded */
if ( lr->lr_parentcnt >= ld->ld_refhoplimit ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"ldap_chase_v3referrals: more than %d referral hops (dropping)\n",
ld->ld_refhoplimit, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"more than %d referral hops (dropping)\n", ld->ld_refhoplimit, 0, 0 );
#endif
ld->ld_errno = LDAP_REFERRAL_LIMIT_EXCEEDED;
rc = -1;
goto done;
@ -809,15 +750,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
* if two search references come in one behind the other
* for the same server with different contexts.
*/
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"ldap_chase_v3referrals: queue referral \"%s\"\n",
refarray[i], 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_chase_v3referrals: queue referral \"%s\"\n",
refarray[i], 0, 0);
#endif
if( lc->lconn_rebind_queue == NULL ) {
/* Create a referral list */
lc->lconn_rebind_queue =
@ -880,15 +815,9 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
goto done;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"ldap_chase_v3referrals: msgid %d, url \"%s\"\n",
lr->lr_msgid, refarray[i], 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_chase_v3referral: msgid %d, url \"%s\"\n",
lr->lr_msgid, refarray[i], 0);
#endif
/* Send the new request to the server - may require a bind */
rinfo.ri_msgid = origreq->lr_origid;
@ -903,14 +832,8 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
#endif
if ( rc < 0 ) {
/* Failure, try next referral in the list */
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"ldap_chase_v3referrals: Unable to chase referral \"%s\" (%s)\n",
refarray[i], ldap_err2string( ld->ld_errno ), 0 );
#else
Debug( LDAP_DEBUG_ANY, "Unable to chase referral \"%s\" (%s)\n",
refarray[i], ldap_err2string( ld->ld_errno ), 0);
#endif
unfollowedcnt += ldap_append_referral( ld, &unfollowed, refarray[i]);
ldap_free_urllist(srv);
srv = NULL;
@ -988,11 +911,7 @@ ldap_chase_referrals( LDAP *ld,
BerElement *ber;
LDAPreqinfo rinfo;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_chase_referrals\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_chase_referrals\n", 0, 0, 0 );
#endif
ld->ld_errno = LDAP_SUCCESS; /* optimistic */
*hadrefp = 0;
@ -1015,15 +934,9 @@ ldap_chase_referrals( LDAP *ld,
}
if ( lr->lr_parentcnt >= ld->ld_refhoplimit ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY,
"ldap_chase_referrals: more than %d referral hops (dropping)\n",
ld->ld_refhoplimit, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"more than %d referral hops (dropping)\n",
ld->ld_refhoplimit, 0, 0 );
#endif
/* XXX report as error in ld->ld_errno? */
return( 0 );
}
@ -1048,14 +961,8 @@ ldap_chase_referrals( LDAP *ld,
rc = ldap_url_parse_ext( ref, &srv );
if ( rc != LDAP_URL_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"ldap_chase_referrals: ignoring unknown referral <%s>\n",
ref, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ignoring unknown referral <%s>\n", ref, 0, 0 );
#endif
rc = ldap_append_referral( ld, &unfollowed, ref );
*hadrefp = 1;
continue;
@ -1066,13 +973,8 @@ ldap_chase_referrals( LDAP *ld,
srv->lud_dn = NULL;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"ldap_chase_referrals: chasing LDAP referral <%s>\n", ref, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"chasing LDAP referral: <%s>\n", ref, 0, 0 );
#endif
*hadrefp = 1;
@ -1103,15 +1005,9 @@ ldap_chase_referrals( LDAP *ld,
if( rc >= 0 ) {
++count;
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"ldap_chase_referrals: Unable to chase referral <%s>\n",
ldap_err2string( ld->ld_errno), 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"Unable to chase referral (%s)\n",
ldap_err2string( ld->ld_errno ), 0, 0 );
#endif
rc = ldap_append_referral( ld, &unfollowed, ref );
}
@ -1178,17 +1074,10 @@ re_encode_request( LDAP *ld,
char *orig_dn;
char *dn;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS,
"re_encode_request: new msgid %ld, new dn <%s>\n",
(long) msgid,
( srv == NULL || srv->lud_dn == NULL ) ? "NONE" : srv->lud_dn, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"re_encode_request: new msgid %ld, new dn <%s>\n",
(long) msgid,
( srv == NULL || srv->lud_dn == NULL) ? "NONE" : srv->lud_dn, 0 );
#endif
tmpber = *origber;
@ -1293,13 +1182,8 @@ re_encode_request( LDAP *ld,
#ifdef LDAP_DEBUG
if ( ldap_debug & LDAP_DEBUG_PACKETS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"re_encode_request: new request is:\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "re_encode_request new request is:\n",
0, 0, 0 );
#endif
ber_log_dump( LDAP_DEBUG_BER, ldap_debug, ber, 0 );
}
#endif /* LDAP_DEBUG */

View file

@ -111,11 +111,7 @@ ldap_result(
assert( ld != NULL );
assert( result != NULL );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "ldap_result msgid %d\n", msgid, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_result msgid %d\n", msgid, 0, 0 );
#endif
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &ld->ld_res_mutex );
@ -149,27 +145,17 @@ chkResponseList(
* wait until it arrives or timeout occurs.
*/
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "ldap_chkResponseList for msgid=%d, all=%d\n",
msgid, all, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_chkResponseList for msgid=%d, all=%d\n",
msgid, all, 0 );
#endif
lastlm = NULL;
for ( lm = ld->ld_responses; lm != NULL; lm = nextlm ) {
nextlm = lm->lm_next;
if ( ldap_abandoned( ld, lm->lm_msgid ) ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"ldap_chkResponseList msg abandoned, msgid %d\n", msgid, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_chkResponseList msg abandoned, msgid %d\n",
msgid, 0, 0 );
#endif
ldap_mark_abandoned( ld, lm->lm_msgid );
if ( lastlm == NULL ) {
@ -227,23 +213,12 @@ chkResponseList(
#ifdef LDAP_DEBUG
if( lm == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS, "ldap_chkResponseList returns NULL\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_chkResponseList returns NULL\n", 0, 0, 0);
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"ldap_chkResponseList returns msgid %d, type 0x%02lu\n",
lm->lm_msgid, (unsigned long) lm->lm_msgtype, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_chkResponseList returns msgid %d, type 0x%02lu\n",
lm->lm_msgid, (unsigned long) lm->lm_msgtype, 0);
#endif
}
#endif
return lm;
@ -268,22 +243,11 @@ wait4msg(
#ifdef LDAP_DEBUG
if ( timeout == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS,
"wait4msg (infinite timeout), msgid %d\n", msgid, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "wait4msg (infinite timeout), msgid %d\n",
msgid, 0, 0 );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS,
"wait4msg (timeout %ld sec, %ld usec), msgid %d\n",
(long) timeout->tv_sec, (long) timeout->tv_usec, msgid );
#else
Debug( LDAP_DEBUG_TRACE, "wait4msg (timeout %ld sec, %ld usec), msgid %d\n",
(long) timeout->tv_sec, (long) timeout->tv_usec, msgid );
#endif
}
#endif /* LDAP_DEBUG */
@ -298,13 +262,8 @@ wait4msg(
rc = -2;
while ( rc == -2 ) {
#ifdef LDAP_DEBUG
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS,
"wait4msg continue, msgid %d, all %d\n", msgid, all, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "wait4msg continue, msgid %d, all %d\n",
msgid, all, 0 );
#endif
if ( ldap_debug & LDAP_DEBUG_TRACE ) {
ldap_dump_connection( ld, ld->ld_conns, 1 );
ldap_dump_requests_and_responses( ld );
@ -331,15 +290,9 @@ wait4msg(
rc = ldap_int_select( ld, tvp );
#ifdef LDAP_DEBUG
if ( rc == -1 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS,
"wait4msg: ldap_int_select returned -1: errno %d\n",
errno, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_int_select returned -1: errno %d\n",
errno, 0, 0 );
#endif
}
#endif
@ -392,13 +345,8 @@ wait4msg(
break;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"wait4msg: %ld secs to go\n", (long) tv.tv_sec, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "wait4msg: %ld secs to go\n",
(long) tv.tv_sec, 0, 0 );
#endif
start_time = tmp_time;
}
}
@ -440,11 +388,7 @@ try_read1msg(
assert( lcp != NULL );
assert( *lcp != NULL );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "read1msg: msgid %d, all %d\n", msgid, all, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "read1msg: msgid %d, all %d\n", msgid, all, 0 );
#endif
lc = *lcp;
@ -481,14 +425,9 @@ nextresp3:
if ( tag != LDAP_TAG_MESSAGE ) {
if ( tag == LBER_DEFAULT) {
#ifdef LDAP_DEBUG
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: ber_get_next failed\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_CONNS,
"ber_get_next failed.\n", 0, 0, 0 );
#endif
#endif
#ifdef EWOULDBLOCK
if (errno==EWOULDBLOCK) return -2;
#endif
@ -511,11 +450,7 @@ nextresp3:
/* if it's been abandoned, toss it */
if ( ldap_abandoned( ld, id ) ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1, "read1msg: abandoned\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "abandoned\n", 0, 0, 0);
#endif
retry_ber:
ber_free( ber, 1 );
if ( ber_sockbuf_ctrl( sb, LBER_SB_OPT_DATA_READY, NULL ) ) {
@ -525,15 +460,9 @@ retry_ber:
}
if (( lr = ldap_find_request_by_msgid( ld, id )) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: no request for response with msgid %ld (tossing)\n",
(long) id, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"no request for response with msgid %ld (tossing)\n",
(long) id, 0, 0 );
#endif
goto retry_ber;
}
#ifdef LDAP_CONNECTIONLESS
@ -549,17 +478,10 @@ nextresp2:
return( -1 );
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: ldap_read: message type %s msgid %ld, original id %ld\n",
ldap_int_msgtype2str( tag ),
(long) lr->lr_msgid, (long) lr->lr_origid );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_read: message type %s msgid %ld, original id %ld\n",
ldap_int_msgtype2str( tag ),
(long) lr->lr_msgid, (long) lr->lr_origid );
#endif
id = lr->lr_origid;
refer_cnt = 0;
@ -594,16 +516,9 @@ nextresp2:
/* If haven't got end search, set chasing referrals */
if( lr->lr_status != LDAP_REQST_COMPLETED) {
lr->lr_status = LDAP_REQST_CHASINGREFS;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: search ref chased,"
"mark request chasing refs, id = %d\n",
lr->lr_msgid, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"read1msg: search ref chased, mark request chasing refs, id = %d\n",
lr->lr_msgid, 0, 0);
#endif
}
v3ref = 1; /* We sucessfully chased the reference */
}
@ -627,16 +542,9 @@ nextresp2:
if( ber_scanf( &tmpber, "{v}", &refs) == LBER_ERROR) {
rc = LDAP_DECODING_ERROR;
lr->lr_status = LDAP_REQST_COMPLETED;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: referral decode error,"
"mark request completed, id = %d\n",
lr->lr_msgid, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"read1msg: referral decode error, mark request completed, id = %d\n",
lr->lr_msgid, 0, 0);
#endif
} else {
/* Chase the referral
* Note: refs arrary is freed by ldap_chase_v3referrals
@ -644,16 +552,9 @@ nextresp2:
refer_cnt = ldap_chase_v3referrals( ld, lr, refs,
0, &lr->lr_res_error, &hadref );
lr->lr_status = LDAP_REQST_COMPLETED;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: referral chased,"
"mark request completed, id = %d\n",
lr->lr_msgid, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"read1msg: referral chased, mark request completed, id = %d\n",
lr->lr_msgid, 0, 0);
#endif
if( refer_cnt > 0) {
v3ref = 1; /* Referral successfully chased */
}
@ -702,15 +603,8 @@ nextresp2:
refer_cnt = ldap_chase_referrals( ld, lr,
&lr->lr_res_error, -1, &hadref );
lr->lr_status = LDAP_REQST_COMPLETED;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: V2 referral chased,"
"mark request completed, id = %d\n",
lr->lr_msgid, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"read1msg: V2 referral chased, mark request completed, id = %d\n", lr->lr_msgid, 0, 0);
#endif
}
/* save errno, message, and matched string */
@ -723,27 +617,15 @@ nextresp2:
} else {
lr->lr_res_errno = LDAP_PARTIAL_RESULTS;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: new result: res_errno: %d, res_error: <%s>, res_matched: <%s>\n",
lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "",
lr->lr_res_matched ? lr->lr_res_matched : "" );
#else
Debug( LDAP_DEBUG_TRACE,
"new result: res_errno: %d, res_error: <%s>, res_matched: <%s>\n",
lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "",
lr->lr_res_matched ? lr->lr_res_matched : "" );
#endif
}
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1, "read1msg: %d new referrals\n",
refer_cnt, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"read1msg: %d new referrals\n", refer_cnt, 0, 0 );
#endif
if ( refer_cnt != 0 ) { /* chasing referrals */
ber_free( ber, 1 );
@ -763,14 +645,8 @@ Debug( LDAP_DEBUG_TRACE,
}
lr->lr_status = LDAP_REQST_COMPLETED; /* declare this request done */
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: mark request completed, id = %d\n",
lr->lr_msgid, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"read1msg: mark request completed, id = %d\n", lr->lr_msgid, 0, 0);
#endif
while ( lr->lr_parent != NULL ) {
merge_error_info( ld, lr->lr_parent, lr );
@ -794,21 +670,12 @@ Debug( LDAP_DEBUG_TRACE,
if ( lr->lr_outrefcnt <= 0 && lr->lr_parent == NULL && tmplr == NULL ) {
id = lr->lr_msgid;
tag = lr->lr_res_msgtype;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: request %ld done\n", (long) id, 0, 0 );
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: res_errno: %d,res_error: <%s>, res_matched: <%s>\n",
lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "",
lr->lr_res_matched ? lr->lr_res_matched : "" );
#else
Debug( LDAP_DEBUG_ANY, "request %ld done\n",
(long) id, 0, 0 );
Debug( LDAP_DEBUG_TRACE,
"res_errno: %d, res_error: <%s>, res_matched: <%s>\n",
lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "",
lr->lr_res_matched ? lr->lr_res_matched : "" );
#endif
if ( !simple_request ) {
ber_free( ber, 1 );
ber = NULL;
@ -960,14 +827,8 @@ lr->lr_res_matched ? lr->lr_res_matched : "" );
goto exit;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"read1msg: adding response id %ld type %ld\n",
(long) new->lm_msgid, (long) new->lm_msgtype, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "adding response id %ld type %ld:\n",
(long) new->lm_msgid, (long) new->lm_msgtype, 0 );
#endif
/* part of a search response - add to end of list of entries */
for ( tmp = l; (tmp->lm_chain != NULL) &&
@ -1081,21 +942,12 @@ merge_error_info( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr )
}
}
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, DETAIL1, "merged parent (id %d) error info: ",
parentr->lr_msgid, 0, 0 );
LDAP_LOG( OPERATION, DETAIL1, "result errno %d, error <%s>, matched <%s>\n",
parentr->lr_res_errno, parentr->lr_res_error ?
parentr->lr_res_error : "", parentr->lr_res_matched ?
parentr->lr_res_matched : "" );
#else
Debug( LDAP_DEBUG_TRACE, "merged parent (id %d) error info: ",
parentr->lr_msgid, 0, 0 );
Debug( LDAP_DEBUG_TRACE, "result errno %d, error <%s>, matched <%s>\n",
parentr->lr_res_errno, parentr->lr_res_error ?
parentr->lr_res_error : "", parentr->lr_res_matched ?
parentr->lr_res_matched : "" );
#endif
}
@ -1141,11 +993,7 @@ ldap_msgfree( LDAPMessage *lm )
LDAPMessage *next;
int type = 0;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_msgfree\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_msgfree\n", 0, 0, 0 );
#endif
for ( ; lm != NULL; lm = next ) {
next = lm->lm_chain;
@ -1170,11 +1018,7 @@ ldap_msgdelete( LDAP *ld, int msgid )
assert( ld != NULL );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_msgdelete\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_msgdelete\n", 0, 0, 0 );
#endif
prev = NULL;
#ifdef LDAP_R_COMPILE

View file

@ -74,11 +74,7 @@ ldap_sasl_bind(
int rc;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ENTRY, "ldap_sasl_bind\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_sasl_bind\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -177,11 +173,7 @@ ldap_sasl_bind_s(
LDAPMessage *result;
struct berval *scredp = NULL;
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ENTRY, "ldap_sasl_bind_s\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_sasl_bind_s\n", 0, 0, 0 );
#endif
/* do a quick !LDAPv3 check... ldap_sasl_bind will do the rest. */
if( servercredp != NULL ) {
@ -263,11 +255,7 @@ ldap_parse_sasl_bind_result(
ber_tag_t tag;
BerElement *ber;
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ENTRY, "ldap_parse_sasl_bind_result\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_parse_sasl_bind_result\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -376,11 +364,7 @@ ldap_pvt_sasl_getmechs ( LDAP *ld, char **pmechlist )
char **values, *mechlist;
int rc;
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ENTRY, "ldap_pvt_sasl_getmech\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_getmech\n", 0, 0, 0 );
#endif
rc = ldap_search_s( ld, "", LDAP_SCOPE_BASE,
NULL, attrs, 0, &res );
@ -470,28 +454,16 @@ ldap_sasl_interactive_bind_s(
goto done;
}
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1,
"ldap_sasl_interactive_bind_s: server supports: %s\n",
smechs, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_sasl_interactive_bind_s: server supports: %s\n",
smechs, 0, 0 );
#endif
mechs = smechs;
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1,
"ldap_sasl_interactive_bind_s: user selected: %s\n",
mechs, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_sasl_interactive_bind_s: user selected: %s\n",
mechs, 0, 0 );
#endif
}
rc = ldap_int_sasl_bind( ld, dn, mechs,

View file

@ -70,11 +70,7 @@ ldap_simple_bind(
int msgid;
struct berval cred;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_simple_bind\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_simple_bind\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -109,11 +105,7 @@ ldap_simple_bind_s( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd )
{
struct berval cred;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_simple_bind_s\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_simple_bind_s\n", 0, 0, 0 );
#endif
if ( passwd != NULL ) {
cred.bv_val = (char *) passwd;

View file

@ -71,11 +71,7 @@ ldap_search_ext(
int timelimit;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_search_ext\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_search_ext\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
@ -186,11 +182,7 @@ ldap_search(
BerElement *ber;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_search\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_search\n", 0, 0, 0 );
#endif
assert( ld != NULL );
assert( LDAP_VALID( ld ) );

View file

@ -227,15 +227,9 @@ ldap_pvt_tls_init_def_ctx( void )
int i;
tls_def_ctx = SSL_CTX_new( SSLv23_method() );
if ( tls_def_ctx == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: "
"TLS could not allocate default ctx (%d).\n",
ERR_peek_error(), 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"TLS: could not allocate default ctx (%lu).\n",
ERR_peek_error(),0,0);
#endif
rc = -1;
goto error_exit;
}
@ -246,15 +240,9 @@ ldap_pvt_tls_init_def_ctx( void )
if ( tls_opt_ciphersuite &&
!SSL_CTX_set_cipher_list( tls_def_ctx, ciphersuite ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: "
"TLS could not set cipher list %s.\n",
tls_opt_ciphersuite, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"TLS: could not set cipher list %s.\n",
tls_opt_ciphersuite, 0, 0 );
#endif
tls_report_error();
rc = -1;
goto error_exit;
@ -265,20 +253,11 @@ ldap_pvt_tls_init_def_ctx( void )
cacertfile, cacertdir ) ||
!SSL_CTX_set_default_verify_paths( tls_def_ctx ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR,
"ldap_pvt_tls_init_def_ctx: "
"TLS could not load verify locations "
"(file:`%s',dir:`%s').\n",
tls_opt_cacertfile ? tls_opt_cacertfile : "",
tls_opt_cacertdir ? tls_opt_cacertdir : "", 0 );
#else
Debug( LDAP_DEBUG_ANY, "TLS: "
"could not load verify locations (file:`%s',dir:`%s').\n",
tls_opt_cacertfile ? tls_opt_cacertfile : "",
tls_opt_cacertdir ? tls_opt_cacertdir : "",
0 );
#endif
tls_report_error();
rc = -1;
goto error_exit;
@ -286,18 +265,11 @@ ldap_pvt_tls_init_def_ctx( void )
calist = get_ca_list( cacertfile, cacertdir );
if ( !calist ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: "
"TLS could not load client CA list (file: `%s',dir:`%s')\n",
tls_opt_cacertfile ? tls_opt_cacertfile : "",
tls_opt_cacertdir ? tls_opt_cacertdir : "", 0 );
#else
Debug( LDAP_DEBUG_ANY, "TLS: "
"could not load client CA list (file:`%s',dir:`%s').\n",
tls_opt_cacertfile ? tls_opt_cacertfile : "",
tls_opt_cacertdir ? tls_opt_cacertdir : "",
0 );
#endif
tls_report_error();
rc = -1;
goto error_exit;
@ -310,14 +282,9 @@ ldap_pvt_tls_init_def_ctx( void )
!SSL_CTX_use_PrivateKey_file( tls_def_ctx,
keyfile, SSL_FILETYPE_PEM ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: "
"TLS could not use key file `%s'.\n", tls_opt_keyfile, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"TLS: could not use key file `%s'.\n",
tls_opt_keyfile,0,0);
#endif
tls_report_error();
rc = -1;
goto error_exit;
@ -327,15 +294,9 @@ ldap_pvt_tls_init_def_ctx( void )
!SSL_CTX_use_certificate_file( tls_def_ctx,
certfile, SSL_FILETYPE_PEM ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_init_def_ctx: "
"TLS could not use certificate `%s'.\n",
tls_opt_certfile, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"TLS: could not use certificate `%s'.\n",
tls_opt_certfile,0,0);
#endif
tls_report_error();
rc = -1;
goto error_exit;
@ -344,15 +305,9 @@ ldap_pvt_tls_init_def_ctx( void )
if ( ( tls_opt_certfile || tls_opt_keyfile ) &&
!SSL_CTX_check_private_key( tls_def_ctx ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR,
"ldap_pvt_tls_init_def_ctx: TLS private key mismatch.\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"TLS: private key mismatch.\n",
0,0,0);
#endif
tls_report_error();
rc = -1;
goto error_exit;
@ -436,12 +391,7 @@ alloc_handle( void *ctx_arg )
ssl = SSL_new( ctx );
if ( ssl == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR,
"alloc_handle: TLS can't create ssl handle.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,"TLS: can't create ssl handle.\n",0,0,0);
#endif
return NULL;
}
return ssl;
@ -787,12 +737,7 @@ ldap_int_tls_connect( LDAP *ld, LDAPConn *conn )
#endif
}
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR,
"ldap_int_tls_connect: TLS can't connect.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,"TLS: can't connect.\n",0,0,0);
#endif
ber_sockbuf_remove_io( sb, &sb_tls_sbio,
LBER_SBIOD_LEVEL_TRANSPORT );
@ -839,12 +784,7 @@ ldap_pvt_tls_accept( Sockbuf *sb, void *ctx_arg )
if ( err <= 0 ) {
if ( update_flags( sb, ssl, err )) return 1;
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR,
"ldap_pvt_tls_accept: TLS can't accept.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,"TLS: can't accept.\n",0,0,0 );
#endif
tls_report_error();
ber_sockbuf_remove_io( sb, &sb_tls_sbio,
@ -950,15 +890,9 @@ ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in )
x = tls_get_cert((SSL *)s);
if (!x) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR,
"ldap_pvt_tls_check_hostname: "
"TLS unable to get peer certificate.\n" , 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"TLS: unable to get peer certificate.\n",
0, 0, 0 );
#endif
/* If this was a fatal condition, things would have
* aborted long before now.
*/
@ -1059,15 +993,9 @@ ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in )
if( X509_NAME_get_text_by_NID( xn, NID_commonName,
buf, sizeof(buf)) == -1)
{
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_check_hostname: "
"TLS unable to get common name from peer certificate.\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"TLS: unable to get common name from peer certificate.\n",
0, 0, 0 );
#endif
ret = LDAP_CONNECT_ERROR;
ld->ld_error = LDAP_STRDUP(
_("TLS: unable to get CN from peer certificate"));
@ -1093,15 +1021,9 @@ ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in )
}
if( ret == LDAP_LOCAL_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR, "ldap_pvt_tls_check_hostname: "
"TLS hostname (%s) does not match "
"common name in certificate (%s).\n", name, buf, 0 );
#else
Debug( LDAP_DEBUG_ANY, "TLS: hostname (%s) does not match "
"common name in certificate (%s).\n",
name, buf, 0 );
#endif
ret = LDAP_CONNECT_ERROR;
ld->ld_error = LDAP_STRDUP(
_("TLS: hostname does not match CN in peer certificate"));
@ -1413,14 +1335,9 @@ tls_info_cb( const SSL *ssl, int where, int ret )
}
#endif
if ( where & SSL_CB_LOOP ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1, "tls_info_cb: "
"TLS trace: %s:%s\n", op, state, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"TLS trace: %s:%s\n",
op, state, 0 );
#endif
} else if ( where & SSL_CB_ALERT ) {
char *atype = (char *) SSL_alert_type_string_long( ret );
@ -1436,40 +1353,22 @@ tls_info_cb( const SSL *ssl, int where, int ret )
__etoa( adesc );
}
#endif
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1,
"tls_info_cb: TLS trace: SSL3 alert %s:%s:%s\n",
op, atype, adesc );
#else
Debug( LDAP_DEBUG_TRACE,
"TLS trace: SSL3 alert %s:%s:%s\n",
op, atype, adesc );
#endif
#ifdef HAVE_EBCDIC
if ( atype ) LDAP_FREE( atype );
if ( adesc ) LDAP_FREE( adesc );
#endif
} else if ( where & SSL_CB_EXIT ) {
if ( ret == 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR,
"tls_info_cb: TLS trace: %s:failed in %s\n",
op, state, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"TLS trace: %s:failed in %s\n",
op, state, 0 );
#endif
} else if ( ret < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR,
"tls_info_cb: TLS trace: %s:error in %s\n",
op, state, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"TLS trace: %s:error in %s\n",
op, state, 0 );
#endif
}
}
#ifdef HAVE_EBCDIC
@ -1511,18 +1410,6 @@ tls_verify_cb( int ok, X509_STORE_CTX *ctx )
__etoa( certerr );
}
#endif
#ifdef NEW_LOGGING
LDAP_LOG( TRANSPORT, ERR,
"TLS certificate verification: depth: %d, err: %d, subject: %s,",
errdepth, errnum,
sname ? sname : "-unknown-" );
LDAP_LOG( TRANSPORT, ERR, " issuer: %s\n", iname ? iname : "-unknown-", 0, 0 );
if ( !ok ) {
LDAP_LOG ( TRANSPORT, ERR,
"TLS certificate verification: Error, %s\n",
certerr, 0, 0 );
}
#else
Debug( LDAP_DEBUG_TRACE,
"TLS certificate verification: depth: %d, err: %d, subject: %s,",
errdepth, errnum,
@ -1533,7 +1420,6 @@ tls_verify_cb( int ok, X509_STORE_CTX *ctx )
"TLS certificate verification: Error, %s\n",
certerr, 0, 0 );
}
#endif
if ( sname )
CRYPTO_free ( sname );
if ( iname )
@ -1569,14 +1455,8 @@ tls_report_error( void )
}
__etoa( buf );
#endif
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR,
"tls_report_error: TLS %s %s:%d\n",
buf, file, line );
#else
Debug( LDAP_DEBUG_ANY, "TLS: %s %s:%d\n",
buf, file, line );
#endif
#ifdef HAVE_EBCDIC
if ( file ) LDAP_FREE( (void *)file );
#endif
@ -1593,15 +1473,9 @@ tls_tmp_rsa_cb( SSL *ssl, int is_export, int key_length )
tmp_rsa = RSA_generate_key( key_length, RSA_F4, NULL, NULL );
if ( !tmp_rsa ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, ERR,
"tls_tmp_rsa_cb: TLS Failed to generate temporary %d-bit %s "
"RSA key\n", key_length, is_export ? "export" : "domestic", 0 );
#else
Debug( LDAP_DEBUG_ANY,
"TLS: Failed to generate temporary %d-bit %s RSA key\n",
key_length, is_export ? "export" : "domestic", 0 );
#endif
return NULL;
}
return tmp_rsa;
@ -1629,30 +1503,18 @@ tls_seed_PRNG( const char *randfile )
}
if (randfile == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1,
"tls_seed_PRNG: TLS Use configuration file or "
"$RANDFILE to define seed PRNG\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"TLS: Use configuration file or $RANDFILE to define seed PRNG\n",
0, 0, 0);
#endif
return -1;
}
total = RAND_load_file(randfile, -1);
if (RAND_status() == 0) {
#ifdef NEW_LOGGING
LDAP_LOG ( TRANSPORT, DETAIL1,
"tls_seed_PRNG: TLS PRNG not been seeded with enough data\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"TLS: PRNG not been seeded with enough data\n",
0, 0, 0);
#endif
return -1;
}

View file

@ -67,11 +67,7 @@ ldap_unbind_ext_s(
int
ldap_unbind( LDAP *ld )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_unbind\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_unbind\n", 0, 0, 0 );
#endif
return( ldap_unbind_ext( ld, NULL, NULL ) );
}
@ -204,11 +200,7 @@ ldap_send_unbind(
BerElement *ber;
ber_int_t id;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_send_unbind\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_send_unbind\n", 0, 0, 0 );
#endif
#ifdef LDAP_CONNECTIONLESS
if (LDAP_IS_UDP(ld))

View file

@ -499,11 +499,7 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
* because a call to LDAP_INT_GLOBAL_OPT() will try to allocate
* the options and cause infinite recursion
*/
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "ldap_url_parse_ext(%s)\n", url_in, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_url_parse_ext(%s)\n", url_in, 0, 0 );
#endif
#endif
*ludpp = NULL; /* pessimistic */

View file

@ -38,11 +38,7 @@ do_abandon( Operation *op, SlapReply *rs )
Operation *o;
int i;
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ENTRY, "conn: %d do_abandon\n", op->o_connid, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0, 0 );
#endif
/*
* Parse the abandon request. It looks like this:
@ -51,12 +47,7 @@ do_abandon( Operation *op, SlapReply *rs )
*/
if ( ber_scanf( op->o_ber, "i", &id ) == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"conn: %d do_abandon: ber_scanf failed\n", op->o_connid, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "do_abandon: ber_scanf failed\n", 0, 0 ,0 );
#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
return SLAPD_DISCONNECT;
}
@ -66,22 +57,11 @@ do_abandon( Operation *op, SlapReply *rs )
return rs->sr_err;
}
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ARGS, "do_abandon: conn: %d id=%ld\n",
op->o_connid, (long) id, 0 );
#else
Debug( LDAP_DEBUG_ARGS, "do_abandon: id=%ld\n", (long) id, 0 ,0 );
#endif
if( id <= 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"do_abandon: conn: %d bad msgid %ld\n",
op->o_connid, (long) id, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"do_abandon: bad msgid %ld\n", (long) id, 0, 0 );
#endif
return LDAP_SUCCESS;
}
@ -125,14 +105,8 @@ done:
ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ENTRY,
"do_abandon: conn: %d op=%ld %sfound\n",
op->o_connid, (long)id, o ? "" : "not " );
#else
Debug( LDAP_DEBUG_TRACE, "do_abandon: op=%ld %sfound\n",
(long) id, o ? "" : "not ", 0 );
#endif
return LDAP_SUCCESS;
}

View file

@ -201,15 +201,9 @@ access_allowed_mask(
state->as_vd_ad=desc;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, ENTRY,
"access_allowed: %s access to \"%s\" \"%s\" requested\n",
access2str( access ), e->e_dn, attr );
#else
Debug( LDAP_DEBUG_ACL,
"=> access_allowed: %s access to \"%s\" \"%s\" requested\n",
access2str( access ), e->e_dn, attr );
#endif
if ( op == NULL ) {
/* no-op call */
@ -244,15 +238,9 @@ access_allowed_mask(
/* grant database root access */
if ( be != NULL && be_isroot( op ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, INFO,
"access_allowed: conn %lu root access granted\n",
op->o_connid, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"<= root access granted\n",
0, 0, 0 );
#endif
if ( maskp ) {
mask = ACL_LVL_WRITE;
}
@ -269,33 +257,19 @@ access_allowed_mask(
&& desc != slap_schema.si_ad_entry
&& desc != slap_schema.si_ad_children )
{
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"access_allowed: conn %lu NoUserMod Operational attribute: %s "
"access granted\n", op->o_connid, attr , 0 );
#else
Debug( LDAP_DEBUG_ACL, "NoUserMod Operational attribute:"
" %s access granted\n",
attr, 0, 0 );
#endif
goto done;
}
/* use backend default access if no backend acls */
if( be != NULL && be->be_acl == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"access_allowed: backend default %s access %s to \"%s\"\n",
access2str( access ),
be->be_dfltaccess >= access ? "granted" : "denied",
op->o_dn.bv_val ? op->o_dn.bv_val : "(anonymous)" );
#else
Debug( LDAP_DEBUG_ACL,
"=> access_allowed: backend default %s access %s to \"%s\"\n",
access2str( access ),
be->be_dfltaccess >= access ? "granted" : "denied",
op->o_dn.bv_val ? op->o_dn.bv_val : "(anonymous)" );
#endif
ret = be->be_dfltaccess >= access;
if ( maskp ) {
@ -313,18 +287,10 @@ access_allowed_mask(
/* be is always non-NULL */
/* use global default access if no global acls */
} else if ( be == NULL && frontendDB->be_acl == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"access_allowed: global default %s access %s to \"%s\"\n",
access2str( access ),
frontendDB->be_dfltaccess >= access ? "granted" : "denied",
op->o_dn.bv_val );
#else
Debug( LDAP_DEBUG_ACL,
"=> access_allowed: global default %s access %s to \"%s\"\n",
access2str( access ),
frontendDB->be_dfltaccess >= access ? "granted" : "denied", op->o_dn.bv_val );
#endif
ret = frontendDB->be_dfltaccess >= access;
if ( maskp ) {
@ -368,25 +334,15 @@ access_allowed_mask(
int i;
for (i = 0; i < MAXREMATCHES && matches[i].rm_so > 0; i++) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"access_allowed: match[%d]: %d %d ",
i, (int)matches[i].rm_so, (int)matches[i].rm_eo );
#else
Debug( LDAP_DEBUG_ACL, "=> match[%d]: %d %d ", i,
(int)matches[i].rm_so, (int)matches[i].rm_eo );
#endif
if( matches[i].rm_so <= matches[0].rm_eo ) {
int n;
for ( n = matches[i].rm_so; n < matches[i].rm_eo; n++) {
Debug( LDAP_DEBUG_ACL, "%c", e->e_ndn[n], 0, 0 );
}
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, ARGS, "\n" , 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 );
#endif
}
if (state) {
@ -411,41 +367,23 @@ vd_access:
}
if ( ACL_IS_INVALID( mask ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"access_allowed: conn %lu \"%s\" (%s) invalid!\n",
op->o_connid, e->e_dn, attr );
#else
Debug( LDAP_DEBUG_ACL,
"=> access_allowed: \"%s\" (%s) invalid!\n",
e->e_dn, attr, 0 );
#endif
ACL_INIT(mask);
} else if ( control == ACL_BREAK ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"access_allowed: conn %lu no more rules\n", op->o_connid, 0,0 );
#else
Debug( LDAP_DEBUG_ACL,
"=> access_allowed: no more rules\n", 0, 0, 0);
#endif
goto done;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, ENTRY,
"access_allowed: %s access %s by %s\n",
access2str( access ), ACL_GRANT( mask, access ) ? "granted" : "denied",
accessmask2str( mask, accessmaskbuf ) );
#else
Debug( LDAP_DEBUG_ACL,
"=> access_allowed: %s access %s by %s\n",
access2str( access ),
ACL_GRANT(mask, access) ? "granted" : "denied",
accessmask2str( mask, accessmaskbuf ) );
#endif
ret = ACL_GRANT(mask, access);
@ -516,26 +454,14 @@ acl_get(
if ( a->acl_dn_pat.bv_len || ( a->acl_dn_style != ACL_STYLE_REGEX )) {
if ( a->acl_dn_style == ACL_STYLE_REGEX ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_get: dnpat [%d] %s nsub: %d\n",
*count, a->acl_dn_pat.bv_val,
(int) a->acl_dn_re.re_nsub );
#else
Debug( LDAP_DEBUG_ACL, "=> dnpat: [%d] %s nsub: %d\n",
*count, a->acl_dn_pat.bv_val, (int) a->acl_dn_re.re_nsub );
#endif
if (regexec(&a->acl_dn_re, e->e_ndn, nmatch, matches, 0))
continue;
} else {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1, "acl_get: dn [%d] %s\n",
*count, a->acl_dn_pat.bv_val, 0 );
#else
Debug( LDAP_DEBUG_ACL, "=> dn: [%d] %s\n",
*count, a->acl_dn_pat.bv_val, 0 );
#endif
patlen = a->acl_dn_pat.bv_len;
if ( dnlen < patlen )
continue;
@ -576,13 +502,8 @@ acl_get(
continue;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_get: [%d] matched\n", *count, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL, "=> acl_get: [%d] matched\n",
*count, 0, 0 );
#endif
}
if ( a->acl_attrs && !ad_inlist( desc, a->acl_attrs ) ) {
@ -606,29 +527,17 @@ acl_get(
}
if ( a->acl_attrval_style == ACL_STYLE_REGEX ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_get: valpat %s\n",
a->acl_attrval.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"acl_get: valpat %s\n",
a->acl_attrval.bv_val, 0, 0 );
#endif
if (regexec(&a->acl_attrval_re, val->bv_val, 0, NULL, 0))
continue;
} else {
int match = 0;
const char *text;
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_get: val %s\n",
a->acl_attrval.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"acl_get: val %s\n",
a->acl_attrval.bv_val, 0, 0 );
#endif
if ( a->acl_attrs[0].an_desc->ad_type->sat_syntax != slap_schema.si_syn_distinguishedName ) {
if (value_match( &match, desc,
@ -685,21 +594,12 @@ acl_get(
}
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_get: [%d] attr %s\n", *count, attr ,0 );
#else
Debug( LDAP_DEBUG_ACL, "=> acl_get: [%d] attr %s\n",
*count, attr, 0);
#endif
return a;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, RESULTS, "acl_get: done.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL, "<= acl_get: done.\n", 0, 0, 0 );
#endif
return( NULL );
}
@ -755,16 +655,6 @@ acl_mask(
assert( attr != NULL );
#ifdef NEW_LOGGING
LDAP_LOG( ACL, ENTRY,
"acl_mask: conn %lu access to entry \"%s\", attr \"%s\" requested\n",
op->o_connid, e->e_dn, attr );
LDAP_LOG( ACL, ARGS,
" to %s by \"%s\", (%s) \n", val ? "value" : "all values",
op->o_ndn.bv_val ? op->o_ndn.bv_val : "",
accessmask2str( *mask, accessmaskbuf ) );
#else
Debug( LDAP_DEBUG_ACL,
"=> acl_mask: access to entry \"%s\", attr \"%s\" requested\n",
e->e_dn, attr, 0 );
@ -774,7 +664,6 @@ acl_mask(
val ? "value" : "all values",
op->o_ndn.bv_val ? op->o_ndn.bv_val : "",
accessmask2str( *mask, accessmaskbuf ) );
#endif
if( state && ( state->as_recorded & ACL_STATE_RECORDED_VD )
@ -795,14 +684,8 @@ acl_mask(
/* AND <who> clauses */
if ( b->a_dn_pat.bv_len != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu check a_dn_pat: %s\n",
op->o_connid, b->a_dn_pat.bv_val ,0 );
#else
Debug( LDAP_DEBUG_ACL, "<= check a_dn_pat: %s\n",
b->a_dn_pat.bv_val, 0, 0);
#endif
/*
* if access applies to the entry itself, and the
* user is bound as somebody in the same namespace as
@ -922,14 +805,8 @@ dn_match_cleanup:;
if ( ! op->o_conn->c_listener ) {
continue;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu check a_sockurl_pat: %s\n",
op->o_connid, b->a_sockurl_pat.bv_val , 0 );
#else
Debug( LDAP_DEBUG_ACL, "<= check a_sockurl_pat: %s\n",
b->a_sockurl_pat.bv_val, 0, 0 );
#endif
if ( !ber_bvccmp( &b->a_sockurl_pat, '*' ) ) {
if ( b->a_sockurl_style == ACL_STYLE_REGEX) {
@ -962,14 +839,8 @@ dn_match_cleanup:;
if ( !op->o_conn->c_peer_domain.bv_val ) {
continue;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu check a_domain_pat: %s\n",
op->o_connid, b->a_domain_pat.bv_val , 0 );
#else
Debug( LDAP_DEBUG_ACL, "<= check a_domain_pat: %s\n",
b->a_domain_pat.bv_val, 0, 0 );
#endif
if ( !ber_bvccmp( &b->a_domain_pat, '*' ) ) {
if ( b->a_domain_style == ACL_STYLE_REGEX) {
if (!regex_matches( &b->a_domain_pat, op->o_conn->c_peer_domain.bv_val,
@ -1019,14 +890,8 @@ dn_match_cleanup:;
if ( !op->o_conn->c_peer_name.bv_val ) {
continue;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu check a_peername_path: %s\n",
op->o_connid, b->a_peername_pat.bv_val , 0 );
#else
Debug( LDAP_DEBUG_ACL, "<= check a_peername_path: %s\n",
b->a_peername_pat.bv_val, 0, 0 );
#endif
if ( !ber_bvccmp( &b->a_peername_pat, '*' ) ) {
if ( b->a_peername_style == ACL_STYLE_REGEX ) {
if (!regex_matches( &b->a_peername_pat, op->o_conn->c_peer_name.bv_val,
@ -1129,14 +994,8 @@ dn_match_cleanup:;
if ( !op->o_conn->c_sock_name.bv_val ) {
continue;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu check a_sockname_path: %s\n",
op->o_connid, b->a_sockname_pat.bv_val , 0 );
#else
Debug( LDAP_DEBUG_ACL, "<= check a_sockname_path: %s\n",
b->a_sockname_pat.bv_val, 0, 0 );
#endif
if ( !ber_bvccmp( &b->a_sockname_pat, '*' ) ) {
if ( b->a_sockname_style == ACL_STYLE_REGEX) {
if (!regex_matches( &b->a_sockname_pat, op->o_conn->c_sock_name.bv_val,
@ -1177,14 +1036,8 @@ dn_match_cleanup:;
continue;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu check a_dn_pat: %s\n",
op->o_connid, attr , 0 );
#else
Debug( LDAP_DEBUG_ACL, "<= check a_dn_at: %s\n",
attr, 0, 0);
#endif
bv = op->o_ndn;
/* see if asker is listed in dnattr */
@ -1305,63 +1158,35 @@ dn_match_cleanup:;
}
if ( b->a_authz.sai_ssf ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu check a_authz.sai_ssf: ACL %u > OP %u\n",
op->o_connid, b->a_authz.sai_ssf, op->o_ssf );
#else
Debug( LDAP_DEBUG_ACL, "<= check a_authz.sai_ssf: ACL %u > OP %u\n",
b->a_authz.sai_ssf, op->o_ssf, 0 );
#endif
if ( b->a_authz.sai_ssf > op->o_ssf ) {
continue;
}
}
if ( b->a_authz.sai_transport_ssf ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu check a_authz.sai_transport_ssf: "
"ACL %u > OP %u\n",
op->o_connid, b->a_authz.sai_transport_ssf,
op->o_transport_ssf );
#else
Debug( LDAP_DEBUG_ACL,
"<= check a_authz.sai_transport_ssf: ACL %u > OP %u\n",
b->a_authz.sai_transport_ssf, op->o_transport_ssf, 0 );
#endif
if ( b->a_authz.sai_transport_ssf > op->o_transport_ssf ) {
continue;
}
}
if ( b->a_authz.sai_tls_ssf ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu check a_authz.sai_tls_ssf: ACL %u > "
"OP %u\n",
op->o_connid, b->a_authz.sai_tls_ssf, op->o_tls_ssf );
#else
Debug( LDAP_DEBUG_ACL,
"<= check a_authz.sai_tls_ssf: ACL %u > OP %u\n",
b->a_authz.sai_tls_ssf, op->o_tls_ssf, 0 );
#endif
if ( b->a_authz.sai_tls_ssf > op->o_tls_ssf ) {
continue;
}
}
if ( b->a_authz.sai_sasl_ssf ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu check a_authz.sai_sasl_ssf: "
"ACL %u > OP %u\n",
op->o_connid, b->a_authz.sai_sasl_ssf, op->o_sasl_ssf );
#else
Debug( LDAP_DEBUG_ACL,
"<= check a_authz.sai_sasl_ssf: ACL %u > OP %u\n",
b->a_authz.sai_sasl_ssf, op->o_sasl_ssf, 0 );
#endif
if ( b->a_authz.sai_sasl_ssf > op->o_sasl_ssf ) {
continue;
}
@ -1521,13 +1346,6 @@ dn_match_cleanup:;
modmask = b->a_access_mask;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, RESULTS,
"acl_mask: [%d] applying %s (%s)\n",
i, accessmask2str( modmask, accessmaskbuf),
b->a_type == ACL_CONTINUE ? "continue" : b->a_type == ACL_BREAK
? "break" : "stop" );
#else
Debug( LDAP_DEBUG_ACL,
"<= acl_mask: [%d] applying %s (%s)\n",
i, accessmask2str( modmask, accessmaskbuf ),
@ -1536,7 +1354,6 @@ dn_match_cleanup:;
: b->a_type == ACL_BREAK
? "break"
: "stop" );
#endif
/* save old mask */
oldmask = *mask;
@ -1559,15 +1376,9 @@ dn_match_cleanup:;
*mask = modmask;
}
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_mask: conn %lu [%d] mask: %s\n",
op->o_connid, i, accessmask2str( *mask, accessmaskbuf) );
#else
Debug( LDAP_DEBUG_ACL,
"<= acl_mask: [%d] mask: %s\n",
i, accessmask2str(*mask, accessmaskbuf), 0 );
#endif
if( b->a_type == ACL_CONTINUE ) {
continue;
@ -1583,15 +1394,9 @@ dn_match_cleanup:;
/* implicit "by * none" clause */
ACL_INIT(*mask);
#ifdef NEW_LOGGING
LDAP_LOG( ACL, RESULTS,
"acl_mask: conn %lu no more <who> clauses, returning %d (stop)\n",
op->o_connid, accessmask2str( *mask, accessmaskbuf) , 0 );
#else
Debug( LDAP_DEBUG_ACL,
"<= acl_mask: no more <who> clauses, returning %s (stop)\n",
accessmask2str(*mask, accessmaskbuf), 0, 0 );
#endif
return ACL_STOP;
}
@ -1625,32 +1430,18 @@ acl_check_modlist(
/* short circuit root database access */
if ( be_isroot( op ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_check_modlist: conn %lu access granted to root user\n",
op->o_connid, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"<= acl_access_allowed: granted to database root\n",
0, 0, 0 );
#endif
goto done;
}
/* use backend default access if no backend acls */
if( op->o_bd != NULL && op->o_bd->be_acl == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_check_modlist: backend default %s access %s to \"%s\"\n",
access2str( ACL_WRITE ),
op->o_bd->be_dfltaccess >= ACL_WRITE ? "granted" : "denied",
op->o_dn.bv_val );
#else
Debug( LDAP_DEBUG_ACL,
"=> access_allowed: backend default %s access %s to \"%s\"\n",
access2str( ACL_WRITE ),
op->o_bd->be_dfltaccess >= ACL_WRITE ? "granted" : "denied", op->o_dn.bv_val );
#endif
ret = (op->o_bd->be_dfltaccess >= ACL_WRITE);
goto done;
}
@ -1662,15 +1453,9 @@ acl_check_modlist(
* by the user
*/
if ( is_at_no_user_mod( mlist->sml_desc->ad_type ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"acl_check_modlist: conn %lu no-user-mod %s: modify access granted\n",
op->o_connid, mlist->sml_desc->ad_cname.bv_val , 0 );
#else
Debug( LDAP_DEBUG_ACL, "acl: no-user-mod %s:"
" modify access granted\n",
mlist->sml_desc->ad_cname.bv_val, 0, 0 );
#endif
continue;
}
@ -2302,14 +2087,8 @@ string_expand(
*dp = '\0';
bv->bv_len = size;
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL1,
"string_expand: pattern = %.*s\n", (int)pat->bv_len, pat->bv_val, 0 );
LDAP_LOG( ACL, DETAIL1, "string_expand: expanded = %s\n", bv->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> string_expand: pattern: %.*s\n", (int)pat->bv_len, pat->bv_val, 0 );
Debug( LDAP_DEBUG_TRACE, "=> string_expand: expanded: %s\n", bv->bv_val, 0, 0 );
#endif
}
static int
@ -2335,32 +2114,20 @@ regex_matches(
char error[ACL_BUF_SIZE];
regerror(rc, &re, error, sizeof(error));
#ifdef NEW_LOGGING
LDAP_LOG( ACL, ERR,
"regex_matches: compile( \"%s\", \"%s\") failed %s\n",
pat->bv_val, str, error );
#else
Debug( LDAP_DEBUG_TRACE,
"compile( \"%s\", \"%s\") failed %s\n",
pat->bv_val, str, error );
#endif
return( 0 );
}
rc = regexec(&re, str, 0, NULL, 0);
regfree( &re );
#ifdef NEW_LOGGING
LDAP_LOG( ACL, DETAIL2, "regex_matches: string: %s\n", str, 0, 0 );
LDAP_LOG( ACL, DETAIL2, "regex_matches: rc: %d %s\n",
rc, rc ? "matches" : "no matches", 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"=> regex_matches: string: %s\n", str, 0, 0 );
Debug( LDAP_DEBUG_TRACE,
"=> regex_matches: rc: %d %s\n",
rc, !rc ? "matches" : "no matches", 0 );
#endif
return( !rc );
}

View file

@ -880,15 +880,9 @@ ad_define_option( const char *name, const char *fname, int lineno )
optlen = 0;
do {
if ( !DESC_CHAR( name[optlen] ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: illegal option name \"%s\"\n",
fname, lineno, name );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: illegal option name \"%s\"\n",
fname, lineno, name );
#endif
return 1;
}
} while ( name[++optlen] );
@ -898,15 +892,9 @@ ad_define_option( const char *name, const char *fname, int lineno )
if ( strcasecmp( name, "binary" ) == 0
|| ad_find_option_definition( name, optlen ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: option \"%s\" is already defined\n",
fname, lineno, name );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: option \"%s\" is already defined\n",
fname, lineno, name );
#endif
return 1;
}
@ -924,15 +912,9 @@ ad_define_option( const char *name, const char *fname, int lineno )
options[i].prefix &&
optlen < options[i+1].name.bv_len &&
strncasecmp( name, options[i+1].name.bv_val, optlen ) == 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: option \"%s\" overrides previous option\n",
fname, lineno, name );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: option \"%s\" overrides previous option\n",
fname, lineno, name );
#endif
return 1;
}

View file

@ -55,11 +55,7 @@ do_add( Operation *op, SlapReply *rs )
Modifications **modtail = &modlist;
Modifications tmp;
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ENTRY, "do_add: conn %d enter\n", op->o_connid,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 );
#endif
/*
* Parse the add request. It looks like this:
*
@ -74,12 +70,7 @@ do_add( Operation *op, SlapReply *rs )
/* get the name */
if ( ber_scanf( ber, "{m", /*}*/ &dn ) == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"do_add: conn %d ber_scanf failed\n", op->o_connid,0,0 );
#else
Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 );
#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
return SLAPD_DISCONNECT;
}
@ -90,12 +81,7 @@ do_add( Operation *op, SlapReply *rs )
op->o_tmpmemctx );
if( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"do_add: conn %d invalid dn (%s)\n", op->o_connid, dn.bv_val, 0 );
#else
Debug( LDAP_DEBUG_ANY, "do_add: invalid dn (%s)\n", dn.bv_val, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
goto done;
}
@ -103,12 +89,7 @@ do_add( Operation *op, SlapReply *rs )
ber_dupbv( &e->e_name, &op->o_req_dn );
ber_dupbv( &e->e_nname, &op->o_req_ndn );
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ARGS,
"do_add: conn %d dn (%s)\n", op->o_connid, e->e_dn, 0 );
#else
Debug( LDAP_DEBUG_ARGS, "do_add: dn (%s)\n", e->e_dn, 0, 0 );
#endif
/* get the attrs */
for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
@ -122,26 +103,15 @@ do_add( Operation *op, SlapReply *rs )
rtag = ber_scanf( ber, "{m{W}}", &tmp.sml_type, &tmp.sml_values );
if ( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"do_add: conn %d decoding error \n", op->o_connid, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "do_add: decoding error\n", 0, 0, 0 );
#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
rs->sr_err = SLAPD_DISCONNECT;
goto done;
}
if ( tmp.sml_values == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO,
"do_add: conn %d no values for type %s\n",
op->o_connid, tmp.sml_type.bv_val, 0 );
#else
Debug( LDAP_DEBUG_ANY, "no values for type %s\n",
tmp.sml_type.bv_val, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
"no values for attribute type" );
goto done;
@ -160,24 +130,14 @@ do_add( Operation *op, SlapReply *rs )
}
if ( ber_scanf( ber, /*{*/ "}") == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"do_add: conn %d ber_scanf failed\n", op->o_connid, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 );
#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
rs->sr_err = SLAPD_DISCONNECT;
goto done;
}
if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO,
"do_add: conn %d get_ctrls failed\n", op->o_connid, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 );
#endif
goto done;
}
@ -400,12 +360,7 @@ fe_op_add( Operation *op, SlapReply *rs )
}
}
#endif
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO,
"do_add: conn %d no backend support\n", op->o_connid, 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS, " do_add: no backend support\n", 0, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"operation not supported within namingContext" );
}
@ -687,15 +642,9 @@ static int call_add_preop_plugins( Operation *op )
* A preoperation plugin failure will abort the
* entire operation.
*/
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO,
"do_add: add preoperation plugin failed\n",
0, 0, 0);
#else
Debug(LDAP_DEBUG_TRACE,
"do_add: add preoperation plugin failed.\n",
0, 0, 0);
#endif
if (( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE,
(void *)&rc ) != 0 ) || rc == LDAP_SUCCESS )
@ -715,15 +664,9 @@ static void call_add_postop_plugins( Operation *op )
rc = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_ADD_FN, op->o_pb );
if ( rc < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO,
"do_add: add postoperation plugin failed\n",
0, 0, 0);
#else
Debug(LDAP_DEBUG_TRACE,
"do_add: add postoperation plugin failed\n",
0, 0, 0);
#endif
}
}
#endif /* LDAP_SLAPI */

View file

@ -60,11 +60,7 @@ get_ava(
rtag = ber_scanf( ber, "{mm}", &type, &value );
if( rtag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR, "get_ava: ber_scanf failure\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, " get_ava ber_scanf\n", 0, 0, 0 );
#endif
*text = "Error decoding attribute value assertion";
return SLAPD_DISCONNECT;
}
@ -76,13 +72,8 @@ get_ava(
rc = slap_bv2ad( &type, &aa->aa_desc, text );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"get_ava: unknown attributeType %s\n", type.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER,
"get_ava: unknown attributeType %s\n", type.bv_val, 0, 0 );
#endif
op->o_tmpfree( aa, op->o_tmpmemctx );
return rc;
}
@ -92,13 +83,8 @@ get_ava(
usage, &value, &aa->aa_value, text, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"get_ava: illegal value for attributeType %s\n", type.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER,
"get_ava: illegal value for attributeType %s\n", type.bv_val, 0, 0 );
#endif
op->o_tmpfree( aa, op->o_tmpmemctx );
return rc;
}

View file

@ -53,13 +53,8 @@ bdb_add(Operation *op, SlapReply *rs )
LDAPControl *ctrls[SLAP_MAX_RESPONSE_CONTROLS];
int num_ctrls = 0;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "==> bdb_add: %s\n",
op->oq_add.rs_e->e_name.bv_val, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "==> bdb_add: %s\n",
op->oq_add.rs_e->e_name.bv_val, 0, 0);
#endif
ctrls[num_ctrls] = 0;
@ -67,15 +62,9 @@ bdb_add(Operation *op, SlapReply *rs )
rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e,
NULL, &rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_add: entry failed schema check: %s (%d)\n",
rs->sr_text, rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_add: entry failed schema check: %s (%d)\n",
rs->sr_text, rs->sr_err, 0 );
#endif
goto return_results;
}
@ -89,13 +78,8 @@ bdb_add(Operation *op, SlapReply *rs )
*/
rs->sr_err = bdb_next_id( op->o_bd, NULL, &op->oq_add.rs_e->e_id );
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_add: next_id failed (%d)\n", rs->sr_err, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_add: next_id failed (%d)\n", rs->sr_err, 0, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -126,15 +110,9 @@ retry: /* transaction retry */
bdb->bi_db_opflags );
rs->sr_text = NULL;
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_add: txn_begin failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_add: txn_begin failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -189,13 +167,8 @@ retry: /* transaction retry */
: NULL;
bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p );
p = NULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1, "bdb_add: parent does not exist\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: parent does not exist\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;
send_ldap_result( op, rs );
@ -218,13 +191,8 @@ retry: /* transaction retry */
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_add: no write access to parent\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_add: no write access to parent\n", 0, 0, 0 );
#endif
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
rs->sr_text = "no write access to parent";
goto return_results;;
@ -233,13 +201,8 @@ retry: /* transaction retry */
#ifdef BDB_SUBENTRIES
if ( is_entry_subentry( p ) ) {
/* parent is a subentry, don't allow add */
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_add: parent is subentry\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is subentry\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_OBJECT_CLASS_VIOLATION;
rs->sr_text = "parent is a subentry";
goto return_results;;
@ -248,13 +211,8 @@ retry: /* transaction retry */
#ifdef BDB_ALIASES
if ( is_entry_alias( p ) ) {
/* parent is an alias, don't allow add */
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_add: parent is alias\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is alias\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_ALIAS_PROBLEM;
rs->sr_text = "parent is an alias";
goto return_results;;
@ -266,13 +224,8 @@ retry: /* transaction retry */
rs->sr_matched = p->e_name.bv_val;
rs->sr_ref = get_entry_referrals( op, p );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_add: parent is referral\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is referral\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;
send_ldap_result( op, rs );
@ -304,14 +257,9 @@ retry: /* transaction retry */
if ((( !be_isroot( op ) && !be_shadow_update(op) )
|| pdn.bv_len > 0 ) && !is_entry_glue( op->oq_add.rs_e ))
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1, "bdb_add: %s denied\n",
pdn.bv_len == 0 ? "suffix" : "entry at root", 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: %s denied\n",
pdn.bv_len == 0 ? "suffix" : "entry at root",
0, 0 );
#endif
rs->sr_err = LDAP_NO_SUCH_OBJECT;
goto return_results;
}
@ -335,13 +283,8 @@ retry: /* transaction retry */
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_add: no write access to entry\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: no write access to entry\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
rs->sr_text = "no write access to entry";
goto return_results;;
@ -352,15 +295,9 @@ retry: /* transaction retry */
bdb->bi_db_opflags );
rs->sr_text = NULL;
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_add: txn_begin(2) failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_add: txn_begin(2) failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -369,14 +306,8 @@ retry: /* transaction retry */
/* dn2id index */
rs->sr_err = bdb_dn2id_add( op, lt2, ei, op->oq_add.rs_e );
if ( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_add: dn2id_add failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: dn2id_add failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
@ -394,12 +325,8 @@ retry: /* transaction retry */
/* id2entry index */
rs->sr_err = bdb_id2entry_add( op->o_bd, lt2, op->oq_add.rs_e );
if ( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR, "bdb_add: id2entry_add failed\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: id2entry_add failed\n",
0, 0, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -414,13 +341,8 @@ retry: /* transaction retry */
/* attribute indexes */
rs->sr_err = bdb_index_entry_add( op, lt2, op->oq_add.rs_e );
if ( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_add: index_entry_add failed\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: index_entry_add failed\n",
0, 0, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -457,13 +379,8 @@ retry: /* transaction retry */
if ( slap_read_controls( op, rs, op->oq_add.rs_e,
&slap_post_read_bv, postread_ctrl ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_add: post-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_add: post-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
}
@ -506,15 +423,9 @@ retry: /* transaction retry */
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_ADD );
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_add: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_add: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#endif
}
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
@ -531,27 +442,15 @@ retry: /* transaction retry */
op->o_private = NULL;
if ( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR, "bdb_add: %s : %s (%d)\n",
rs->sr_text, db_strerror(rs->sr_err), rs->sr_err );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n",
rs->sr_text, db_strerror(rs->sr_err), rs->sr_err );
#endif
rs->sr_err = LDAP_OTHER;
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_add: added%s id=%08lx dn=\"%s\"\n",
op->o_noop ? " (no-op)" : "",
op->oq_add.rs_e->e_id, op->oq_add.rs_e->e_dn );
#else
Debug(LDAP_DEBUG_TRACE, "bdb_add: added%s id=%08lx dn=\"%s\"\n",
op->o_noop ? " (no-op)" : "",
op->oq_add.rs_e->e_id, op->oq_add.rs_e->e_dn );
#endif
rs->sr_text = NULL;
if( num_ctrls ) rs->sr_ctrls = ctrls;

View file

@ -188,14 +188,8 @@ bdb_attr_index_config(
return LDAP_INAPPROPRIATE_MATCHING;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, DETAIL1,
"attr_index_config: index %s 0x%04lx\n",
ad->ad_cname.bv_val, mask, 0 );
#else
Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04lx\n",
ad->ad_cname.bv_val, mask, 0 );
#endif
a->ai_desc = ad;

View file

@ -43,13 +43,8 @@ bdb_bind( Operation *op, SlapReply *rs )
u_int32_t locker;
DB_LOCK lock;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS,
"==> bdb_bind: dn: %s\n", op->o_req_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS,
"==> bdb_bind: dn: %s\n", op->o_req_dn.bv_val, 0, 0);
#endif
/* allow noauth binds */
if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op )) {
@ -112,13 +107,8 @@ dn2entry_retry:
#ifdef BDB_SUBENTRIES
if ( is_entry_subentry( e ) ) {
/* entry is an subentry, don't allow bind */
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_bind: entry is subentry\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry is subentry\n", 0,
0, 0 );
#endif
rs->sr_err = LDAP_INVALID_CREDENTIALS;
goto done;
}
@ -127,12 +117,7 @@ dn2entry_retry:
#ifdef BDB_ALIASES
if ( is_entry_alias( e ) ) {
/* entry is an alias, don't allow bind */
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_bind: entry is alias\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0, 0, 0 );
#endif
#if 1
rs->sr_err = LDAP_INVALID_CREDENTIALS;
@ -145,13 +130,8 @@ dn2entry_retry:
#endif
if ( is_entry_referral( e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_bind: entry is referral\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
0, 0 );
#endif
rs->sr_err = LDAP_INVALID_CREDENTIALS;
goto done;
}

View file

@ -89,15 +89,9 @@ bdb_cache_entry_db_relock(
list, 2, NULL );
if (rc && !tryOnly) {
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"bdb_cache_entry_db_relock: entry %ld, rw %d, rc %d\n",
ei->bei_id, rw, rc );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_cache_entry_db_relock: entry %ld, rw %d, rc %d\n",
ei->bei_id, rw, rc );
#endif
} else {
*lock = list[1].lock;
}
@ -129,15 +123,9 @@ bdb_cache_entry_db_lock( DB_ENV *env, u_int32_t locker, EntryInfo *ei,
rc = LOCK_GET(env, locker, tryOnly ? DB_LOCK_NOWAIT : 0,
&lockobj, db_rw, lock);
if (rc && !tryOnly) {
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"bdb_cache_entry_db_lock: entry %ld, rw %d, rc %d\n",
ei->bei_id, rw, rc );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_cache_entry_db_lock: entry %ld, rw %d, rc %d\n",
ei->bei_id, rw, rc );
#endif
}
return rc;
#endif /* NO_THREADS */
@ -1002,13 +990,8 @@ bdb_cache_delete(
/* Lock the parent's kids tree */
bdb_cache_entryinfo_lock( ei->bei_parent );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, ENTRY,
"bdb_cache_delete: delete %ld.\n", e->e_id, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_delete( %ld )\n",
e->e_id, 0, 0 );
#endif
/* set lru mutex */
ldap_pvt_thread_mutex_lock( &cache->lru_mutex );
@ -1117,11 +1100,7 @@ bdb_cache_release_all( Cache *cache )
/* set lru mutex */
ldap_pvt_thread_mutex_lock( &cache->lru_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, ENTRY, "bdb_cache_release_all: enter\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "====> bdb_cache_release_all\n", 0, 0, 0 );
#endif
avl_free( cache->c_dntree.bei_kids, NULL );
avl_free( cache->c_idtree, bdb_entryinfo_release );
@ -1195,13 +1174,8 @@ bdb_txn_get( Operation *op, DB_ENV *env, DB_TXN **txn )
if ( ( rc = ldap_pvt_thread_pool_setkey( ctx, ((char *)env)+1,
*txn, bdb_txn_free ) ) ) {
TXN_ABORT( *txn );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR, "bdb_txn_get: err %s(%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY, "bdb_txn_get: err %s(%d)\n",
db_strerror(rc), rc, 0 );
#endif
return rc;
}
@ -1222,15 +1196,9 @@ bdb_locker_id_free( void *key, void *data )
rc = XLOCK_ID_FREE( env, lockid );
if ( rc == EINVAL ) {
DB_LOCKREQ lr;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_locker_id_free: %d err %s(%d)\n",
lockid, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_locker_id_free: %d err %s(%d)\n",
lockid, db_strerror(rc), rc );
#endif
/* release all locks held by this locker. */
lr.op = DB_LOCK_PUT_ALL;
lr.obj = NULL;
@ -1273,13 +1241,8 @@ bdb_locker_id( Operation *op, DB_ENV *env, int *locker )
if ( ( rc = ldap_pvt_thread_pool_setkey( ctx, env,
data, bdb_locker_id_free ) ) ) {
XLOCK_ID_FREE( env, lockid );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR, "bdb_locker_id: err %s(%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY, "bdb_locker_id: err %s(%d)\n",
db_strerror(rc), rc, 0 );
#endif
return rc;
}

View file

@ -93,13 +93,8 @@ dn2entry_retry:
/* entry is a referral, don't allow add */
rs->sr_ref = get_entry_referrals( op, e );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_compare: entry is referral\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;
rs->sr_matched = e->e_name.bv_val;

View file

@ -195,58 +195,34 @@ bdb_db_config(
int se_id = 0, se_size = 0;
struct slap_session_entry *sent;
if ( argc < 3 ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: missing arguments in \"sessionlog <id> <size>\""
" line.\n", fname, lineno , 0 );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing arguments in \"sessionlog <id> <size>\""
" line\n", fname, lineno, 0 );
#endif
return( 1 );
}
se_id = atoi( argv[1] );
if ( se_id < 0 || se_id > 999 ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: session log id %d is out of range [0..999]\n",
fname, lineno , se_id );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: session log id %d is out of range [0..999]\n",
fname, lineno , se_id );
#endif
return( 1 );
}
se_size = atoi( argv[2] );
if ( se_size < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: session log size %d is negative\n",
fname, lineno , se_size );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: session log size %d is negative\n",
fname, lineno , se_size );
#endif
return( 1 );
}
LDAP_LIST_FOREACH( sent, &bdb->bi_session_list, se_link ) {
if ( sent->se_id == se_id ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: session %d already exists\n",
fname, lineno , se_id );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: session %d already exists\n",
fname, lineno , se_id );
#endif
return( 1 );
}
}

View file

@ -107,13 +107,8 @@ bdb_csn_commit(
&rs->sr_text, textbuf, textlen );
op->o_tmpfree( max_committed_csn.bv_val, op->o_tmpmemctx );
if ( ret != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_csn_commit: modify failed (%d)\n", rs->sr_err, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_csn_commit: modify failed (%d)\n", rs->sr_err, 0, 0 );
#endif
switch( ret ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -151,13 +146,8 @@ bdb_csn_commit(
/* This serializes add. But this case is very rare : only once. */
rs->sr_err = bdb_next_id( op->o_bd, tid, &ctxcsn_id );
if ( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_add: next_id failed (%d)\n", rs->sr_err, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_add: next_id failed (%d)\n", rs->sr_err, 0, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
return BDB_CSN_ABORT;
@ -216,13 +206,8 @@ bdb_csn_commit(
break;
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"bdb_csn_commit : bdb_dn2entry retry\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_csn_commit : bdb_dn2entry retry\n", 0, 0, 0 );
#endif
goto rewind;
case LDAP_BUSY:
rs->sr_err = rc;

View file

@ -100,15 +100,9 @@ bdb_db_cache(
rc = db_create( &db->bdi_db, bdb->bi_dbenv, 0 );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( CACHE, ERR,
"bdb_db_cache: db_create(%s) failed: %s (%d)\n",
bdb->bi_dbenv_home, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_cache: db_create(%s) failed: %s (%d)\n",
bdb->bi_dbenv_home, db_strerror(rc), rc );
#endif
ldap_pvt_thread_mutex_unlock( &bdb->bi_database_mutex );
return rc;
}
@ -134,15 +128,9 @@ bdb_db_cache(
ch_free( file );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( CACHE, ERR,
"bdb_db_cache: db_open(%s) failed: %s (%d)\n",
name, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_cache: db_open(%s) failed: %s (%d)\n",
name, db_strerror(rc), rc );
#endif
ldap_pvt_thread_mutex_unlock( &bdb->bi_database_mutex );
return rc;
}

View file

@ -57,13 +57,8 @@ bdb_delete( Operation *op, SlapReply *rs )
ctrls[num_ctrls] = 0;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS, "==> bdb_delete: %s\n",
op->o_req_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS, "==> bdb_delete: %s\n",
op->o_req_dn.bv_val, 0, 0 );
#endif
if( 0 ) {
retry: /* transaction retry */
@ -75,13 +70,8 @@ retry: /* transaction retry */
bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p);
p = NULL;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==> bdb_delete: retrying...\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "==> bdb_delete: retrying...\n",
0, 0, 0 );
#endif
rs->sr_err = TXN_ABORT( ltid );
ltid = NULL;
op->o_private = NULL;
@ -102,15 +92,9 @@ retry: /* transaction retry */
bdb->bi_db_opflags );
rs->sr_text = NULL;
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"==> bdb_delete: txn_begin failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: txn_begin failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -158,14 +142,9 @@ retry: /* transaction retry */
/* FIXME : dn2entry() should return non-glue entry */
if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ARGS,
"<=- bdb_delete: no such object %s\n", op->o_req_dn.bv_val, 0, 0);
#else
Debug( LDAP_DEBUG_ARGS,
"<=- bdb_delete: no such object %s\n",
op->o_req_dn.bv_val, 0, 0);
#endif
if ( matched != NULL ) {
rs->sr_matched = ch_strdup( matched->e_dn );
@ -222,14 +201,9 @@ retry: /* transaction retry */
if ( pdn.bv_len != 0 ) {
if( p == NULL || !bvmatch( &pdn, &p->e_nname )) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: parent does not exist\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: parent does not exist\n",
0, 0, 0);
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "could not locate parent of entry";
goto return_results;
@ -246,14 +220,9 @@ retry: /* transaction retry */
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: no write access to parent\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: no write access to parent\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
rs->sr_text = "no write access to parent";
goto return_results;
@ -279,28 +248,18 @@ retry: /* transaction retry */
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: no access to parent\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: no access "
"to parent\n", 0, 0, 0 );
#endif
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
rs->sr_text = "no write access to parent";
goto return_results;
}
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: no parent and not root\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: no parent "
"and not root\n", 0, 0, 0);
#endif
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
goto return_results;
}
@ -324,14 +283,9 @@ retry: /* transaction retry */
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: no write access to entry\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: no write access to entry\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
rs->sr_text = "no write access to entry";
goto return_results;
@ -341,13 +295,8 @@ retry: /* transaction retry */
/* entry is a referral, don't allow delete */
rs->sr_ref = get_entry_referrals( op, e );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: entry is referral\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: entry is referral\n", 0, 0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;
rs->sr_matched = e->e_name.bv_val;
@ -370,13 +319,8 @@ retry: /* transaction retry */
if( slap_read_controls( op, rs, e,
&slap_pre_read_bv, preread_ctrl ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: pre-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: pre-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
}
@ -386,14 +330,9 @@ retry: /* transaction retry */
bdb->bi_db_opflags );
rs->sr_text = NULL;
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_delete: txn_begin(2) failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: txn_begin(2) failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -407,27 +346,16 @@ retry: /* transaction retry */
case DB_LOCK_NOTGRANTED:
goto retry;
case 0:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_delete: non-leaf %s\n", op->o_req_dn.bv_val, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_delete: non-leaf %s\n",
op->o_req_dn.bv_val, 0, 0);
#endif
rs->sr_err = LDAP_NOT_ALLOWED_ON_NONLEAF;
rs->sr_text = "subtree delete not supported";
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_delete: has_children failed %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_delete: has_children failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
}
@ -437,15 +365,9 @@ retry: /* transaction retry */
/* delete from dn2id */
rs->sr_err = bdb_dn2id_delete( op, lt2, eip, e );
if ( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_delete: dn2id failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_TRACE,
"<=- bdb_delete: dn2id failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -459,15 +381,9 @@ retry: /* transaction retry */
/* delete from id2entry */
rs->sr_err = bdb_id2entry_delete( op->o_bd, lt2, e );
if ( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_delete: id2entry failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_TRACE,
"<=- bdb_delete: id2entry failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -481,15 +397,9 @@ retry: /* transaction retry */
/* delete indices for old attributes */
rs->sr_err = bdb_index_entry_del( op, lt2, e );
if ( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_delete: index failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_delete: index failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -511,15 +421,9 @@ retry: /* transaction retry */
case 0:
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_delete: has_children failed %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_delete: has_children failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -596,15 +500,9 @@ retry: /* transaction retry */
LDAP_LIST_FOREACH( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_DELETE );
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_delete: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#endif
}
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
@ -616,34 +514,20 @@ retry: /* transaction retry */
op->o_private = NULL;
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_delete: txn_%s failed: %s (%d)\n",
op->o_noop ? "abort (no-op)" : "commit",
db_strerror(rs->sr_err), rs->sr_err );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: txn_%s failed: %s (%d)\n",
op->o_noop ? "abort (no-op)" : "commit",
db_strerror(rs->sr_err), rs->sr_err );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "commit failed";
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_delete: deleted%s id=%08lx db=\"%s\"\n",
op->o_noop ? " (no-op)" : "",
e->e_id, e->e_dn );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: deleted%s id=%08lx dn=\"%s\"\n",
op->o_noop ? " (no-op)" : "",
e->e_id, e->e_dn );
#endif
rs->sr_err = LDAP_SUCCESS;
rs->sr_text = NULL;
if( num_ctrls ) rs->sr_ctrls = ctrls;

View file

@ -40,12 +40,8 @@ bdb_dn2entry(
EntryInfo *ei = NULL;
int rc, rc2;
#ifdef NEW_LOGGING
LDAP_LOG ( CACHE, ARGS, "bdb_dn2entry(\"%s\")\n", dn->bv_val, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "bdb_dn2entry(\"%s\")\n",
dn->bv_val, 0, 0 );
#endif
*e = NULL;

View file

@ -38,13 +38,8 @@ bdb_dn2id_add(
char *buf;
struct berval ptr, pdn;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "bdb_dn2id_add( \"%s\", 0x%08lx )\n",
e->e_ndn, (long) e->e_id, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_add( \"%s\", 0x%08lx )\n",
e->e_ndn, (long) e->e_id, 0 );
#endif
assert( e->e_id != NOID );
DBTzero( &key );
@ -66,13 +61,8 @@ bdb_dn2id_add(
/* store it -- don't override */
rc = db->put( db, txn, &key, &data, DB_NOOVERWRITE );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR, "bdb_dn2id_add: put failed: %s %d\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_add: put failed: %s %d\n",
db_strerror(rc), rc, 0 );
#endif
goto done;
}
@ -83,15 +73,9 @@ bdb_dn2id_add(
buf[0] = DN_SUBTREE_PREFIX;
rc = db->put( db, txn, &key, &data, DB_NOOVERWRITE );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR,
"=> bdb_dn2id_add: subtree (%s) put failed: %d\n",
ptr.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_dn2id_add: subtree (%s) put failed: %d\n",
ptr.bv_val, rc, 0 );
#endif
goto done;
}
@ -110,15 +94,9 @@ bdb_dn2id_add(
rc = bdb_idl_insert_key( op->o_bd, db, txn, &key, e->e_id );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR,
"=> bdb_dn2id_add: parent (%s) insert failed: %d\n",
ptr.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_dn2id_add: parent (%s) insert failed: %d\n",
ptr.bv_val, rc, 0 );
#endif
goto done;
}
}
@ -134,15 +112,9 @@ bdb_dn2id_add(
rc = bdb_idl_insert_key( op->o_bd, db, txn, &key, e->e_id );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR,
"=> bdb_dn2id_add: subtree (%s) insert failed: %d\n",
ptr.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_dn2id_add: subtree (%s) insert failed: %d\n",
ptr.bv_val, rc, 0 );
#endif
break;
}
#ifdef BDB_MULTIPLE_SUFFIXES
@ -159,11 +131,7 @@ bdb_dn2id_add(
done:
op->o_tmpfree( buf, op->o_tmpmemctx );
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS, "<= bdb_dn2id_add: %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_add: %d\n", rc, 0, 0 );
#endif
return rc;
}
@ -181,13 +149,8 @@ bdb_dn2id_delete(
char *buf;
struct berval pdn, ptr;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS,
"=> bdb_dn2id_delete ( \"%s\", 0x%08lx )\n", e->e_ndn, e->e_id, 0);
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_delete( \"%s\", 0x%08lx )\n",
e->e_ndn, e->e_id, 0 );
#endif
DBTzero( &key );
key.size = e->e_nname.bv_len + 2;
@ -203,14 +166,8 @@ bdb_dn2id_delete(
/* delete it */
rc = db->del( db, txn, &key, 0 );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR,
"=> bdb_dn2id_delete: delete failed: %s %d\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_dn2id_delete: delete failed: %s %d\n",
db_strerror(rc), rc, 0 );
#endif
goto done;
}
@ -221,15 +178,9 @@ bdb_dn2id_delete(
buf[0] = DN_SUBTREE_PREFIX;
rc = db->del( db, txn, &key, 0 );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR,
"=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n",
ptr.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n",
ptr.bv_val, rc, 0 );
#endif
goto done;
}
@ -248,15 +199,9 @@ bdb_dn2id_delete(
rc = bdb_idl_delete_key( op->o_bd, db, txn, &key, e->e_id );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR,
"=> bdb_dn2id_delete: parent (%s) delete failed: %d\n",
ptr.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_dn2id_delete: parent (%s) delete failed: %d\n",
ptr.bv_val, rc, 0 );
#endif
goto done;
}
}
@ -271,15 +216,9 @@ bdb_dn2id_delete(
rc = bdb_idl_delete_key( op->o_bd, db, txn, &key, e->e_id );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR,
"=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n",
ptr.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n",
ptr.bv_val, rc, 0 );
#endif
goto done;
}
#ifdef BDB_MULTIPLE_SUFFIXES
@ -296,11 +235,7 @@ bdb_dn2id_delete(
done:
op->o_tmpfree( buf, op->o_tmpmemctx );
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS, "<= bdb_dn2id_delete %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_delete %d\n", rc, 0, 0 );
#endif
return rc;
}
@ -316,11 +251,7 @@ bdb_dn2id(
struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
DB *db = bdb->bi_dn2id->bdi_db;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_dn2id( \"%s\" )\n", dn->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id( \"%s\" )\n", dn->bv_val, 0, 0 );
#endif
DBTzero( &key );
key.size = dn->bv_len + 2;
key.data = op->o_tmpalloc( key.size, op->o_tmpmemctx );
@ -337,21 +268,11 @@ bdb_dn2id(
rc = db->get( db, txn, &key, &data, bdb->bi_db_opflags );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR, "<= bdb_dn2id: get failed %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: get failed: %s (%d)\n",
db_strerror( rc ), rc, 0 );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_dn2id: got id=0x%08lx\n", ei->bei_id, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: got id=0x%08lx\n",
ei->bei_id, 0, 0 );
#endif
}
op->o_tmpfree( key.data, op->o_tmpmemctx );
@ -370,13 +291,8 @@ bdb_dn2id_children(
ID id;
int rc;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS,
"=> bdb_dn2id_children( %s )\n", e->e_nname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id_children( %s )\n",
e->e_nname.bv_val, 0, 0 );
#endif
DBTzero( &key );
key.size = e->e_nname.bv_len + 2;
key.data = op->o_tmpalloc( key.size, op->o_tmpmemctx );
@ -401,17 +317,10 @@ bdb_dn2id_children(
rc = db->get( db, txn, &key, &data, bdb->bi_db_opflags );
op->o_tmpfree( key.data, op->o_tmpmemctx );
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, DETAIL1,
"<= bdb_dn2id_children( %s ): %s (%d)\n",
e->e_nname.bv_val, rc == 0 ? "" : ( rc == DB_NOTFOUND ? "no " :
db_strerror(rc)), rc );
#else
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id_children( %s ): %s (%d)\n",
e->e_nname.bv_val,
rc == 0 ? "" : ( rc == DB_NOTFOUND ? "no " :
db_strerror(rc) ), rc );
#endif
return rc;
}
@ -430,13 +339,8 @@ bdb_dn2idl(
int prefix = ( op->ors_scope == LDAP_SCOPE_ONELEVEL )
? DN_ONE_PREFIX : DN_SUBTREE_PREFIX;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_dn2ididl( \"%s\" )\n",
e->e_nname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2idl( \"%s\" )\n",
e->e_nname.bv_val, 0, 0 );
#endif
#ifndef BDB_MULTIPLE_SUFFIXES
if ( prefix == DN_SUBTREE_PREFIX && BEI(e)->bei_parent->bei_id == 0 ) {
@ -456,27 +360,15 @@ bdb_dn2idl(
rc = bdb_idl_fetch_key( op->o_bd, db, NULL, &key, ids );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR,
"<= bdb_dn2ididl: get failed: %s (%d)\n", db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_dn2idl: get failed: %s (%d)\n",
db_strerror( rc ), rc, 0 );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_dn2ididl: id=%ld first=%ld last=%ld\n",
(long) ids[0], (long) BDB_IDL_FIRST( ids ),
(long) BDB_IDL_LAST( ids ) );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_dn2idl: id=%ld first=%ld last=%ld\n",
(long) ids[0],
(long) BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ) );
#endif
}
op->o_tmpfree( key.data, op->o_tmpmemctx );
@ -1085,13 +977,8 @@ hdb_dn2idl(
struct bdb_info *bdb = (struct bdb_info *)op->o_bd->be_private;
struct dn2id_cookie cx;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS,
"=> hdb_dn2ididl( \"%s\" )\n", e->e_nname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> hdb_dn2idl( \"%s\" )\n",
e->e_nname.bv_val, 0, 0 );
#endif
#ifndef BDB_MULTIPLE_SUFFIXES
if ( op->ors_scope != LDAP_SCOPE_ONELEVEL &&

View file

@ -28,11 +28,7 @@ void bdb_errcall( const char *pfx, char * msg )
if ( msg[0] > 0x7f )
__etoa( msg );
#endif
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, INFO, "bdb(%s): %s\n", pfx, msg, 0 );
#else
Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
#endif
}
#ifdef HAVE_EBCDIC

View file

@ -60,11 +60,7 @@ bdb_filter_candidates(
ID *stack )
{
int rc = 0;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ENTRY, "=> bdb_filter_candidates\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "=> bdb_filter_candidates\n", 0, 0, 0 );
#endif
#if 0
char *subtree="SUBTREE";
#endif
@ -91,12 +87,7 @@ bdb_filter_candidates(
break;
#if 0 /* Not used any more, search calls bdb_dn2idl directly */
case SLAPD_FILTER_DN_ONE:
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN ONE\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tDN ONE\n", 0, 0, 0 );
#endif
rc = bdb_dn2idl( op->o_bd, f->f_dn, DN_ONE_PREFIX, ids,
stack, op->o_tmpmemctx );
if( rc == DB_NOTFOUND ) {
@ -109,139 +100,78 @@ bdb_filter_candidates(
subtree="CHILDREN";
/* Fall Thru */
case SLAPD_FILTER_DN_SUBTREE:
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN %s\n",
subtree, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tDN %s\n",
subtree, 0, 0 );
#endif
rc = bdb_dn2idl( op->o_bd, f->f_dn, DN_SUBTREE_PREFIX, ids,
stack, op->o_tmpmemctx );
break;
#endif
case LDAP_FILTER_PRESENT:
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tPRESENT\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 );
#endif
rc = presence_candidates( op, f->f_desc, ids );
break;
case LDAP_FILTER_EQUALITY:
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tEQUALITY\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 );
#endif
rc = equality_candidates( op, f->f_ava, ids, tmp );
break;
case LDAP_FILTER_APPROX:
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAPPROX\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 );
#endif
rc = approx_candidates( op, f->f_ava, ids, tmp );
break;
case LDAP_FILTER_SUBSTRINGS:
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tSUBSTRINGS\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 );
#endif
rc = substring_candidates( op, f->f_sub, ids, tmp );
break;
case LDAP_FILTER_GE:
/* no GE index, use pres */
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tGE\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 );
#endif
rc = presence_candidates( op, f->f_ava->aa_desc, ids );
break;
case LDAP_FILTER_LE:
/* no LE index, use pres */
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tLE\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 );
#endif
rc = presence_candidates( op, f->f_ava->aa_desc, ids );
break;
case LDAP_FILTER_NOT:
/* no indexing to support NOT filters */
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tNOT\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 );
#endif
{ struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
BDB_IDL_ALL( bdb, ids );
}
break;
case LDAP_FILTER_AND:
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAND\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 );
#endif
rc = list_candidates( op,
f->f_and, LDAP_FILTER_AND, ids, tmp, stack );
break;
case LDAP_FILTER_OR:
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tOR\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 );
#endif
rc = list_candidates( op,
f->f_or, LDAP_FILTER_OR, ids, tmp, stack );
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tUNKNOWN\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tUNKNOWN %lu\n",
(unsigned long) f->f_choice, 0, 0 );
#endif
/* Must not return NULL, otherwise extended filters break */
{ struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
BDB_IDL_ALL( bdb, ids );
}
}
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_filter_candidates: id=%ld first=%ld last=%ld\n",
(long)ids[0], (long)BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ));
#else
Debug( LDAP_DEBUG_FILTER,
"<= bdb_filter_candidates: id=%ld first=%ld last=%ld\n",
(long) ids[0],
(long) BDB_IDL_FIRST( ids ),
(long) BDB_IDL_LAST( ids ) );
#endif
return rc;
}
@ -259,11 +189,7 @@ list_candidates(
int rc = 0;
Filter *f;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "=> bdb_list_candidates: 0x%x\n", ftype, 0 , 0 );
#else
Debug( LDAP_DEBUG_FILTER, "=> bdb_list_candidates 0x%x\n", ftype, 0, 0 );
#endif
for ( f = flist; f != NULL; f = f->f_next ) {
/* ignore precomputed scopes */
if ( f->f_choice == SLAPD_FILTER_COMPUTED &&
@ -301,27 +227,16 @@ list_candidates(
}
if( rc == LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_list_candidates: id=%ld first=%ld last=%ld\n",
(long) ids[0], (long) BDB_IDL_FIRST( ids ),
(long) BDB_IDL_LAST( ids ) );
#else
Debug( LDAP_DEBUG_FILTER,
"<= bdb_list_candidates: id=%ld first=%ld last=%ld\n",
(long) ids[0],
(long) BDB_IDL_FIRST(ids),
(long) BDB_IDL_LAST(ids) );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ARGS, "<= bdb_list_candidates: rc=%d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER,
"<= bdb_list_candidates: undefined rc=%d\n",
rc, 0, 0 );
#endif
}
return rc;
@ -339,13 +254,8 @@ presence_candidates(
slap_mask_t mask;
struct berval prefix = {0, NULL};
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ENTRY, "=> bdb_presence_candidates (%s)\n",
desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_presence_candidates (%s)\n",
desc->ad_cname.bv_val, 0, 0 );
#endif
BDB_IDL_ALL( bdb, ids );
@ -357,44 +267,25 @@ presence_candidates(
&db, &mask, &prefix );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_presence_candidates: (%s) index_param "
"returned=%d\n",
desc->ad_cname.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_presence_candidates: (%s) index_param "
"returned=%d\n",
desc->ad_cname.bv_val, rc, 0 );
#endif
return 0;
}
if( db == NULL ) {
/* not indexed */
#ifdef NEW_LOGGING
LDAP_LOG(INDEX, RESULTS,
"<= bdb_presence_candidates: (%s) not indexed\n",
desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_presence_candidates: (%s) not indexed\n",
desc->ad_cname.bv_val, 0, 0 );
#endif
return 0;
}
if( prefix.bv_val == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(INDEX, RESULTS,
"<= bdb_presence_candidates: (%s) no prefix\n",
desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_presence_candidates: (%s) no prefix\n",
desc->ad_cname.bv_val, 0, 0 );
#endif
return -1;
}
@ -404,31 +295,18 @@ presence_candidates(
BDB_IDL_ZERO( ids );
rc = 0;
} else if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_presence_candidates: (%s) "
"key read failed (%d)\n",
desc->ad_cname.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_presense_candidates: (%s) "
"key read failed (%d)\n",
desc->ad_cname.bv_val, rc, 0 );
#endif
goto done;
}
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n",
(long)ids[0], (long)BDB_IDL_FIRST( ids ), (long)BDB_IDL_LAST( ids ) );
#else
Debug(LDAP_DEBUG_TRACE,
"<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n",
(long) ids[0],
(long) BDB_IDL_FIRST(ids),
(long) BDB_IDL_LAST(ids) );
#endif
done:
return rc;
@ -450,13 +328,8 @@ equality_candidates(
struct berval *keys = NULL;
MatchingRule *mr;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ENTRY, "=> bdb_equality_candidates (%s)\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_equality_candidates (%s)\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#endif
BDB_IDL_ALL( bdb, ids );
@ -464,30 +337,17 @@ equality_candidates(
&db, &mask, &prefix );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_equality_candidates: (%s) "
"index_param failed (%d)\n",
ava->aa_desc->ad_cname.bv_val, rc, 0);
#else
Debug( LDAP_DEBUG_ANY,
"<= bdb_equality_candidates: (%s) "
"index_param failed (%d)\n",
ava->aa_desc->ad_cname.bv_val, rc, 0 );
#endif
return 0;
}
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(INDEX, RESULTS,
"<= bdb_equality_candidates: (%s) not indexed\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= bdb_equality_candidates: (%s) not indexed\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#endif
return 0;
}
@ -510,30 +370,17 @@ equality_candidates(
&keys, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_equality_candidates: (%s, %s) "
"MR filter failed (%d)\n",
prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_equality_candidates: (%s, %s) "
"MR filter failed (%d)\n",
prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
#endif
return 0;
}
if( keys == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_equality_candidates: (%s) no keys\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_equality_candidates: (%s) no keys\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#endif
return 0;
}
@ -545,30 +392,17 @@ equality_candidates(
rc = 0;
break;
} else if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_equality_candidates: (%s) "
"key read failed (%d)\n",
ava->aa_desc->ad_cname.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_equality_candidates: (%s) "
"key read failed (%d)\n",
ava->aa_desc->ad_cname.bv_val, rc, 0 );
#endif
break;
}
if( BDB_IDL_IS_ZERO( tmp ) ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_equality_candidates: (%s) NULL\n",
ava->aa_desc->ad_cname.bv_val, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_equality_candidates: (%s) NULL\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#endif
BDB_IDL_ZERO( ids );
break;
}
@ -585,18 +419,11 @@ equality_candidates(
ber_bvarray_free_x( keys, op->o_tmpmemctx );
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_equality_candidates: id=%ld first=%ld last=%ld\n",
(long) ids[0], (long) BDB_IDL_FIRST( ids ),
(long) BDB_IDL_LAST( ids ) );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_equality_candidates: id=%ld, first=%ld, last=%ld\n",
(long) ids[0],
(long) BDB_IDL_FIRST(ids),
(long) BDB_IDL_LAST(ids) );
#endif
return( rc );
}
@ -617,13 +444,8 @@ approx_candidates(
struct berval *keys = NULL;
MatchingRule *mr;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ENTRY, "=> bdb_approx_candidates (%s)\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_approx_candidates (%s)\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#endif
BDB_IDL_ALL( bdb, ids );
@ -631,30 +453,17 @@ approx_candidates(
&db, &mask, &prefix );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_approx_candidates: (%s) "
"index_param failed (%d)\n",
ava->aa_desc->ad_cname.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= bdb_approx_candidates: (%s) "
"index_param failed (%d)\n",
ava->aa_desc->ad_cname.bv_val, rc, 0 );
#endif
return 0;
}
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(INDEX, RESULTS,
"<= bdb_approx_candidates: (%s) not indexed\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= bdb_approx_candidates: (%s) not indexed\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#endif
return 0;
}
@ -682,30 +491,17 @@ approx_candidates(
&keys, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_approx_candidates: (%s, %s) "
"MR filter failed (%d)\n",
prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_approx_candidates: (%s, %s) "
"MR filter failed (%d)\n",
prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
#endif
return 0;
}
if( keys == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_approx_candidates: (%s) no keys (%s)\n",
prefix.bv_val, ava->aa_desc->ad_cname.bv_val, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_approx_candidates: (%s) no keys (%s)\n",
prefix.bv_val, ava->aa_desc->ad_cname.bv_val, 0 );
#endif
return 0;
}
@ -717,30 +513,17 @@ approx_candidates(
rc = 0;
break;
} else if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_approx_candidates: (%s) "
"key read failed (%d)\n",
ava->aa_desc->ad_cname.bv_val, rc, 0);
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_approx_candidates: (%s) "
"key read failed (%d)\n",
ava->aa_desc->ad_cname.bv_val, rc, 0 );
#endif
break;
}
if( BDB_IDL_IS_ZERO( tmp ) ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_approx_candidates: (%s) NULL\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_approx_candidates: (%s) NULL\n",
ava->aa_desc->ad_cname.bv_val, 0, 0 );
#endif
BDB_IDL_ZERO( ids );
break;
}
@ -757,17 +540,10 @@ approx_candidates(
ber_bvarray_free_x( keys, op->o_tmpmemctx );
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_approx_candidates: id=%ld first=%ld last=%ld\n",
(long) ids[0], (long) BDB_IDL_FIRST( ids ),
(long) BDB_IDL_LAST( ids ) );
#else
Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates %ld, first=%ld, last=%ld\n",
(long) ids[0],
(long) BDB_IDL_FIRST(ids),
(long) BDB_IDL_LAST(ids) );
#endif
return( rc );
}
@ -787,13 +563,8 @@ substring_candidates(
struct berval *keys = NULL;
MatchingRule *mr;
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ENTRY, "=> bdb_substring_candidates (%s)\n",
sub->sa_desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_substring_candidates (%s)\n",
sub->sa_desc->ad_cname.bv_val, 0, 0 );
#endif
BDB_IDL_ALL( bdb, ids );
@ -801,30 +572,17 @@ substring_candidates(
&db, &mask, &prefix );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_substring_candidates: (%s) "
"index_param failed (%d)\n",
sub->sa_desc->ad_cname.bv_val, rc, 0);
#else
Debug( LDAP_DEBUG_ANY,
"<= bdb_substring_candidates: (%s) "
"index_param failed (%d)\n",
sub->sa_desc->ad_cname.bv_val, rc, 0 );
#endif
return 0;
}
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_substring_candidates: (%s) not indexed\n",
sub->sa_desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= bdb_substring_candidates: (%s) not indexed\n",
sub->sa_desc->ad_cname.bv_val, 0, 0 );
#endif
return 0;
}
@ -848,30 +606,17 @@ substring_candidates(
&keys, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_substring_candidates: (%s) "
"MR filter failed (%d)\n",
sub->sa_desc->ad_cname.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_substring_candidates: (%s) "
"MR filter failed (%d)\n",
sub->sa_desc->ad_cname.bv_val, rc, 0 );
#endif
return 0;
}
if( keys == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_substring_candidates: (0x%04lx) no keys (%s)\n",
mask, sub->sa_desc->ad_cname.bv_val, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_substring_candidates: (0x%04lx) no keys (%s)\n",
mask, sub->sa_desc->ad_cname.bv_val, 0 );
#endif
return 0;
}
@ -883,30 +628,17 @@ substring_candidates(
rc = 0;
break;
} else if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_substring_candidates: (%s) "
"key read failed (%d)\n",
sub->sa_desc->ad_cname.bv_val, rc, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_substring_candidates: (%s) "
"key read failed (%d)\n",
sub->sa_desc->ad_cname.bv_val, rc, 0 );
#endif
break;
}
if( BDB_IDL_IS_ZERO( tmp ) ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_substring_candidates: (%s) NULL\n",
sub->sa_desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= bdb_substring_candidates: (%s) NULL\n",
sub->sa_desc->ad_cname.bv_val, 0, 0 );
#endif
BDB_IDL_ZERO( ids );
break;
}
@ -923,17 +655,10 @@ substring_candidates(
ber_bvarray_free_x( keys, op->o_tmpmemctx );
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, RESULTS,
"<= bdb_substring_candidates: id=%ld first=%ld last=%ld\n",
(long) ids[0], (long) BDB_IDL_FIRST( ids ),
(long) BDB_IDL_LAST( ids ) );
#else
Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates: %ld, first=%ld, last=%ld\n",
(long) ids[0],
(long) BDB_IDL_FIRST(ids),
(long) BDB_IDL_LAST(ids) );
#endif
return( rc );
}

View file

@ -250,19 +250,11 @@ int bdb_entry_get(
DB_LOCK lock;
int free_lock_id = 0;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ARGS,
"bdb_entry_get: ndn: \"%s\"\n", ndn->bv_val, 0, 0 );
LDAP_LOG( BACK_BDB, ARGS,
"bdb_entry_get: oc: \"%s\", at: \"%s\"\n",
oc ? oc->soc_cname.bv_val : "(null)", at_name, 0);
#else
Debug( LDAP_DEBUG_ARGS,
"=> bdb_entry_get: ndn: \"%s\"\n", ndn->bv_val, 0, 0 );
Debug( LDAP_DEBUG_ARGS,
"=> bdb_entry_get: oc: \"%s\", at: \"%s\"\n",
oc ? oc->soc_cname.bv_val : "(null)", at_name, 0);
#endif
if( op ) boi = (struct bdb_op_info *) op->o_private;
if( boi != NULL && op->o_bd->be_private == boi->boi_bdb->be_private ) {
@ -308,66 +300,40 @@ dn2entry_retry:
}
if (ei) e = ei->bei_e;
if (e == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, INFO,
"bdb_entry_get: cannot find entry (%s)\n",
ndn->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"=> bdb_entry_get: cannot find entry: \"%s\"\n",
ndn->bv_val, 0, 0 );
#endif
if ( free_lock_id ) {
LOCK_ID_FREE( bdb->bi_dbenv, locker );
}
return LDAP_NO_SUCH_OBJECT;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, DETAIL1, "bdb_entry_get: found entry (%s)\n",
ndn->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"=> bdb_entry_get: found entry: \"%s\"\n",
ndn->bv_val, 0, 0 );
#endif
#ifdef BDB_ALIASES
/* find attribute values */
if( is_entry_alias( e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, INFO,
"bdb_entry_get: entry (%s) is an alias\n", e->e_name.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"<= bdb_entry_get: entry is an alias\n", 0, 0, 0 );
#endif
rc = LDAP_ALIAS_PROBLEM;
goto return_results;
}
#endif
if( is_entry_referral( e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, INFO,
"bdb_entry_get: entry (%s) is a referral.\n", e->e_name.bv_val, 0, 0);
#else
Debug( LDAP_DEBUG_ACL,
"<= bdb_entry_get: entry is a referral\n", 0, 0, 0 );
#endif
rc = LDAP_REFERRAL;
goto return_results;
}
if ( oc && !is_entry_objectclass( e, oc, 0 )) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, INFO,
"bdb_entry_get: failed to find objectClass.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"<= bdb_entry_get: failed to find objectClass\n",
0, 0, 0 );
#endif
rc = LDAP_NO_SUCH_ATTRIBUTE;
goto return_results;
}
@ -400,12 +366,8 @@ return_results:
LOCK_ID_FREE( bdb->bi_dbenv, locker );
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ENTRY, "bdb_entry_get: rc=%d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_entry_get: rc=%d\n",
rc, 0, 0 );
#endif
return(rc);
}

View file

@ -80,34 +80,20 @@ static void idl_check( ID *ids )
static void idl_dump( ID *ids )
{
if( BDB_IDL_IS_RANGE( ids ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, INFO, "IDL: range (%ld - %ld)\n",
(long) BDB_IDL_RANGE_FIRST( ids ),
(long) BDB_IDL_RANGE_LAST( ids ), 0 );
#else
Debug( LDAP_DEBUG_ANY,
"IDL: range ( %ld - %ld )\n",
(long) BDB_IDL_RANGE_FIRST( ids ),
(long) BDB_IDL_RANGE_LAST( ids ) );
#endif
} else {
ID i;
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, INFO, "IDL: size %ld", (long) ids[0], 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "IDL: size %ld", (long) ids[0], 0, 0 );
#endif
for( i=1; i<=ids[0]; i++ ) {
if( i % 16 == 1 ) {
Debug( LDAP_DEBUG_ANY, "\n", 0, 0, 0 );
}
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, INFO, "%02lx",(long)ids[i], 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, " %02lx", (long) ids[i], 0, 0 );
#endif
}
Debug( LDAP_DEBUG_ANY, "\n", 0, 0, 0 );
@ -182,12 +168,8 @@ int bdb_idl_insert( ID *ids, ID id )
unsigned x;
#if IDL_DEBUG > 1
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, DETAIL1, "insert: %04lx at %d\n", (long) id, x, 0 );
#else
Debug( LDAP_DEBUG_ANY, "insert: %04lx at %d\n", (long) id, x, 0 );
idl_dump( ids );
#endif
#elif IDL_DEBUG > 0
idl_check( ids );
#endif
@ -248,12 +230,8 @@ static int idl_delete( ID *ids, ID id )
unsigned x = bdb_idl_search( ids, id );
#if IDL_DEBUG > 1
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, DETAIL1, "delete: %04lx at %d\n", (long) id, x, 0 );
#else
Debug( LDAP_DEBUG_ANY, "delete: %04lx at %d\n", (long) id, x, 0 );
idl_dump( ids );
#endif
#elif IDL_DEBUG > 0
idl_check( ids );
#endif
@ -381,15 +359,9 @@ bdb_idl_cache_put(
ee = bdb->bi_idl_lru_tail;
if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) ee,
bdb_idl_entry_cmp ) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_cache_put: AVL delete failed\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_cache_put: "
"AVL delete failed\n",
0, 0, 0 );
#endif
}
IDL_LRU_DELETE( bdb, ee );
i++;
@ -419,15 +391,9 @@ bdb_idl_cache_del(
if ( matched_idl_entry != NULL ) {
if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
bdb_idl_entry_cmp ) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_cache_del: AVL delete failed\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_cache_del: "
"AVL delete failed\n",
0, 0, 0 );
#endif
}
--bdb->bi_idl_cache_size;
ldap_pvt_thread_mutex_lock( &bdb->bi_idl_tree_lrulock );
@ -478,15 +444,9 @@ bdb_idl_fetch_key(
char keybuf[16];
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ARGS,
"bdb_idl_fetch_key: %s\n",
bdb_show_key( key, keybuf ), 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS,
"bdb_idl_fetch_key: %s\n",
bdb_show_key( key, keybuf ), 0, 0 );
#endif
assert( ids != NULL );
@ -505,14 +465,8 @@ bdb_idl_fetch_key(
rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_fetch_key: cursor failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
"cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 );
#endif
return rc;
}
@ -537,16 +491,9 @@ bdb_idl_fetch_key(
/* On disk, a range is denoted by 0 in the first element */
if (ids[1] == 0) {
if (ids[0] != BDB_IDL_RANGE_SIZE) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"=> bdb_idl_fetch_key: range size mismatch: "
"expected %ld, got %ld\n",
BDB_IDL_RANGE_SIZE, ids[0], 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
"range size mismatch: expected %d, got %ld\n",
BDB_IDL_RANGE_SIZE, ids[0], 0 );
#endif
cursor->c_close( cursor );
return -1;
}
@ -557,14 +504,8 @@ bdb_idl_fetch_key(
rc2 = cursor->c_close( cursor );
if (rc2) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_fetch_key: close failed: %s (%d)\n",
db_strerror(rc2), rc2, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
"close failed: %s (%d)\n", db_strerror(rc2), rc2, 0 );
#endif
return rc2;
}
@ -572,41 +513,23 @@ bdb_idl_fetch_key(
return rc;
} else if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_fetch_key: get failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
"get failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
return rc;
} else if ( data.size == 0 || data.size % sizeof( ID ) ) {
/* size not multiple of ID size */
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_fetch_key: odd size: expected %ld multiple, got %ld\n",
(long) sizeof( ID ), (long) data.size, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
"odd size: expected %ld multiple, got %ld\n",
(long) sizeof( ID ), (long) data.size, 0 );
#endif
return -1;
} else if ( data.size != BDB_IDL_SIZEOF(ids) ) {
/* size mismatch */
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_fetch_key: get size mismatch: expected %ld, got %ld\n",
(long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
"get size mismatch: expected %ld, got %ld\n",
(long) ((1 + ids[0]) * sizeof( ID )), (long) data.size, 0 );
#endif
return -1;
}
@ -635,15 +558,9 @@ bdb_idl_insert_key(
{
char buf[16];
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ARGS,
"bdb_idl_insert_key: %lx %s\n",
(long) id, bdb_show_key( key, buf ), 0 );
#else
Debug( LDAP_DEBUG_ARGS,
"bdb_idl_insert_key: %lx %s\n",
(long) id, bdb_show_key( key, buf ), 0 );
#endif
}
assert( id != NOID );
@ -659,14 +576,8 @@ bdb_idl_insert_key(
rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags );
if ( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_insert_key: cursor failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
"cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 );
#endif
return rc;
}
data.data = &tmp;
@ -788,28 +699,16 @@ put1: data.data = &id;
} else {
/* initial c_get failed, nothing was done */
fail:
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_insert_key: %s failed: %s (%d)\n",
err, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
"%s failed: %s (%d)\n", err, db_strerror(rc), rc );
#endif
cursor->c_close( cursor );
return rc;
}
rc = cursor->c_close( cursor );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_insert_key: c_close failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
"c_close failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
}
return rc;
}
@ -831,15 +730,9 @@ bdb_idl_delete_key(
{
char buf[16];
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ARGS,
"bdb_idl_delete_key: %lx %s\n",
(long) id, bdb_show_key( key, buf ), 0 );
#else
Debug( LDAP_DEBUG_ARGS,
"bdb_idl_delete_key: %lx %s\n",
(long) id, bdb_show_key( key, buf ), 0 );
#endif
}
assert( id != NOID );
@ -855,14 +748,8 @@ bdb_idl_delete_key(
rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags );
if ( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_delete_key: cursor failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
"cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 );
#endif
return rc;
}
/* Fetch the first data item for this key, to see if it
@ -946,28 +833,17 @@ bdb_idl_delete_key(
/* initial c_get failed, nothing was done */
fail:
if ( rc != DB_NOTFOUND ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_idl_delete_key: %s failed: %s (%d)\n",
err, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_delete_key: "
"%s failed: %s (%d)\n", err, db_strerror(rc), rc );
#endif
}
cursor->c_close( cursor );
return rc;
}
rc = cursor->c_close( cursor );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR, "bdb_idl_delete_key: c_close failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_idl_delete_key: c_close failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
}
return rc;

View file

@ -175,15 +175,9 @@ static int indexer(
rc = bdb_db_cache( op->o_bd, atname->bv_val, &db );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"bdb_index_read: Could not open DB %s\n",
atname->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_index_read: Could not open DB %s\n",
atname->bv_val, 0, 0 );
#endif
return LDAP_OTHER;
}
@ -350,14 +344,9 @@ bdb_index_entry(
int rc;
Attribute *ap = e->e_attrs;
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "index_entry: %s (%s) %ld\n",
opid == SLAP_INDEX_ADD_OP ? "add" : "del", e->e_dn, (long) e->e_id );
#else
Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n",
opid == SLAP_INDEX_ADD_OP ? "add" : "del",
(long) e->e_id, e->e_dn );
#endif
/* add each attribute to the indexes */
for ( ; ap != NULL; ap = ap->a_next ) {
@ -365,26 +354,17 @@ bdb_index_entry(
ap->a_nvals, e->e_id, opid );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY,
"index_entry: failure (%d)\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= index_entry_%s( %ld, \"%s\" ) failure\n",
opid == SLAP_INDEX_ADD_OP ? "add" : "del",
(long) e->e_id, e->e_dn );
#endif
return rc;
}
}
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n",
opid == SLAP_INDEX_ADD_OP ? "add" : "del",
(long) e->e_id, e->e_dn );
#endif
return LDAP_SUCCESS;
}

View file

@ -67,13 +67,9 @@ bdb_db_init( BackendDB *be )
{
struct bdb_info *bdb;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ENTRY, "bdb_db_init", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_init: Initializing %s database\n",
be->bd_info->bi_type, 0, 0 );
#endif
/* allocate backend-database-specific stuff */
bdb = (struct bdb_info *) ch_calloc( 1, sizeof(struct bdb_info) );
@ -138,24 +134,14 @@ bdb_db_open( BackendDB *be )
char path[MAXPATHLEN];
#endif
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ARGS,
"bdb_db_open: %s\n", be->be_suffix[0].bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS,
"bdb_db_open: %s\n",
be->be_suffix[0].bv_val, 0, 0 );
#endif
#ifndef BDB_MULTIPLE_SUFFIXES
if ( be->be_suffix[1].bv_val ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_open: only one suffix allowed\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_open: only one suffix allowed\n", 0, 0, 0 );
#endif
return -1;
}
#endif
@ -163,15 +149,9 @@ bdb_db_open( BackendDB *be )
rc = db_env_create( &bdb->bi_dbenv, 0 );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_open: db_env_create failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_open: db_env_create failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
return rc;
}
@ -231,15 +211,9 @@ bdb_db_open( BackendDB *be )
#endif
rc = bdb->bi_dbenv->set_tmp_dir( bdb->bi_dbenv, dir );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_open: set_tmp_dir(%s) failed: %s (%d)\n",
dir, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_open: set_tmp_dir(%s) failed: %s (%d)\n",
dir, db_strerror(rc), rc );
#endif
return rc;
}
@ -249,15 +223,9 @@ bdb_db_open( BackendDB *be )
#endif
rc = bdb->bi_dbenv->set_lg_dir( bdb->bi_dbenv, dir );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_open: set_lg_dir(%s) failed: %s (%d)\n",
dir, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_open: set_lg_dir(%s) failed: %s (%d)\n",
dir, db_strerror(rc), rc );
#endif
return rc;
}
@ -267,28 +235,17 @@ bdb_db_open( BackendDB *be )
#endif
rc = bdb->bi_dbenv->set_data_dir( bdb->bi_dbenv, dir );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_open: set_data_dir(%s) failed: %s (%d)\n",
dir, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_open: set_data_dir(%s) failed: %s (%d)\n",
dir, db_strerror(rc), rc );
#endif
return rc;
}
}
#endif
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, DETAIL1,
"bdb_db_open: dbenv_open %s\n", bdb->bi_dbenv_home, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_db_open: dbenv_open(%s)\n",
bdb->bi_dbenv_home, 0, 0);
#endif
#ifdef HAVE_EBCDIC
strcpy( path, bdb->bi_dbenv_home );
@ -304,15 +261,9 @@ bdb_db_open( BackendDB *be )
bdb->bi_dbenv_mode );
#endif
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_open: dbenv_open failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_open: dbenv_open failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
return rc;
}
@ -320,15 +271,9 @@ bdb_db_open( BackendDB *be )
rc = bdb->bi_dbenv->set_flags( bdb->bi_dbenv,
bdb->bi_dbenv_xflags, 1);
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_open: dbenv_set_flags failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_open: dbenv_set_flags failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
return rc;
}
}
@ -346,15 +291,9 @@ bdb_db_open( BackendDB *be )
rc = db_create( &db->bdi_db, bdb->bi_dbenv, 0 );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_open: db_create(%s) failed: %s (%d)\n",
bdb->bi_dbenv_home, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_open: db_create(%s) failed: %s (%d)\n",
bdb->bi_dbenv_home, db_strerror(rc), rc );
#endif
return rc;
}
@ -413,15 +352,9 @@ bdb_db_open( BackendDB *be )
#endif
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_open: db_create(%s) failed: %s (%d)\n",
bdb->bi_dbenv_home, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_open: db_open(%s) failed: %s (%d)\n",
bdb->bi_dbenv_home, db_strerror(rc), rc );
#endif
return rc;
}
@ -436,15 +369,9 @@ bdb_db_open( BackendDB *be )
/* get nextid */
rc = bdb_last_id( be, NULL );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_open: last_id(%s) failed: %s (%d)\n",
bdb->bi_dbenv_home, db_strerror(rc), rc );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_open: last_id(%s) failed: %s (%d)\n",
bdb->bi_dbenv_home, db_strerror(rc), rc );
#endif
return rc;
}
@ -506,29 +433,17 @@ bdb_db_destroy( BackendDB *be )
/* force a checkpoint */
rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_destroy: txn_checkpoint failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_destroy: txn_checkpoint failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
}
rc = bdb->bi_dbenv->close( bdb->bi_dbenv, 0 );
bdb->bi_dbenv = NULL;
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_db_destroy: close failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_db_destroy: close failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
return rc;
}
}
@ -587,12 +502,8 @@ bdb_initialize(
};
/* initialize the underlying database system */
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ENTRY, "bdb_db_initialize\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_initialize: initialize BDB backend\n",
0, 0, 0 );
#endif
bi->bi_flags |=
SLAP_BFLAG_INCREMENT |
@ -625,26 +536,14 @@ bdb_initialize(
minor != DB_VERSION_MINOR ||
patch < DB_VERSION_PATCH )
{
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
"bdb_initialize: BDB library version mismatch:"
" expected " DB_VERSION_STRING ","
" got %s\n", version, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_initialize: BDB library version mismatch:"
" expected " DB_VERSION_STRING ","
" got %s\n", version, 0, 0 );
#endif
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, DETAIL1,
"bdb_db_initialize: %s\n", version, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "bdb_initialize: %s\n",
version, 0, 0 );
#endif
}
db_env_set_func_free( ber_memfree );

View file

@ -38,11 +38,7 @@ bdb_key_read(
int rc;
DBT key;
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "key_read: enter\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 );
#endif
DBTzero( &key );
bv2DBT(k,&key);
@ -52,20 +48,11 @@ bdb_key_read(
rc = bdb_idl_fetch_key( be, db, txn, &key, ids );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR, "bdb_key_read: failed (%d)\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= bdb_index_read: failed (%d)\n",
rc, 0, 0 );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, DETAIL1,
"bdb_key_read: %ld candidates\n", (long)BDB_IDL_N(ids), 0, 0);
#else
Debug( LDAP_DEBUG_TRACE, "<= bdb_index_read %ld candidates\n",
(long) BDB_IDL_N(ids), 0, 0 );
#endif
}
return rc;
@ -85,13 +72,8 @@ bdb_key_change(
int rc;
DBT key;
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "key_change: %s ID %lx\n",
op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long) id, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> key_change(%s,%lx)\n",
op == SLAP_INDEX_ADD_OP ? "ADD":"DELETE", (long) id, 0 );
#endif
DBTzero( &key );
bv2DBT(k,&key);
@ -108,11 +90,7 @@ bdb_key_change(
if ( rc == DB_NOTFOUND ) rc = 0;
}
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, RESULTS, "key_change: return %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= key_change %d\n", rc, 0, 0 );
#endif
return rc;
}

View file

@ -44,13 +44,8 @@ int bdb_modify_internal(
Attribute *ap;
int glue_attr_delete = 0;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "bdb_modify_internal: 0x%08lx: %s\n",
e->e_id, e->e_dn, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modify_internal: 0x%08lx: %s\n",
e->e_id, e->e_dn, 0);
#endif
if ( !acl_check_modlist( op, e, modlist )) {
return LDAP_INSUFFICIENT_ACCESS;
@ -97,21 +92,12 @@ int bdb_modify_internal(
switch ( mod->sm_op ) {
case LDAP_MOD_ADD:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1, "bdb_modify_internal: add\n", 0,0,0);
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: add\n", 0, 0, 0);
#endif
err = modify_add_values( e, mod, get_permissiveModify(op),
text, textbuf, textlen );
if( err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify_internal: %d %s\n", err, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n",
err, *text, 0);
#endif
}
break;
@ -121,75 +107,40 @@ int bdb_modify_internal(
break;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modify_internal: delete\n", 0, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: delete\n", 0, 0, 0);
#endif
err = modify_delete_values( e, mod, get_permissiveModify(op),
text, textbuf, textlen );
assert( err != LDAP_TYPE_OR_VALUE_EXISTS );
if( err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify_internal: %d %s\n", err, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n",
err, *text, 0);
#endif
}
break;
case LDAP_MOD_REPLACE:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modify_internal: replace\n", 0, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: replace\n", 0, 0, 0);
#endif
err = modify_replace_values( e, mod, get_permissiveModify(op),
text, textbuf, textlen );
if( err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify_internal: %d %s\n", err, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n",
err, *text, 0);
#endif
}
break;
case LDAP_MOD_INCREMENT:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modify_internal: increment\n", 0, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"bdb_modify_internal: increment\n", 0, 0, 0);
#endif
err = modify_increment_values( e, mod, get_permissiveModify(op),
text, textbuf, textlen );
if( err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify_internal: %d %s\n", err, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"bdb_modify_internal: %d %s\n",
err, *text, 0);
#endif
}
break;
case SLAP_MOD_SOFTADD:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modify_internal: softadd\n",0,0,0 );
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: softadd\n", 0, 0, 0);
#endif
/* Avoid problems in index_add_mods()
* We need to add index if necessary.
*/
@ -205,33 +156,18 @@ int bdb_modify_internal(
}
if( err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify_internal: %d %s\n", err, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n",
err, *text, 0);
#endif
}
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify_internal: invalid op %d\n", mod->sm_op, 0, 0 );
#else
Debug(LDAP_DEBUG_ANY, "bdb_modify_internal: invalid op %d\n",
mod->sm_op, 0, 0);
#endif
*text = "Invalid modify operation";
err = LDAP_OTHER;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify_internal: %d %s\n", err, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: %d %s\n",
err, *text, 0);
#endif
}
if ( err != LDAP_SUCCESS ) {
@ -273,15 +209,9 @@ int bdb_modify_internal(
e->e_attrs = save_attrs;
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR, "bdb_modify_internal: "
"entry failed schema check %s\n",
*text, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"entry failed schema check: %s\n",
*text, 0, 0 );
#endif
}
/* if NOOP then silently revert to saved attrs */
@ -299,15 +229,9 @@ int bdb_modify_internal(
if ( rc != LDAP_SUCCESS ) {
attrs_free( e->e_attrs );
e->e_attrs = save_attrs;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify_internal: attribute index delete failure\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"Attribute index delete failure",
0, 0, 0 );
#endif
return rc;
}
ap->a_flags &= ~SLAP_ATTR_IXDEL;
@ -323,15 +247,9 @@ int bdb_modify_internal(
if ( rc != LDAP_SUCCESS ) {
attrs_free( e->e_attrs );
e->e_attrs = save_attrs;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify_internal: attribute index add failure\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"Attribute index add failure",
0, 0, 0 );
#endif
return rc;
}
ap->a_flags &= ~SLAP_ATTR_IXADD;
@ -372,13 +290,8 @@ bdb_modify( Operation *op, SlapReply *rs )
Entry *ctxcsn_e;
int ctxcsn_added = 0;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "bdb_modify: %s\n",
op->o_req_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS, "bdb_modify: %s\n",
op->o_req_dn.bv_val, 0, 0 );
#endif
ctrls[num_ctrls] = NULL;
@ -392,12 +305,8 @@ retry: /* transaction retry */
bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
e = NULL;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1, "bdb_modify: retrying...\n", 0, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE,
"bdb_modify: retrying...\n", 0, 0, 0);
#endif
pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
while ( pm_list != NULL ) {
@ -425,14 +334,9 @@ retry: /* transaction retry */
bdb->bi_db_opflags );
rs->sr_text = NULL;
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modify: txn_begin failed: %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: txn_begin failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -452,14 +356,9 @@ retry: /* transaction retry */
locker, &lock );
if ( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modify: dn2entry failed: (%d)\n", rs->sr_err, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: dn2entry failed (%d)\n",
rs->sr_err, 0, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -523,15 +422,9 @@ retry: /* transaction retry */
/* entry is a referral, don't allow modify */
rs->sr_ref = get_entry_referrals( op, e );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modify: entry is referral\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: entry is referral\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;
rs->sr_matched = e->e_name.bv_val;
@ -555,15 +448,9 @@ retry: /* transaction retry */
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
rc = bdb_psearch(op, rs, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY );
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#endif
}
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
@ -577,13 +464,8 @@ retry: /* transaction retry */
if ( slap_read_controls( op, rs, e,
&slap_pre_read_bv, preread_ctrl ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_modify: pre-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_modify: pre-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
}
@ -593,15 +475,9 @@ retry: /* transaction retry */
bdb->bi_db_opflags );
rs->sr_text = NULL;
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify: txn_begin(2) failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: txn_begin(2) failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -612,14 +488,9 @@ retry: /* transaction retry */
&dummy, &rs->sr_text, textbuf, textlen );
if( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify: modify failed (%d)\n", rs->sr_err, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: modify failed (%d)\n",
rs->sr_err, 0, 0 );
#endif
if ( (rs->sr_err == LDAP_INSUFFICIENT_ACCESS) && opinfo.boi_err ) {
rs->sr_err = opinfo.boi_err;
}
@ -636,14 +507,9 @@ retry: /* transaction retry */
/* change the entry itself */
rs->sr_err = bdb_id2entry_update( op->o_bd, lt2, &dummy );
if ( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify: id2entry update failed (%d)\n", rs->sr_err, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: id2entry update failed (%d)\n",
rs->sr_err, 0, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -678,13 +544,8 @@ retry: /* transaction retry */
if( slap_read_controls( op, rs, &dummy,
&slap_post_read_bv, postread_ctrl ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_modify: post-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_modify: post-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
}
@ -718,15 +579,9 @@ retry: /* transaction retry */
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_MODIFY );
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#endif
}
}
pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
@ -734,15 +589,9 @@ retry: /* transaction retry */
rc = bdb_psearch(op, rs, pm_list->ps_op,
e, LDAP_PSEARCH_BY_SCOPEOUT);
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#endif
}
LDAP_LIST_REMOVE ( pm_list, ps_link );
pm_prev = pm_list;
@ -758,33 +607,20 @@ retry: /* transaction retry */
op->o_private = NULL;
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modify: txn_%s failed %s (%d)\n",
op->o_noop ? "abort (no_op)" : "commit",
db_strerror(rs->sr_err), rs->sr_err );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: txn_%s failed: %s (%d)\n",
op->o_noop ? "abort (no-op)" : "commit",
db_strerror(rs->sr_err), rs->sr_err );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "commit failed";
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modify: updated%s id=%08lx dn=\"%s\"\n",
op->o_noop ? " (no_op)" : "", e->e_id, e->e_dn );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: updated%s id=%08lx dn=\"%s\"\n",
op->o_noop ? " (no-op)" : "",
e->e_id, e->e_dn );
#endif
rs->sr_err = LDAP_SUCCESS;
rs->sr_text = NULL;

View file

@ -77,15 +77,9 @@ bdb_modrdn( Operation *op, SlapReply *rs )
ctrls[num_ctrls] = NULL;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY, "==>bdb_modrdn(%s,%s,%s)\n",
op->o_req_dn.bv_val,op->oq_modrdn.rs_newrdn.bv_val,
op->oq_modrdn.rs_newSup ? op->oq_modrdn.rs_newSup->bv_val : "NULL" );
#else
Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn(%s,%s,%s)\n",
op->o_req_dn.bv_val,op->oq_modrdn.rs_newrdn.bv_val,
op->oq_modrdn.rs_newSup ? op->oq_modrdn.rs_newSup->bv_val : "NULL" );
#endif
if( 0 ) {
retry: /* transaction retry */
@ -105,11 +99,7 @@ retry: /* transaction retry */
bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np);
np = NULL;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1, "==>bdb_modrdn: retrying...\n", 0, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn: retrying...\n", 0, 0, 0 );
#endif
pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
while ( pm_list != NULL ) {
LDAP_LIST_REMOVE ( pm_list, ps_link );
@ -138,15 +128,9 @@ retry: /* transaction retry */
bdb->bi_db_opflags );
rs->sr_text = NULL;
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"==>bdb_modrdn: txn_begin failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: txn_begin failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -237,13 +221,8 @@ retry: /* transaction retry */
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"==>bdb_modrdn: no access to entry\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "no access to entry\n", 0,
0, 0 );
#endif
rs->sr_text = "no write access to old entry";
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
goto return_results;
@ -257,27 +236,16 @@ retry: /* transaction retry */
case DB_LOCK_NOTGRANTED:
goto retry;
case 0:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_modrdn: non-leaf %s\n", op->o_req_dn.bv_val, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_modrdn: non-leaf %s\n",
op->o_req_dn.bv_val, 0, 0);
#endif
rs->sr_err = LDAP_NOT_ALLOWED_ON_NONLEAF;
rs->sr_text = "subtree rename not supported";
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_modrdn: has_children failed %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_modrdn: has_children failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
}
@ -290,13 +258,8 @@ retry: /* transaction retry */
/* parent is a referral, don't allow add */
rs->sr_ref = get_entry_referrals( op, e );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: entry %s is referral \n", e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry %s is referral\n",
e->e_dn, 0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL,
rs->sr_matched = e->e_name.bv_val;
@ -340,13 +303,8 @@ retry: /* transaction retry */
p = eip->bei_e;
if( p == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"==>bdb_modrdn: parent does not exist\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: parent does not exist\n",
0, 0, 0);
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "old entry's parent does not exist";
goto return_results;
@ -364,25 +322,15 @@ retry: /* transaction retry */
}
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"==>bdb_modrdn: no access to parent\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0,
0, 0 );
#endif
rs->sr_text = "no write access to old parent's children";
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: wr to children %s is OK\n", p_ndn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to children of entry %s OK\n",
p_ndn.bv_val, 0, 0 );
#endif
if ( p_ndn.bv_val == slap_empty_bv.bv_val ) {
p_dn = slap_empty_bv;
@ -390,14 +338,9 @@ retry: /* transaction retry */
dnParent( &e->e_name, &p_dn );
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: parent dn=%s\n", p_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: parent dn=%s\n",
p_dn.bv_val, 0, 0 );
#endif
} else {
/* no parent, modrdn entry directly under root */
@ -422,51 +365,29 @@ retry: /* transaction retry */
}
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"==>bdb_modrdn: no access to parent\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"no access to parent\n",
0, 0, 0 );
#endif
rs->sr_text = "no write access to old parent";
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: wr to children of entry \"%s\" OK\n",
p_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to children of entry \"\" OK\n",
0, 0, 0 );
#endif
p_dn.bv_val = "";
p_dn.bv_len = 0;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: parent dn=\"\" \n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: parent dn=\"\"\n",
0, 0, 0 );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"==>bdb_modrdn: no parent, not root &\"\" is not "
"suffix\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: no parent, not root "
"& \"\" is not suffix\n",
0, 0, 0);
#endif
rs->sr_text = "no write access to old parent";
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
goto return_results;
@ -477,27 +398,15 @@ retry: /* transaction retry */
new_parent_dn = &p_dn; /* New Parent unless newSuperior given */
if ( op->oq_modrdn.rs_newSup != NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: new parent \"%s\" requested...\n",
op->oq_modrdn.rs_newSup->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: new parent \"%s\" requested...\n",
op->oq_modrdn.rs_newSup->bv_val, 0, 0 );
#endif
/* newSuperior == oldParent? */
if( dn_match( &p_ndn, op->oq_modrdn.rs_nnewSup ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, INFO, "bdb_back_modrdn: "
"new parent \"%s\" same as the old parent \"%s\"\n",
op->oq_modrdn.rs_newSup->bv_val, p_dn.bv_val, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_back_modrdn: "
"new parent \"%s\" same as the old parent \"%s\"\n",
op->oq_modrdn.rs_newSup->bv_val, p_dn.bv_val, 0 );
#endif
op->oq_modrdn.rs_newSup = NULL; /* ignore newSuperior */
}
}
@ -531,29 +440,17 @@ retry: /* transaction retry */
}
if( np == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: newSup(ndn=%s) not here!\n",
np_ndn->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: newSup(ndn=%s) not here!\n",
np_ndn->bv_val, 0, 0);
#endif
rs->sr_text = "new superior not found";
rs->sr_err = LDAP_OTHER;
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: wr to new parent OK np=%p, id=%ld\n",
(void *) np, (long) np->e_id, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to new parent OK np=%p, id=%ld\n",
(void *) np, (long) np->e_id, 0 );
#endif
/* check newSuperior for "children" acl */
rs->sr_err = access_allowed( op, np, children,
@ -566,14 +463,9 @@ retry: /* transaction retry */
goto retry;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: no wr to newSup children\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: no wr to newSup children\n",
0, 0, 0 );
#endif
rs->sr_text = "no write access to new superior's children";
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
goto return_results;
@ -582,13 +474,8 @@ retry: /* transaction retry */
#ifdef BDB_ALIASES
if ( is_entry_alias( np ) ) {
/* parent is an alias, don't allow add */
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: entry is alias\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is alias\n",
0, 0, 0 );
#endif
rs->sr_text = "new superior is an alias";
rs->sr_err = LDAP_ALIAS_PROBLEM;
goto return_results;
@ -597,13 +484,8 @@ retry: /* transaction retry */
if ( is_entry_referral( np ) ) {
/* parent is a referral, don't allow add */
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"==>bdb_modrdn: entry is referral\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is referral\n",
0, 0, 0 );
#endif
rs->sr_text = "new superior is a referral";
rs->sr_err = LDAP_OTHER;
goto return_results;
@ -636,63 +518,37 @@ retry: /* transaction retry */
}
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"==>bdb_modrdn: no access to superior\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"no access to new superior\n",
0, 0, 0 );
#endif
rs->sr_text =
"no write access to new superior's children";
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modrdn: wr to children entry \"\" OK\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to children of entry \"\" OK\n",
0, 0, 0 );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modrdn: new superior=\"\", not root & \"\" "
"is not suffix\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: new superior=\"\", not root "
"& \"\" is not suffix\n",
0, 0, 0);
#endif
rs->sr_text = "no write access to new superior's children";
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
goto return_results;
}
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modrdn: new superior=\"\"\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: new superior=\"\"\n",
0, 0, 0 );
#endif
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modrdn: wr to new parent's children OK\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: wr to new parent's children OK\n",
0, 0, 0 );
#endif
new_parent_dn = np_dn;
}
@ -708,13 +564,8 @@ retry: /* transaction retry */
ber_dupbv( &new_ndn, &bv );
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_modrdn: new ndn=%s\n", new_ndn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new ndn=%s\n",
new_ndn.bv_val, 0, 0 );
#endif
/* Shortcut the search */
nei = neip ? neip : eip;
@ -741,47 +592,27 @@ retry: /* transaction retry */
if ( !new_rdn && ldap_bv2rdn_x( &op->oq_modrdn.rs_newrdn, &new_rdn,
(char **)&rs->sr_text, LDAP_DN_FORMAT_LDAP, op->o_tmpmemctx ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modrdn: can't figure out "
"type(s)/values(s) of newrdn\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: can't figure out "
"type(s)/values(s) of newrdn\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_INVALID_DN_SYNTAX;
rs->sr_text = "unknown type(s) used in RDN";
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n",
new_rdn[ 0 ]->la_attr.bv_val, new_rdn[ 0 ]->la_value.bv_val, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: new_rdn_type=\"%s\", new_rdn_val=\"%s\"\n",
new_rdn[ 0 ]->la_attr.bv_val, new_rdn[ 0 ]->la_value.bv_val, 0 );
#endif
if ( op->oq_modrdn.rs_deleteoldrdn ) {
if ( !old_rdn && ldap_bv2rdn_x( &op->o_req_dn, &old_rdn,
(char **)&rs->sr_text, LDAP_DN_FORMAT_LDAP, op->o_tmpmemctx ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modrdn: can't figure out "
"type(s)/values(s) of old_rdn\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: can't figure out "
"the old_rdn type(s)/value(s)\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "cannot parse RDN from old DN";
goto return_results;
@ -804,13 +635,8 @@ retry: /* transaction retry */
if( slap_read_controls( op, rs, e,
&slap_pre_read_bv, preread_ctrl ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
}
@ -819,15 +645,9 @@ retry: /* transaction retry */
rs->sr_err = TXN_BEGIN( bdb->bi_dbenv, ltid, &lt2, bdb->bi_db_opflags );
rs->sr_text = NULL;
if( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modrdn: txn_begin(2) failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: txn_begin(2) failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -836,15 +656,9 @@ retry: /* transaction retry */
/* delete old DN */
rs->sr_err = bdb_dn2id_delete( op, lt2, eip, e );
if ( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_modrdn: dn2id del failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_TRACE,
"<=- bdb_modrdn: dn2id del failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -864,15 +678,9 @@ retry: /* transaction retry */
/* add new DN */
rs->sr_err = bdb_dn2id_add( op, lt2, neip ? neip : eip, &dummy );
if ( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_modrdn: dn2id add failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_TRACE,
"<=- bdb_modrdn: dn2id add failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -890,15 +698,9 @@ retry: /* transaction retry */
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
rc = bdb_psearch( op, rs, ps_list, &dummy, LDAP_PSEARCH_BY_PREMODIFY );
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modrdn: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#endif
}
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
@ -909,15 +711,9 @@ retry: /* transaction retry */
rs->sr_err = bdb_modify_internal( op, lt2, &mod[0], &dummy,
&rs->sr_text, textbuf, textlen );
if( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_modrdn: modify failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_TRACE,
"<=- bdb_modrdn: modify failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
if ( ( rs->sr_err == LDAP_INSUFFICIENT_ACCESS ) && opinfo.boi_err ) {
rs->sr_err = opinfo.boi_err;
}
@ -933,15 +729,9 @@ retry: /* transaction retry */
/* id2entry index */
rs->sr_err = bdb_id2entry_update( op->o_bd, lt2, &dummy );
if ( rs->sr_err != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_modrdn: id2entry failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_TRACE,
"<=- bdb_modrdn: id2entry failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
@ -963,15 +753,9 @@ retry: /* transaction retry */
case 0:
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_modrdn: has_children failed %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_modrdn: has_children failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
@ -1007,13 +791,8 @@ retry: /* transaction retry */
if( slap_read_controls( op, rs, &dummy,
&slap_post_read_bv, postread_ctrl ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- bdb_modrdn: post-read failed!\n", 0, 0, 0 );
#endif
goto return_results;
}
}
@ -1051,15 +830,9 @@ retry: /* transaction retry */
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_MODIFY );
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modrdn: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#endif
}
}
pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
@ -1067,15 +840,9 @@ retry: /* transaction retry */
rc = bdb_psearch(op, rs, pm_list->ps_op,
e, LDAP_PSEARCH_BY_SCOPEOUT);
if ( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_modrdn: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: persistent search failed (%d,%d)\n",
rc, rs->sr_err, 0 );
#endif
}
pm_prev = pm_list;
LDAP_LIST_REMOVE ( pm_list, ps_link );
@ -1096,29 +863,17 @@ retry: /* transaction retry */
op->o_private = NULL;
if( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS, "bdb_modrdn: %s : %s (%d)\n",
rs->sr_text, db_strerror(rs->sr_err), rs->sr_err );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n",
rs->sr_text, db_strerror(rs->sr_err), rs->sr_err );
#endif
rs->sr_err = LDAP_OTHER;
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n",
op->o_noop ? " (no-op)" : "",
e->e_id, e->e_dn );
#else
Debug(LDAP_DEBUG_TRACE,
"bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n",
op->o_noop ? " (no-op)" : "",
e->e_id, e->e_dn );
#endif
rs->sr_text = NULL;
if( num_ctrls ) rs->sr_ctrls = ctrls;

View file

@ -66,14 +66,9 @@ int bdb_last_id( BackendDB *be, DB_TXN *tid )
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR, "bdb_last_id: get failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_last_id: get failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
goto done;
}

View file

@ -70,15 +70,9 @@ retry:
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"=> bdb_hasSubordinates: has_children failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_hasSubordinates: has_children failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
rc = LDAP_OTHER;
}

View file

@ -67,15 +67,9 @@ dn2entry_retry:
case DB_LOCK_NOTGRANTED:
goto dn2entry_retry;
default:
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_referrals: dn2entry failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_referrals: dn2entry failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
LOCK_ID_FREE ( bdb->bi_dbenv, locker );
return rs->sr_err;
@ -85,15 +79,9 @@ dn2entry_retry:
rc = 0;
rs->sr_matched = NULL;
if ( e != NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
(long) op->o_tag, op->o_req_dn.bv_val, e->e_name.bv_val );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
(long) op->o_tag, op->o_req_dn.bv_val, e->e_name.bv_val );
#endif
if( is_entry_referral( e ) ) {
rc = LDAP_OTHER;
@ -138,15 +126,9 @@ dn2entry_retry:
rs->sr_ref = referral_rewrite(
refs, &e->e_name, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
(long) op->o_tag, op->o_req_dn.bv_val, e->e_name.bv_val );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
(long) op->o_tag, op->o_req_dn.bv_val, e->e_name.bv_val );
#endif
rs->sr_matched = e->e_name.bv_val;
if( rs->sr_ref != NULL ) {

View file

@ -434,11 +434,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
struct bdb_op_info *opinfo = NULL;
DB_TXN *ltid = NULL;
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ENTRY, "bdb_search\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_search\n", 0, 0, 0);
#endif
attrs = sop->oq_search.rs_attrs;
opinfo = (struct bdb_op_info *) op->o_private;
@ -654,13 +650,8 @@ dn2entry_retry:
ber_bvarray_free( erefs );
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_search: entry is referral\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_search: entry is referral\n",
0, 0, 0 );
#endif
if (!rs->sr_ref) rs->sr_text = "bad_referral object";
rs->sr_err = LDAP_REFERRAL;
@ -760,13 +751,8 @@ dn2entry_retry:
}
if ( candidates[0] == 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_search: no candidates\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_search: no candidates\n",
0, 0, 0 );
#endif
goto nochange;
}
@ -816,15 +802,9 @@ dn2entry_retry:
}
if ( cursor == NOID ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_search: no paged results candidates\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_search: no paged results candidates\n",
0, 0, 0 );
#endif
send_paged_response( sop, rs, &lastid, 0 );
rs->sr_err = LDAP_OTHER;
@ -959,15 +939,9 @@ id2entry_retry:
if ( e == NULL ) {
if( !BDB_IDL_IS_RANGE(candidates) ) {
/* only complain for non-range IDLs */
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_search: candidate %ld not found\n",
(long) id, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_search: candidate %ld not found\n",
(long) id, 0, 0 );
#endif
}
goto loop_continue;
@ -1077,15 +1051,9 @@ id2entry_retry:
/* Not in scope, ignore it */
if ( !scopeok ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_search: %ld scope not okay\n",
(long) id, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_search: %ld scope not okay\n",
(long) id, 0, 0 );
#endif
goto loop_continue;
}
@ -1130,15 +1098,9 @@ id2entry_retry:
if ( rs->sr_err == LDAP_COMPARE_TRUE ) {
if ( rc_sync == LDAP_COMPARE_TRUE ) {
if ( no_sync_state_change ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_search: error in context csn management\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_search: error in context csn management\n",
0, 0, 0 );
#endif
}
entry_sync_state = LDAP_SYNC_ADD;
@ -1266,15 +1228,9 @@ id2entry_retry:
psid_e, ps_link );
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_search: invalid ps_type (%d) \n",
ps_type, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_search: invalid ps_type (%d) \n",
ps_type, 0, 0);
#endif
}
} else {
@ -1357,14 +1313,9 @@ id2entry_retry:
}
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_search: %ld does not match filter\n", (long) id, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_search: %ld does not match filter\n",
(long) id, 0, 0 );
#endif
}
loop_continue:
@ -1536,14 +1487,8 @@ static int base_candidate(
Entry *e,
ID *ids )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY,
"base_candidate: base: \"%s\" (0x%08lx)\n",
e->e_nname.bv_val, (long) e->e_id, 0);
#else
Debug(LDAP_DEBUG_ARGS, "base_candidates: base: \"%s\" (0x%08lx)\n",
e->e_nname.bv_val, (long) e->e_id, 0);
#endif
ids[0] = 1;
ids[1] = e->e_id;
@ -1641,15 +1586,9 @@ static int search_candidates(
* (|[(objectClass=referral)(objectClass=alias)](user-filter))
*/
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY,
"search_candidates: base=\"%s\" (0x%08lx) scope=%d\n",
e->e_nname.bv_val, (long) e->e_id, op->oq_search.rs_scope);
#else
Debug(LDAP_DEBUG_TRACE,
"search_candidates: base=\"%s\" (0x%08lx) scope=%d\n",
e->e_nname.bv_val, (long) e->e_id, op->oq_search.rs_scope );
#endif
xf.f_or = op->oq_search.rs_filter;
xf.f_choice = LDAP_FILTER_OR;
@ -1721,28 +1660,16 @@ static int search_candidates(
}
if( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_search_candidates: failed (rc=%d)\n", rc, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE,
"bdb_search_candidates: failed (rc=%d)\n",
rc, NULL, NULL );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_search_candidates: id=%ld first=%ld last=%ld\n",
(long) ids[0], (long) BDB_IDL_FIRST(ids),
(long) BDB_IDL_LAST(ids));
#else
Debug(LDAP_DEBUG_TRACE,
"bdb_search_candidates: id=%ld first=%ld last=%ld\n",
(long) ids[0],
(long) BDB_IDL_FIRST(ids),
(long) BDB_IDL_LAST(ids) );
#endif
}
return rc;
@ -1880,15 +1807,9 @@ send_paged_response(
PagedResultsCookie respcookie;
struct berval cookie;
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY,
"send_paged_response: lastid=0x%08lx nentries=%d\n",
lastid ? *lastid : 0, rs->sr_nentries, NULL );
#else
Debug(LDAP_DEBUG_ARGS,
"send_paged_response: lastid=0x%08lx nentries=%d\n",
lastid ? *lastid : 0, rs->sr_nentries, NULL );
#endif
BER_BVZERO( &ctrl.ldctl_value );
ctrls[0] = &ctrl;

View file

@ -159,13 +159,8 @@ ID bdb_tool_dn2id_get(
rc = db->get( db, NULL, &key, &data, bdb->bi_db_opflags );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( INDEX, ERR, "bdb_tool_dn2id_get: get failed %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_tool_dn2id_get: get failed: %s (%d)\n",
db_strerror( rc ), rc, 0 );
#endif
id = NOID;
}
@ -253,13 +248,8 @@ static int bdb_tool_next_id(
snprintf( text->bv_val, text->bv_len,
"next_id failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_next_id: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_next_id: %s\n", text->bv_val, 0, 0 );
#endif
return rc;
}
rc = bdb_dn2id_add( op, tid, ei, e );
@ -267,13 +257,8 @@ static int bdb_tool_next_id(
snprintf( text->bv_val, text->bv_len,
"dn2id_add failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_next_id: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_next_id: %s\n", text->bv_val, 0, 0 );
#endif
} else if ( hole ) {
if ( nholes == nhmax - 1 ) {
if ( holes == hbuf ) {
@ -325,13 +310,8 @@ ID bdb_tool_entry_put(
assert( text->bv_val );
assert( text->bv_val[0] == '\0' ); /* overconservative? */
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ARGS, "=> bdb_tool_entry_put( %ld, \"%s\" )\n",
(long) e->e_id, e->e_dn, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_put( %ld, \"%s\" )\n",
(long) e->e_id, e->e_dn, 0 );
#endif
rc = TXN_BEGIN( bdb->bi_dbenv, NULL, &tid,
bdb->bi_db_opflags );
@ -339,13 +319,9 @@ ID bdb_tool_entry_put(
snprintf( text->bv_val, text->bv_len,
"txn_begin failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n",
text->bv_val, 0, 0 );
#endif
return NOID;
}
@ -365,13 +341,8 @@ ID bdb_tool_entry_put(
snprintf( text->bv_val, text->bv_len,
"id2entry_add failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#endif
goto done;
}
@ -381,13 +352,8 @@ ID bdb_tool_entry_put(
snprintf( text->bv_val, text->bv_len,
"index_entry_add failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#endif
goto done;
}
@ -398,14 +364,9 @@ done:
snprintf( text->bv_val, text->bv_len,
"txn_commit failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n",
text->bv_val, 0, 0 );
#endif
e->e_id = NOID;
}
@ -414,14 +375,9 @@ done:
snprintf( text->bv_val, text->bv_len,
"txn_aborted! %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n",
text->bv_val, 0, 0 );
#endif
e->e_id = NOID;
}
@ -438,13 +394,8 @@ int bdb_tool_entry_reindex(
DB_TXN *tid = NULL;
Operation op = {0};
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ARGS,
"=> bdb_tool_entry_reindex( %ld )\n", (long) id, 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS, "=> bdb_tool_entry_reindex( %ld )\n",
(long) id, 0, 0 );
#endif
/* No indexes configured, nothing to do. Could return an
* error here to shortcut things.
@ -463,29 +414,17 @@ int bdb_tool_entry_reindex(
e = bdb_tool_entry_get( be, id );
if( e == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, DETAIL1,
"bdb_tool_entry_reindex:: could not locate id=%ld\n",
(long) id, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"bdb_tool_entry_reindex:: could not locate id=%ld\n",
(long) id, 0, 0 );
#endif
return -1;
}
rc = TXN_BEGIN( bi->bi_dbenv, NULL, &tid, bi->bi_db_opflags );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_reindex: txn_begin failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_reindex: txn_begin failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
goto done;
}
@ -496,13 +435,8 @@ int bdb_tool_entry_reindex(
*
*/
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_reindex( %ld, \"%s\" )\n", (long) id, e->e_dn, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_reindex( %ld, \"%s\" )\n",
(long) id, e->e_dn, 0 );
#endif
op.o_bd = be;
op.o_tmpmemctx = NULL;
@ -512,15 +446,9 @@ int bdb_tool_entry_reindex(
/* add dn2id indices */
rc = bdb_dn2id_add( &op, tid, NULL, e );
if( rc != 0 && rc != DB_KEYEXIST ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_reindex: dn2id_add failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_reindex: dn2id_add failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
goto done;
}
#endif
@ -531,29 +459,17 @@ done:
if( rc == 0 ) {
rc = TXN_COMMIT( tid, 0 );
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_reindex: txn_commit failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_reindex: txn_commit failed: %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
e->e_id = NOID;
}
} else {
TXN_ABORT( tid );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, DETAIL1,
"=> bdb_tool_entry_reindex: txn_aborted! %s (%d)\n",
db_strerror(rc), rc, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_reindex: txn_aborted! %s (%d)\n",
db_strerror(rc), rc, 0 );
#endif
e->e_id = NOID;
}
bdb_entry_release( &op, e, 0 );
@ -581,13 +497,8 @@ ID bdb_tool_entry_modify(
assert ( e->e_id != NOID );
assert ( e->e_id != 0 );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ARGS, "=> bdb_tool_entry_put( %ld, \"%s\" )\n",
(long) e->e_id, e->e_dn, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_tool_entry_put( %ld, \"%s\" )\n",
(long) e->e_id, e->e_dn, 0 );
#endif
rc = TXN_BEGIN( bdb->bi_dbenv, NULL, &tid,
bdb->bi_db_opflags );
@ -595,13 +506,9 @@ ID bdb_tool_entry_modify(
snprintf( text->bv_val, text->bv_len,
"txn_begin failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n",
text->bv_val, 0, 0 );
#endif
return NOID;
}
@ -615,13 +522,8 @@ ID bdb_tool_entry_modify(
snprintf( text->bv_val, text->bv_len,
"id2entry_add failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#endif
goto done;
}
@ -630,13 +532,8 @@ ID bdb_tool_entry_modify(
snprintf( text->bv_val, text->bv_len,
"index_entry_del failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#endif
goto done;
}
@ -645,13 +542,8 @@ ID bdb_tool_entry_modify(
snprintf( text->bv_val, text->bv_len,
"index_entry_add failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#endif
goto done;
}
@ -662,14 +554,9 @@ done:
snprintf( text->bv_val, text->bv_len,
"txn_commit failed: %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n",
text->bv_val, 0, 0 );
#endif
e->e_id = NOID;
}
@ -678,14 +565,9 @@ done:
snprintf( text->bv_val, text->bv_len,
"txn_aborted! %s (%d)",
db_strerror(rc), rc );
#ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ERR,
"=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"=> bdb_tool_entry_put: %s\n",
text->bv_val, 0, 0 );
#endif
e->e_id = NOID;
}

View file

@ -49,11 +49,7 @@ bdb_trans_backoff( int num_retries )
delay = 16384 * (key * (double) pow_retries / (double) max_key);
delay = delay ? delay : 1;
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR, "delay = %d, num_retries = %d\n", delay, num_retries, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "delay = %d, num_retries = %d\n", delay, num_retries, 0 );
#endif
timeout.tv_sec = delay / 1000000;
timeout.tv_usec = delay % 1000000;

View file

@ -51,11 +51,7 @@ ldap_back_add(
int rc = LDAP_SUCCESS;
#endif /* LDAP_BACK_PROXY_AUTHZ */
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDAP, ENTRY, "ldap_back_add: %s\n", op->o_req_dn.bv_val, 0, 0 );
#else /* !NEW_LOGGING */
Debug(LDAP_DEBUG_ARGS, "==> ldap_back_add: %s\n", op->o_req_dn.bv_val, 0, 0);
#endif /* !NEW_LOGGING */
lc = ldap_back_getconn(op, rs);
if ( !lc || !ldap_back_dobind( lc, op, rs ) ) {

View file

@ -349,13 +349,8 @@ ldap_back_getconn(Operation *op, SlapReply *rs)
ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDAP, INFO,
"ldap_back_getconn: conn %p inserted\n", (void *) lc, 0, 0);
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_TRACE,
"=>ldap_back_getconn: conn %p inserted\n", (void *) lc, 0, 0 );
#endif /* !NEW_LOGGING */
/* Err could be -1 in case a duplicate ldapconn is inserted */
if ( rs->sr_err != 0 ) {
@ -367,14 +362,8 @@ ldap_back_getconn(Operation *op, SlapReply *rs)
return( NULL );
}
} else {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDAP, INFO,
"ldap_back_getconn: conn %p fetched\n",
(void *) lc, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_TRACE,
"=>ldap_back_getconn: conn %p fetched\n", (void *) lc, 0, 0 );
#endif /* !NEW_LOGGING */
}
return( lc );

View file

@ -733,15 +733,9 @@ parse_idassert(
/* identity assertion mode */
if ( strcasecmp( argv[0], "idassert-mode" ) == 0 ) {
if ( argc != 2 ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: illegal args number %d in \"idassert-mode <args>\" line.\n",
fname, lineno, argc );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: illegal args number %d in \"idassert-mode <args>\" line.\n",
fname, lineno, argc );
#endif
return 1;
}
@ -785,15 +779,9 @@ parse_idassert(
rc = dnNormalize( 0, NULL, NULL, &id, &dn, NULL );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: idassert ID \"%s\" is not a valid DN.\n",
fname, lineno, argv[1] );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: idassert ID \"%s\" is not a valid DN\n",
fname, lineno, argv[1] );
#endif
return 1;
}
@ -834,15 +822,9 @@ parse_idassert(
ber_str2bv( argv[1], 0, 0, &dn );
rc = dnNormalize( 0, NULL, NULL, &dn, &li->idassert_authcDN, NULL );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: idassert ID \"%s\" is not a valid DN.\n",
fname, lineno, argv[1] );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: idassert ID \"%s\" is not a valid DN\n",
fname, lineno, argv[1] );
#endif
return 1;
}
@ -949,15 +931,9 @@ parse_idassert(
ber_str2bv( val, 0, 0, &dn );
rc = dnNormalize( 0, NULL, NULL, &dn, &li->idassert_authcDN, NULL );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
"%s: line %d: SASL authcdn \"%s\" is not a valid DN.\n",
fname, lineno, val );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: SASL authcdn \"%s\" is not a valid DN\n",
fname, lineno, val );
#endif
return 1;
}

View file

@ -109,13 +109,8 @@ ldap_back_exop_passwd(
isproxy = ber_bvcmp( &op->o_req_ndn, &op->o_ndn );
#ifdef NEW_LOGGING
LDAP_LOG ( ACL, DETAIL1, "ldap_back_exop_passwd: \"%s\"%s\"\n",
op->o_req_dn.bv_val, isproxy ? " (proxy)" : "", 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_back_exop_passwd: \"%s\"%s\n",
op->o_req_dn.bv_val, isproxy ? " (proxy)" : "", 0 );
#endif
if ( isproxy ) {
dc.rwmap = &li->rwmap;

View file

@ -174,13 +174,8 @@ ldap_back_db_open( BackendDB *be )
{
struct ldapinfo *li = (struct ldapinfo *)be->be_private;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDAP, DETAIL1,
"ldap_back_db_open: URI=%s\n", li->url, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_back_db_open: URI=%s\n", li->url, 0, 0 );
#endif
#ifdef LDAP_BACK_PROXY_AUTHZ
/* by default, use proxyAuthz control on each operation */

View file

@ -492,15 +492,9 @@ ldap_back_filter_map_rewrite(
*fstr = ftmp;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDAP, DETAIL1,
"[rw] %s: \"%s\" -> \"%s\"\n",
fdc.ctx, ftmp.bv_val, fstr->bv_val );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS,
"[rw] %s: \"%s\" -> \"%s\"\n",
fdc.ctx, ftmp.bv_val, fstr->bv_val );
#endif /* !NEW_LOGGING */
rc = LDAP_SUCCESS;
break;

View file

@ -420,13 +420,8 @@ ldap_build_entry(
if ( slap_bv2undef_ad( &mapped, &attr->a_desc, &text )
!= LDAP_SUCCESS )
{
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDAP, DETAIL1,
"slap_bv2undef_ad(%s): %s\n", mapped.bv_val, text, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"slap_bv2undef_ad(%s): %s\n", mapped.bv_val, text, 0 );
#endif /* !NEW_LOGGING */
ch_free( attr );
continue;
}

View file

@ -53,15 +53,9 @@ ldap_back_dn_massage(
} else {
*res = *dn;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDAP, DETAIL1,
"[rw] %s: \"%s\" -> \"%s\"\n",
dc->ctx, dn->bv_val, res->bv_val );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS,
"[rw] %s: \"%s\" -> \"%s\"\n",
dc->ctx, dn->bv_val, res->bv_val );
#endif /* !NEW_LOGGING */
rc = LDAP_SUCCESS;
break;
@ -147,16 +141,10 @@ ldap_back_dn_massage(
res->bv_val = ch_malloc( res->bv_len + 1 );
strncpy( res->bv_val, dn->bv_val, diff );
strcpy( &res->bv_val[diff], dc->rwmap->rwm_suffix_massage[i+dst].bv_val );
#ifdef NEW_LOGGING
LDAP_LOG ( BACK_LDAP, ARGS,
"ldap_back_dn_massage: converted \"%s\" to \"%s\"\n",
dn->bv_val, res->bv_val, 0 );
#else
Debug( LDAP_DEBUG_ARGS,
"ldap_back_dn_massage:"
" converted \"%s\" to \"%s\"\n",
dn->bv_val, res->bv_val, 0 );
#endif
break;
}
}

View file

@ -40,14 +40,9 @@ ldap_back_conn_destroy(
struct ldapinfo *li = (struct ldapinfo *) be->be_private;
struct ldapconn *lc = NULL, lc_curr;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDAP, INFO,
"ldap_back_conn_destroy: fetching conn %ld\n", conn->c_connid, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_TRACE,
"=>ldap_back_conn_destroy: fetching conn %ld\n",
conn->c_connid, 0, 0 );
#endif /* !NEW_LOGGING */
lc_curr.conn = conn;
lc_curr.local_dn = conn->c_ndn;
@ -64,15 +59,9 @@ ldap_back_conn_destroy(
#endif /* ENABLE_REWRITE */
if (lc) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDAP, DETAIL1,
"ldap_back_conn_destroy: destroying conn %ld\n",
conn->c_connid, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_TRACE,
"=>ldap_back_conn_destroy: destroying conn %ld\n",
lc->conn->c_connid, 0, 0 );
#endif
/*
* Needs a test because the handler may be corrupted,

View file

@ -42,26 +42,15 @@ ldbm_back_add(
int subentry;
#endif
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_add: %s\n",
op->o_req_dn.bv_val, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n",
op->o_req_dn.bv_val, 0, 0);
#endif
rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL,
&rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: entry (%s) failed schema check.\n",
op->o_req_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry failed schema check: %s\n",
rs->sr_text, 0, 0 );
#endif
send_ldap_result( op, rs );
return rs->sr_err;
@ -74,14 +63,8 @@ ldbm_back_add(
if ( !access_allowed( op, op->oq_add.rs_e,
entry, NULL, ACL_WRITE, NULL ) )
{
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: No write access to entry (%s).\n",
op->o_req_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "no write access to entry\n", 0,
0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS,
"no write access to entry" );
@ -132,14 +115,8 @@ ldbm_back_add(
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: Parent of (%s) does not exist.\n",
op->o_req_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "parent does not exist\n",
0, 0, 0 );
#endif
rs->sr_text = rs->sr_ref
? "parent is referral" : "parent does not exist";
@ -158,14 +135,8 @@ ldbm_back_add(
cache_return_entry_w( &li->li_cache, p );
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: No write access to parent (%s).\n",
op->o_req_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "no write access to parent\n", 0,
0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS,
"no write access to parent" );
@ -175,13 +146,8 @@ ldbm_back_add(
#ifdef LDBM_SUBENTRIES
if ( is_entry_subentry( p )) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, DETAIL1,
"bdb_add: parent is subentry\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is subentry\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_OBJECT_CLASS_VIOLATION;
rs->sr_text = "parent is a subentry";
goto return_results;
@ -195,13 +161,8 @@ ldbm_back_add(
cache_return_entry_w( &li->li_cache, p );
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
#ifdef NEW_LOGGING
LDAP_LOG(BACK_LDBM, ERR,
"ldbm_back_add: Parent is an alias.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "parent is alias\n", 0,
0, 0 );
#endif
send_ldap_error( op, rs, LDAP_ALIAS_PROBLEM,
"parent is an alias" );
@ -220,13 +181,8 @@ ldbm_back_add(
cache_return_entry_w( &li->li_cache, p );
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: Parent is referral.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "parent is referral\n", 0,
0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;
send_ldap_result( op, rs );
@ -252,14 +208,8 @@ ldbm_back_add(
{
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: %s add denied.\n",
pdn.bv_val == NULL ? "suffix" : "entry at root", 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "%s add denied\n",
pdn.bv_val == NULL ? "suffix" : "entry at root", 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_NO_SUCH_OBJECT, NULL );
return LDAP_NO_SUCH_OBJECT;
@ -274,13 +224,8 @@ ldbm_back_add(
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: next_id failed.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "ldbm_add: next_id failed\n",
0, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_OTHER,
"next_id add failed" );
@ -302,13 +247,8 @@ ldbm_back_add(
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: cache_add_entry_lock failed.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "cache_add_entry_lock failed\n", 0, 0,
0 );
#endif
rs->sr_text = rs->sr_err > 0 ? NULL : "cache add failed";
rs->sr_err = rs->sr_err > 0 ? LDAP_ALREADY_EXISTS : LDAP_OTHER;
@ -321,13 +261,8 @@ ldbm_back_add(
/* attribute indexes */
if ( index_entry_add( op, op->oq_add.rs_e ) != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: index_entry_add failed.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "index_entry_add failed\n", 0,
0, 0 );
#endif
send_ldap_error( op, rs, LDAP_OTHER,
"index generation failed" );
@ -339,13 +274,8 @@ ldbm_back_add(
if ( dn2id_add( op->o_bd, &op->oq_add.rs_e->e_nname,
op->oq_add.rs_e->e_id ) != 0 )
{
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: dn2id_add failed.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "dn2id_add failed\n", 0,
0, 0 );
#endif
/* FIXME: delete attr indices? */
send_ldap_error( op, rs, LDAP_OTHER,
@ -356,13 +286,8 @@ ldbm_back_add(
/* id2entry index */
if ( id2entry_add( op->o_bd, op->oq_add.rs_e ) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_add: id2entry_add failed.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "id2entry_add failed\n", 0,
0, 0 );
#endif
/* FIXME: delete attr indices? */
(void) dn2id_delete( op->o_bd, &op->oq_add.rs_e->e_nname,

View file

@ -188,14 +188,8 @@ attr_index_config(
return LDAP_INAPPROPRIATE_MATCHING;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"attr_index_config: index %s 0x%04lx\n",
ad->ad_cname.bv_val, mask, 0 );
#else
Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04lx\n",
ad->ad_cname.bv_val, mask, 0 );
#endif
a->ai_desc = ad;

View file

@ -45,13 +45,8 @@ ldbm_back_bind(
AttributeDescription *password = slap_schema.si_ad_userPassword;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY,
"ldbm_back_bind: dn: %s.\n", op->o_req_dn.bv_val, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"==> ldbm_back_bind: dn: %s\n", op->o_req_dn.bv_val, 0, 0);
#endif
if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op ) ) {
ber_dupbv( &op->oq_bind.rb_edn, be_root_dn( op->o_bd ) );
@ -80,13 +75,8 @@ ldbm_back_bind(
#ifdef LDBM_SUBENTRIES
if ( is_entry_subentry( e ) ) {
/* entry is an subentry, don't allow bind */
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_bind: entry is subentry\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"entry is subentry\n", 0, 0, 0 );
#endif
rc = LDAP_INVALID_CREDENTIALS;
goto return_results;
}
@ -94,13 +84,7 @@ ldbm_back_bind(
if ( is_entry_alias( e ) ) {
/* entry is an alias, don't allow bind */
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_bind: entry (%s) is an alias.\n",
e->e_name.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0, 0, 0 );
#endif
#if 1
rc = LDAP_INVALID_CREDENTIALS;
@ -113,12 +97,7 @@ ldbm_back_bind(
if ( is_entry_referral( e ) ) {
/* entry is a referral, don't allow bind */
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_bind: entry(%s) is a referral.\n", e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0, 0, 0 );
#endif
rc = LDAP_INVALID_CREDENTIALS;
goto return_results;

View file

@ -128,30 +128,18 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw )
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"cache_return_entry_rw: return (%ld):%s, refcnt=%d\n",
id, rw ? "w" : "r", refcnt );
#else
Debug( LDAP_DEBUG_TRACE,
"====> cache_return_entry_%s( %ld ): created (%d)\n",
rw ? "w" : "r", id, refcnt );
#endif
} else if ( LEI(e)->lei_state == CACHE_ENTRY_DELETED ) {
if( refcnt > 0 ) {
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"cache_return_entry_rw: %ld, delete pending (%d).\n",
id, refcnt, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"====> cache_return_entry_%s( %ld ): delete pending (%d)\n",
rw ? "w" : "r", id, refcnt );
#endif
} else {
cache_entry_private_destroy( e );
@ -162,29 +150,18 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw )
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"cache_return_entry_rw: (%ld): deleted (%d)\n", id, refcnt, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"====> cache_return_entry_%s( %ld ): deleted (%d)\n",
rw ? "w" : "r", id, refcnt );
#endif
}
} else {
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"cache_return_entry_rw: ID %ld:%s returned (%d)\n",
id, rw ? "w": "r", refcnt );
#else
Debug( LDAP_DEBUG_TRACE,
"====> cache_return_entry_%s( %ld ): returned (%d)\n",
rw ? "w" : "r", id, refcnt);
#endif
}
}
@ -229,11 +206,6 @@ cache_add_entry_rw(
int i, rc;
Entry *ee;
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, ENTRY,
"cache_add_entry_rw: add (%s):%s to cache\n",
e->e_dn, rw ? "w" : "r", 0 );
#endif
/* set cache mutex */
ldap_pvt_thread_mutex_lock( &cache->c_mutex );
@ -243,15 +215,9 @@ cache_add_entry_rw(
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, ERR,
"cache_add_entry_rw: add (%s):%ld private init failed!\n",
e->e_dn, e->e_id, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"====> cache_add_entry( %ld ): \"%s\": private init failed!\n",
e->e_id, e->e_dn, 0 );
#endif
return( -1 );
}
@ -262,15 +228,9 @@ cache_add_entry_rw(
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"cache_add_entry: (%s):%ld already in cache.\n",
e->e_dn, e->e_id, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"====> cache_add_entry( %ld ): \"%s\": already in dn cache\n",
e->e_id, e->e_dn, 0 );
#endif
cache_entry_private_destroy(e);
@ -281,28 +241,16 @@ cache_add_entry_rw(
if ( avl_insert( &cache->c_idtree, (caddr_t) e,
entry_id_cmp, avl_dup_error ) != 0 )
{
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"cache_add_entry: (%s):%ls already in cache.\n",
e->e_dn, e->e_id, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"====> cache_add_entry( %ld ): \"%s\": already in id cache\n",
e->e_id, e->e_dn, 0 );
#endif
/* delete from dn tree inserted above */
if ( avl_delete( &cache->c_dntree, (caddr_t) e,
entry_dn_cmp ) == NULL )
{
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, INFO,
"cache_add_entry: can't delete (%s) from cache.\n",
e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "====> can't delete from dn cache\n",
0, 0, 0 );
#endif
}
cache_entry_private_destroy(e);
@ -383,15 +331,9 @@ cache_update_entry(
if ( avl_insert( &cache->c_dntree, (caddr_t) e,
entry_dn_cmp, avl_dup_error ) != 0 )
{
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"cache_update_entry: (%s):%ld already in dn cache\n",
e->e_dn, e->e_id, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"====> cache_update_entry( %ld ): \"%s\": already in dn cache\n",
e->e_id, e->e_dn, 0 );
#endif
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
@ -402,28 +344,16 @@ cache_update_entry(
if ( avl_insert( &cache->c_idtree, (caddr_t) e,
entry_id_cmp, avl_dup_error ) != 0 )
{
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"cache_update_entry: (%s)%ld already in id cache\n",
e->e_dn, e->e_id, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"====> cache_update_entry( %ld ): \"%s\": already in id cache\n",
e->e_id, e->e_dn, 0 );
#endif
/* delete from dn tree inserted above */
if ( avl_delete( &cache->c_dntree, (caddr_t) e,
entry_dn_cmp ) == NULL )
{
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, INFO,
"cache_update_entry: can't delete (%s)%ld from dn cache.\n",
e->e_dn, e->e_id, 0 );
#else
Debug( LDAP_DEBUG_ANY, "====> can't delete from dn cache\n",
0, 0, 0 );
#endif
}
/* free cache mutex */
@ -522,15 +452,9 @@ try_again:
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, INFO,
"cache_find_entry_ndn2id: (%s) %ld not ready: %d\n",
ndn->bv_val, id, state );
#else
Debug(LDAP_DEBUG_TRACE,
"====> cache_find_entry_ndn2id(\"%s\"): %ld (not ready) %d\n",
ndn->bv_val, id, state);
#endif
ldap_pvt_thread_yield();
goto try_again;
@ -543,15 +467,9 @@ try_again:
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"cache_find_entry_ndn2id: (%s): %ld %d tries\n",
ndn->bv_val, id, count );
#else
Debug(LDAP_DEBUG_TRACE,
"====> cache_find_entry_ndn2id(\"%s\"): %ld (%d tries)\n",
ndn->bv_val, id, count);
#endif
} else {
/* free cache mutex */
@ -605,16 +523,9 @@ try_again:
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, INFO,
"cache_find_entry_id: (%ld)->%ld not ready (%d).\n",
id, ep_id, state );
#else
Debug(LDAP_DEBUG_TRACE,
"====> cache_find_entry_id( %ld ): %ld (not ready) %d\n",
id, ep_id, state);
#endif
ldap_pvt_thread_yield();
goto try_again;
@ -629,15 +540,9 @@ try_again:
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"cache_find_entry_id: %ld -> %s found %d tries.\n",
ep_id, ep->e_dn, count );
#else
Debug(LDAP_DEBUG_TRACE,
"====> cache_find_entry_id( %ld ) \"%s\" (found) (%d tries)\n",
ep_id, ep->e_dn, count);
#endif
return( ep );
}
@ -672,13 +577,8 @@ cache_delete_entry(
assert( e->e_private );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, ENTRY,
"cache_delete_entry: delete %ld.\n", e->e_id, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "====> cache_delete_entry( %ld )\n",
e->e_id, 0, 0 );
#endif
rc = cache_delete_entry_internal( cache, e );
@ -732,11 +632,7 @@ cache_release_all( Cache *cache )
/* set cache mutex */
ldap_pvt_thread_mutex_lock( &cache->c_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, ENTRY, "cache_release_all: enter\n" , 0, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE, "====> cache_release_all\n", 0, 0, 0 );
#endif
while ( (e = cache->c_lrutail) != NULL && LEI(e)->lei_refcnt == 0 ) {
@ -748,12 +644,7 @@ cache_release_all( Cache *cache )
}
if ( cache->c_cursize ) {
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, INFO,
"cache_release_all: Entry cache could not be emptied.\n", 0, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE, "Entry-cache could not be emptied\n", 0, 0, 0 );
#endif
}
/* free cache mutex */

View file

@ -32,20 +32,10 @@ ldbm_back_db_close( Backend *be )
li->li_dbshutdown++;
ldap_pvt_thread_join( li->li_dbsynctid, (void *) NULL );
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, CRIT,
"ldbm_back_db_close: ldbm backend syncing\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldbm backend syncing\n", 0, 0, 0 );
#endif
ldbm_cache_flush_all( be );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, CRIT,
"ldbm_back_db_close: ldbm backend synch'ed\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldbm backend done syncing\n", 0, 0, 0 );
#endif
cache_release_all( &((struct ldbminfo *) be->be_private)->li_cache );

View file

@ -68,13 +68,8 @@ ldbm_back_compare(
/* entry is a referral, don't allow add */
rs->sr_ref = get_entry_referrals( op, e );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_compare: entry (%s) is a referral.\n", e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;

View file

@ -115,32 +115,18 @@ ldbm_back_db_config(
#ifndef NO_THREADS
int i;
if ( argc < 2 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, ERR, "ldbm_back_db_config: %s: "
"line %d: missing frequency value in \"dbsync <frequency> "
"[<wait-times> [wait-interval]]\" line\n", fname, lineno, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing frquency value in \"dbsync <frequency> [<wait-times> [wait-interval]]\" line\n",
fname, lineno, 0 );
#endif
return 1;
}
i = atoi( argv[1] );
if( i < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, ERR,
"ldbm_back_db_config: %s: "
"line %d: frequency value (%d) invalid \"dbsync "
"<frequency> [<wait-times> [wait-interval]]\" line\n",
fname, lineno, i );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: frquency value (%d) invalid \"dbsync <frequency> [<wait-times> [wait-interval]]\" line\n",
fname, lineno, i );
#endif
return 1;
}
@ -149,16 +135,9 @@ ldbm_back_db_config(
if ( argc > 2 ) {
i = atoi( argv[2] );
if ( i < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG,ERR, "ldbm_back_db_config: %s: "
"line %d: frequency value (%d) invalid \"dbsync "
"<frequency> [<wait-times> [wait-interval]]\" line\n",
fname, lineno, i );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: frquency value (%d) invalid \"dbsync <frequency> [<wait-times> [wait-interval]]\" line\n",
fname, lineno, i );
#endif
return 1;
}
li ->li_dbsyncwaitn = i;
@ -167,16 +146,9 @@ ldbm_back_db_config(
if ( argc > 3 ) {
i = atoi( argv[3] );
if ( i <= 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG,ERR, "ldbm_back_db_config: %s: "
"line %d: frequency value (%d) invalid \"dbsync "
"<frequency> [<wait-times> [wait-interval]]\" line\n",
fname, lineno, i );
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: frquency value (%d) invalid \"dbsync <frequency> [<wait-times> [wait-interval]]\" line\n",
fname, lineno, i );
#endif
return 1;
}
li ->li_dbsyncwaitinterval = i;
@ -186,13 +158,8 @@ ldbm_back_db_config(
li->li_dbwritesync = 0;
#else
#ifdef NEW_LOGGING
LDAP_LOG ( CONFIG, ERR, "ldbm_back_db_config: \"dbsync\""
" policies not supported in non-threaded environments\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"\"dbsync\" policies not supported in non-threaded environments\n", 0, 0, 0);
#endif
return 1;
#endif

View file

@ -62,13 +62,8 @@ ldbm_cache_open(
flags |= LDBM_NOSYNC;
}
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, ENTRY,
"ldbm_cache_open: \"%s\", %d, %o\n", buf, flags, li->li_mode );
#else
Debug( LDAP_DEBUG_TRACE, "=> ldbm_cache_open( \"%s\", %d, %o )\n", buf,
flags, li->li_mode );
#endif
empty = MAXDBCACHE;
@ -109,13 +104,8 @@ ldbm_cache_open(
break;
}
li->li_dbcache[i].dbc_refcnt++;
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"ldbm_cache_open: cache %d\n", i, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= ldbm_cache_open (cache %d)\n", i, 0, 0 );
#endif
ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex );
return( &li->li_dbcache[i] );
@ -140,15 +130,9 @@ ldbm_cache_open(
free( li->li_dbcache[i].dbc_name );
li->li_dbcache[i].dbc_name = NULL;
} else {
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, INFO,
"ldbm_cache_open: no unused db to close - waiting\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"ldbm_cache_open no unused db to close - waiting\n",
0, 0, 0 );
#endif
ldap_pvt_thread_cond_wait( &li->li_dbcache_cv,
&li->li_dbcache_mutex );
@ -164,17 +148,10 @@ ldbm_cache_open(
li->li_dbcachesize )) == NULL )
{
int err = errno;
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, ERR,
"ldbm_cache_open: \"%s\" failed, errono=%d, reason=%s\n",
buf, err, err > -1 && err < sys_nerr ? sys_errlist[err] :
"unknown" );
#else
Debug( LDAP_DEBUG_TRACE,
"<= ldbm_cache_open NULL \"%s\" errno=%d reason=\"%s\")\n",
buf, err, err > -1 && err < sys_nerr ?
sys_errlist[err] : "unknown" );
#endif
ldap_pvt_thread_mutex_unlock( &li->li_dbcache_mutex );
return( NULL );
@ -199,23 +176,12 @@ ldbm_cache_open(
assert( li->li_dbcache[i].dbc_maxindirect < 256 );
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, ARGS,
"ldbm_cache_open: blksize:%ld maxids:%d maxindirect:%d\n",
li->li_dbcache[i].dbc_blksize, li->li_dbcache[i].dbc_maxids,
li->li_dbcache[i].dbc_maxindirect );
#else
Debug( LDAP_DEBUG_ARGS,
"ldbm_cache_open (blksize %ld) (maxids %d) (maxindirect %d)\n",
li->li_dbcache[i].dbc_blksize, li->li_dbcache[i].dbc_maxids,
li->li_dbcache[i].dbc_maxindirect );
#endif
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1, "<= ldbm_cache_open: (opened %d)\n", i, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= ldbm_cache_open (opened %d)\n", i, 0, 0 );
#endif
ldap_pvt_thread_mutex_init( &li->li_dbcache[i].dbc_write_mutex );
@ -267,39 +233,21 @@ ldbm_cache_flush_all( Backend *be )
ldap_pvt_thread_mutex_lock( &li->li_dbcache_mutex );
for ( i = 0; i < MAXDBCACHE; i++ ) {
if ( li->li_dbcache[i].dbc_name != NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"ldbm_cache_flush_all: flushing db (%s)\n",
li->li_dbcache[i].dbc_name, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldbm flushing db (%s)\n",
li->li_dbcache[i].dbc_name, 0, 0 );
#endif
ldbm_sync( li->li_dbcache[i].dbc_db );
li->li_dbcache[i].dbc_dirty = 0;
if ( li->li_dbcache[i].dbc_refcnt != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, INFO,
"ldbm_cache_flush_all: couldn't close db (%s), refcnt=%d\n",
li->li_dbcache[i].dbc_name, li->li_dbcache[i].dbc_refcnt,0);
#else
Debug( LDAP_DEBUG_TRACE,
"refcnt = %d, couldn't close db (%s)\n",
li->li_dbcache[i].dbc_refcnt,
li->li_dbcache[i].dbc_name, 0 );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG( CACHE, DETAIL1,
"ldbm_cache_flush_all: ldbm closing db (%s)\n",
li->li_dbcache[i].dbc_name, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm closing db (%s)\n",
li->li_dbcache[i].dbc_name, 0, 0 );
#endif
ldap_pvt_thread_cond_signal( &li->li_dbcache_cv );
ldbm_close( li->li_dbcache[i].dbc_db );
@ -320,13 +268,8 @@ ldbm_cache_sync( Backend *be )
ldap_pvt_thread_mutex_lock( &li->li_dbcache_mutex );
for ( i = 0; i < MAXDBCACHE; i++ ) {
if ( li->li_dbcache[i].dbc_name != NULL && li->li_dbcache[i].dbc_dirty ) {
#ifdef NEW_LOGGING
LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync: "
"ldbm syncing db (%s)\n", li->li_dbcache[i].dbc_name, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldbm syncing db (%s)\n",
li->li_dbcache[i].dbc_name, 0, 0 );
#endif
ldbm_sync( li->li_dbcache[i].dbc_db );
li->li_dbcache[i].dbc_dirty = 0;
}
@ -383,12 +326,7 @@ ldbm_cache_sync_daemon(
Backend *be = (Backend *)be_ptr;
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
#ifdef NEW_LOGGING
LDAP_LOG ( CACHE, ARGS, "ldbm_cache_sync_daemon:"
" synchronizer starting for %s\n", li->li_directory, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "synchronizer starting for %s\n", li->li_directory, 0, 0 );
#endif
while (!li->li_dbshutdown) {
int i = li->li_dbsyncwaitn;
@ -396,33 +334,18 @@ ldbm_cache_sync_daemon(
sleep( li->li_dbsyncfreq );
while (i && ldap_pvt_thread_pool_backload(&connection_pool) != 0) {
#ifdef NEW_LOGGING
LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync_daemon:"
" delay syncing %s\n", li->li_directory, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "delay syncing %s\n", li->li_directory, 0, 0 );
#endif
sleep(li->li_dbsyncwaitinterval);
i--;
}
if (!li->li_dbshutdown) {
#ifdef NEW_LOGGING
LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync_daemon:"
" syncing %s\n", li->li_directory, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "syncing %s\n", li->li_directory, 0, 0 );
#endif
ldbm_cache_sync( be );
}
}
#ifdef NEW_LOGGING
LDAP_LOG ( CACHE, DETAIL1, "ldbm_cache_sync_daemon:"
" synchronizer stopping\n", 0, 0, 0);
#else
Debug( LDAP_DEBUG_ANY, "synchronizer stopping\n", 0, 0, 0 );
#endif
return NULL;
}

View file

@ -39,11 +39,7 @@ ldbm_back_delete(
AttributeDescription *children = slap_schema.si_ad_children;
AttributeDescription *entry = slap_schema.si_ad_entry;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_delete: %s\n", op->o_req_dn.bv_val, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_delete: %s\n", op->o_req_dn.bv_val, 0, 0);
#endif
/* grab giant lock for writing */
ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock);
@ -53,13 +49,8 @@ ldbm_back_delete(
/* FIXME : dn2entry() should return non-glue entry */
if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_delete: no such object %s\n", op->o_req_dn.bv_val, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: no such object %s\n",
op->o_req_dn.bv_val, 0, 0);
#endif
if ( matched != NULL ) {
rs->sr_matched = ch_strdup( matched->e_dn );
@ -100,15 +91,9 @@ ldbm_back_delete(
if ( ! access_allowed( op, e,
entry, NULL, ACL_WRITE, NULL ) )
{
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_delete: no write access to entry of (%s)\n",
op->o_req_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_delete: no write access to entry\n", 0,
0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS,
"no write access to entry" );
@ -122,13 +107,8 @@ ldbm_back_delete(
/* parent is an alias, don't allow add */
rs->sr_ref = get_entry_referrals( op, e );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_delete: entry (%s) is a referral.\n", e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;
rs->sr_matched = e->e_name.bv_val;
@ -142,13 +122,8 @@ ldbm_back_delete(
}
if ( has_children( op->o_bd, e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_delete: (%s) is a non-leaf node.\n", op->o_req_dn.bv_val, 0,0);
#else
Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: non leaf %s\n",
op->o_req_dn.bv_val, 0, 0);
#endif
send_ldap_error( op, rs, LDAP_NOT_ALLOWED_ON_NONLEAF,
"subtree delete not supported" );
@ -159,14 +134,9 @@ ldbm_back_delete(
if( !be_issuffix( op->o_bd, &e->e_nname ) && (dnParent( &e->e_nname, &pdn ),
pdn.bv_len) ) {
if( (p = dn2entry_w( op->o_bd, &pdn, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_delete: parent of (%s) does not exist\n", op->o_req_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_delete: parent does not exist\n",
0, 0, 0);
#endif
send_ldap_error( op, rs, LDAP_OTHER,
"could not locate parent of entry" );
@ -177,15 +147,9 @@ ldbm_back_delete(
if ( ! access_allowed( op, p,
children, NULL, ACL_WRITE, NULL ) )
{
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_delete: no access to parent of (%s)\n",
op->o_req_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_delete: no access to parent\n", 0,
0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS,
"no write access to parent" );
@ -205,15 +169,9 @@ ldbm_back_delete(
/* check parent for "children" acl */
if ( ! rc ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_delete: no access "
"to parent of ("")\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_delete: no "
"access to parent\n", 0, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS,
"no write access to parent" );
@ -221,15 +179,9 @@ ldbm_back_delete(
}
} else {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_delete: (%s) has no "
"parent & not a root.\n", op->o_ndn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_delete: no parent & "
"not root\n", 0, 0, 0);
#endif
send_ldap_error( op, rs,
LDAP_INSUFFICIENT_ACCESS,
@ -241,14 +193,9 @@ ldbm_back_delete(
/* delete from dn2id mapping */
if ( dn2id_delete( op->o_bd, &e->e_nname, e->e_id ) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_delete: (%s) operations error\n", op->o_req_dn.bv_val, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"<=- ldbm_back_delete: operations error %s\n",
op->o_req_dn.bv_val, 0, 0);
#endif
send_ldap_error( op, rs, LDAP_OTHER,
"DN index delete failed" );
@ -257,14 +204,9 @@ ldbm_back_delete(
/* delete from disk and cache */
if ( id2entry_delete( op->o_bd, e ) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_delete: (%s) operations error\n", op->o_req_dn.bv_val, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"<=- ldbm_back_delete: operations error %s\n",
op->o_req_dn.bv_val, 0, 0);
#endif
send_ldap_error( op, rs, LDAP_OTHER,
"entry delete failed" );

View file

@ -38,23 +38,14 @@ dn2id_add(
char *buf;
struct berval ptr, pdn;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "dn2id_add: (%s):%ld\n", dn->bv_val, id, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> dn2id_add( \"%s\", %ld )\n", dn->bv_val, id, 0 );
#endif
assert( id != NOID );
db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT );
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"dn2id_add: couldn't open/create dn2id%s\n", LDBM_SUFFIX, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "Could not open/create dn2id%s\n",
LDBM_SUFFIX, 0, 0 );
#endif
return( -1 );
}
@ -112,11 +103,7 @@ dn2id_add(
free( buf );
ldbm_cache_close( be, db );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "dn2id_add: return %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= dn2id_add %d\n", rc, 0, 0 );
#endif
return( rc );
}
@ -133,36 +120,23 @@ dn2id(
Datum key, data;
unsigned char *tmp;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "dn2id: (%s)\n", dn->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn->bv_val, 0, 0 );
#endif
assert( idp );
/* first check the cache */
*idp = cache_find_entry_ndn2id( be, &li->li_cache, dn );
if ( *idp != NOID ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1, "dn2id: (%s)%ld in cache.\n", dn, *idp, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld (in cache)\n", *idp,
0, 0 );
#endif
return( 0 );
}
db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT );
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"dn2id: couldn't open dn2id%s\n", LDBM_SUFFIX, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "<= dn2id could not open dn2id%s\n",
LDBM_SUFFIX, 0, 0 );
#endif
/*
* return code !0 if ldbm cache open failed;
* callers should handle this
@ -188,11 +162,7 @@ dn2id(
free( key.dptr );
if ( data.dptr == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO, "dn2id: (%s) NOID\n", dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= dn2id NOID\n", 0, 0, 0 );
#endif
*idp = NOID;
return( 0 );
@ -204,11 +174,7 @@ dn2id(
ldbm_datum_free( db->dbc_db, data );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "dn2id: %ld\n", *idp, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld\n", *idp, 0, 0 );
#endif
return( 0 );
}
@ -225,11 +191,7 @@ dn2idl(
Datum key;
unsigned char *tmp;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "dn2idl: \"%c%s\"\n", prefix, dn->bv_val, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> dn2idl( \"%c%s\" )\n", prefix, dn->bv_val, 0 );
#endif
assert( idlp != NULL );
*idlp = NULL;
@ -241,13 +203,8 @@ dn2idl(
db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT );
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"dn2idl: could not open dn2id%s\n", LDBM_SUFFIX, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "<= dn2idl could not open dn2id%s\n",
LDBM_SUFFIX, 0, 0 );
#endif
return -1;
}
@ -285,26 +242,16 @@ dn2id_delete(
char *buf;
struct berval ptr, pdn;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY,
"dn2id_delete: (%s)%ld\n", dn->bv_val, id, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> dn2id_delete( \"%s\", %ld )\n", dn->bv_val, id, 0 );
#endif
assert( id != NOID );
db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT );
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"dn2id_delete: couldn't open db2id%s\n", LDBM_SUFFIX, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= dn2id_delete could not open dn2id%s\n", LDBM_SUFFIX,
0, 0 );
#endif
return( -1 );
}
@ -356,11 +303,7 @@ dn2id_delete(
ldbm_cache_close( be, db );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "dn2id_delete: return %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= dn2id_delete %d\n", rc, 0, 0 );
#endif
return( rc );
}
@ -382,13 +325,8 @@ dn2entry_rw(
Entry *e = NULL;
struct berval pdn;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY,
"dn2entry_rw: %s entry %s\n", rw ? "w" : "r", dn->bv_val, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "dn2entry_%s: dn: \"%s\"\n",
rw ? "w" : "r", dn->bv_val, 0);
#endif
if( matched != NULL ) {
@ -408,15 +346,9 @@ dn2entry_rw(
return( e );
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"dn2entry_rw: no entry for valid id (%ld), dn (%s)\n",
id, dn->bv_val, 0 );
#else
Debug(LDAP_DEBUG_ANY,
"dn2entry_%s: no entry for valid id (%ld), dn \"%s\"\n",
rw ? "w" : "r", id, dn->bv_val);
#endif
/* must have been deleted from underneath us */
/* treat as if NOID was found */

View file

@ -77,82 +77,48 @@ int ldbm_back_entry_get(
int rc;
const char *at_name = at ? at->ad_cname.bv_val : "(null)";
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ARGS,
"ldbm_back_entry_get: ndn: \"%s\"\n", ndn->bv_val, 0, 0 );
LDAP_LOG( BACK_LDBM, ARGS,
"ldbm_back_entry_get: oc: \"%s\", at: \"%s\"\n",
oc ? oc->soc_cname.bv_val : "(null)", at_name, 0);
#else
Debug( LDAP_DEBUG_ARGS,
"=> ldbm_back_entry_get: ndn: \"%s\"\n", ndn->bv_val, 0, 0 );
Debug( LDAP_DEBUG_ARGS,
"=> ldbm_back_entry_get: oc: \"%s\", at: \"%s\"\n",
oc ? oc->soc_cname.bv_val : "(null)", at_name, 0);
#endif
/* don't grab the giant lock - our caller has already gotten it. */
/* can we find entry */
e = dn2entry_rw( op->o_bd, ndn, NULL, rw );
if (e == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_entry_get: cannot find entry (%s)\n",
ndn->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"=> ldbm_back_entry_get: cannot find entry: \"%s\"\n",
ndn->bv_val, 0, 0 );
#endif
return LDAP_NO_SUCH_OBJECT;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_entry_get: found entry (%s)\n",
ndn->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"=> ldbm_back_entry_get: found entry: \"%s\"\n",
ndn->bv_val, 0, 0 );
#endif
#ifdef BDB_ALIASES
/* find attribute values */
if( is_entry_alias( e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_entry_get: entry (%s) is an alias\n", e->e_name.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_entry_get: entry is an alias\n", 0, 0, 0 );
#endif
rc = LDAP_ALIAS_PROBLEM;
goto return_results;
}
#endif
if( is_entry_referral( e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_entry_get: entry (%s) is a referral.\n", e->e_name.bv_val, 0, 0);
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_entry_get: entry is a referral\n", 0, 0, 0 );
#endif
rc = LDAP_REFERRAL;
goto return_results;
}
if ( oc && !is_entry_objectclass( e, oc, 0 )) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_entry_get: failed to find objectClass.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"<= ldbm_back_entry_get: failed to find objectClass\n",
0, 0, 0 );
#endif
rc = LDAP_NO_SUCH_ATTRIBUTE;
goto return_results;
}
@ -167,12 +133,8 @@ return_results:
*ent = e;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_entry_get: rc=%d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_entry_get: rc=%d\n",
rc, 0, 0 );
#endif
return(rc);
}

View file

@ -48,11 +48,7 @@ filter_candidates(
char *sub = "SUBTREE";
ID_BLOCK *result;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY, "filter_candidates: enter\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> filter_candidates\n", 0, 0, 0 );
#endif
result = NULL;
@ -74,12 +70,7 @@ filter_candidates(
break;
case SLAPD_FILTER_DN_ONE:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1,
"filter_candidates: DN ONE (%s)\n", f->f_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tDN ONE\n", 0, 0, 0 );
#endif
/* an error is treated as an empty list */
if ( dn2idl( op->o_bd, f->f_dn, DN_ONE_PREFIX, &result ) != 0
@ -94,13 +85,8 @@ filter_candidates(
sub = "CHILDREN";
#endif
case SLAPD_FILTER_DN_SUBTREE:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1,
"filter_candidates: DN %s (%s)\n", sub, f->f_dn, 0 );
#else
Debug( LDAP_DEBUG_FILTER,
"\tDN %s\n", sub, 0, 0 );
#endif
/* an error is treated as an empty list */
if ( dn2idl( op->o_bd, f->f_dn, DN_SUBTREE_PREFIX, &result ) != 0
@ -111,100 +97,55 @@ filter_candidates(
break;
case LDAP_FILTER_PRESENT:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1,
"filter_candidates: Present (%s)\n",
f->f_desc->ad_cname.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 );
#endif
result = presence_candidates( op, f->f_desc );
break;
case LDAP_FILTER_EQUALITY:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1,
"filter_candidates: EQUALITY (%s),(%s)\n",
f->f_ava->aa_desc->ad_cname.bv_val,
f->f_ava->aa_value.bv_val, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 );
#endif
result = equality_candidates( op, f->f_ava );
break;
case LDAP_FILTER_APPROX:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1,
"filter_candidates: APPROX (%s), (%s)\n",
f->f_ava->aa_desc->ad_cname.bv_val,
f->f_ava->aa_value.bv_val, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 );
#endif
result = approx_candidates( op, f->f_ava );
break;
case LDAP_FILTER_SUBSTRINGS:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1,
"filter_candidates: SUBSTRINGS\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 );
#endif
result = substring_candidates( op, f->f_sub );
break;
case LDAP_FILTER_GE:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1, "filter_candidates: GE\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 );
#endif
result = presence_candidates( op, f->f_ava->aa_desc );
break;
case LDAP_FILTER_LE:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1, "filter_candidates: LE\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 );
#endif
result = presence_candidates( op, f->f_ava->aa_desc );
break;
case LDAP_FILTER_AND:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1, "filter_candidates: AND\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 );
#endif
result = list_candidates( op, f->f_and, LDAP_FILTER_AND );
break;
case LDAP_FILTER_OR:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1, "filter_candidates: OR\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 );
#endif
result = list_candidates( op, f->f_or, LDAP_FILTER_OR );
break;
case LDAP_FILTER_NOT:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1, "filter_candidates: NOT\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 );
#endif
/*
* As candidates lists may contain entries which do
@ -215,11 +156,7 @@ filter_candidates(
result = idl_allids( op->o_bd );
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1, "filter_candidates: UNKNOWN\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_FILTER, "\tUNKNOWN\n", 0, 0, 0 );
#endif
/* unknown filters must not return NULL, to allow
* extended filter processing to be done later.
*/
@ -227,14 +164,8 @@ filter_candidates(
break;
}
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY,
"filter_candidates: return %ld\n",
result ? ID_BLOCK_NIDS(result) : 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= filter_candidates %ld\n",
result ? ID_BLOCK_NIDS(result) : 0, 0, 0 );
#endif
return( result );
}
@ -252,11 +183,7 @@ presence_candidates(
slap_mask_t mask;
struct berval prefix = {0, NULL};
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY, "presence_candidates: enter\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> presence_candidates\n", 0, 0, 0 );
#endif
idl = idl_allids( op->o_bd );
@ -268,27 +195,18 @@ presence_candidates(
&dbname, &mask, &prefix );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, INFO,
"presence_candidates: index_param returned %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= presence_candidates: index_param returned=%d\n",
rc, 0, 0 );
#endif
return idl;
}
if( dbname == NULL ) {
/* not indexed */
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, INFO, "presence_candidates: not indexed\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= presense_candidates: not indexed\n",
0, 0, 0 );
#endif
return idl;
}
@ -296,15 +214,9 @@ presence_candidates(
db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT );
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, INFO,
"presence_candidates: db open failed (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= presense_candidates db open failed (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#endif
return idl;
}
@ -316,38 +228,23 @@ presence_candidates(
rc = key_read( op->o_bd, db, &prefix, &idl );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"presence_candidates: key read failed (%d)\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= presense_candidates key read failed (%d)\n",
rc, 0, 0 );
#endif
} else if( idl == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, DETAIL1, "presence_candidates: NULL\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= presense_candidates NULL\n",
0, 0, 0 );
#endif
}
}
ldbm_cache_close( op->o_bd, db );
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY,
"presence_candidates: return %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= presence_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#endif
return( idl );
}
@ -368,11 +265,7 @@ equality_candidates(
struct berval *keys = NULL;
MatchingRule *mr;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY, "equality_candidates: enter\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> equality_candidates\n", 0, 0, 0 );
#endif
idl = idl_allids( op->o_bd );
@ -381,27 +274,18 @@ equality_candidates(
&dbname, &mask, &prefix );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"equality_candidates: index_param returned %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= equality_candidates: index_param returned=%d\n",
rc, 0, 0 );
#endif
return idl;
}
if( dbname == NULL ) {
/* not indexed */
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR, "equality_candidates: not indexed\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= equality_candidates: not indexed\n",
0, 0, 0 );
#endif
return idl;
}
@ -425,28 +309,17 @@ equality_candidates(
&keys, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"equality_candidates: (%s%s) MR filter failed (%d\n",
dbname, LDBM_SUFFIX, rc );
#else
Debug( LDAP_DEBUG_TRACE,
"<= equality_candidates: (%s%s) MR filter failed (%d)\n",
dbname, LDBM_SUFFIX, rc );
#endif
return idl;
}
if( keys == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"equality_candidates: no keys (%s%s)\n", dbname, LDBM_SUFFIX, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= equality_candidates: no keys (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#endif
return idl;
}
@ -454,14 +327,9 @@ equality_candidates(
db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT );
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR, "equality_candidates: db open failed (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= equality_candidates db open failed (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#endif
return idl;
}
@ -475,14 +343,9 @@ equality_candidates(
if( rc != LDAP_SUCCESS ) {
idl_free( idl );
idl = NULL;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"equality_candidates: key read failed (%d)\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= equality_candidates key read failed (%d)\n",
rc, 0, 0 );
#endif
break;
}
@ -490,13 +353,9 @@ equality_candidates(
if( tmp == NULL ) {
idl_free( idl );
idl = NULL;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, INFO, "equality_candidates NULL\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= equality_candidates NULL\n",
0, 0, 0 );
#endif
break;
}
@ -514,14 +373,8 @@ equality_candidates(
ldbm_cache_close( op->o_bd, db );
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY,
"equality_candidates: return %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= equality_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#endif
return( idl );
}
@ -542,11 +395,7 @@ approx_candidates(
struct berval *keys = NULL;
MatchingRule *mr;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY, "approx_candidates: enter\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> approx_candidates\n", 0, 0, 0 );
#endif
idl = idl_allids( op->o_bd );
@ -555,27 +404,18 @@ approx_candidates(
&dbname, &mask, &prefix );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"approx_candidates: index_param returned %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= approx_candidates: index_param returned=%d\n",
rc, 0, 0 );
#endif
return idl;
}
if( dbname == NULL ) {
/* not indexed */
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR, "approx_candidates: not indexed\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= approx_candidates: not indexed\n",
0, 0, 0 );
#endif
return idl;
}
@ -604,29 +444,17 @@ approx_candidates(
&keys, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"approx_candidates: (%s%s) MR filter failed (%d)\n",
dbname, LDBM_SUFFIX, rc );
#else
Debug( LDAP_DEBUG_TRACE,
"<= approx_candidates: (%s%s) MR filter failed (%d)\n",
dbname, LDBM_SUFFIX, rc );
#endif
return idl;
}
if( keys == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, INFO,
"approx_candidates: no keys (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= approx_candidates: no keys (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#endif
return idl;
}
@ -634,15 +462,9 @@ approx_candidates(
db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT );
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"approx_candidates db open failed (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= approx_candidates db open failed (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#endif
return idl;
}
@ -656,13 +478,8 @@ approx_candidates(
if( rc != LDAP_SUCCESS ) {
idl_free( idl );
idl = NULL;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"approx_candidates: key read failed (%d)\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= approx_candidates key read failed (%d)\n",
rc, 0, 0 );
#endif
break;
}
@ -670,12 +487,8 @@ approx_candidates(
if( tmp == NULL ) {
idl_free( idl );
idl = NULL;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, INFO, "approx_candidates: NULL\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= approx_candidates NULL\n",
0, 0, 0 );
#endif
break;
}
@ -692,14 +505,8 @@ approx_candidates(
ldbm_cache_close( op->o_bd, db );
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY,
"approx_candidates: return %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= approx_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#endif
return( idl );
}
@ -714,23 +521,15 @@ list_candidates(
ID_BLOCK *idl, *tmp, *tmp2;
Filter *f;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY, "list_candidates: 0x%x\n", ftype, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> list_candidates 0x%x\n", ftype, 0, 0 );
#endif
idl = NULL;
for ( f = flist; f != NULL; f = f->f_next ) {
if ( (tmp = filter_candidates( op, f )) == NULL &&
ftype == LDAP_FILTER_AND ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, INFO, "list_candidates: NULL\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= list_candidates NULL\n", 0, 0, 0 );
#endif
idl_free( idl );
return( NULL );
@ -750,13 +549,8 @@ list_candidates(
}
}
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY, "list_candidates: return %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= list_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#endif
return( idl );
}
@ -777,11 +571,7 @@ substring_candidates(
struct berval *keys = NULL;
MatchingRule *mr;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY, "substrings_candidates: enter\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> substrings_candidates\n", 0, 0, 0 );
#endif
idl = idl_allids( op->o_bd );
@ -790,27 +580,18 @@ substring_candidates(
&dbname, &mask, &prefix );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"substrings_candidates: index_param returned %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= substrings_candidates: index_param returned=%d\n",
rc, 0, 0 );
#endif
return idl;
}
if( dbname == NULL ) {
/* not indexed */
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR, "substrings_candidates: not indexed\n", 0, 0, 0);
#else
Debug( LDAP_DEBUG_ANY,
"<= substrings_candidates: not indexed\n",
0, 0, 0 );
#endif
return idl;
}
@ -835,29 +616,17 @@ substring_candidates(
&keys, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"substrings_candidates: (%s%s) MR filter failed (%d)\n",
dbname, LDBM_SUFFIX, rc );
#else
Debug( LDAP_DEBUG_TRACE,
"<= substrings_candidates: (%s%s) MR filter failed (%d)\n",
dbname, LDBM_SUFFIX, rc );
#endif
return idl;
}
if( keys == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"substrings_candidates: (0x%04lx) no keys (%s%s)\n",
mask, dbname, LDBM_SUFFIX );
#else
Debug( LDAP_DEBUG_TRACE,
"<= substrings_candidates: (0x%04lx) no keys (%s%s)\n",
mask, dbname, LDBM_SUFFIX );
#endif
return idl;
}
@ -865,15 +634,9 @@ substring_candidates(
db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT );
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"substrings_candidates: db open failed (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= substrings_candidates db open failed (%s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#endif
return idl;
}
@ -887,13 +650,8 @@ substring_candidates(
if( rc != LDAP_SUCCESS ) {
idl_free( idl );
idl = NULL;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ERR,
"substrings_candidates: key read failed (%d)\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates key read failed (%d)\n",
rc, 0, 0 );
#endif
break;
}
@ -901,12 +659,8 @@ substring_candidates(
if( tmp == NULL ) {
idl_free( idl );
idl = NULL;
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, INFO, "substrings_candidates: NULL\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates NULL\n",
0, 0, 0 );
#endif
break;
}
@ -923,14 +677,8 @@ substring_candidates(
ldbm_cache_close( op->o_bd, db );
#ifdef NEW_LOGGING
LDAP_LOG( FILTER, ENTRY,
"substrings_candidates: return %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= substrings_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#endif
return( idl );
}

View file

@ -37,23 +37,14 @@ has_children(
ldbm_datum_init( key );
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "has_children: enter %ld\n", p->e_id, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> has_children( %ld )\n", p->e_id , 0, 0 );
#endif
if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX,
LDBM_WRCREAT )) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"has_children: could not open \"dn2id%s\"\n", LDBM_SUFFIX, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= has_children -1 could not open \"dn2id%s\"\n",
LDBM_SUFFIX, 0, 0 );
#endif
return( 0 );
}
@ -73,14 +64,8 @@ has_children(
rc = 1;
}
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY,
"has_children: id (%ld) %s children.\n",
p->e_id, rc ? "has" : "doesn't have", 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= has_children( %ld ): %s\n",
p->e_id, rc ? "yes" : "no", 0 );
#endif
return( rc );
}

View file

@ -41,24 +41,14 @@ id2entry_add( Backend *be, Entry *e )
ldbm_datum_init( key );
ldbm_datum_init( data );
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "id2entry_add: (%s)%ld\n", e->e_dn, e->e_id, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> id2entry_add( %ld, \"%s\" )\n", e->e_id,
e->e_dn, 0 );
#endif
if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
== NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"id2entry_add: could not open/create id2entry%s\n",
LDBM_SUFFIX, 0,0 );
#else
Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry%s\n",
LDBM_SUFFIX, 0, 0 );
#endif
return( -1 );
}
@ -83,11 +73,7 @@ id2entry_add( Backend *be, Entry *e )
ldbm_cache_close( be, db );
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "id2entry_add: return %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= id2entry_add %d\n", rc, 0, 0 );
#endif
return( rc );
@ -104,12 +90,8 @@ id2entry_delete( Backend *be, Entry *e )
ID id;
#endif
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "id2entry_delete: (%s)%ld\n", e->e_dn, e->e_id, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "=> id2entry_delete( %ld, \"%s\" )\n", e->e_id,
e->e_dn, 0 );
#endif
#ifdef notdef
@ -123,27 +105,15 @@ id2entry_delete( Backend *be, Entry *e )
if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
== NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"id2entry_delete: could not open/create id2entry%s\n",
LDBM_SUFFIX, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry%s\n",
LDBM_SUFFIX, 0, 0 );
#endif
return( -1 );
}
if ( cache_delete_entry( &li->li_cache, e ) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"id2entry_delete: Could not delete (%s)%ld from cache\n",
e->e_dn, e->e_id, 0 );
#else
Debug(LDAP_DEBUG_ANY, "could not delete %ld (%s) from cache\n",
e->e_id, e->e_dn, 0 );
#endif
}
@ -159,11 +129,7 @@ id2entry_delete( Backend *be, Entry *e )
ldbm_cache_close( be, db );
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "id2entry_delete: return %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= id2entry_delete %d\n", rc, 0, 0 );
#endif
return( rc );
}
@ -183,37 +149,21 @@ id2entry_rw( Backend *be, ID id, int rw )
ldbm_datum_init( key );
ldbm_datum_init( data );
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY,
"id2entry_rw: %s (%ld)\n", rw ? "write" : "read", id, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> id2entry_%s( %ld )\n",
rw ? "w" : "r", id, 0 );
#endif
if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, DETAIL1,
"id2entry_rw: %s (%ld) 0x%lx (cache).\n",
rw ? "write" : "read", id, (unsigned long)e );
#else
Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (cache)\n",
rw ? "w" : "r", id, (unsigned long) e );
#endif
return( e );
}
if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
== NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"id2entry_rw: could not open id2entry%s\n", LDBM_SUFFIX, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "Could not open id2entry%s\n",
LDBM_SUFFIX, 0, 0 );
#endif
return( NULL );
}
@ -229,13 +179,8 @@ id2entry_rw( Backend *be, ID id, int rw )
data = ldbm_cache_fetch( db, key );
if ( data.dptr == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"id2entry_rw: (%ld) not found\n", id, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) not found\n",
rw ? "w" : "r", id, 0 );
#endif
ldbm_cache_close( be, db );
return( NULL );
@ -246,13 +191,8 @@ id2entry_rw( Backend *be, ID id, int rw )
ldbm_cache_close( be, db );
if ( e == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"id2entry_rw: %s of %ld failed\n", rw ? "write" : "read", id, 0);
#else
Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) (failed)\n",
rw ? "w" : "r", id, 0 );
#endif
return( NULL );
}
@ -269,38 +209,20 @@ id2entry_rw( Backend *be, ID id, int rw )
* There are many underlying race condtions in the cache/disk code.
*/
if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, DETAIL1,
"id2entry_rw: %s of %ld 0x%lx (cache)\n",
rw ? "write" : "read", id, (unsigned long)e );
#else
Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (cache)\n",
rw ? "w" : "r", id, (unsigned long) e );
#endif
return( e );
}
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"id2entry_rw: %s of %ld (cache add failed)\n",
rw ? "write" : "read", id, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) (cache add failed)\n",
rw ? "w" : "r", id, 0 );
#endif
return NULL;
}
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY,
"id2entry_rw: %s of %ld 0x%lx (disk)\n",
rw ? "write" : "read", id, (unsigned long)e );
#else
Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (disk)\n",
rw ? "w" : "r", id, (unsigned long) e );
#endif
if ( slapMode == SLAP_SERVER_MODE ) {
/* marks the entry as committed, so it will get added to the cache

View file

@ -124,13 +124,9 @@ void
idl_free( ID_BLOCK *idl )
{
if ( idl == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, INFO, "idl_free: called with NULL pointer\n" , 0,0,0);
#else
Debug( LDAP_DEBUG_TRACE,
"idl_free: called with NULL pointer\n",
0, 0, 0 );
#endif
return;
}
@ -231,13 +227,8 @@ idl_fetch(
cont_id( &data, ID_BLOCK_ID(idl, i) );
if ( (tmp[i] = idl_fetch_one( be, db, data )) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, INFO,
"idl_fetch: idl_fetch_one returned NULL\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_ANY,
"idl_fetch: one returned NULL\n", 0, 0, 0 );
#endif
continue;
}
@ -274,14 +265,8 @@ idl_fetch(
idl_check(idl);
#endif
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY,
"idl_fetch: %ld ids (%ld max)\n",
ID_BLOCK_NIDS(idl), ID_BLOCK_NMAXN(idl), 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= idl_fetch %ld ids (%ld max)\n",
ID_BLOCK_NIDS(idl), ID_BLOCK_NMAXN(idl), 0 );
#endif
return( idl );
}
@ -418,14 +403,9 @@ idl_change_first(
/* delete old key block */
if ( (rc = ldbm_cache_delete( db, bkey )) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, INFO,
"idl_change_first: ldbm_cache_delete returned %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"idl_change_first: ldbm_cache_delete returned %d\n",
rc, 0, 0 );
#endif
return( rc );
}
@ -434,13 +414,8 @@ idl_change_first(
cont_id( &bkey, ID_BLOCK_ID(b, 0) );
if ( (rc = idl_store( be, db, bkey, b )) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, INFO,
"idl_change_first: idl_store returned %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"idl_change_first: idl_store returned %d\n", rc, 0, 0 );
#endif
return( rc );
}
@ -448,13 +423,8 @@ idl_change_first(
/* update + write indirect header block */
ID_BLOCK_ID(h, pos) = ID_BLOCK_ID(b, 0);
if ( (rc = idl_store( be, db, hkey, h )) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, INFO,
"idl_change_first: idl_store returned %s\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"idl_change_first: idl_store returned %d\n", rc, 0, 0 );
#endif
return( rc );
}
@ -586,13 +556,8 @@ idl_insert_key(
cont_id( &k2, ID_BLOCK_ID(idl, i) );
if ( (tmp = idl_fetch_one( be, db, k2 )) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"idl_insert_key: nonexistent continuation block\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "idl_insert_key: nonexistent continuation block\n",
0, 0, 0 );
#endif
cont_free( &k2 );
idl_free( idl );
@ -603,13 +568,8 @@ idl_insert_key(
switch ( idl_insert( &tmp, id, db->dbc_maxids ) ) {
case 0: /* id inserted ok */
if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"ids_insert_key: idl_store returned %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"idl_insert_key: idl_store returned %d\n", rc, 0, 0 );
#endif
}
break;
@ -647,14 +607,9 @@ idl_insert_key(
cont_alloc( &k3, &key );
cont_id( &k3, ID_BLOCK_ID(idl, i + 1) );
if ( (tmp2 = idl_fetch_one( be, db, k3 )) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"idl_insert_key: idl_fetch_one returned NULL\n", 0, 0, 0);
#else
Debug( LDAP_DEBUG_ANY,
"idl_insert_key: idl_fetch_one returned NULL\n",
0, 0, 0 );
#endif
/* split the original block */
cont_free( &k3 );
@ -676,13 +631,8 @@ idl_insert_key(
rc = idl_insert( &tmp, id, db->dbc_maxids );
if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"idl_insert_key: idl_store returned %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"idl_insert_key: idl_store returned %d\n", rc, 0, 0 );
#endif
}
@ -707,15 +657,9 @@ idl_insert_key(
* will always be called.
*/
if ( rc == 2 ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, INFO,
"idl_insert_key: id %ld is already in next block\n",
id, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"idl_insert_key: id %ld already in next block\n",
id, 0, 0 );
#endif
}
@ -968,13 +912,8 @@ idl_delete_key (
cont_id( &data, ID_BLOCK_ID(idl, j) );
if ( (tmp = idl_fetch_one( be, db, data )) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, INFO,
"idl_delete_key: idl_fetch_one returned NULL\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"idl_delete_key: idl_fetch of returned NULL\n", 0, 0, 0 );
#endif
continue;
}

View file

@ -173,14 +173,9 @@ static int indexer(
db = ldbm_cache_open( op->o_bd, dbname, LDBM_SUFFIX, LDBM_WRCREAT );
if ( db == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ERR,
"index_read: Could not open db %s%s\n", dbname, LDBM_SUFFIX, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"<= index_read NULL (could not open %s%s)\n",
dbname, LDBM_SUFFIX, 0 );
#endif
return LDAP_OTHER;
}
@ -312,15 +307,9 @@ index_entry(
Entry *e )
{
Attribute *ap = e->e_attrs;
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY,
"index_entry: %s (%s)%ld\n", opid == SLAP_INDEX_ADD_OP ? "add" : "del",
e->e_dn, e->e_id );
#else
Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n",
opid == SLAP_INDEX_ADD_OP ? "add" : "del",
e->e_id, e->e_dn );
#endif
/* add each attribute to the indexes */
for ( ; ap != NULL; ap = ap->a_next ) {
@ -329,13 +318,9 @@ index_entry(
e->e_id, opid );
}
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "index_entry: success\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n",
opid == SLAP_INDEX_ADD_OP ? "add" : "del",
e->e_id, e->e_dn );
#endif
return LDAP_SUCCESS;
}

View file

@ -219,13 +219,8 @@ ldbm_back_db_open(
if ( rc != 0 )
{
#ifdef NEW_LOGGING
LDAP_LOG ( BACK_LDBM, ERR, "ldbm_back_db_open: sync "
"ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"sync ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
#endif
return 1;
}
}

View file

@ -36,11 +36,7 @@ key_read(
Datum key;
ID_BLOCK *idl;
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "key_read: enter\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 );
#endif
ldbm_datum_init( key );
@ -49,13 +45,8 @@ key_read(
idl = idl_fetch( be, db, key );
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY,
"key_read: %ld candidates\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= index_read %ld candidates\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
#endif
*idout = idl;
@ -75,13 +66,8 @@ key_change(
int rc;
Datum key;
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "key_change: %s ID %lx\n",
op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long)id, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> key_change(%s,%lx)\n",
op == SLAP_INDEX_ADD_OP ? "ADD":"DELETE", (long) id, 0 );
#endif
ldbm_datum_init( key );
@ -100,11 +86,7 @@ key_change(
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( INDEX, ENTRY, "key_change: return %d\n", rc, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "<= key_change %d\n", rc, 0, 0 );
#endif
ldap_pvt_thread_yield();

View file

@ -45,19 +45,11 @@ int ldbm_modify_internal(
Attribute *save_attrs;
Attribute *ap;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY,
"ldbm_modify_internal: %s\n",
e->e_name.bv_val,
get_permissiveModify(op) ? " (permissive)" : "",
0 );
#else
Debug(LDAP_DEBUG_TRACE,
"ldbm_modify_internal: %s\n",
e->e_name.bv_val,
get_permissiveModify(op) ? " (permissive)" : "",
0 );
#endif
if ( !acl_check_modlist( op, e, modlist )) {
return LDAP_INSUFFICIENT_ACCESS;
@ -71,102 +63,57 @@ int ldbm_modify_internal(
switch ( mod->sm_op ) {
case LDAP_MOD_ADD:
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_modify_internal: add\n", 0, 0, 0);
#else
Debug(LDAP_DEBUG_ARGS,
"ldbm_modify_internal: add\n", 0, 0, 0);
#endif
rc = modify_add_values( e, mod, get_permissiveModify( op ),
text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
#endif
}
break;
case LDAP_MOD_DELETE:
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_modify_internal: delete\n", 0,0,0);
#else
Debug(LDAP_DEBUG_ARGS,
"ldbm_modify_internal: delete\n", 0, 0, 0);
#endif
rc = modify_delete_values( e, mod, get_permissiveModify( op ),
text, textbuf, textlen );
assert( rc != LDAP_TYPE_OR_VALUE_EXISTS );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
#endif
}
break;
case LDAP_MOD_REPLACE:
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_modify_internal: replace\n",0,0,0);
#else
Debug(LDAP_DEBUG_ARGS,
"ldbm_modify_internal: replace\n", 0, 0, 0);
#endif
rc = modify_replace_values( e, mod, get_permissiveModify( op ),
text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
#endif
}
break;
case LDAP_MOD_INCREMENT:
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_modify_internal: increment\n",0,0,0);
#else
Debug(LDAP_DEBUG_ARGS,
"ldbm_modify_internal: increment\n",0,0,0);
#endif
rc = modify_increment_values( e, mod, get_permissiveModify( op ),
text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
#endif
}
break;
case SLAP_MOD_SOFTADD:
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_modify_internal: softadd\n", 0, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"ldbm_modify_internal: softadd\n", 0, 0, 0);
#endif
/* Avoid problems in index_add_mods()
* We need to add index if necessary.
@ -181,34 +128,19 @@ int ldbm_modify_internal(
}
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
#endif
}
break;
default:
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_modify_internal: invalid op %d\n", mod->sm_op, 0, 0 );
#else
Debug(LDAP_DEBUG_ANY, "ldbm_modify_internal: invalid op %d\n",
mod->sm_op, 0, 0);
#endif
rc = LDAP_OTHER;
*text = "Invalid modify operation";
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_modify_internal: %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
#endif
}
if ( rc != LDAP_SUCCESS ) {
@ -235,14 +167,8 @@ int ldbm_modify_internal(
rc = entry_schema_check( op->o_bd, e, save_attrs, text, textbuf, textlen );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_modify_internal: entry failed schema check: %s\n",
*text, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "entry failed schema check: %s\n",
*text, 0, 0 );
#endif
goto exit;
}
@ -262,15 +188,9 @@ int ldbm_modify_internal(
ap->a_nvals,
e->e_id, SLAP_INDEX_DELETE_OP );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_modify_internal: Attribute index delete failure\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"ldbm_modify_internal: Attribute index delete failure\n",
0, 0, 0 );
#endif
goto exit;
}
ap->a_flags &= ~SLAP_ATTR_IXDEL;
@ -284,15 +204,9 @@ int ldbm_modify_internal(
ap->a_nvals,
e->e_id, SLAP_INDEX_ADD_OP );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_modify_internal: Attribute index add failure\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"ldbm_modify_internal: Attribute index add failure\n",
0, 0, 0 );
#endif
goto exit;
}
ap->a_flags &= ~SLAP_ATTR_IXADD;
@ -325,11 +239,7 @@ ldbm_back_modify(
char textbuf[SLAP_TEXT_BUFLEN];
size_t textlen = sizeof textbuf;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_modify: enter\n", 0, 0, 0);
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0);
#endif
/* grab giant lock for writing */
ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock);
@ -379,13 +289,8 @@ ldbm_back_modify(
/* parent is an alias, don't allow add */
rs->sr_ref = get_entry_referrals( op, e );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_modify: entry (%s) is referral\n", op->o_req_ndn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;
rs->sr_matched = e->e_name.bv_val;

View file

@ -63,18 +63,11 @@ ldbm_back_modrdn(
Modifications *mod = NULL; /* Used to delete old/add new rdn */
int manageDSAit = get_manageDSAit( op );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY,
"ldbm_back_modrdn: dn: %s newSuperior=%s\n",
op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "NULL",
( op->oq_modrdn.rs_newSup && op->oq_modrdn.rs_newSup->bv_len ) ? op->oq_modrdn.rs_newSup->bv_val : "NULL",0 );
#else
Debug( LDAP_DEBUG_TRACE,
"==>ldbm_back_modrdn: dn: %s newSuperior=%s\n",
op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "NULL",
( op->oq_modrdn.rs_newSup && op->oq_modrdn.rs_newSup->bv_len )
? op->oq_modrdn.rs_newSup->bv_val : "NULL", 0 );
#endif
/* grab giant lock for writing */
ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock);
@ -122,15 +115,9 @@ ldbm_back_modrdn(
if ( ! access_allowed( op, e,
entry, NULL, ACL_WRITE, NULL ) )
{
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_modrdn: no write access to entry of (%s)\n",
op->o_req_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_modrdn: no write access to entry\n", 0,
0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS,
"no write access to entry" );
@ -143,13 +130,8 @@ ldbm_back_modrdn(
/* parent is an alias, don't allow add */
rs->sr_ref = get_entry_referrals( op, e );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_modrdn: entry %s is a referral\n", e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry %s is referral\n", e->e_dn,
0, 0 );
#endif
rs->sr_err = LDAP_REFERRAL;
rs->sr_matched = e->e_name.bv_val;
@ -162,13 +144,8 @@ ldbm_back_modrdn(
}
if ( has_children( op->o_bd, e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_modrdn: entry %s has children\n", e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry %s has children\n", e->e_dn,
0, 0 );
#endif
send_ldap_error( op, rs, LDAP_NOT_ALLOWED_ON_NONLEAF,
"subtree rename not supported" );
@ -187,14 +164,8 @@ ldbm_back_modrdn(
*/
if( (p = dn2entry_w( op->o_bd, &p_ndn, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_modrdn: parent of %s does not exist\n",
e->e_ndn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "parent does not exist\n",
0, 0, 0);
#endif
send_ldap_error( op, rs, LDAP_OTHER,
"parent entry does not exist" );
@ -206,29 +177,17 @@ ldbm_back_modrdn(
if ( ! access_allowed( op, p,
children, NULL, ACL_WRITE, NULL ) )
{
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_modrdn: no access to parent of (%s)\n",
e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0,
0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS,
NULL );
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_back_modrdn: wr to children of entry %s OK\n",
p_ndn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: wr to children of entry %s OK\n",
p_ndn.bv_val, 0, 0 );
#endif
if ( p_ndn.bv_val == slap_empty_bv.bv_val ) {
p_dn = slap_empty_bv;
@ -236,13 +195,8 @@ ldbm_back_modrdn(
dnParent( &e->e_name, &p_dn );
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_back_modrdn: parent dn=%s\n", p_dn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: parent dn=%s\n",
p_dn.bv_val, 0, 0 );
#endif
} else {
/* no parent, must be root to modify rdn */
@ -259,14 +213,9 @@ ldbm_back_modrdn(
/* check parent for "children" acl */
if ( ! can_access ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_modrdn: no access to parent \"\"\n", 0,0,0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_modrdn: no "
"access to parent\n", 0, 0, 0 );
#endif
send_ldap_error( op, rs,
LDAP_INSUFFICIENT_ACCESS,
@ -275,15 +224,9 @@ ldbm_back_modrdn(
}
} else {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_modrdn: (%s) has no parent & not a root.\n",
op->o_ndn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_modrdn: no parent & "
"not root\n", 0, 0, 0);
#endif
send_ldap_error( op, rs,
LDAP_INSUFFICIENT_ACCESS,
@ -292,43 +235,26 @@ ldbm_back_modrdn(
}
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_modrdn: (%s) no parent, locked root.\n", e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: no parent, locked root\n",
0, 0, 0 );
#endif
}
new_parent_dn = &p_dn; /* New Parent unless newSuperior given */
if ( op->oq_modrdn.rs_newSup != NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_back_modrdn: new parent \"%s\" requested\n",
op->oq_modrdn.rs_newSup->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: new parent \"%s\" requested...\n",
op->oq_modrdn.rs_newSup->bv_val, 0, 0 );
#endif
np_ndn = op->oq_modrdn.rs_nnewSup;
/* newSuperior == oldParent? */
if ( dn_match( &p_ndn, np_ndn ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO, "ldbm_back_modrdn: "
"new parent\"%s\" seems to be the same as the "
"old parent \"%s\"\n", op->oq_modrdn.rs_newSup->bv_val, p_dn.bv_val, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: "
"new parent\"%s\" seems to be the same as the "
"old parent \"%s\"\n",
op->oq_modrdn.rs_newSup->bv_val, p_dn.bv_val, 0 );
#endif
op->oq_modrdn.rs_newSup = NULL; /* ignore newSuperior */
}
@ -340,43 +266,26 @@ ldbm_back_modrdn(
if ( op->oq_modrdn.rs_nnewSup->bv_len ) {
if( (np = dn2entry_w( op->o_bd, np_ndn, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_modrdn: newSup(ndn=%s) not found.\n",
np_ndn->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: newSup(ndn=%s) not here!\n",
np_ndn->bv_val, 0, 0);
#endif
send_ldap_error( op, rs, LDAP_OTHER,
"newSuperior not found" );
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_back_modrdn: wr to new parent OK np=%p, id=%ld\n",
(void *) np, np->e_id, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: wr to new parent OK np=%p, id=%ld\n",
(void *) np, np->e_id, 0 );
#endif
/* check newSuperior for "children" acl */
if ( !access_allowed( op, np, children, NULL,
ACL_WRITE, NULL ) )
{
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_modrdn: no wr to newSup children.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: no wr to newSup children\n",
0, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, NULL );
goto return_results;
@ -384,12 +293,7 @@ ldbm_back_modrdn(
if ( is_entry_alias( np ) ) {
/* parent is an alias, don't allow add */
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_modrdn: entry (%s) is an alias.\n", np->e_dn,0,0);
#else
Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_ALIAS_PROBLEM,
@ -400,14 +304,8 @@ ldbm_back_modrdn(
if ( is_entry_referral( np ) ) {
/* parent is a referral, don't allow add */
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_modrdn: entry (%s) is a referral\n",
np->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry (%s) is referral\n",
np->e_dn, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_OTHER,
"newSuperior is a referral" );
@ -434,15 +332,9 @@ ldbm_back_modrdn(
/* check parent for "children" acl */
if ( ! can_access ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_modrdn: no access "
"to new superior \"\"\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_modrdn: no "
"access to new superior\n", 0, 0, 0 );
#endif
send_ldap_error( op, rs,
LDAP_INSUFFICIENT_ACCESS,
@ -451,16 +343,10 @@ ldbm_back_modrdn(
}
} else {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ERR,
"ldbm_back_modrdn: \"\" not allowed as new superior\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<=- ldbm_back_modrdn: \"\" "
"not allowed as new superior\n",
0, 0, 0);
#endif
send_ldap_error( op, rs,
LDAP_INSUFFICIENT_ACCESS,
@ -470,14 +356,9 @@ ldbm_back_modrdn(
}
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_back_modrdn: wr to new parent's children OK.\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: wr to new parent's children OK\n",
0, 0, 0 );
#endif
new_parent_dn = op->oq_modrdn.rs_newSup;
}
@ -486,13 +367,8 @@ ldbm_back_modrdn(
build_new_dn( &new_dn, new_parent_dn, &op->oq_modrdn.rs_newrdn, NULL );
dnNormalize( 0, NULL, NULL, &new_dn, &new_ndn, NULL );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_modrdn: new ndn=%s\n",
new_ndn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: new ndn=%s\n",
new_ndn.bv_val, 0, 0 );
#endif
/* check for abandon */
if ( op->o_abandon ) {
@ -506,14 +382,9 @@ ldbm_back_modrdn(
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO, "ldbm_back_modrdn: new ndn (%s) does not exist\n",
new_ndn.bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: new ndn=%s does not exist\n",
new_ndn.bv_val, 0, 0 );
#endif
/* Get attribute type and attribute value of our new rdn, we will
* need to add that to our new entry
@ -521,63 +392,37 @@ ldbm_back_modrdn(
if ( ldap_bv2rdn( &op->oq_modrdn.rs_newrdn, &new_rdn, (char **)&rs->sr_text,
LDAP_DN_FORMAT_LDAP ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"ldbm_back_modrdn: can't figure out "
"type(s)/values(s) of newrdn\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: can't figure out "
"type(s)/values(s) of newrdn\n",
0, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX,
"unknown type(s) used in RDN" );
goto return_results;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"ldbm_back_modrdn: new_rdn_type=\"%s\", "
"new_rdn_val=\"%s\"\n",
new_rdn[ 0 ]->la_attr.bv_val,
new_rdn[ 0 ]->la_value.bv_val, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: new_rdn_type=\"%s\", "
"new_rdn_val=\"%s\"\n",
new_rdn[ 0 ]->la_attr.bv_val,
new_rdn[ 0 ]->la_value.bv_val, 0 );
#endif
if ( op->oq_modrdn.rs_deleteoldrdn ) {
if ( ldap_bv2rdn( &op->o_req_dn, &old_rdn, (char **)&rs->sr_text,
LDAP_DN_FORMAT_LDAP ) )
{
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"ldbm_back_modrdn: can't figure out "
"type(s)/values(s) of old_rdn\n",
0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: can't figure out "
"the old_rdn type(s)/value(s)\n",
0, 0, 0 );
#endif
send_ldap_error( op, rs, LDAP_OTHER,
"cannot parse RDN from old DN" );
goto return_results;
}
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_modrdn: DN_X500\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: DN_X500\n",
0, 0, 0 );
#endif
if ( slap_modrdn2mods( op, rs, e, old_rdn, new_rdn, &mod ) != LDAP_SUCCESS ) {
send_ldap_result( op, rs );

View file

@ -35,13 +35,8 @@ next_id_read( Backend *be, ID *idp )
if ( (db = ldbm_cache_open( be, "nextid", LDBM_SUFFIX, LDBM_WRCREAT ))
== NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, CRIT,
"next_id_read: could not open/create nextid%s\n", LDBM_SUFFIX, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "Could not open/create nextid" LDBM_SUFFIX "\n",
0, 0, 0 );
#endif
return( -1 );
}
@ -74,13 +69,8 @@ next_id_write( Backend *be, ID id )
if ( (db = ldbm_cache_open( be, "nextid", LDBM_SUFFIX, LDBM_WRCREAT ))
== NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, CRIT,
"next_id_write: Could not open/create nextid%s\n", LDBM_SUFFIX, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "Could not open/create nextid" LDBM_SUFFIX "\n",
0, 0, 0 );
#endif
return( -1 );
}

View file

@ -51,15 +51,9 @@ ldbm_back_referrals(
if ( matched != NULL ) {
rs->sr_matched = ch_strdup( matched->e_dn );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_back_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
op->o_tag, op->o_req_dn.bv_val, rs->sr_matched );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
op->o_tag, op->o_req_dn.bv_val, rs->sr_matched );
#endif
if( is_entry_referral( matched ) ) {
rs->sr_err = LDAP_OTHER;
@ -99,15 +93,9 @@ ldbm_back_referrals(
rs->sr_ref = referral_rewrite(
refs, &e->e_name, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
op->o_tag, op->o_req_dn.bv_val, e->e_dn );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
op->o_tag, op->o_req_dn.bv_val, e->e_dn );
#endif
rs->sr_matched = e->e_name.bv_val;
if( rs->sr_ref != NULL ) {

View file

@ -49,11 +49,7 @@ ldbm_back_search(
struct berval realbase = BER_BVNULL;
int manageDSAit = get_manageDSAit( op );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_search: enter\n", 0, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "=> ldbm_back_search\n", 0, 0, 0);
#endif
/* grab giant lock for reading */
ldap_pvt_thread_rdwr_rlock(&li->li_giant_rwlock);
@ -134,15 +130,9 @@ ldbm_back_search(
cache_return_entry_r( &li->li_cache, e );
ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock);
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_search: entry (%s) is a referral.\n",
e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_search: entry is referral\n",
0, 0, 0 );
#endif
if( erefs ) {
rs->sr_ref = referral_rewrite( erefs, &matched_dn,
@ -189,13 +179,8 @@ ldbm_back_search(
searchit:
if ( candidates == NULL ) {
/* no candidates */
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_search: no candidates\n" , 0, 0, 0);
#else
Debug( LDAP_DEBUG_TRACE, "ldbm_search: no candidates\n",
0, 0, 0 );
#endif
rs->sr_err = LDAP_SUCCESS;
send_ldap_result( op, rs );
@ -244,14 +229,9 @@ searchit:
e = id2entry_r( op->o_bd, id );
if ( e == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_search: candidate %ld not found.\n", id, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_search: candidate %ld not found\n",
id, 0, 0 );
#endif
goto loop_continue;
}
@ -306,15 +286,9 @@ searchit:
} else if ( dnIsSuffix( &e->e_nname, &realbase ) ) {
/* alias is within scope */
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_search: alias \"%s\" in subtree\n",
e->e_dn, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_search: alias \"%s\" in subtree\n",
e->e_dn, 0, 0 );
#endif
goto loop_continue;
}
@ -375,15 +349,9 @@ searchit:
rs->sr_ref = NULL;
} else {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL2,
"ldbm_search: candidate referral %ld scope not okay\n",
id, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_search: candidate referral %ld scope not okay\n",
id, 0, 0 );
#endif
}
goto loop_continue;
@ -453,27 +421,15 @@ searchit:
}
} else {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL2,
"ldbm_search: candidate entry %ld scope not okay\n",
id, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_search: candidate entry %ld scope not okay\n",
id, 0, 0 );
#endif
}
} else {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL2,
"ldbm_search: candidate entry %ld does not match filter\n",
id, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"ldbm_search: candidate entry %ld does not match filter\n",
id, 0, 0 );
#endif
}
loop_continue:
@ -510,12 +466,8 @@ base_candidate(
{
ID_BLOCK *idl;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "base_candidate: base (%s)\n", e->e_dn, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "base_candidates: base: \"%s\"\n",
e->e_dn, 0, 0);
#endif
idl = idl_alloc( 1 );
@ -543,15 +495,9 @@ search_candidates(
AttributeAssertion aa_subentry;
#endif
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"search_candidates: base (%s) scope %d deref %d\n",
e->e_ndn, scope, deref );
#else
Debug(LDAP_DEBUG_TRACE,
"search_candidates: base=\"%s\" s=%d d=%d\n",
e->e_ndn, scope, deref );
#endif
xf.f_or = filter;

View file

@ -55,13 +55,8 @@ int ldbm_tool_entry_open(
if ( (id2entry = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, flags ))
== NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, CRIT,
"Could not open/create id2entry%s\n", LDBM_SUFFIX, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry" LDBM_SUFFIX "\n",
0, 0, 0 );
#endif
return( -1 );
}
@ -198,13 +193,8 @@ ID ldbm_tool_entry_put(
e->e_id = li->li_nextid++;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY,
"ldbm_tool_entry_put: (%s)%ld\n", e->e_dn, e->e_id ,0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> ldbm_tool_entry_put( %ld, \"%s\" )\n",
e->e_id, e->e_dn, 0 );
#endif
if ( dn2id( be, &e->e_nname, &id ) ) {
/* something bad happened to ldbm cache */
@ -213,15 +203,9 @@ ID ldbm_tool_entry_put(
}
if( id != NOID ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY,
"ldbm_tool_entry_put: \"%s\" already exists (id=%ld)\n",
e->e_dn, id, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"<= ldbm_tool_entry_put: \"%s\" already exists (id=%ld)\n",
e->e_ndn, id, 0 );
#endif
strncpy( text->bv_val, "already exists", text->bv_len );
return NOID;
}
@ -276,27 +260,16 @@ int ldbm_tool_entry_reindex(
Entry *e;
Operation op = {0};
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_tool_entry_reindex: ID=%ld\n",
(long)id, 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS, "=> ldbm_tool_entry_reindex( %ld )\n",
(long) id, 0, 0 );
#endif
e = ldbm_tool_entry_get( be, id );
if( e == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_tool_entry_reindex: could not locate id %ld\n",
(long)id, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"ldbm_tool_entry_reindex:: could not locate id=%ld\n",
(long) id, 0, 0 );
#endif
return -1;
}
@ -308,13 +281,8 @@ int ldbm_tool_entry_reindex(
*
*/
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, ENTRY,
"ldbm_tool_entry_reindex: (%s) %ld\n", e->e_dn, id, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "=> ldbm_tool_entry_reindex( %ld, \"%s\" )\n",
id, e->e_dn, 0 );
#endif
dn2id_add( be, &e->e_nname, e->e_id );

View file

@ -43,13 +43,8 @@ meta_back_add( Operation *op, SlapReply *rs )
struct berval mdn = BER_BVNULL, mapped;
dncookie dc;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, ENTRY, "meta_back_add: %s\n",
op->o_req_dn.bv_val, 0, 0 );
#else /* !NEW_LOGGING */
Debug(LDAP_DEBUG_ARGS, "==> meta_back_add: %s\n",
op->o_req_dn.bv_val, 0, 0 );
#endif /* !NEW_LOGGING */
/*
* get the current connection

View file

@ -54,13 +54,8 @@ meta_back_bind( Operation *op, SlapReply *rs )
rs->sr_err = LDAP_SUCCESS;
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, ENTRY, "meta_back_bind: dn: %s.\n",
op->o_req_dn.bv_val, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS, "meta_back_bind: dn: %s.\n%s%s",
op->o_req_dn.bv_val, "", "" );
#endif /* !NEW_LOGGING */
if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op ) ) {
isroot = 1;
@ -70,15 +65,9 @@ meta_back_bind( Operation *op, SlapReply *rs )
lc = meta_back_getconn( op, rs, op_type,
&op->o_req_ndn, NULL );
if ( !lc ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, NOTICE,
"meta_back_bind: no target for dn %s.\n",
op->o_req_dn.bv_val, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"meta_back_bind: no target for dn %s.\n%s%s",
op->o_req_dn.bv_val, "", "");
#endif /* !NEW_LOGGING */
send_ldap_result( op, rs );
return -1;
@ -111,18 +100,11 @@ meta_back_bind( Operation *op, SlapReply *rs )
* A bind operation is expected to have
* ONE CANDIDATE ONLY!
*/
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, WARNING,
"==>meta_back_bind: more than one"
" candidate is attempting to bind"
" ...\n" , 0, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"==>meta_back_bind: more than one"
" candidate is attempting to bind"
" ...\n%s%s%s",
"", "", "" );
#endif /* !NEW_LOGGING */
}
if ( isroot && li->targets[ i ]->pseudorootdn.bv_val != NULL ) {
@ -333,19 +315,11 @@ meta_back_dobind( struct metaconn *lc, Operation *op )
op->o_ctrls, NULL, NULL);
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, WARNING,
"meta_back_dobind: (anonymous)"
" bind failed"
" with error %d (%s)\n",
rc, ldap_err2string( rc ), 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"==>meta_back_dobind: (anonymous)"
" bind failed"
" with error %d (%s)\n",
rc, ldap_err2string( rc ), 0 );
#endif /* !NEW_LOGGING */
/*
* null cred bind should always succeed
@ -438,21 +412,12 @@ meta_back_op_result( struct metaconn *lc, Operation *op, SlapReply *rs )
LDAP_OPT_MATCHED_DN, &match );
rs->sr_err = slap_map_api2result( rs );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, RESULTS,
"meta_back_op_result: target"
" <%d> sending msg \"%s\""
" (matched \"%s\")\n",
i, ( msg ? msg : "" ),
( match ? match : "" ) );
#else /* !NEW_LOGGING */
Debug(LDAP_DEBUG_ANY,
"==> meta_back_op_result: target"
" <%d> sending msg \"%s\""
" (matched \"%s\")\n",
i, ( msg ? msg : "" ),
( match ? match : "" ) );
#endif /* !NEW_LOGGING */
/*
* FIXME: need to rewrite "match" (need rwinfo)

View file

@ -342,15 +342,9 @@ meta_back_getconn(
return NULL;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, INFO,
"meta_back_getconn: got target %d for ndn=\"%s\" from cache\n",
i, ndn->bv_val, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_CACHE,
"==>meta_back_getconn: got target %d for ndn=\"%s\" from cache\n%s",
i, ndn->bv_val, "" );
#endif /* !NEW_LOGGING */
/*
* Clear all other candidates
@ -456,14 +450,9 @@ meta_back_getconn(
ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, INFO,
"meta_back_getconn: conn %ld inserted\n", lc->conn->c_connid, 0, 0);
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_TRACE,
"=>meta_back_getconn: conn %ld inserted\n%s%s",
lc->conn->c_connid, "", "" );
#endif /* !NEW_LOGGING */
/*
* Err could be -1 in case a duplicate metaconn is inserted
@ -475,14 +464,9 @@ meta_back_getconn(
return NULL;
}
} else {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, INFO,
"meta_back_getconn: conn %ld fetched\n", lc->conn->c_connid, 0, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_TRACE,
"=>meta_back_getconn: conn %ld fetched\n%s%s",
lc->conn->c_connid, "", "" );
#endif /* !NEW_LOGGING */
}
return lc;

View file

@ -127,16 +127,10 @@ meta_back_group(
} else {
mop_ndn = *op_ndn;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1,
"[rw] bindDn (op ndn in group): \"%s\" -> \"%s\"\n",
op_ndn->bv_val, mop_ndn.bv_val, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS,
"rw> bindDn (op ndn in group):"
" \"%s\" -> \"%s\"\n%s",
op_ndn->bv_val, mop_ndn.bv_val, "" );
#endif /* !NEW_LOGGING */
break;
case REWRITE_REGEXEC_UNWILLING:
@ -158,16 +152,10 @@ meta_back_group(
} else {
mgr_ndn = *gr_ndn;
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1,
"[rw] searchBase (gr ndn in group): \"%s\" -> \"%s\"\n",
gr_ndn->bv_val, mgr_ndn.bv_val, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS,
"rw> searchBase (gr ndn in group):"
" \"%s\" -> \"%s\"\n%s",
gr_ndn->bv_val, mgr_ndn.bv_val, "" );
#endif /* !NEW_LOGGING */
break;
case REWRITE_REGEXEC_UNWILLING:

Some files were not shown because too many files have changed in this diff Show more