(*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(
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
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;
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;
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 ) {
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.
}
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;
}
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);
}
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,
*/
#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,
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
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;
}
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;
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 );
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:
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:
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 ) );
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;
}
}
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 */
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;
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) {
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;
/* 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;
(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;
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 ) );
* 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 ;
{
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 );
{
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 ) );
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 ) );
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 ) );
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 ) );
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;
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;
* 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;
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 );
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 );
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 );
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;
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;
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;
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 ) ) {
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;
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;
* 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;
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;
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;
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;
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 ) ) {
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;
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 ) );
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 ) );
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 ) );
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) );
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) );
{
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 );
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 ) {
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
{
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 );
{
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 );
{
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 );
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 );
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;
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 );
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
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 );
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;
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;
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 ) );
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 ) );
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) {
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 '#' */
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) {
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);
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;
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 )
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;
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 )
{
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 );
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 );
}
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 );
}
* }
*/
-#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 );
{
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 );
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 );
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 );
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 ) {
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;
}
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 );
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:
{
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();
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 */
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
}
{
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 */
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
++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 );
++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 );
{
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 ) {
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
}
}
{
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 )
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;
/* 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;
* 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 =
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;
#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;
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;
}
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 );
}
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;
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;
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 );
}
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;
#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 */
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 );
* 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 ) {
#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;
#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 */
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 );
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
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;
}
}
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;
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
/* 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 ) ) {
}
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
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;
/* 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 */
}
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
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 */
}
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 */
} 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 );
}
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 );
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;
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) &&
}
}
-#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
}
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;
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
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 ) );
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 ) {
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 ) );
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 );
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,
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 ) );
{
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;
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 ) );
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 ) );
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;
}
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;
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;
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;
!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;
!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;
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;
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;
#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 );
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,
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.
*/
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"));
}
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"));
}
#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 );
__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
__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,
"TLS certificate verification: Error, %s\n",
certerr, 0, 0 );
}
-#endif
if ( sname )
CRYPTO_free ( sname );
if ( iname )
}
__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
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;
}
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;
}
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 ) );
}
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))
* 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 */
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:
*/
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;
}
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;
}
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;
}
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 */
/* 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;
}
&& 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 ) {
/* 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 ) {
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) {
}
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);
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;
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 ) ) {
}
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,
}
}
-#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 );
}
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 );
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 )
/* 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
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) {
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,
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,
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,
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 */
}
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;
}
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 ),
: b->a_type == ACL_BREAK
? "break"
: "stop" );
-#endif
/* save old mask */
oldmask = *mask;
*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;
/* 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;
}
/* 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;
}
* 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;
}
*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
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 );
}
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] );
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;
}
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;
}
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:
*
/* 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;
}
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;
}
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;
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;
}
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;
}
}
}
#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" );
}
* 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 )
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 */
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;
}
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;
}
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;
}
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;
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;
}
*/
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;
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;
: 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 );
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;;
#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;;
#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;;
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 );
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;
}
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;;
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;
/* 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:
/* 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:
/* 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:
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;
}
}
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 );
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;
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;
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 )) {
#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;
}
#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;
#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;
}
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;
}
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 */
/* 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 );
/* 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 );
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;
}
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;
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;
}
/* 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;
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 );
}
}
&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:
/* 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;
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;
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;
}
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;
}
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 */
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;
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;
/* 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 );
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;
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;
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;
}
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;
/* 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;
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;
}
}
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;
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";
}
/* 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:
/* 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:
/* 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:
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;
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 );
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;
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;
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 );
/* 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;
}
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;
}
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;
}
}
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
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;
}
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;
/* 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;
}
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;
}
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;
}
}
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
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;
}
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 );
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 );
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 );
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;
}
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 ) {
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 );
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 &&
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
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
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 ) {
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;
}
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 &&
}
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;
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 );
&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;
}
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;
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 );
&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;
}
&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;
}
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;
}
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 );
}
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 );
&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;
}
&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;
}
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;
}
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 );
}
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 );
&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;
}
&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;
}
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;
}
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 );
}
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 ) {
}
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;
}
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);
}
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 );
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
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
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++;
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 );
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 );
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;
}
/* 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;
}
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;
}
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;
}
{
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 );
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;
} 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;
}
{
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 );
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
/* 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;
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;
}
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 ) {
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;
}
{
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) );
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
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;
}
#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;
}
#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;
}
#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 );
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;
}
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;
}
}
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;
}
#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;
}
/* 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;
}
/* 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;
}
}
};
/* 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 |
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 );
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);
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;
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);
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;
}
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;
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;
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.
*/
}
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 ) {
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 */
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;
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;
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;
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 ) {
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;
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:
/* 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;
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 );
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;
}
}
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;
&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;
}
/* 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:
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;
}
}
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);
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;
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;
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 */
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 );
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;
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;
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";
}
/* 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;
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;
}
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;
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 */
}
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;
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 */
}
}
}
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,
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;
#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;
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;
}
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;
}
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;
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;
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;
}
}
rs->sr_err = TXN_BEGIN( bdb->bi_dbenv, ltid, <2, bdb->bi_db_opflags );
rs->sr_text = NULL;
if( rs->sr_err != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "bdb_modrdn: txn_begin(2) failed: %s (%d)\n",
- db_strerror(rs->sr_err), rs->sr_err, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: txn_begin(2) failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
-#endif
rs->sr_err = LDAP_OTHER;
rs->sr_text = "internal error";
goto return_results;
/* 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:
/* 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:
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 );
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;
}
/* 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:
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;
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;
}
}
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);
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 );
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;
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;
}
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;
}
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;
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;
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 ) {
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;
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;
}
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;
}
}
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;
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;
/* 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;
}
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;
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 {
}
} 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:
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;
* (|[(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;
}
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;
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;
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;
}
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 );
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 ) {
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 );
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;
}
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;
}
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;
}
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;
}
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;
}
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.
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;
}
*
*/
-#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;
/* 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
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 );
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 );
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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 ) ) {
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 ) {
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 );
/* 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;
}
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;
}
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;
}
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;
}
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;
{
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 */
*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;
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;
}
} 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;
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;
}
}
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;
#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,
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;
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" );
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";
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" );
#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;
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" );
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 );
{
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;
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" );
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;
/* 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" );
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,
/* 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,
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;
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 ) );
#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;
}
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;
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;
/* 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 );
/* 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
}
}
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 );
/* 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 );
}
/* 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);
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);
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 );
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 */
/* 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;
/* 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 */
/* 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;
/* 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 );
}
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 );
/* 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 ) {
}
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 */
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 );
/* 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;
#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;
}
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;
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;
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
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;
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] );
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 );
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 );
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 );
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 );
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;
}
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;
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;
}
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);
/* 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 );
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" );
/* 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;
}
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" );
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" );
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" );
/* 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" );
}
} 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,
/* 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" );
/* 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" );
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 );
}
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 );
}
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
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 );
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 );
}
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;
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;
}
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 );
}
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 );
}
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 ) {
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 */
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;
}
*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);
}
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;
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
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
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
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.
*/
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 );
}
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 );
&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;
}
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;
}
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 );
}
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 );
&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;
}
&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;
}
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;
}
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;
}
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;
}
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 );
}
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 );
&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;
}
&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;
}
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;
}
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;
}
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;
}
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 );
}
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 );
}
}
-#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 );
}
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 );
&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;
}
&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;
}
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;
}
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;
}
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;
}
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 );
}
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 );
}
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 );
}
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 );
}
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 );
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
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
}
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 );
}
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 );
}
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 );
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 );
}
* 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
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;
}
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;
}
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 );
}
/* 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 );
}
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 );
}
/* 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 );
}
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 );
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;
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 );
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
}
* 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
}
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;
}
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;
}
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 ) {
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;
}
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;
}
}
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 );
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;
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 );
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();
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;
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.
}
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 ) {
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;
}
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;
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;
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);
/* 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;
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);
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" );
/* 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;
}
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" );
*/
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" );
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;
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 */
/* 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,
}
} 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,
}
}
-#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 */
}
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;
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,
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" );
/* 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,
}
} 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,
}
}
-#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;
}
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 ) {
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
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 );
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 );
}
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 );
}
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;
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 ) {
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);
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,
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 );
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;
}
} 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;
}
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;
}
} 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:
{
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 );
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;
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 );
}
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 */
}
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;
}
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;
}
*
*/
-#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 );
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
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;
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;
* 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 ) {
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
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)
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
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
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;
} 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:
} 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:
ldap_get_option( lsc->ld,
LDAP_OPT_MATCHED_DN, &match.bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, ERR,
- "meta_back_search [%d] "
- "match=\"%s\" err=\"%s\"\n",
- i, match.bv_val, err );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"=>meta_back_search [%d] "
"match=\"%s\" err=\"%s\"\n",
i, match.bv_val, err );
-#endif /* !NEW_LOGGING */
candidate_match++;
last = i;
rc = 0;
!= LDAP_SUCCESS) {
if ( slap_bv2undef_ad( &mapped, &attr->a_desc, &text )
!= LDAP_SUCCESS) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "slap_bv2undef_ad(%s): %s\n", mapped.bv_val, text, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"slap_bv2undef_ad(%s): "
"%s\n%s", mapped.bv_val, text, "" );
-#endif /* !NEW_LOGGING */
ch_free( attr );
continue;
}
struct metainfo *li = ( struct metainfo * )be->be_private;
struct metaconn *lc, lc_curr;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, ENTRY,
- "meta_back_conn_destroy: fetching conn %ld\n", conn->c_connid, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_TRACE,
"=>meta_back_conn_destroy: fetching conn %ld\n%s%s",
conn->c_connid, "", "" );
-#endif /* !NEW_LOGGING */
lc_curr.conn = conn;
if ( lc ) {
int i;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, INFO,
- "meta_back_conn_destroy: destroying conn %ld\n",
- lc->conn->c_connid, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_TRACE,
"=>meta_back_conn_destroy: destroying conn %ld\n%s%s",
lc->conn->c_connid, "", "" );
-#endif /* !NEW_LOGGING */
/*
* Cleanup rewrite session
if ( monitor_cache_get( mi,
&monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn,
&e_backend ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_backend_init: "
- "unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_backend_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_backend_init: "
- "unable to create entry 'cn=Backend %d,%s'\n",
- i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_backend_init: "
"unable to create entry 'cn=Backend %d,%s'\n%s",
i,
monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val,
"" );
-#endif
return( -1 );
}
| MONITOR_F_SUB;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_backend_init: "
- "unable to add entry 'cn=Backend %d,%s'\n",
- i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_backend_init: "
"unable to add entry 'cn=Backend %d,%s'\n%s",
i,
monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val,
"" );
-#endif
return( -1 );
}
= (struct monitorinfo *) op->o_bd->be_private;
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_MON, ENTRY, "monitor_back_bind: dn: %s.\n",
- op->o_req_dn.bv_val, 0, 0 );
-#else
Debug(LDAP_DEBUG_ARGS, "==> monitor_back_bind: dn: %s\n",
op->o_req_dn.bv_val, 0, 0 );
-#endif
if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE
&& be_isroot_pw( op ) ) {
if ( monitor_cache_get( mi,
&monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn, &e_conn ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_conn_init: "
- "unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_conn_init: "
- "unable to create entry 'cn=Total,%s'\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to create entry 'cn=Total,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
mp->mp_flags &= ~MONITOR_F_VOLATILE_CH;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_conn_init: "
- "unable to add entry 'cn=Total,%s'\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to add entry 'cn=Total,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_conn_init: "
- "unable to create entry 'cn=Current,%s'\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to create entry 'cn=Current,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
mp->mp_flags &= ~MONITOR_F_VOLATILE_CH;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_conn_init: "
- "unable to add entry 'cn=Current,%s'\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to add entry 'cn=Current,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_conn_create: "
- "unable to create entry "
- "'cn=" CONN_CN_PREFIX " %ld,%s' entry\n",
- c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_create: "
"unable to create entry "
"'cn=" CONN_CN_PREFIX " %ld,%s' entry\n",
c->c_connid,
monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, 0 );
-#endif
return( -1 );
}
if ( monitor_cache_get( mi,
&monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn,
&e_database ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_database_init: "
- "unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_database_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_database_init: "
- "unable to create entry 'cn=Database %d,%s'\n",
- i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_database_init: "
"unable to create entry 'cn=Database %d,%s'\n%s",
i,
monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val,
"" );
-#endif
return( -1 );
}
| MONITOR_F_SUB;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_database_init: "
- "unable to add entry 'cn=Database %d,%s'\n",
- i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_database_init: "
"unable to add entry 'cn=Database %d,%s'\n",
i,
monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val,
0 );
-#endif
return( -1 );
}
* database monitor can be defined once only
*/
if ( be_monitor ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "only one monitor backend is allowed\n", 0, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"only one monitor backend is allowed\n", 0, 0, 0 );
-#endif
return( -1 );
}
be_monitor = be;
rc = dnNormalize( 0, NULL, NULL, &dn, &ndn, NULL );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "unable to normalize monitor DN \"%s\"\n",
- SLAPD_MONITOR_DN, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"unable to normalize monitor DN \"%s\"\n",
SLAPD_MONITOR_DN, 0, 0 );
-#endif
return -1;
}
mi = ( struct monitorinfo * )ch_calloc( sizeof( struct monitorinfo ), 1 );
if ( mi == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "unable to initialize monitor backend\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"unable to initialize monitor backend\n", 0, 0, 0 );
-#endif
return -1;
}
#endif /* INTEGRATE_CORE_SCHEMA */
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_back_db_init: %s: %s\n",
- mat_core[i].name, text, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_back_db_init: %s: %s\n",
mat_core[i].name, text, 0 );
-#endif
return( -1 );
}
}
at = ldap_str2attributetype( mat[i].schema, &code,
&err, LDAP_SCHEMA_ALLOW_ALL );
if ( !at ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "monitor_back_db_init: "
- "in AttributeType '%s' %s before %s\n",
- mat[i].name, ldap_scherr2str(code), err );
-#else
Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
"in AttributeType '%s' %s before %s\n",
mat[i].name, ldap_scherr2str(code), err );
-#endif
return -1;
}
if ( at->at_oid == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "monitor_back_db_init: "
- "null OID for attributeType '%s'\n",
- mat[i].name, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
"null OID for attributeType '%s'\n",
mat[i].name, 0, 0 );
-#endif
return -1;
}
code = at_add(at, &err);
if ( code ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "monitor_back_db_init: "
- "%s in attributeType '%s'\n",
- scherr2str(code), mat[i].name, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
"%s in attributeType '%s'\n",
scherr2str(code), mat[i].name, 0 );
-#endif
return -1;
}
ldap_memfree(at);
ad = ((AttributeDescription **)&(((char *)mi)[mat[i].offset]));
ad[0] = NULL;
if ( slap_str2ad( mat[i].name, ad, &text ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_back_db_init: %s\n", text, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_back_db_init: %s\n", text, 0, 0 );
-#endif
return -1;
}
oc = ldap_str2objectclass(moc[i].schema, &code, &err,
LDAP_SCHEMA_ALLOW_ALL );
if ( !oc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "unable to parse monitor objectclass '%s': "
- "%s before %s\n" , moc[i].name,
- ldap_scherr2str(code), err );
-#else
Debug( LDAP_DEBUG_ANY,
"unable to parse monitor objectclass '%s': "
"%s before %s\n" , moc[i].name,
ldap_scherr2str(code), err );
-#endif
return -1;
}
if ( oc->oc_oid == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "objectclass '%s' has no OID\n" ,
- moc[i].name, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"objectclass '%s' has no OID\n" ,
moc[i].name, 0, 0 );
-#endif
return -1;
}
code = oc_add(oc, 0, &err);
if ( code ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "objectclass '%s': %s \"%s\"\n" ,
- moc[i].name, scherr2str(code), err );
-#else
Debug( LDAP_DEBUG_ANY,
"objectclass '%s': %s \"%s\"\n" ,
moc[i].name, scherr2str(code), err );
-#endif
return -1;
}
Oc = oc_find( moc[i].name );
if ( Oc == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "monitor_back_db_init: "
- "unable to find objectClass %s "
- "(just added)\n", moc[i].name, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
"unable to find objectClass %s "
"(just added)\n", moc[i].name, 0, 0 );
-#endif
return -1;
}
rc = dnPretty( NULL, &dn, &monitor_subsys[ i ].mss_rdn, NULL );
free( dn.bv_val );
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor RDN \"%s\" is invalid\n",
- dn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor RDN \"%s\" is invalid\n",
dn.bv_val, 0, 0 );
-#endif
return( -1 );
}
&monitor_subsys[ i ].mss_ndn, NULL );
free( dn.bv_val );
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor DN \"%s\" is invalid\n",
- dn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor DN \"%s\" is invalid\n",
dn.bv_val, 0, 0 );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "unable to create '%s' entry\n",
- monitor_subsys[ i ].mss_dn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"unable to create '%s' entry\n",
monitor_subsys[ i ].mss_dn.bv_val, 0, 0 );
-#endif
return( -1 );
}
mp->mp_flags = monitor_subsys[ i ].mss_flags;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "unable to add entry '%s' to cache\n",
- monitor_subsys[ i ].mss_dn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"unable to add entry '%s' to cache\n",
monitor_subsys[ i ].mss_dn.bv_val, 0, 0 );
-#endif
return -1;
}
e = str2entry( buf );
if ( e == NULL) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "unable to create '%s' entry\n",
- SLAPD_MONITOR_DN, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"unable to create '%s' entry\n",
SLAPD_MONITOR_DN, 0, 0 );
-#endif
return( -1 );
}
if ( attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
&bv, NULL ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "unable to add monitoredInfo to '%s' entry\n",
- SLAPD_MONITOR_DN, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"unable to add monitoredInfo to '%s' entry\n",
SLAPD_MONITOR_DN, 0, 0 );
-#endif
return( -1 );
}
if ( mi->mi_l.bv_len ) {
if ( attr_merge_normalize_one( e, mi->mi_ad_l, &mi->mi_l, NULL ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "unable to add locality to '%s' entry\n",
- SLAPD_MONITOR_DN, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"unable to add locality to '%s' entry\n",
SLAPD_MONITOR_DN, 0, 0 );
-#endif
return( -1 );
}
}
mp->mp_next = NULL;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "unable to add entry '%s' to cache\n",
- SLAPD_MONITOR_DN, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"unable to add entry '%s' to cache\n",
SLAPD_MONITOR_DN, 0, 0 );
-#endif
return -1;
}
return 0;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_listener_init: "
- "unable to get listeners\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_listener_init: "
"unable to get listeners\n", 0, 0, 0 );
-#endif
return( -1 );
}
if ( monitor_cache_get( mi,
&monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn,
&e_listener ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_listener_init: "
- "unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_listener_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_listener_init: "
- "unable to create entry 'cn=Listener, %d,%s'\n",
- i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_listener_init: "
"unable to create entry 'cn=Listener %d,%s'\n%s",
i,
monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val,
"" );
-#endif
return( -1 );
}
| MONITOR_F_SUB;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_listener_init: "
- "unable to add entry 'cn=Listener %d,%s'\n",
- i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_listener_init: "
"unable to add entry 'cn=Listener %d,%s'\n",
i,
monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val,
0 );
-#endif
return( -1 );
}
if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn,
&e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_log_init: "
- "unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_log_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
Entry *matched;
Entry *e;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_MON, ENTRY, "monitor_back_modify: enter\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_ARGS, "monitor_back_modify:\n", 0, 0, 0);
-#endif
/* acquire and lock entry */
monitor_cache_dn2entry( op, &op->o_req_ndn, &e, &matched );
if ( monitor_cache_get( mi,
&monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn, &e_op ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_ops_init: "
- "unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_ops_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_ops_init: "
- "unable to create entry 'cn=%s,%s'\n",
- bv_op[ i ].bv_val,
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_ops_init: "
"unable to create entry 'cn=%s,%s'\n",
bv_op[ i ].bv_val,
monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 );
-#endif
return( -1 );
}
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_ops_init: "
- "unable to add entry 'cn=%s,%s'\n",
- bv_op[ i ].bv_val,
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_ops_init: "
"unable to add entry 'cn=%s,%s'\n",
bv_op[ i ].bv_val,
monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 );
-#endif
return( -1 );
}
if ( monitor_cache_get( mi,
&monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn,
&e_overlay ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_overlay_init: "
- "unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_overlay_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_overlay_init: "
- "unable to create entry 'cn=Overlay %d,%s'\n",
- i, monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_overlay_init: "
"unable to create entry 'cn=Overlay %d,%s'\n%s",
i,
monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val,
"" );
-#endif
return( -1 );
}
| MONITOR_F_SUB;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_overlay_init: "
- "unable to add entry 'cn=Overlay %d,%s'\n",
- i, monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_overlay_init: "
"unable to add entry 'cn=Overlay %d,%s'\n%s",
i,
monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val,
"" );
-#endif
return( -1 );
}
if ( monitor_cache_get( mi,
&monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn, &e_conn ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_rww_init: "
- "unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_rww_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_rww_init: "
- "unable to create entry 'cn=Read,%s'\n",
- monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_rww_init: "
"unable to create entry 'cn=Read,%s'\n",
monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
-#endif
return( -1 );
}
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_rww_init: "
- "unable to add entry 'cn=Read,%s'\n",
- monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_rww_init: "
"unable to add entry 'cn=Read,%s'\n",
monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_rww_init: "
- "unable to create entry 'cn=Write,%s'\n",
- monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_rww_init: "
"unable to create entry 'cn=Write,%s'\n",
monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
-#endif
return( -1 );
}
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_rww_init: "
- "unable to add entry 'cn=Write,%s'\n",
- monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_rww_init: "
"unable to add entry 'cn=Write,%s'\n",
monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
-#endif
return( -1 );
}
int rc = LDAP_SUCCESS;
Entry *e, *matched = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_MON, ENTRY,
- "monitor_back_search: enter\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE, "=> monitor_back_search\n%s%s%s", "", "", "");
-#endif
/* get entry with reader lock */
if ( monitor_cache_get( mi,
&monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn, &e_sent ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_sent_init: "
- "unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_sent_init: "
- "unable to create entry 'cn=Entries,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=Entries,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_sent_init: "
- "unable to add entry 'cn=Entries,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=Entries,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_sent_init: "
- "unable to create entry 'cn=Referrals,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=Referrals,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_sent_init: "
- "unable to add entry 'cn=Referrals,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=Referrals,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_sent_init: "
- "unable to create entry 'cn=PDU,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=PDU,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_sent_init: "
- "unable to add entry 'cn=PDU,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=PDU,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_sent_init: "
- "unable to create entry 'cn=Bytes,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=Bytes,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_sent_init: "
- "unable to add entry 'cn=Bytes,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=Bytes,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
if ( monitor_cache_get( mi,
&monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn, &e ) )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_thread_init: unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_thread_init: unable to get entry '%s'\n",
monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val,
0, 0 );
-#endif
return( -1 );
}
if ( monitor_cache_get( mi,
&monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn, &e_time ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_time_init: "
- "unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_time_init: "
"unable to get entry '%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_time_init: "
- "unable to create entry 'cn=Start,%s'\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_time_init: "
"unable to create entry 'cn=Start,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_time_init: "
- "unable to add entry 'cn=Start,%s'\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_time_init: "
"unable to add entry 'cn=Start,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
e = str2entry( buf );
if ( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_time_init: "
- "unable to create entry 'cn=Current,%s'\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_time_init: "
"unable to create entry 'cn=Current,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "monitor_subsys_time_init: "
- "unable to add entry 'cn=Current,%s'\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_time_init: "
"unable to add entry 'cn=Current,%s'\n%s%s",
monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val,
"", "" );
-#endif
return( -1 );
}
if ( ldap_bv2rdn( &op->oq_modrdn.rs_newrdn, &new_rdn, &next,
LDAP_DN_FORMAT_LDAP ) )
{
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- " backsql_modrdn: can't figure out "
- "type(s)/values(s) of newrdn\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
" backsql_modrdn: can't figure out "
"type(s)/values(s) of newrdn\n",
0, 0, 0 );
-#endif
rs->sr_err = LDAP_INVALID_DN_SYNTAX;
goto done;
}
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, RESULTS,
- " backsql_modrdn: new_rdn_type=\"%s\", "
- "new_rdn_val=\"%s\"\n",
- new_rdn[ 0 ]->la_attr.bv_val,
- new_rdn[ 0 ]->la_value.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
" backsql_modrdn: new_rdn_type=\"%s\", "
"new_rdn_val=\"%s\"\n",
new_rdn[ 0 ]->la_attr.bv_val,
new_rdn[ 0 ]->la_value.bv_val, 0 );
-#endif
if ( op->oq_modrdn.rs_deleteoldrdn ) {
if ( ldap_bv2rdn( &op->o_req_dn, &old_rdn, &next,
LDAP_DN_FORMAT_LDAP ) )
{
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- " backsql_modrdn: can't figure out "
- "type(s)/values(s) of old_rdn\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
" backsql_modrdn: can't figure out "
"the old_rdn type(s)/value(s)\n",
0, 0, 0 );
-#endif
rs->sr_err = LDAP_OTHER;
goto done;
}
if((nBackendInfo != 0) || (backendInfo != NULL)) {
/* already initialized */
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, ERR,
- "backend_init: backend already initialized\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_init: already initialized.\n", 0, 0, 0 );
-#endif
return -1;
}
rc = binfo[nBackendInfo].bi_init( &binfo[nBackendInfo] );
if(rc != 0) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, INFO,
- "backend_init: initialized for type \"%s\"\n",
- binfo[nBackendInfo].bi_type, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_init: initialized for type \"%s\"\n",
binfo[nBackendInfo].bi_type, 0, 0 );
-#endif
/* destroy those we've already inited */
for( nBackendInfo--;
nBackendInfo >= 0 ;
return 0;
#else
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, ERR, "backend_init: failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_init: failed\n",
0, 0, 0 );
-#endif
return rc;
#endif /* SLAPD_MODULES */
int rc = 0;
if ( aBackendInfo->bi_init == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, ERR, "backend_add: "
- "backend type \"%s\" does not have the (mandatory)init function\n",
- aBackendInfo->bi_type, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "backend_add: "
"backend type \"%s\" does not have the (mandatory)init function\n",
aBackendInfo->bi_type, 0, 0 );
-#endif
return -1;
}
if ((rc = aBackendInfo->bi_init(aBackendInfo)) != 0) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, ERR,
- "backend_add: initialization for type \"%s\" failed\n",
- aBackendInfo->bi_type, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_add: initialization for type \"%s\" failed\n",
aBackendInfo->bi_type, 0, 0 );
-#endif
return rc;
}
LDAP_TAILQ_INIT( be->be_pending_csn_list );
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, DETAIL1, "backend_startup: starting \"%s\"\n",
- be->be_suffix ? be->be_suffix[0].bv_val : "(unknown)",
- 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"backend_startup: starting \"%s\"\n",
be->be_suffix ? be->be_suffix[0].bv_val : "(unknown)",
0, 0 );
-#endif
if ( be->bd_info->bi_db_open ) {
rc = be->bd_info->bi_db_open( be );
if ( rc != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, CRIT,
- "backend_startup: bi_db_open failed! (%d)\n", rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_startup: bi_db_open failed! (%d)\n",
rc, 0, 0 );
-#endif
}
}
return rc;
if( ! ( nBackendDB > 0 ) ) {
/* no databases */
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, INFO,
- "backend_startup: %d databases to startup. \n", nBackendDB, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_startup: %d databases to startup.\n",
nBackendDB, 0, 0 );
-#endif
return 1;
}
if ( be->bd_info->bi_open ) {
rc = be->bd_info->bi_open( be->bd_info );
if ( rc != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, CRIT,
- "backend_startup: bi_open failed!\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_startup: bi_open failed!\n",
0, 0, 0 );
-#endif
return rc;
}
if ( frontendDB->bd_info->bi_db_open ) {
rc = frontendDB->bd_info->bi_db_open( frontendDB );
if ( rc != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, CRIT,
- "backend_startup: bi_db_open(frontend) failed! (%d)\n",
- rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_startup: bi_db_open(frontend) failed! (%d)\n",
rc, 0, 0 );
-#endif
return rc;
}
}
rc = backendInfo[i].bi_open(
&backendInfo[i] );
if ( rc != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, CRIT,
- "backend_startup: bi_open %d failed!\n", i, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_startup: bi_open %d failed!\n",
i, 0, 0 );
-#endif
return rc;
}
}
/* open each backend database */
for( i = 0; i < nBackendDB; i++ ) {
if ( backendDB[i].be_suffix == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, CRIT,
- "backend_startup: warning, database %d (%s) "
- "has no suffix\n",
- i, backendDB[i].bd_info->bi_type, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_startup: warning, database %d (%s) "
"has no suffix\n",
i, backendDB[i].bd_info->bi_type, 0 );
-#endif
}
/* append global access controls */
acl_append( &backendDB[i].be_acl, frontendDB->be_acl );
if ( !( backendDB[i].be_search && backendDB[i].be_add &&
backendDB[i].be_modify && backendDB[i].be_delete )) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, CRIT,
- "backend_startup: database(%d) does not support "
- "operations required for syncrepl", i, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_startup: database(%d) does not support "
"operations required for syncrepl", i, 0, 0 );
-#endif
continue;
}
}
if(rc != 0) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, NOTICE,
- "backend_shutdown: bi_db_close %s failed!\n",
- backendDB[i].be_type, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_close: bi_db_close %s failed!\n",
backendDB[i].be_type, 0, 0 );
-#endif
}
}
if ( frontendDB->bd_info->bi_db_close ) {
rc = frontendDB->bd_info->bi_db_close ( frontendDB );
if ( rc != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, CRIT,
- "backend_startup: bi_db_close(frontend) failed! (%d)\n",
- rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend_startup: bi_db_close(frontend) failed! (%d)\n",
rc, 0, 0 );
-#endif
}
}
* A preoperation plugin failure will abort the
* entire operation.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_bind: Unbind preoperation plugin failed\n",
- 0, 0, 0);
-#else
Debug(LDAP_DEBUG_TRACE,
"do_bind: Unbind preoperation plugin failed\n",
0, 0, 0);
-#endif
return 0;
}
}
if ( op->o_pb != NULL && slapi_int_call_plugins( &backends[i],
SLAPI_PLUGIN_POST_UNBIND_FN, (Slapi_PBlock *)op->o_pb ) < 0 )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_unbind: Unbind postoperation plugins failed\n",
- 0, 0, 0);
-#else
Debug(LDAP_DEBUG_TRACE,
"do_unbind: Unbind postoperation plugins failed\n",
0, 0, 0);
-#endif
}
#endif /* defined( LDAP_SLAPI ) */
}
ber_tag_t tag;
Backend *be = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY, "do_bind: conn %d\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "do_bind\n", 0, 0, 0 );
-#endif
/*
* Force to connection to "anonymous" until bind succeeds.
tag = ber_scanf( ber, "{imt" /*}*/, &version, &dn, &method );
if ( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_bind: conn %d ber_scanf failed\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "bind: ber_scanf failed\n", 0, 0, 0 );
-#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
rs->sr_err = SLAPD_DISCONNECT;
goto cleanup;
}
if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_bind: conn %d get_ctrls failed\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_bind: get_ctrls failed\n", 0, 0, 0 );
-#endif
goto cleanup;
}
rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
op->o_tmpmemctx );
if ( rs->sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_bind: conn %d invalid dn (%s)\n",
- op->o_connid, dn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "bind: invalid dn (%s)\n",
dn.bv_val, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
goto cleanup;
}
if( op->orb_method == LDAP_AUTH_SASL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "do_sasl_bind: conn %d dn (%s) mech %s\n",
- op->o_connid, op->o_req_dn.bv_val, mech.bv_val );
-#else
Debug( LDAP_DEBUG_TRACE, "do_sasl_bind: dn (%s) mech %s\n",
op->o_req_dn.bv_val, mech.bv_val, NULL );
-#endif
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "do_bind: version=%ld dn=\"%s\" method=%ld\n",
- (unsigned long) version, op->o_req_dn.bv_val,
- (unsigned long) op->orb_method );
-#else
Debug( LDAP_DEBUG_TRACE,
"do_bind: version=%ld dn=\"%s\" method=%ld\n",
(unsigned long) version, op->o_req_dn.bv_val,
(unsigned long) op->orb_method );
-#endif
}
Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu BIND dn=\"%s\" method=%ld\n",
(unsigned long) op->orb_method, 0 );
if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_bind: conn %d unknown version = %ld\n",
- op->o_connid, (unsigned long)version, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_bind: unknown version=%ld\n",
(unsigned long) version, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
"requested protocol version not supported" );
goto cleanup;
if ( op->orb_method == LDAP_AUTH_SASL ) {
if ( op->o_protocol < LDAP_VERSION3 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_bind: conn %d sasl with LDAPv%ld\n",
- op->o_connid, (unsigned long)op->o_protocol, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_bind: sasl with LDAPv%ld\n",
(unsigned long)op->o_protocol, 0, 0 );
-#endif
send_ldap_discon( op, rs,
LDAP_PROTOCOL_ERROR, "SASL bind requires LDAPv3" );
rs->sr_err = SLAPD_DISCONNECT;
}
if( mech.bv_len == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_bind: conn %d no SASL mechanism provided\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_bind: no sasl mechanism provided\n",
0, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_AUTH_METHOD_NOT_SUPPORTED,
"no SASL mechanism provided" );
goto cleanup;
op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
op->o_conn->c_authmech.bv_val, op->orb_ssf );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
- op->o_conn->c_authmech.bv_val,
- op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
- op->orb_ssf );
-#else
Debug( LDAP_DEBUG_TRACE,
"do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
op->o_conn->c_authmech.bv_val,
op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
op->orb_ssf );
-#endif
} else if ( rs->sr_err == LDAP_SASL_BIND_IN_PROGRESS ) {
op->o_conn->c_sasl_bind_in_progress = 1;
* just need to send success
*/
send_ldap_result( op, rs );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "do_bind: conn %d v%d anonymous bind\n",
- op->o_connid, op->o_protocol, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "do_bind: v%d anonymous bind\n",
op->o_protocol, 0, 0 );
-#endif
goto cleanup;
} else if ( global_disallows & SLAP_DISALLOW_BIND_SIMPLE ) {
rs->sr_text = "unwilling to perform simple authentication";
send_ldap_result( op, rs );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_bind: conn %d v%d simple bind(%s) disallowed\n",
- op->o_connid, op->o_protocol, op->o_req_ndn.bv_val );
-#else
Debug( LDAP_DEBUG_TRACE,
"do_bind: v%d simple bind(%s) disallowed\n",
op->o_protocol, op->o_req_ndn.bv_val, 0 );
-#endif
goto cleanup;
}
send_ldap_result( op, rs );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "do_bind: conn %d v%d Kerberos V4 (step 1) bind refused\n",
- op->o_connid, op->o_protocol, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"do_bind: v%d Kerberos V4 (step 1) bind refused\n",
op->o_protocol, 0, 0 );
-#endif
goto cleanup;
}
ber_str2bv( "KRBV4", sizeof("KRBV4")-1, 0, &mech );
rs->sr_text = "Kerberos V4 (step 2) bind not supported";
send_ldap_result( op, rs );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "do_bind: conn %d v%d Kerberos V4 (step 2) bind refused\n",
- op->o_connid, op->o_protocol, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"do_bind: v%d Kerberos V4 (step 2) bind refused\n",
op->o_protocol, 0, 0 );
-#endif
goto cleanup;
#endif
rs->sr_text = "unknown authentication method";
send_ldap_result( op, rs );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_bind: conn %ld v%d unknown authentication method (%ld)\n",
- op->o_connid, op->o_protocol, op->orb_method );
-#else
Debug( LDAP_DEBUG_TRACE,
"do_bind: v%d unknown authentication method (%ld)\n",
op->o_protocol, op->orb_method, 0 );
-#endif
goto cleanup;
}
rc = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_BIND_FN, pb );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_bind: Bind preoperation plugin returned %d\n",
- rs->sr_err, 0, 0);
-#else
Debug(LDAP_DEBUG_TRACE,
"do_bind: Bind preoperation plugin returned %d.\n",
rs->sr_err, 0, 0);
-#endif
switch ( rc ) {
case SLAPI_BIND_SUCCESS:
op->o_connid, op->o_opid,
op->o_conn->c_dn.bv_val, mech.bv_val, 0 );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "do_bind: v%d bind: \"%s\" to \"%s\" \n",
- op->o_protocol, op->o_conn->c_dn.bv_val, op->o_conn->c_dn.bv_val );
-#else
Debug( LDAP_DEBUG_TRACE,
"do_bind: v%d bind: \"%s\" to \"%s\"\n",
op->o_protocol, op->o_req_dn.bv_val, op->o_conn->c_dn.bv_val );
-#endif
ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
if ( pb != NULL &&
slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb ) < 0 )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_bind: Bind postoperation plugins failed\n",
- 0, 0, 0);
-#else
Debug(LDAP_DEBUG_TRACE,
"do_bind: Bind postoperation plugins failed.\n",
0, 0, 0);
-#endif
}
#endif /* LDAP_SLAPI */
void *new;
if ( (new = (void *) ber_memalloc_x( size, NULL )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "ch_malloc: allocation of %lu bytes failed\n", (long)size, 0,0 );
-#else
Debug( LDAP_DEBUG_ANY, "ch_malloc of %lu bytes failed\n",
(long) size, 0, 0 );
-#endif
assert( 0 );
exit( EXIT_FAILURE );
}
}
if ( (new = (void *) ber_memrealloc_x( block, size, NULL )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "ch_realloc: reallocation of %lu bytes failed\n", (long)size, 0,0 );
-#else
Debug( LDAP_DEBUG_ANY, "ch_realloc of %lu bytes failed\n",
(long) size, 0, 0 );
-#endif
assert( 0 );
exit( EXIT_FAILURE );
}
void *new;
if ( (new = (void *) ber_memcalloc_x( nelem, size, NULL )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "ch_calloc: allocation of %lu elements of %lu bytes faild\n",
- (long)nelem, (long)size, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ch_calloc of %lu elems of %lu bytes failed\n",
(long) nelem, (long) size, 0 );
-#endif
assert( 0 );
exit( EXIT_FAILURE );
}
char *new;
if ( (new = ber_strdup_x( string, NULL )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "chr_strdup: duplication of \"%s\" failed\n", string, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ch_strdup(%s) failed\n", string, 0, 0 );
-#endif
assert( 0 );
exit( EXIT_FAILURE );
}
ava.aa_desc = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY, "do_compare: conn %d\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "do_compare\n", 0, 0, 0 );
-#endif
/*
* Parse the compare request. It looks like this:
*
*/
if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_compare: conn %d ber_scanf failed\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
-#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
return SLAPD_DISCONNECT;
}
if ( ber_scanf( op->o_ber, "{mm}", &desc, &value ) == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_compare: conn %d get ava failed\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_compare: get ava failed\n", 0, 0, 0 );
-#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
return SLAPD_DISCONNECT;
}
if ( ber_scanf( op->o_ber, /*{*/ "}" ) == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_compare: conn %d ber_scanf failed\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
-#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
return SLAPD_DISCONNECT;
}
if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_compare: conn %d get_ctrls failed\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_compare: get_ctrls failed\n", 0, 0, 0 );
-#endif
goto cleanup;
}
rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
op->o_tmpmemctx );
if( rs->sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_compare: conn %d invalid dn (%s)\n",
- op->o_connid, dn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_compare: invalid dn (%s)\n", dn.bv_val, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
goto cleanup;
}
AttributeAssertion ava = *op->orc_ava;
if( strcasecmp( op->o_req_ndn.bv_val, LDAP_ROOT_DSE ) == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "do_compare: dn (%s) attr(%s) value (%s)\n",
- op->o_req_dn.bv_val,
- ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
-#else
Debug( LDAP_DEBUG_ARGS,
"do_compare: dn (%s) attr (%s) value (%s)\n",
op->o_req_dn.bv_val,
ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
-#endif
Statslog( LDAP_DEBUG_STATS,
"conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n",
}
} else if ( bvmatch( &op->o_req_ndn, &frontendDB->be_schemandn ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "do_compare: dn (%s) attr(%s) value (%s)\n",
- op->o_req_dn.bv_val,
- ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
-#else
Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
op->o_req_dn.bv_val,
ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
-#endif
Statslog( LDAP_DEBUG_STATS,
"conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n",
goto cleanup;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "do_compare: dn (%s) attr(%s) value (%s)\n",
- op->o_req_dn.bv_val,
- ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
-#else
Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
op->o_req_dn.bv_val,
ava.aa_desc->ad_cname.bv_val, ava.aa_value.bv_val );
-#endif
Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu CMP dn=\"%s\" attr=\"%s\"\n",
op->o_connid, op->o_opid, op->o_req_dn.bv_val,
* A preoperation plugin failure will abort the
* entire operation.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_compare: compare preoperation plugin failed\n",
- 0, 0, 0);
-#else
Debug(LDAP_DEBUG_TRACE,
"do_compare: compare preoperation plugin failed\n",
0, 0, 0);
-#endif
if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE,
(void *)&rs->sr_err ) != 0 ) || rs->sr_err == LDAP_SUCCESS )
{
if ( pb != NULL && slapi_int_call_plugins( op->o_bd,
SLAPI_PLUGIN_POST_COMPARE_FN, pb ) < 0 )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_compare: compare postoperation plugins failed\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE,
"do_compare: compare postoperation plugins failed\n", 0, 0, 0 );
-#endif
}
#endif /* defined( LDAP_SLAPI ) */
{
ComponentAssertionValue cav;
int len, rc;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "get_comp_filter\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "get_comp_filter\n", 0, 0, 0 );
-#endif
slapd_ber2cav(bv, &cav);
rc = parse_comp_filter( op, &cav, filt, text );
bv->bv_val = cav.cav_ptr;
ber_len_t len;
char *last;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "get_comp_filter_list\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "get_comp_filter_list\n", 0, 0, 0 );
-#endif
new = f;
for ( tag = comp_first_element( cav ); tag != LDAP_COMP_FILTER_UNDEFINED;
tag = comp_next_element( cav ) )
type = peek_componentId_type( cav );
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "get_compId [%d]\n", type, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "get_compId [%d]\n", type, 0, 0 );
-#endif
len = 0;
_cid.ci_type = type;
_cid.ci_next = NULL;
case LDAP_COMPREF_ALL :
_cid.ci_val.ci_all = '*';
cav->cav_ptr++;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "get_compId : ALL\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "get_compId : ALL\n", 0, 0, 0 );
-#endif
break;
default :
return LDAP_COMPREF_UNDEFINED;
rule_text.bv_val = cav->cav_ptr;
*mr = mr_bvfind( &rule_text );
cav->cav_ptr += count;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "get_matching_rule: %s\n", (*mr)->smr_mrule.mr_oid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "get_matching_rule: %s\n", (*mr)->smr_mrule.mr_oid, 0, 0 );
-#endif
if ( *mr == NULL ) {
*text = "component matching rule not recognized";
return LDAP_INAPPROPRIATE_MATCHING;
int rc;
ComponentAssertion* _ca;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "get_item: %s\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "get_item: %s\n", 0, 0, 0 );
-#endif
_ca = op->o_tmpalloc( sizeof( ComponentAssertion ), op->o_tmpmemctx );
rc = peek_cav_str( cav, "component" );
switch ( f.cf_choice ) {
case LDAP_COMP_FILTER_AND:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "LDAP_COMP_FILTER_AND\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "LDAP_COMP_FILTER_AND\n", 0, 0, 0 );
-#endif
err = get_comp_filter_list( op, cav, &f.cf_and, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_COMP_FILTER_OR:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "LDAP_COMP_FILTER_OR\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "LDAP_COMP_FILTER_OR\n", 0, 0, 0 );
-#endif
err = get_comp_filter_list( op, cav, &f.cf_or, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_COMP_FILTER_NOT:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "LDAP_COMP_FILTER_NOT\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "LDAP_COMP_FILTER_NOT\n", 0, 0, 0 );
-#endif
err = parse_comp_filter( op, cav, &f.cf_not, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_COMP_FILTER_ITEM:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "LDAP_COMP_FILTER_ITEM\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "LDAP_COMP_FILTER_ITEM\n", 0, 0, 0 );
-#endif
err = get_item( op, cav, &f.cf_ca, text );
if ( err != LDAP_SUCCESS ) {
break;
mra->cf->cf_ca->ca_mra = mra;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "test_comp_filter_entry\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "test_comp_filter_entry\n", 0, 0, 0 );
-#endif
if ( mra->ma_desc ) {
/*
* ma_desc is available, so filtering for one attribute
{
int rc;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "test_comp_filter_attr\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "test_comp_filter_attr\n", 0, 0, 0 );
-#endif
switch ( f->cf_choice ) {
case SLAPD_FILTER_COMPUTED:
rc = f->cf_result;
if ( (fp = fopen( fname, "r" )) == NULL ) {
ldap_syslog = 1;
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ENTRY,
- "read_config: " "could not open config file \"%s\": %s (%d)\n",
- fname, strerror(errno), errno );
-#else
Debug( LDAP_DEBUG_ANY,
"could not open config file \"%s\": %s (%d)\n",
fname, strerror(errno), errno );
-#endif
return 1;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ENTRY,
- "read_config: reading config file %s\n", fname, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONFIG, "reading config file %s\n", fname, 0, 0 );
-#endif
fp_getline_init( &lineno );
}
if ( cargc < 1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: bad config line (ignored)\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: bad config line (ignored)\n",
fname, lineno, 0 );
-#endif
continue;
}
if ( strcasecmp( cargv[0], "backend" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s : line %d: missing type in \"backend\" line.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing type in \"backend <type>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if( be != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: backend line must appear before any "
- "database definition.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: backend line must appear before any database definition\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
bi = backend_info( cargv[1] );
if( bi == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "read_config: backend %s initialization failed.\n",
- cargv[1], 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"backend %s initialization failed.\n",
cargv[1], 0, 0 );
-#endif
return( 1 );
}
} else if ( strcasecmp( cargv[0], "database" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing type in \"database <type>\" line\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing type in \"database <type>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
be = backend_db_init( cargv[1] );
if( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "database %s initialization failed.\n", cargv[1], 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"database %s initialization failed.\n",
cargv[1], 0, 0 );
-#endif
return( 1 );
}
} else if ( strcasecmp( cargv[0], "concurrency" ) == 0 ) {
int c;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing level in \"concurrency <level>\" "
- " line\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing level in \"concurrency <level>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
c = strtol( cargv[1], &next, 10 );
if ( next == NULL || next[0] != '\0' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse level \"%s\" in \"concurrency <level>\" "
- " line\n", fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to parse level \"%s\" in \"concurrency <level>\" line\n",
fname, lineno, cargv[1] );
-#endif
return( 1 );
}
if( c < 1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: invalid level (%d) in "
- "\"concurrency <level>\" line.\n", fname, lineno, c );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: invalid level (%d) in \"concurrency <level>\" line\n",
fname, lineno, c );
-#endif
return( 1 );
}
} else if ( strcasecmp( cargv[0], "sockbuf_max_incoming" ) == 0 ) {
long max;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing max in \"sockbuf_max_incoming "
- "<bytes>\" line\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing max in \"sockbuf_max_incoming <bytes>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
max = atol( cargv[1] );
if( max < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: invalid max value (%ld) in "
- "\"sockbuf_max_incoming <bytes>\" line.\n",
- fname, lineno, max );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: invalid max value (%ld) in "
"\"sockbuf_max_incoming <bytes>\" line.\n",
fname, lineno, max );
-#endif
return( 1 );
}
} else if ( strcasecmp( cargv[0], "sockbuf_max_incoming_auth" ) == 0 ) {
long max;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing max in \"sockbuf_max_incoming_auth "
- "<bytes>\" line\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing max in \"sockbuf_max_incoming_auth <bytes>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
max = atol( cargv[1] );
if( max < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: invalid max value (%ld) in "
- "\"sockbuf_max_incoming_auth <bytes>\" line.\n",
- fname, lineno, max );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: invalid max value (%ld) in "
"\"sockbuf_max_incoming_auth <bytes>\" line.\n",
fname, lineno, max );
-#endif
return( 1 );
}
} else if ( strcasecmp( cargv[0], "conn_max_pending" ) == 0 ) {
long max;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing max in \"conn_max_pending "
- "<requests>\" line\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing max in \"conn_max_pending <requests>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
max = atol( cargv[1] );
if( max < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: invalid max value (%ld) in "
- "\"conn_max_pending <requests>\" line.\n",
- fname, lineno, max );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: invalid max value (%ld) in "
"\"conn_max_pending <requests>\" line.\n",
fname, lineno, max );
-#endif
return( 1 );
}
} else if ( strcasecmp( cargv[0], "conn_max_pending_auth" ) == 0 ) {
long max;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing max in \"conn_max_pending_auth "
- "<requests>\" line\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing max in \"conn_max_pending_auth <requests>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
max = atol( cargv[1] );
if( max < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: invalid max value (%ld) in "
- "\"conn_max_pending_auth <requests>\" line.\n",
- fname, lineno, max );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: invalid max value (%ld) in "
"\"conn_max_pending_auth <requests>\" line.\n",
fname, lineno, max );
-#endif
return( 1 );
}
/* default search base */
} else if ( strcasecmp( cargv[0], "defaultSearchBase" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing dn in \"defaultSearchBase <dn\" "
- "line\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"missing dn in \"defaultSearchBase <dn>\" line\n",
fname, lineno, 0 );
-#endif
return 1;
} else if ( cargc > 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: extra cruft after <dn> in "
- "\"defaultSearchBase %s\" line (ignored)\n",
- fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"extra cruft after <dn> in \"defaultSearchBase %s\", "
"line (ignored)\n",
fname, lineno, cargv[1] );
-#endif
}
if ( bi != NULL || be != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: defaultSearchBase line must appear "
- "prior to any backend or database definitions\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"defaultSearchBaase line must appear prior to "
"any backend or database definition\n",
fname, lineno, 0 );
-#endif
return 1;
}
if ( default_search_nbase.bv_len ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: "
- "default search base \"%s\" already defined "
- "(discarding old)\n", fname, lineno,
- default_search_base.bv_val );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"default search base \"%s\" already defined "
"(discarding old)\n",
fname, lineno, default_search_base.bv_val );
-#endif
free( default_search_base.bv_val );
free( default_search_nbase.bv_val );
&default_search_nbase, NULL );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: defaultSearchBase DN is invalid.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: defaultSearchBase DN is invalid\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
}
} else if ( strcasecmp( cargv[0], "threads" ) == 0 ) {
int c;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing count in \"threads <count>\" line\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing count in \"threads <count>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
c = strtol( cargv[1], &next, 10 );
if (next == NULL || next[0] != '\0' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse count \"%s\" in \"threads <count>\" line\n",
- fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to parse count \"%s\" in \"threads <count>\" line\n",
fname, lineno, cargv[1] );
-#endif
return( 1 );
}
if( c < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: invalid level (%d) in \"threads <count>\""
- "line\n", fname, lineno, c );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: invalid level (%d) in \"threads <count>\" line\n",
fname, lineno, c );
-#endif
return( 1 );
}
/* get pid file name */
} else if ( strcasecmp( cargv[0], "pidfile" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d missing file name in \"pidfile <file>\" "
- "line.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing file name in \"pidfile <file>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
/* get args file name */
} else if ( strcasecmp( cargv[0], "argsfile" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: %d: missing file name in "
- "\"argsfile <file>\" line.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing file name in \"argsfile <file>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
/* default password hash */
} else if ( strcasecmp( cargv[0], "password-hash" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing hash in "
- "\"password-hash <hash>\" line.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing hash in \"password-hash <hash>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( default_passwd_hash != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: already set default password_hash!\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: already set default password_hash!\n",
fname, lineno, 0 );
-#endif
return 1;
}
for(i = 1; i < cargc; i++) {
if ( lutil_passwd_scheme( cargv[i] ) == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: password scheme \"%s\" not available\n",
- fname, lineno, cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: password scheme \"%s\" not available\n",
fname, lineno, cargv[i] );
-#endif
} else {
ldap_charray_add( &default_passwd_hash, cargv[i] );
}
}
if( !default_passwd_hash ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: no valid hashes found\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: no valid hashes found\n",
fname, lineno, 0 );
return 1;
-#endif
}
} else if ( strcasecmp( cargv[0], "password-crypt-salt-format" ) == 0 )
{
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing format in "
- "\"password-crypt-salt-format <format>\" line\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: missing format in "
"\"password-crypt-salt-format <format>\" line\n",
fname, lineno, 0 );
-#endif
return 1;
}
} else if ( strcasecmp( cargv[0], "schemadn" ) == 0 ) {
struct berval dn;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing dn in "
- "\"schemadn <dn>\" line.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing dn in \"schemadn <dn>\" line\n",
fname, lineno, 0 );
-#endif
return 1 ;
}
ber_str2bv( cargv[1], 0, 0, &dn );
&frontendDB->be_schemandn, NULL );
}
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: schemadn DN is invalid.\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: schemadn DN is invalid\n",
fname, lineno, 0 );
-#endif
return 1;
}
} else if ( strcasecmp( cargv[0], "ucdata-path" ) == 0 ) {
int err;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing path in "
- "\"ucdata-path <path>\" line.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing path in \"ucdata-path <path>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
err = load_ucdata( cargv[1] );
if ( err <= 0 ) {
if ( err == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: ucdata already loaded, ucdata-path "
- "must be set earlier in the file and/or be "
- "specified only once!\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: ucdata already loaded, ucdata-path must be set earlier in the file and/or be specified only once!\n",
fname, lineno, 0 );
-#endif
}
return( 1 );
struct slap_limits_set *lim;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing limit in \"sizelimit <limit>\" "
- "line.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing limit in \"sizelimit <limit>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( strncasecmp( cargv[i], "size", 4 ) == 0 ) {
rc = limits_parse_one( cargv[i], lim );
if ( rc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable "
- "to parse value \"%s\" in \"sizelimit "
- "<limit>\" line.\n", fname, lineno, cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable "
"to parse value \"%s\" "
"in \"sizelimit "
"<limit>\" line\n",
fname, lineno, cargv[i] );
-#endif
return( 1 );
}
} else {
lim->lms_s_soft = strtol( cargv[i] , &next, 0 );
if ( next == cargv[i] ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse limit \"%s\" in \"sizelimit <limit>\" "
- "line.\n", fname, lineno, cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to parse limit \"%s\" in \"sizelimit <limit>\" line\n",
fname, lineno, cargv[i] );
-#endif
return( 1 );
} else if ( next[0] != '\0' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: trailing chars \"%s\" in \"sizelimit <limit>\" "
- "line ignored.\n", fname, lineno, next );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: trailing chars \"%s\" in \"sizelimit <limit>\" line ignored\n",
fname, lineno, next );
-#endif
}
}
lim->lms_s_hard = 0;
struct slap_limits_set *lim;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d missing limit in \"timelimit <limit>\" "
- "line.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing limit in \"timelimit <limit>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( strncasecmp( cargv[i], "time", 4 ) == 0 ) {
rc = limits_parse_one( cargv[i], lim );
if ( rc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse value \"%s\" "
- "in \"timelimit <limit>\" line.\n",
- fname, lineno, cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable "
"to parse value \"%s\" "
"in \"timelimit "
"<limit>\" line\n",
fname, lineno, cargv[i] );
-#endif
return( 1 );
}
} else {
lim->lms_t_soft = strtol( cargv[i] , &next, 0 );
if ( next == cargv[i] ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse limit \"%s\" in \"timelimit <limit>\" "
- "line.\n", fname, lineno, cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to parse limit \"%s\" in \"timelimit <limit>\" line\n",
fname, lineno, cargv[i] );
-#endif
return( 1 );
} else if ( next[0] != '\0' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: trailing chars \"%s\" in \"timelimit <limit>\" "
- "line ignored.\n", fname, lineno, next );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: trailing chars \"%s\" in \"timelimit <limit>\" line ignored\n",
fname, lineno, next );
-#endif
}
}
lim->lms_t_hard = 0;
/* set regex-based limits */
} else if ( strcasecmp( cargv[0], "limits" ) == 0 ) {
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, WARNING,
- "%s: line %d \"limits\" allowed only in database "
- "environment.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d \"limits\" allowed only in database environment.\n%s",
fname, lineno, "" );
-#endif
return( 1 );
}
/* mark this as a subordinate database */
} else if ( strcasecmp( cargv[0], "subordinate" ) == 0 ) {
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: "
- "subordinate keyword must appear inside a database "
- "definition.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: subordinate keyword "
"must appear inside a database definition.\n",
fname, lineno, 0 );
-#endif
return 1;
} else {
if ( be == NULL ) {
if ( cargv[1][0] == '-' && overlay_config( frontendDB, &cargv[1][1] ) ) {
/* log error */
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: "
- "(optional) global overlay \"%s\" configuration "
- "failed (ignored)\n", fname, lineno, &cargv[1][1] );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"(optional) global overlay \"%s\" configuration "
"failed (ignored)\n", fname, lineno, &cargv[1][1] );
-#endif
} else if ( overlay_config( frontendDB, cargv[1] ) ) {
return 1;
}
} else {
if ( cargv[1][0] == '-' && overlay_config( be, &cargv[1][1] ) ) {
/* log error */
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: "
- "(optional) overlay \"%s\" configuration "
- "failed (ignored)\n", fname, lineno, &cargv[1][1] );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"(optional) overlay \"%s\" configuration "
"failed (ignored)\n", fname, lineno, &cargv[1][1] );
-#endif
} else if ( overlay_config( be, cargv[1] ) ) {
return 1;
}
struct berval dn, pdn, ndn;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing dn in \"suffix <dn>\" line.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"missing dn in \"suffix <dn>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
} else if ( cargc > 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: extra cruft after <dn> in \"suffix %s\""
- " line (ignored).\n", fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: extra cruft "
"after <dn> in \"suffix %s\" line (ignored)\n",
fname, lineno, cargv[1] );
-#endif
}
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: suffix line must appear inside a database "
- "definition.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix line "
"must appear inside a database definition\n",
fname, lineno, 0 );
-#endif
return( 1 );
#if defined(SLAPD_MONITOR_DN)
/* "cn=Monitor" is reserved for monitoring slap */
} else if ( strcasecmp( cargv[1], SLAPD_MONITOR_DN ) == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: \""
- "%s\" is reserved for monitoring slapd\n",
- fname, lineno, SLAPD_MONITOR_DN );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: \""
"%s\" is reserved for monitoring slapd\n",
fname, lineno, SLAPD_MONITOR_DN );
-#endif
return( 1 );
#endif /* SLAPD_MONITOR_DN */
}
rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn, NULL );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: suffix DN is invalid.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: suffix DN is invalid\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
tmp_be = select_backend( &ndn, 0, 0 );
if ( tmp_be == be ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: suffix already served by this backend "
- "(ignored)\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix "
"already served by this backend (ignored)\n",
fname, lineno, 0 );
-#endif
free( pdn.bv_val );
free( ndn.bv_val );
} else if ( tmp_be != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: suffix already served by a preceding "
- "backend \"%s\"\n", fname, lineno,
- tmp_be->be_suffix[0].bv_val );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix "
"already served by a preceeding backend \"%s\"\n",
fname, lineno, tmp_be->be_suffix[0].bv_val );
-#endif
free( pdn.bv_val );
free( ndn.bv_val );
return( 1 );
} else if( pdn.bv_len == 0 && default_search_nbase.bv_len ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: suffix DN empty and default search "
- "base provided \"%s\" (assuming okay).\n",
- fname, lineno, default_search_base.bv_val );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"suffix DN empty and default "
"search base provided \"%s\" (assuming okay)\n",
fname, lineno, default_search_base.bv_val );
-#endif
}
ber_bvarray_add( &be->be_suffix, &pdn );
} else if ( strcasecmp( cargv[0], "maxDerefDepth" ) == 0 ) {
int i;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing depth in \"maxDerefDepth <depth>\""
- " line\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing depth in \"maxDerefDepth <depth>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: depth line must appear inside a database "
- "definition.\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: depth line must appear inside a database definition.\n",
fname, lineno, 0 );
-#endif
return 1;
}
i = strtol( cargv[1], &next, 10 );
if ( next == NULL || next[0] != '\0' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: unable to parse depth \"%s\" in \"maxDerefDepth <depth>\" "
- "line.\n", fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to parse depth \"%s\" in \"maxDerefDepth <depth>\" "
"line.\n", fname, lineno, cargv[1] );
-#endif
return 1;
}
if (i < 0) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: depth must be positive.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: depth must be positive.\n",
fname, lineno, 0 );
-#endif
return 1;
/* set magic "root" dn for this database */
} else if ( strcasecmp( cargv[0], "rootdn" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: missing dn in \"rootdn <dn>\" line.\n",
- fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing dn in \"rootdn <dn>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: rootdn line must appear inside a database "
- "definition.\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: rootdn line must appear inside a database definition.\n",
fname, lineno, 0 );
-#endif
return 1;
} else {
&be->be_rootndn, NULL );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: rootdn DN is invalid.\n",
- fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: rootdn DN is invalid\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
}
/* set super-secret magic database password */
} else if ( strcasecmp( cargv[0], "rootpw" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing passwd in \"rootpw <passwd>\""
- " line\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"missing passwd in \"rootpw <passwd>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: "
- "rootpw line must appear inside a database "
- "definition.\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"rootpw line must appear inside a database "
"definition.\n",
fname, lineno, 0 );
-#endif
return 1;
} else {
Backend *tmp_be = select_backend( &be->be_rootndn, 0, 0 );
if( tmp_be != be ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: "
- "rootpw can only be set when rootdn is under suffix\n",
- fname, lineno, "" );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"rootpw can only be set when rootdn is under suffix\n",
fname, lineno, 0 );
-#endif
return 1;
}
/* make this database read-only */
} else if ( strcasecmp( cargv[0], "readonly" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing on|off in \"readonly <on|off>\" "
- "line.\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing on|off in \"readonly <on|off>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
int i;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing <op_list> in \"restrict <op_list>\" "
- "line.\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing <op_list> in \"restrict <op_list>\" "
"line.\n", fname, lineno, 0 );
-#endif
return 1;
}
} else {
restrict_unknown:;
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "unknown operation %s in \"allow <features>\" line.\n",
- fname, lineno, cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"unknown operation %s in \"allow <features>\" line\n",
fname, lineno, cargv[i] );
-#endif
return 1;
}
}
slap_mask_t allows = 0;
if ( be != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: allow line must appear prior to "
- "database definitions.\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: allow line must appear prior to database definitions\n",
fname, lineno, 0 );
-#endif
}
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing feature(s) in \"allow <features>\""
- " line\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing feature(s) in \"allow <features>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
allows |= SLAP_ALLOW_UPDATE_ANON;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "unknown feature %s in \"allow <features>\" line.\n",
- fname, lineno, cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"unknown feature %s in \"allow <features>\" line\n",
fname, lineno, cargv[i] );
-#endif
return 1;
}
slap_mask_t disallows = 0;
if ( be != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: disallow line must appear prior to "
- "database definitions.\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: disallow line must appear prior to database definitions\n",
fname, lineno, 0 );
-#endif
}
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing feature(s) in \"disallow <features>\""
- " line.\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing feature(s) in \"disallow <features>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
disallows |= SLAP_DISALLOW_TLS_AUTHC;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unknown feature %s in "
- "\"disallow <features>\" line.\n",
- fname, lineno, cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unknown feature %s in \"disallow <features>\" line\n",
fname, lineno, cargv[i] );
-#endif
return 1;
}
slap_mask_t requires = 0;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing feature(s) in "
- "\"require <features>\" line.\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing feature(s) in \"require <features>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
requires |= SLAP_REQUIRE_STRONG;
} else if( strcasecmp( cargv[i], "none" ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unknown feature %s in "
- "\"require <features>\" line.\n",
- fname, lineno , cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unknown feature %s in \"require <features>\" line\n",
fname, lineno, cargv[i] );
-#endif
return( 1 );
}
slap_ssf_set_t *set;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing factor(s) in \"security <factors>\""
- " line.\n", fname, lineno ,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing factor(s) in \"security <factors>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
src = &cargv[i][STRLENOF("simple_bind=")];
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unknown factor %s in "
- "\"security <factors>\" line.\n",
- fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unknown factor %s in \"security <factors>\" line\n",
fname, lineno, cargv[i] );
-#endif
return( 1 );
}
*tgt = strtol( src, &next, 10 );
if ( next == NULL || next[0] != '\0' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse factor \"%s\" in "
- "\"security <factors>\" line.\n",
- fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to parse factor \"%s\" in \"security <factors>\" line\n",
fname, lineno, cargv[i] );
-#endif
return( 1 );
}
/* where to send clients when we don't hold it */
} else if ( strcasecmp( cargv[0], "referral" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing URL in \"referral <URL>\""
- " line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing URL in \"referral <URL>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if( validate_global_referral( cargv[1] ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: invalid URL (%s) in \"referral\" line.\n",
- fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"invalid URL (%s) in \"referral\" line.\n",
fname, lineno, cargv[1] );
-#endif
return 1;
}
if( value_add( &default_referral, vals ) )
return LDAP_OTHER;
-#ifdef NEW_LOGGING
- } else if ( strcasecmp( cargv[0], "logfile" ) == 0 ) {
- FILE *logfile;
- if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: Error in logfile directive, "
- "\"logfile <filename>\"\n", fname, lineno , 0 );
-#else
- Debug( LDAP_DEBUG_ANY,
- "%s: line %d: Error in logfile directive, \"logfile filename\"\n",
- fname, lineno, 0 );
-#endif
-
- return( 1 );
- }
- logfile = fopen( cargv[1], "w" );
- if ( logfile != NULL ) lutil_debug_file( logfile );
-
-#endif
/* start of a new database definition */
} else if ( strcasecmp( cargv[0], "debug" ) == 0 ) {
int level;
if ( cargc < 3 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: Error in debug directive, "
- "\"debug <subsys> <level>\"\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: Error in debug directive, \"debug subsys level\"\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
level = strtol( cargv[2], &next, 10 );
if ( next == NULL || next[0] != '\0' ){
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse level \"%s\" in debug directive, "
- "\"debug <subsys> <level>\"\n", fname, lineno , cargv[2] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to parse level \"%s\" in debug directive, "
"\"debug <subsys> <level>\"\n", fname, lineno , cargv[2] );
-#endif
return( 1 );
}
/* specify an objectclass */
} else if ( strcasecmp( cargv[0], "objectclass" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: illegal objectclass format.\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: illegal objectclass format.\n",
fname, lineno, 0 );
-#endif
return( 1 );
} else if ( *cargv[1] == '(' /*')'*/) {
if( rc ) return rc;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: old objectclass format not supported\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: old objectclass format not supported.\n",
fname, lineno, 0 );
-#endif
}
} else if ( strcasecmp( cargv[0], "ditcontentrule" ) == 0 ) {
|| ( strcasecmp( cargv[0], "attribute" ) == 0 ))
{
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: "
- "illegal attribute type format.\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"illegal attribute type format.\n",
fname, lineno, 0 );
-#endif
return( 1 );
} else if ( *cargv[1] == '(' /*')'*/) {
if( rc ) return rc;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: old attribute type format not supported.\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: old attribute type format not supported.\n",
fname, lineno, 0 );
-#endif
}
/* turn on/off schema checking */
} else if ( strcasecmp( cargv[0], "schemacheck" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing on|off in \"schemacheck <on|off>\""
- " line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing on|off in \"schemacheck <on|off>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( strcasecmp( cargv[1], "off" ) == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: schema checking disabled! your mileage may "
- "vary!\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: schema checking disabled! your mileage may vary!\n",
fname, lineno, 0 );
-#endif
global_schemacheck = 0;
} else {
global_schemacheck = 1;
/* debug level to log things to syslog */
} else if ( strcasecmp( cargv[0], "loglevel" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing level(s) in \"loglevel <level> [...]\""
- " line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing level(s) in \"loglevel <level> [...]\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( isdigit( cargv[i][0] ) ) {
level = strtol( cargv[i], &next, 10 );
if ( next == NULL || next[0] != '\0' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unable to parse level \"%s\" "
- "in \"loglevel <level> [...]\" line.\n",
- fname, lineno , cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to parse level \"%s\" "
"in \"loglevel <level> [...]\" line.\n",
fname, lineno , cargv[i] );
-#endif
return( 1 );
}
}
if ( int_2_level[j].s == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: unknown level \"%s\" "
- "in \"loglevel <level> [...]\" line.\n",
- fname, lineno , cargv[i] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unknown level \"%s\" "
"in \"loglevel <level> [...]\" line.\n",
fname, lineno , cargv[i] );
-#endif
return( 1 );
}
}
} else if ( strcasecmp( cargv[0], "syncrepl" ) == 0 ) {
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: syncrepl line must appear inside "
- "a database definition.\n", fname, lineno, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: syncrepl line must appear inside "
"a database definition.\n", fname, lineno, 0);
-#endif
return 1;
} else if ( SLAP_SHADOW( be )) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: syncrepl: database already shadowed.\n",
- fname, lineno, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: syncrepl: database already shadowed.\n",
fname, lineno, 0);
-#endif
return 1;
} else if ( add_syncrepl( be, cargv, cargc )) {
/* list of replicas of the data in this backend (master only) */
} else if ( strcasecmp( cargv[0], "replica" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing host or uri in \"replica "
- " <host[:port]\" line\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing host or uri in \"replica <host[:port]>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: replica line must appear inside "
- "a database definition.\n", fname, lineno, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: replica line must appear inside a database definition\n",
fname, lineno, 0 );
-#endif
return 1;
} else {
== 0 ) {
if ( ldap_url_parse( cargv[ i ] + 4, &ludp )
!= LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: replica line contains invalid "
- "uri definition.\n", fname, lineno, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: replica line contains invalid "
"uri definition.\n", fname, lineno, 0);
-#endif
return 1;
}
if (ludp->lud_host == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: replica line contains invalid "
- "uri definition - missing hostname.\n",
- fname, lineno, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: replica line contains invalid "
"uri definition - missing hostname.\n", fname, lineno, 0);
-#endif
return 1;
}
replicahost = ch_malloc( strlen( cargv[ i ] ) );
if ( replicahost == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ERR,
- "out of memory in read_config\n", 0, 0,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"out of memory in read_config\n", 0, 0, 0 );
-#endif
ldap_free_urldesc( ludp );
exit( EXIT_FAILURE );
}
}
}
if ( i == cargc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: missing host or uri in \"replica\" line\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing host or uri in \"replica\" line\n",
fname, lineno, 0 );
-#endif
return 1;
} else if ( nr == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: unable to add"
- " replica \"%s\"\n",
- fname, lineno,
- cargv[i] + 5 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to add replica \"%s\"\n",
fname, lineno, cargv[i] + 5 );
-#endif
return 1;
} else {
for ( i = 1; i < cargc; i++ ) {
switch ( add_replica_suffix( be, nr, cargv[i] + 7 ) ) {
case 1:
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: suffix \"%s\" in \"replica\""
- " line is not valid for backend(ignored)\n",
- fname, lineno, cargv[i] + 7 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: suffix \"%s\" in \"replica\" line is not valid for backend (ignored)\n",
fname, lineno, cargv[i] + 7 );
-#endif
break;
case 2:
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: unable to normalize suffix"
- " in \"replica\" line (ignored)\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unable to normalize suffix in \"replica\" line (ignored)\n",
fname, lineno, 0 );
-#endif
break;
}
}
if ( add_replica_attrs( be, nr, arg + 1, exclude ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: attribute \"%s\" in "
- "\"replica\" line is unknown\n",
- fname, lineno, arg + 1 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: attribute \"%s\" in \"replica\" line is unknown\n",
fname, lineno, arg + 1 );
-#endif
return( 1 );
}
}
/* dn of slave entity allowed to write to replica */
} else if ( strcasecmp( cargv[0], "updatedn" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing dn in \"updatedn <dn>\""
- " line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing dn in \"updatedn <dn>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: updatedn line must appear inside "
- "a database definition\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: updatedn line must appear inside a database definition\n",
fname, lineno, 0 );
-#endif
return 1;
} else if ( SLAP_SHADOW(be) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: updatedn: database already shadowed.\n",
- fname, lineno, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: updatedn: database already shadowed.\n",
fname, lineno, 0);
-#endif
return 1;
} else {
rc = dnNormalize( 0, NULL, NULL, &dn, &be->be_update_ndn, NULL );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: updatedn DN is invalid.\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: updatedn DN is invalid\n",
fname, lineno, 0 );
-#endif
return 1;
}
} else if ( strcasecmp( cargv[0], "updateref" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "missing url in \"updateref <ldapurl>\" line.\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"missing url in \"updateref <ldapurl>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: updateref"
- " line must appear inside a database definition\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: updateref"
" line must appear inside a database definition\n",
fname, lineno, 0 );
-#endif
return 1;
} else if ( !SLAP_SHADOW(be) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: "
- "updateref line must come after syncrepl or updatedn.\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"updateref line must after syncrepl or updatedn.\n",
fname, lineno, 0 );
-#endif
return 1;
}
if( validate_global_referral( cargv[1] ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "invalid URL (%s) in \"updateref\" line.\n",
- fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"invalid URL (%s) in \"updateref\" line.\n",
fname, lineno, cargv[1] );
-#endif
return 1;
}
/* replication log file to which changes are appended */
} else if ( strcasecmp( cargv[0], "replogfile" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing filename in \"replogfile <filename>\""
- " line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing filename in \"replogfile <filename>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
/* file from which to read additional rootdse attrs */
} else if ( strcasecmp( cargv[0], "rootDSE" ) == 0) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "missing filename in \"rootDSE <filename>\" line.\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"missing filename in \"rootDSE <filename>\" line.\n",
fname, lineno, 0 );
-#endif
return 1;
}
if( read_root_dse_file( cargv[1] ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "could not read \"rootDSE <filename>\" line.\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"could not read \"rootDSE <filename>\" line\n",
fname, lineno, 0 );
-#endif
return 1;
}
/* maintain lastmodified{by,time} attributes */
} else if ( strcasecmp( cargv[0], "lastmod" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing on|off in \"lastmod <on|off>\""
- " line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing on|off in \"lastmod <on|off>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: lastmod"
- " line must appear inside a database definition\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: lastmod"
" line must appear inside a database definition\n",
fname, lineno, 0 );
-#endif
return 1;
} else if ( SLAP_NOLASTMODCMD(be) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO, "%s: line %d: lastmod"
- " not available for %s database\n",
- fname, lineno , be->bd_info->bi_type );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: lastmod"
" not available for %s databases\n",
fname, lineno, be->bd_info->bi_type );
-#endif
return 1;
}
} else if ( strcasecmp( cargv[0], "idletimeout" ) == 0 ) {
int i;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing timeout value in "
- "\"idletimeout <seconds>\" line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing timeout value in \"idletimeout <seconds>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
i = atoi( cargv[1] );
if( i < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: timeout value (%d) invalid "
- "\"idletimeout <seconds>\" line.\n", fname, lineno, i );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: timeout value (%d) invalid \"idletimeout <seconds>\" line\n",
fname, lineno, i );
-#endif
return( 1 );
}
/* include another config file */
} else if ( strcasecmp( cargv[0], "include" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing filename in \"include "
- "<filename>\" line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing filename in \"include <filename>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
/* location of kerberos srvtab file */
} else if ( strcasecmp( cargv[0], "srvtab" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing filename in \"srvtab "
- "<filename>\" line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing filename in \"srvtab <filename>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
#ifdef SLAPD_MODULES
} else if (strcasecmp( cargv[0], "moduleload") == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: missing filename in \"moduleload "
- "<filename>\" line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing filename in \"moduleload <filename>\" line\n",
fname, lineno, 0 );
-#endif
exit( EXIT_FAILURE );
}
if (module_load(cargv[1], cargc - 2, (cargc > 2) ? cargv + 2 : NULL)) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: failed to load or initialize module %s\n",
- fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: failed to load or initialize module %s\n",
fname, lineno, cargv[1]);
-#endif
exit( EXIT_FAILURE );
}
} else if (strcasecmp( cargv[0], "modulepath") == 0 ) {
if ( cargc != 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: missing path in \"modulepath <path>\""
- " line\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing path in \"modulepath <path>\" line\n",
fname, lineno, 0 );
-#endif
exit( EXIT_FAILURE );
}
if (module_path( cargv[1] )) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: failed to set module search path to %s.\n",
- fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: failed to set module search path to %s\n",
fname, lineno, cargv[1]);
-#endif
exit( EXIT_FAILURE );
}
} else if ( !strcasecmp( cargv[0], "reverse-lookup" ) ) {
#ifdef SLAPD_RLOOKUPS
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: reverse-lookup: missing \"on\" or \"off\"\n",
- fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: reverse-lookup: missing \"on\" or \"off\"\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
} else if ( !strcasecmp( cargv[1], "off" ) ) {
use_reverse_lookup = 0;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: reverse-lookup: "
- "must be \"on\" (default) or \"off\"\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: reverse-lookup: must be \"on\" (default) or \"off\"\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
#else /* !SLAPD_RLOOKUPS */
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: reverse lookups "
- "are not configured (ignored).\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: reverse lookups are not configured (ignored).\n",
fname, lineno, 0 );
-#endif
#endif /* !SLAPD_RLOOKUPS */
/* Netscape plugins */
* and extended operation plugins
*/
if ( be == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: plugin line must appear "
- "insid a database definition.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: plugin "
"line must appear inside a database "
"definition\n", fname, lineno, 0 );
-#endif
return( 1 );
}
#endif /* notdef */
if ( slapi_int_read_config( be, fname, lineno, cargc, cargv )
!= LDAP_SUCCESS )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: SLAPI config read failed.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: SLAPI "
"config read failed.\n", fname, lineno, 0 );
-#endif
return( 1 );
}
slapi_plugins_used++;
#else /* !defined( LDAP_SLAPI ) */
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: SLAPI not supported.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: SLAPI "
"not supported.\n", fname, lineno, 0 );
-#endif
return( 1 );
#endif /* !defined( LDAP_SLAPI ) */
} else if ( strcasecmp( cargv[0], "pluginlog" ) == 0 ) {
#if defined( LDAP_SLAPI )
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: missing file name "
- "in pluginlog <filename> line.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing file name "
"in pluginlog <filename> line.\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
break;
case SLAP_CONF_UNKNOWN:
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: unknown directive \"%s\" inside "
- "backend info definition (ignored).\n",
- fname, lineno, cargv[0] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unknown directive \"%s\" inside backend info definition (ignored)\n",
fname, lineno, cargv[0] );
-#endif
break;
default:
break;
case SLAP_CONF_UNKNOWN:
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: unknown directive \"%s\" inside "
- "backend database definition (ignored).\n",
- fname, lineno, cargv[0] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unknown directive \"%s\" inside backend database definition (ignored)\n",
fname, lineno, cargv[0] );
-#endif
break;
default:
break;
case SLAP_CONF_UNKNOWN:
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, INFO,
- "%s: line %d: unknown directive \"%s\" inside "
- "global database definition (ignored).\n",
- fname, lineno, cargv[0] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unknown directive \"%s\" inside global database definition (ignored)\n",
fname, lineno, cargv[0] );
-#endif
break;
default:
*strtok_quote_ptr = ' ';
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, DETAIL1, "line %d (%s)\n", lineno, logline , 0 );
-#else
Debug( LDAP_DEBUG_CONFIG, "line %d (%s)\n", lineno, logline, 0 );
-#endif
if ( strtok_quote_ptr ) {
*strtok_quote_ptr = '\0';
tmp = ch_realloc( cargv, (cargv_size + ARGS_STEP) *
sizeof(*cargv) );
if ( tmp == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ERR, "line %d: out of memory\n", lineno, 0,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"line %d: out of memory\n",
lineno, 0, 0 );
-#endif
return -1;
}
cargv = tmp;
}
err = ucdata_load( path ? path : SLAPD_DEFAULT_UCDATA, UCDATA_ALL );
if ( err ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "load_ucdata: Error %d loading ucdata.\n", err, 0,0 );
-#else
Debug( LDAP_DEBUG_ANY, "error loading ucdata (error %d)\n",
err, 0, 0 );
-#endif
return( -1 );
}
si = (syncinfo_t *) ch_calloc( 1, sizeof( syncinfo_t ) );
if ( si == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ERR, "out of memory in add_syncrepl\n", 0, 0,0 );
-#else
Debug( LDAP_DEBUG_ANY, "out of memory in add_syncrepl\n", 0, 0, 0 );
-#endif
return 1;
}
LDAP_STAILQ_FOREACH( si_entry, &be->be_syncinfo, si_next ) {
if ( si->si_rid == si_entry->si_rid ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ERR,
- "add_syncrepl: duplicated replica id\n", 0, 0,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"add_syncrepl: duplicated replica id\n",0, 0, 0 );
-#endif
duplicated_replica_id = 1;
break;
}
if ( rc < 0 || duplicated_replica_id ) {
syncinfo_t *si_entry;
/* Something bad happened - back out */
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ERR, "failed to add syncinfo\n", 0, 0,0 );
-#else
Debug( LDAP_DEBUG_ANY, "failed to add syncinfo\n", 0, 0, 0 );
-#endif
/* If error, remove all syncinfo */
LDAP_STAILQ_FOREACH( si_entry, &be->be_syncinfo, si_next ) {
LDAP_STAILQ_INIT( &be->be_syncinfo );
return 1;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG ( CONFIG, RESULTS,
- "add_syncrepl: Config: ** successfully added syncrepl \"%s\"\n",
- si->si_provideruri == NULL ? "(null)" : si->si_provideruri, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONFIG,
"Config: ** successfully added syncrepl \"%s\"\n",
si->si_provideruri == NULL ? "(null)" : si->si_provideruri, 0, 0 );
-#endif
if ( !si->si_schemachecking ) {
SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NO_SCHEMA_CHECK;
}
assert( connections == NULL );
if( connections != NULL) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connections_init: already initialized.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "connections_init: already initialized.\n",
0, 0, 0 );
-#endif
return -1;
}
connections = (Connection *) ch_calloc( dtblsize, sizeof(Connection) );
if( connections == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connections_init: allocation (%d * %ld) of connection "
- "array failed\n", dtblsize, (long) sizeof(Connection), 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"connections_init: allocation (%d*%ld) of connection array failed\n",
dtblsize, (long) sizeof(Connection), 0 );
-#endif
return -1;
}
/* should check return of every call */
if( connections == NULL) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connections_destroy: nothing to destroy.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "connections_destroy: nothing to destroy.\n",
0, 0, 0 );
-#endif
return -1;
}
Connection *c;
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ENTRY, "connection_get: socket %ld\n", (long)s, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS,
"connection_get(%ld)\n",
(long) s, 0, 0 );
-#endif
assert( connections != NULL );
assert( c->c_conn_state == SLAP_C_INVALID );
assert( sd == AC_SOCKET_INVALID );
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ARGS,
- "connection_get: connection %d not used\n", s, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_get(%d): connection not used\n",
s, 0, 0 );
-#endif
ldap_pvt_thread_mutex_unlock( &c->c_mutex );
return NULL;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, RESULTS,
- "connection_get: get for %d got connid %lu\n", s, c->c_connid, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_get(%d): got connid=%lu\n",
s, c->c_connid, 0 );
-#endif
c->c_n_get++;
#endif
if( s == AC_SOCKET_INVALID ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connection_init: init of socket %ld invalid.\n", (long)s, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"connection_init: init of socket %ld invalid.\n", (long)s, 0, 0 );
-#endif
return -1;
}
}
if( c == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connection_init(%d): connection table full "
- "(%d/%d)\n", s, i, dtblsize );
-#else
Debug( LDAP_DEBUG_ANY,
"connection_init(%d): connection table full "
"(%d/%d)\n", s, i, dtblsize);
-#endif
ldap_pvt_thread_mutex_unlock( &connections_mutex );
return -1;
}
if( ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_NONBLOCK,
c /* non-NULL */ ) < 0 )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connection_init: conn %lu set nonblocking failed\n",
- c->c_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"connection_init(%d, %s): set nonblocking failed\n",
s, c->c_peer_name.bv_val, 0 );
-#endif
}
ldap_pvt_thread_mutex_lock( &conn_nextid_mutex );
ber_socket_t sd;
ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd );
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "connection_closing: conn %lu readying socket %d for close.\n",
- c->c_connid, sd, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_closing: readying conn=%lu sd=%d for close\n",
c->c_connid, sd, 0 );
-#endif
/* update state to closing */
c->c_conn_state = SLAP_C_CLOSING;
ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd );
if( !LDAP_STAILQ_EMPTY(&c->c_ops) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "connection_close: conn %lu deferring sd %d\n",
- c->c_connid, sd, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_close: deferring conn=%lu sd=%d\n",
c->c_connid, sd, 0 );
-#endif
return;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, RESULTS,
- "connection_close: conn %lu sd %d\n", c->c_connid, sd, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "connection_close: conn=%lu sd=%d\n",
c->c_connid, sd, 0 );
-#endif
connection_destroy( c );
}
case LDAP_REQ_EXTENDED:
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO, "connection_operation: "
- "conn %lu unknown LDAP request 0x%lx\n",
- conn->c_connid, tag, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "connection_operation: "
"conn %lu unknown LDAP request 0x%lx\n",
conn->c_connid, tag, 0 );
-#endif
op->o_tag = LBER_ERROR;
rs.sr_err = LDAP_PROTOCOL_ERROR;
rs.sr_text = "unknown LDAP request";
}
if( conn->c_sasl_bind_in_progress && tag != LDAP_REQ_BIND ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_operation: conn %lu SASL bind in progress (tag=%ld).\n",
- conn->c_connid, (long)tag, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "connection_operation: "
"error: SASL bind in progress (tag=%ld).\n",
(long) tag, 0, 0 );
-#endif
send_ldap_error( op, &rs, LDAP_OPERATIONS_ERROR,
"SASL bind in progress" );
rc = LDAP_OPERATIONS_ERROR;
c = connection_get( s );
if( c == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connection_read: sock %ld no connection\n", (long)s, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"connection_read(%ld): no connection!\n",
(long) s, 0, 0 );
-#endif
slapd_remove(s, 1, 0);
ldap_pvt_thread_mutex_unlock( &connections_mutex );
c->c_n_read++;
if( c->c_conn_state == SLAP_C_CLOSING ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connection_read: conn %lu connection closing, ignoring input\n",
- c->c_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): closing, ignoring input for id=%lu\n",
s, c->c_connid, 0 );
-#endif
connection_return( c );
ldap_pvt_thread_mutex_unlock( &connections_mutex );
return 0;
return 0;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "connection_read: conn %lu checking for input.\n",
- c->c_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): checking for input on id=%lu\n",
s, c->c_connid, 0 );
-#endif
#ifdef HAVE_TLS
if ( c->c_is_tls && c->c_needs_tls_accept ) {
fd_set rfd;
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_read: conn %lu TLS accept error, error %d\n",
- c->c_connid, rc, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): TLS accept error "
"error=%d id=%lu, closing\n",
s, rc, c->c_connid );
-#endif
c->c_needs_tls_accept = 0;
/* connections_mutex and c_mutex are locked */
connection_closing( c );
rc = dnX509peerNormalize( ssl, &authid );
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO, "connection_read: "
- "conn %lu unable to get TLS client DN, error %d\n",
- c->c_connid, rc, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "connection_read(%d): "
"unable to get TLS client DN, error=%d id=%lu\n",
s, rc, c->c_connid );
-#endif
}
slap_sasl_external( c, c->c_tls_ssf, &authid );
if ( authid.bv_val ) free( authid.bv_val );
rc = ldap_pvt_sasl_install( c->c_sb, c->c_sasl_sockctx );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_read: conn %lu SASL install error %d, closing\n",
- c->c_connid, rc, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): SASL install error "
"error=%d id=%lu, closing\n",
s, rc, c->c_connid );
-#endif
/* connections_mutex and c_mutex are locked */
connection_closing( c );
connection_close( c );
#endif
if( rc < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_read: conn %lu input error %d, closing.\n",
- c->c_connid, rc, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_read(%d): input error=%d id=%lu, closing.\n",
s, rc, c->c_connid );
-#endif
/* connections_mutex and c_mutex are locked */
connection_closing( c );
connection_close( c );
if ( conn->c_currentber == NULL &&
( conn->c_currentber = ber_alloc()) == NULL )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_input: conn %lu ber_alloc failed.\n",
- conn->c_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_alloc failed\n", 0, 0, 0 );
-#endif
return -1;
}
ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_GET_FD, &sd );
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_input: conn %lu ber_get_next failed, errno %d (%s).\n",
- conn->c_connid, err, sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_TRACE,
"ber_get_next on fd %d failed errno=%d (%s)\n",
sd, err, sock_errstr(err) );
-#endif
if ( err != EWOULDBLOCK && err != EAGAIN ) {
/* log, close and send error */
ber_free( conn->c_currentber, 1 );
if ( (tag = ber_get_int( ber, &msgid )) != LDAP_TAG_MSGID ) {
/* log, close and send error */
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_input: conn %lu ber_get_int returns 0x%lx.\n",
- conn->c_connid, tag, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_get_int returns 0x%lx\n",
tag, 0, 0 );
-#endif
ber_free( ber, 1 );
return -1;
}
if ( (tag = ber_peek_tag( ber, &len )) == LBER_ERROR ) {
/* log, close and send error */
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_input: conn %lu ber_peek_tag returns 0x%lx.\n",
- conn->c_connid, tag, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_peek_tag returns 0x%lx\n",
tag, 0, 0 );
-#endif
ber_free( ber, 1 );
return -1;
tag = ber_peek_tag(ber, &len);
}
if( tag != LDAP_REQ_ABANDON && tag != LDAP_REQ_SEARCH ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_input: conn %lu invalid req for UDP 0x%lx.\n",
- conn->c_connid, tag, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "invalid req for UDP 0x%lx\n", tag, 0, 0 );
-#endif
ber_free( ber, 1 );
return 0;
}
sizeof(struct sockaddr), 0 );
if (rc != sizeof(struct sockaddr)) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connection_input: conn %lu ber_write failed\n",
- conn->c_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_write failed\n", 0, 0, 0 );
-#endif
return 1;
}
if (op->o_protocol == LDAP_VERSION2) {
rc = ber_printf(op->o_res_ber, "{is{" /*}}*/, op->o_msgid, "");
if (rc == -1) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connection_input: conn %lu put outer sequence failed\n",
- conn->c_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_write failed\n", 0, 0, 0 );
-#endif
return rc;
}
}
? slap_conn_max_pending_auth
: slap_conn_max_pending;
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connection_input: conn %lu deferring operation: %s\n",
- conn->c_connid, defer, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"connection_input: conn=%lu deferring operation: %s\n",
conn->c_connid, defer, 0 );
-#endif
conn->c_n_ops_pending++;
LDAP_STAILQ_INSERT_TAIL( &conn->c_pending_ops, op, o_next );
if ( conn->c_n_ops_pending > max ) {
rc = ldap_pvt_thread_mutex_trylock( &connections_mutex );
if( rc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "connection_resched: conn %lu reaquiring locks.\n",
- conn->c_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_resched: reaquiring locks conn=%lu sd=%d\n",
conn->c_connid, sd, 0 );
-#endif
/*
* reaquire locks in the right order...
* this may allow another thread to close this connection,
}
if( conn->c_conn_state != SLAP_C_CLOSING ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "connection_resched: conn %lu closed by other thread.\n",
- conn->c_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "connection_resched: "
"closed by other thread conn=%lu sd=%d\n",
conn->c_connid, sd, 0 );
-#endif
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "connection_resched: conn %lu attempting closing.\n",
- conn->c_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "connection_resched: "
"attempting closing conn=%lu sd=%d\n",
conn->c_connid, sd, 0 );
-#endif
connection_close( conn );
}
connection_operation, (void *) op );
if ( status != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_op_activate: conn %lu thread pool submit failed.\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"ldap_pvt_thread_pool_submit: failed (%d) for conn=%lu\n",
status, op->o_connid, 0 );
-#endif
/* should move op to pending list */
}
slapd_clr_write( s, 0);
if( c == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "connection_write: sock %ld no connection!\n", (long)s, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"connection_write(%ld): no connection!\n",
(long)s, 0, 0 );
-#endif
slapd_remove(s, 1, 0);
ldap_pvt_thread_mutex_unlock( &connections_mutex );
return -1;
c->c_n_write++;
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "connection_write conn %lu waking output.\n", c->c_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection_write(%d): waking output for id=%lu\n",
s, c->c_connid, 0 );
-#endif
ldap_pvt_thread_cond_signal( &c->c_write_cv );
if ( ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_NEEDS_READ, NULL ) ) {
goto return_results;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "get_ctrls: conn %lu\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"=> get_ctrls\n", 0, 0, 0 );
-#endif
if( op->o_protocol < LDAP_VERSION3 ) {
rs->sr_err = SLAPD_DISCONNECT;
c->ldctl_oid = bv.bv_val;
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "get_ctrls: conn %lu get OID failed.\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get oid failed.\n",
0, 0, 0 );
-#endif
slap_free_ctrls( op, op->o_ctrls );
op->o_ctrls = NULL;
goto return_results;
} else if( c->ldctl_oid == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "get_ctrls: conn %lu got emtpy OID.\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"get_ctrls: conn %lu got emtpy OID.\n",
op->o_connid, 0, 0 );
-#endif
slap_free_ctrls( op, op->o_ctrls );
op->o_ctrls = NULL;
tag = ber_scanf( ber, "b", &crit );
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "get_ctrls: conn %lu get crit failed.\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get crit failed.\n",
0, 0, 0 );
-#endif
slap_free_ctrls( op, op->o_ctrls );
op->o_ctrls = NULL;
rs->sr_err = SLAPD_DISCONNECT;
tag = ber_scanf( ber, "m", &c->ldctl_value );
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "get_ctrls: conn %lu: "
- "%s (%scritical): get value failed.\n",
- op->o_connid, c->ldctl_oid,
- c->ldctl_iscritical ? "" : "non" );
-#else
Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: conn %lu: "
"%s (%scritical): get value failed.\n",
op->o_connid, c->ldctl_oid,
c->ldctl_iscritical ? "" : "non" );
-#endif
slap_free_ctrls( op, op->o_ctrls );
op->o_ctrls = NULL;
rs->sr_err = SLAPD_DISCONNECT;
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "get_ctrls: conn %lu oid=\"%s\" (%scritical)\n",
- op->o_connid, c->ldctl_oid, c->ldctl_iscritical ? "" : "non" );
-#else
Debug( LDAP_DEBUG_TRACE,
"=> get_ctrls: oid=\"%s\" (%scritical)\n",
c->ldctl_oid, c->ldctl_iscritical ? "" : "non", 0 );
-#endif
sc = find_ctrl( c->ldctl_oid );
if( sc != NULL ) {
}
return_results:
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, RESULTS,
- "get_ctrls: n=%d rc=%d err=\"%s\"\n",
- nctrls, rs->sr_err, rs->sr_text ? rs->sr_text : "" );
-#else
Debug( LDAP_DEBUG_TRACE,
"<= get_ctrls: n=%d rc=%d err=\"%s\"\n",
nctrls, rs->sr_err, rs->sr_text ? rs->sr_text : "");
-#endif
if( sendres && rs->sr_err != LDAP_SUCCESS ) {
if( rs->sr_err == SLAPD_DISCONNECT ) {
? SLAP_CRITICAL_CONTROL
: SLAP_NONCRITICAL_CONTROL;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "parseProxyAuthz: conn %lu authzid=\"%s\"\n",
- op->o_connid,
- ctrl->ldctl_value.bv_len ? ctrl->ldctl_value.bv_val : "anonymous",
- 0 );
-#else
Debug( LDAP_DEBUG_ARGS,
"parseProxyAuthz: conn %lu authzid=\"%s\"\n",
op->o_connid,
ctrl->ldctl_value.bv_len ? ctrl->ldctl_value.bv_val : "anonymous",
0 );
-#endif
if( ctrl->ldctl_value.bv_len == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, RESULTS,
- "parseProxyAuthz: conn=%lu anonymous\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"parseProxyAuthz: conn=%lu anonymous\n",
op->o_connid, 0, 0 );
-#endif
/* anonymous */
free( op->o_dn.bv_val );
return LDAP_PROXY_AUTHZ_FAILURE;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, RESULTS,
- "parseProxyAuthz: conn=%lu \"%s\"\n",
- op->o_connid,
- dn.bv_len ? dn.bv_val : "(NULL)", 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"parseProxyAuthz: conn=%lu \"%s\"\n",
op->o_connid,
dn.bv_len ? dn.bv_val : "(NULL)", 0 );
-#endif
rc = slap_sasl_authorized( op, &op->o_ndn, &dn );
#ifdef LDAP_DEBUG
filter2bv_x( op, op->o_assertion, &fstr );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "parseAssert: conn %ld assert: %s\n",
- op->o_connid, fstr.bv_len ? fstr.bv_val : "empty" , 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "parseAssert: conn %ld assert: %s\n",
op->o_connid, fstr.bv_len ? fstr.bv_val : "empty" , 0 );
-#endif
op->o_tmpfree( fstr.bv_val, op->o_tmpmemctx );
#endif
vrFilter2bv( op, op->o_vrFilter, &fstr );
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "parseValuesReturnFilter: conn %d vrFilter: %s\n",
- op->o_connid, fstr.bv_len ? fstr.bv_val : "empty" , 0 );
-#else
Debug( LDAP_DEBUG_ARGS, " vrFilter: %s\n",
fstr.bv_len ? fstr.bv_val : "empty", 0, 0 );
-#endif
op->o_tmpfree( fstr.bv_val, op->o_tmpmemctx );
#endif
FD_SET( s, &slap_daemon.sd_actives );
FD_SET( s, &slap_daemon.sd_readers );
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "slapd_add: added %ld%s%s\n", (long)s,
- FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "",
- FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" );
-#else
Debug( LDAP_DEBUG_CONNS, "daemon: added %ld%s%s\n",
(long) s,
FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "",
FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" );
-#endif
ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
}
slap_daemon.sd_nactives--;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "slapd_remove: removing %ld%s%s\n", (long) s,
- FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "",
- FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" );
-#else
Debug( LDAP_DEBUG_CONNS, "daemon: removing %ld%s%s\n",
(long) s,
FD_ISSET(s, &slap_daemon.sd_readers) ? "r" : "",
FD_ISSET(s, &slap_daemon.sd_writers) ? "w" : "" );
-#endif
FD_CLR( s, &slap_daemon.sd_actives );
FD_CLR( s, &slap_daemon.sd_readers );
FD_CLR( s, &slap_daemon.sd_writers );
}
static void slapd_close(ber_socket_t s) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1, "slapd_close: closing %ld\n", (long)s, 0, 0);
-#else
Debug( LDAP_DEBUG_CONNS, "daemon: closing %ld\n",
(long) s, 0, 0 );
-#endif
tcp_close(s);
}
if ( strlen(host) >
(sizeof(((struct sockaddr_un *)*sap)->sun_path) - 1) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_get_listener_addresses: domain socket path (%s) "
- "too long in URL\n", host, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: domain socket path (%s) too long in URL",
host, 0, 0);
-#endif
goto errexit;
}
snprintf(serv, sizeof serv, "%d", port);
if ( (err = getaddrinfo(host, serv, &hints, &res)) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_get_listener_addresses: getaddrinfo failed: %s\n",
- AC_GAI_STRERROR(err), 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "daemon: getaddrinfo failed: %s\n",
AC_GAI_STRERROR(err), 0, 0);
-#endif
return -1;
}
for ( sai=res; sai; sai=sai->ai_next ) {
if( sai->ai_addr == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_get_listener_addresses: "
- "getaddrinfo ai_addr is NULL?\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "slap_get_listener_addresses: "
"getaddrinfo ai_addr is NULL?\n", 0, 0, 0 );
-#endif
freeaddrinfo(res);
goto errexit;
}
} else if ( !inet_aton( host, &in ) ) {
he = gethostbyname( host );
if( he == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_get_listener_addresses: invalid host %s\n", host, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: invalid host %s", host, 0, 0);
-#endif
return -1;
}
for (n = 0; he->h_addr_list[n]; n++) ;
rc = ldap_url_parse( url, &lud );
if( rc != LDAP_URL_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slap_open_listener: listen URL \"%s\" parse error %d\n",
- url, rc , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: listen URL \"%s\" parse error=%d\n",
url, rc, 0 );
-#endif
return rc;
}
#ifndef HAVE_TLS
if( ldap_pvt_url_scheme2tls( lud->lud_scheme ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_open_listener: TLS is not supported (%s)\n", url, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: TLS not supported (%s)\n",
url, 0, 0 );
-#endif
ldap_free_urldesc( lud );
return -1;
}
}
#else
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_open_listener: URL scheme is not supported: %s\n", url, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "daemon: URL scheme not supported: %s",
url, 0, 0);
-#endif
ldap_free_urldesc( lud );
return -1;
#endif
l.sl_sd = socket( (*sal)->sa_family, socktype, 0);
if ( l.sl_sd == AC_SOCKET_INVALID ) {
int err = sock_errno();
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slap_open_listener: %s socket() failed errno=%d (%s)\n",
- af, err, sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: %s socket() failed errno=%d (%s)\n",
af, err, sock_errstr(err) );
-#endif
sal++;
continue;
}
#ifndef HAVE_WINSOCK
if ( l.sl_sd >= dtblsize ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slap_open_listener: listener descriptor %ld is too "
- "great %ld\n", (long)l.sl_sd, (long)dtblsize, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: listener descriptor %ld is too great %ld\n",
(long) l.sl_sd, (long) dtblsize, 0 );
-#endif
tcp_close( l.sl_sd );
sal++;
continue;
(char *) &tmp, sizeof(tmp) );
if ( rc == AC_SOCKET_ERROR ) {
int err = sock_errno();
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_open_listener: setsockopt( %ld, SO_REUSEADDR ) "
- "failed errno %d (%s)\n", (long)l.sl_sd, err,
- sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_ANY,
"slapd(%ld): setsockopt(SO_REUSEADDR) failed errno=%d (%s)\n",
(long) l.sl_sd, err, sock_errstr(err) );
-#endif
}
#endif
}
(char *) &tmp, sizeof(tmp) );
if ( rc == AC_SOCKET_ERROR ) {
int err = sock_errno();
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_open_listener: setsockopt( %ld, IPV6_V6ONLY ) failed errno %d (%s)\n",
- (long)l.sl_sd, err, sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_ANY,
"slapd(%ld): setsockopt(IPV6_V6ONLY) failed errno=%d (%s)\n",
(long) l.sl_sd, err, sock_errstr(err) );
-#endif
}
#endif
addrlen = sizeof(struct sockaddr_in6);
if (bind(l.sl_sd, *sal, addrlen)) {
err = sock_errno();
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_open_listener: bind(%ld) failed errno=%d (%s)\n",
- (long)l.sl_sd, err, sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_ANY, "daemon: bind(%ld) failed errno=%d (%s)\n",
(long) l.sl_sd, err, sock_errstr(err) );
-#endif
tcp_close( l.sl_sd );
sal++;
continue;
#if 0 /* don't muck with socket perms */
if ( chmod( addr, l.sl_perms ) < 0 && crit ) {
int err = sock_errno();
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_open_listener: fchmod(%ld) failed errno=%d (%s)\n",
- (long)l.sl_sd, err, sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_ANY, "daemon: fchmod(%ld) failed errno=%d (%s)",
(long) l.sl_sd, err, sock_errstr(err) );
-#endif
tcp_close( l.sl_sd );
slap_free_listener_addresses(psal);
return -1;
#endif /* LDAP_PF_INET6 */
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_open_listener: unsupported address family (%d)\n",
- (int)(*sal)->sa_family, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "daemon: unsupported address family (%d)\n",
(int) (*sal)->sa_family, 0, 0 );
-#endif
break;
}
if ( l.sl_url.bv_val == NULL )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, RESULTS,
- "slap_open_listener: failed on %s\n", url, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_open_listener: failed on %s\n", url, 0, 0 );
-#endif
return -1;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, RESULTS,
- "slap_open_listener: daemon initialized %s\n",
- l.sl_url.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "daemon: initialized %s\n",
l.sl_url.bv_val, 0, 0 );
-#endif
return 0;
}
int i, j, n, rc;
char **u;
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ARGS,
- "slapd_daemon_init: %s\n", urls ? urls : "<null>", 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "daemon_init: %s\n",
urls ? urls : "<null>", 0, 0 );
-#endif
if( (rc = sockinit()) != 0 ) {
return rc;
}
* this byte arrives.
*/
if( (rc = lutil_pair( wake_sds )) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slap_daemon_init: lutil_pair() failed rc=%d\n", rc, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: lutil_pair() failed rc=%d\n", rc, 0, 0 );
-#endif
return rc;
}
u = ldap_str2charray( urls, " " );
if( u == NULL || u[0] == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slap_daemon_init: no urls (%s) provided.\n", urls, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "daemon_init: no urls (%s) provided.\n",
urls, 0, 0 );
-#endif
return -1;
}
for( i=0; u[i] != NULL; i++ ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "slap_daemon_init: listen on %s\n", u[i], 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "daemon_init: listen on %s\n",
u[i], 0, 0 );
-#endif
}
if( i == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_daemon_init: no listeners to open (%s)\n", urls, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "daemon_init: no listeners to open (%s)\n",
urls, 0, 0 );
-#endif
ldap_charray_free( u );
return -1;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slap_daemon_init: %d listeners to open...\n", i, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners to open...\n",
i, 0, 0 );
-#endif
slap_listeners = ch_malloc( (i+1)*sizeof(Listener *) );
for(n = 0, j = 0; u[n]; n++ ) {
}
slap_listeners[j] = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "slap_daemon_init: %d listeners opened\n", i, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "daemon_init: %d listeners opened\n",
i, 0, 0 );
-#endif
#ifdef HAVE_SLP
if( slapd_register_slp ) {
if ( i < l ) {
/* We are already listening to in6addr_any */
-#ifdef NEW_LOGGING
- LDAP_LOG(CONNECTION, WARNING,
- "slapd_daemon_task: Attempt to listen to 0.0.0.0 failed, already listening on ::, assuming IPv4 included\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONNS,
"daemon: Attempt to listen to 0.0.0.0 failed, already listening on ::, assuming IPv4 included\n",
0, 0, 0 );
-#endif
slapd_close( slap_listeners[l]->sl_sd );
slap_listeners[l]->sl_sd = AC_SOCKET_INVALID;
continue;
}
}
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slapd_daemon_task: listen( %s, 5 ) failed errno=%d (%s)\n",
- slap_listeners[l]->sl_url.bv_val, err, sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: listen(%s, 5) failed errno=%d (%s)\n",
slap_listeners[l]->sl_url.bv_val, err,
sock_errstr(err) );
-#endif
return( (void*)-1 );
}
slap_listeners[l]->sl_is_mute )
continue;
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "slapd_daemon_task: select: listen=%d "
- "active_threads=%d tvp=%s\n",
- slap_listeners[l]->sl_sd, at, tvp == NULL ? "NULL" : "zero" );
-#else
Debug( LDAP_DEBUG_CONNS,
"daemon: select: listen=%d active_threads=%d tvp=%s\n",
slap_listeners[l]->sl_sd, at,
tvp == NULL ? "NULL" : "zero" );
-#endif
}
switch(ns = select( nfds, &readfds,
}
if( err != EINTR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slapd_daemon_task: select failed (%d): %s\n",
- err, sock_errstr(err), 0 );
-#else
Debug( LDAP_DEBUG_CONNS,
"daemon: select failed (%d): %s\n",
err, sock_errstr(err), 0 );
-#endif
slapd_shutdown = 2;
}
}
case 0: /* timeout - let threads run */
ebadf = 0;
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL2,
- "slapd_daemon_task: select timeout - yielding\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONNS, "daemon: select timeout - yielding\n",
0, 0, 0 );
-#endif
ldap_pvt_thread_yield();
continue;
if( slapd_shutdown ) continue;
ebadf = 0;
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL2,
- "slapd_daemon_task: activity on %d descriptors\n", ns, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONNS, "daemon: activity on %d descriptors\n",
ns, 0, 0 );
-#endif
/* FALL THRU */
}
ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slapd_daemon_task: accept(%ld) failed errno=%d (%s)\n",
- (long)slap_listeners[l]->sl_sd,
- err, sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: accept(%ld) failed errno=%d (%s)\n",
(long) slap_listeners[l]->sl_sd, err,
sock_errstr(err) );
-#endif
ldap_pvt_thread_yield();
continue;
}
#ifndef HAVE_WINSOCK
/* make sure descriptor number isn't too great */
if ( s >= dtblsize ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slapd_daemon_task: %ld beyond descriptor table size %ld\n",
- (long)s, (long)dtblsize, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: %ld beyond descriptor table size %ld\n",
(long) s, (long) dtblsize, 0 );
-#endif
slapd_close(s);
ldap_pvt_thread_yield();
(char *) &tmp, sizeof(tmp) );
if ( rc == AC_SOCKET_ERROR ) {
int err = sock_errno();
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slapd_daemon_task: setsockopt( %ld, SO_KEEPALIVE)"
- " failed errno=%d (%s)\n",
- (long)s, err, sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_ANY,
"slapd(%ld): setsockopt(SO_KEEPALIVE) failed "
"errno=%d (%s)\n", (long) s, err, sock_errstr(err) );
-#endif
}
#endif
#ifdef TCP_NODELAY
(char *)&tmp, sizeof(tmp) );
if ( rc == AC_SOCKET_ERROR ) {
int err = sock_errno();
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slapd_daemon_task: setsockopt( %ld, "
- "TCP_NODELAY) failed errno=%d (%s)\n",
- (long)s, err, sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_ANY,
"slapd(%ld): setsockopt(TCP_NODELAY) failed "
"errno=%d (%s)\n", (long) s, err, sock_errstr(err) );
-#endif
}
#endif
}
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL1,
- "slapd_daemon_task: new connection on %ld\n", (long)s, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONNS, "daemon: new connection on %ld\n",
(long) s, 0, 0 );
-#endif
switch ( from.sa_addr.sa_family ) {
# ifdef LDAP_PF_LOCAL
case AF_LOCAL:
if( authid.bv_val ) ch_free(authid.bv_val);
if( id < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, INFO,
- "slapd_daemon_task: "
- "connection_init(%ld, %s, %s) "
- "failed.\n",
- (long)s, peername,
- slap_listeners[l]->sl_name.bv_val );
-#else
Debug( LDAP_DEBUG_ANY,
"daemon: connection_init(%ld, %s, %s) "
"failed.\n",
(long) s,
peername,
slap_listeners[l]->sl_name.bv_val );
-#endif
slapd_close(s);
continue;
}
}
#ifdef LDAP_DEBUG
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL2,
- "slapd_daemon_task: activity on ", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONNS, "daemon: activity on:", 0, 0, 0 );
-#endif
#ifdef HAVE_WINSOCK
for ( i = 0; i < readfds.fd_count; i++ ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL2,
- " %d%s", readfds.fd_array[i], "r", 0, 0 );
-#else
Debug( LDAP_DEBUG_CONNS, " %d%s",
readfds.fd_array[i], "r", 0 );
-#endif
}
for ( i = 0; i < writefds.fd_count; i++ ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL2,
- " %d%s", writefds.fd_array[i], "w" , 0 );
-#else
Debug( LDAP_DEBUG_CONNS, " %d%s",
writefds.fd_array[i], "w", 0 );
-#endif
}
#else
r = FD_ISSET( i, &readfds );
w = FD_ISSET( i, &writefds );
if ( r || w ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL2,
- " %d%s%s", i, r ? "r" : "", w ? "w" : "" );
-#else
Debug( LDAP_DEBUG_CONNS, " %d%s%s", i,
r ? "r" : "", w ? "w" : "" );
-#endif
}
}
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL2, "\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 );
-#endif
#endif
wd = i;
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL2,
- "slapd_daemon_task: write active on %d\n", wd, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONNS,
"daemon: write active on %d\n",
wd, 0, 0 );
-#endif
/*
* NOTE: it is possible that the connection was closed
* and that the stream is now inactive.
rd = i;
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, DETAIL2,
- "slapd_daemon_task: read activity on %d\n", rd, 0, 0 );
-#else
Debug ( LDAP_DEBUG_CONNS,
"daemon: read activity on %d\n", rd, 0, 0 );
-#endif
/*
* NOTE: it is possible that the connection was closed
* and that the stream is now inactive.
}
if( slapd_shutdown == 1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, CRIT,
- "slapd_daemon_task: shutdown requested and initiated.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"daemon: shutdown requested and initiated.\n",
0, 0, 0 );
-#endif
} else if ( slapd_shutdown == 2 ) {
#ifdef HAVE_NT_SERVICE_MANAGER
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, CRIT,
- "slapd_daemon_task: shutdown initiated by Service Manager.\n",
- 0, 0, 0);
-#else
Debug( LDAP_DEBUG_TRACE,
"daemon: shutdown initiated by Service Manager.\n",
0, 0, 0);
-#endif
#else /* !HAVE_NT_SERVICE_MANAGER */
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, CRIT,
- "slapd_daemon_task: abnormal condition, "
- "shutdown initiated.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"daemon: abnormal condition, shutdown initiated.\n",
0, 0, 0 );
-#endif
#endif /* !HAVE_NT_SERVICE_MANAGER */
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, CRIT,
- "slapd_daemon_task: no active streams, shutdown initiated.\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"daemon: no active streams, shutdown initiated.\n",
0, 0, 0 );
-#endif
}
if( slapd_gentle_shutdown != 2 ) {
connections_shutdown();
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, CRIT,
- "slapd_daemon_task: shutdown waiting for %d threads to terminate.\n",
- ldap_pvt_thread_pool_backload(&connection_pool), 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"slapd shutdown: waiting for %d threads to terminate\n",
ldap_pvt_thread_pool_backload(&connection_pool), 0, 0 );
-#endif
ldap_pvt_thread_pool_destroy(&connection_pool, 1);
return NULL;
0, slapd_daemon_task, NULL );
if ( rc != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, ERR,
- "slapd_daemon: listener ldap_pvt_thread_create failed (%d).\n",
- rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"listener ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
-#endif
return rc;
}
slap_sig_shutdown( int sig )
{
#if 0
-#ifdef NEW_LOGGING
- LDAP_LOG( CONNECTION, CRIT,
- "slap_sig_shutdown: signal %d\n", sig, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE, "slap_sig_shutdown: signal %d\n", sig, 0, 0);
-#endif
#endif
/*
{
struct berval dn = BER_BVNULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "do_delete: conn %d\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 );
-#endif
/*
* Parse the delete request. It looks like this:
*/
if ( ber_scanf( op->o_ber, "m", &dn ) == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_delete: conn: %d ber_scanf failed\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
-#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
return SLAPD_DISCONNECT;
}
if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_delete: conn %d get_ctrls failed\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_delete: get_ctrls failed\n", 0, 0, 0 );
-#endif
goto cleanup;
}
rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
op->o_tmpmemctx );
if( rs->sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_delete: conn %d invalid dn (%s)\n",
- op->o_connid, dn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_delete: invalid dn (%s)\n", dn.bv_val, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
goto cleanup;
}
if( op->o_req_ndn.bv_len == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_delete: conn %d: Attempt to delete root DSE.\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_delete: root dse!\n", 0, 0, 0 );
-#endif
/* protocolError would likely be a more appropriate error */
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"cannot delete the root DSE" );
goto cleanup;
} else if ( bvmatch( &op->o_req_ndn, &frontendDB->be_schemandn ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "do_delete: conn %d: "
- "Attempt to delete subschema subentry.\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_delete: subschema subentry!\n", 0, 0, 0 );
-#endif
/* protocolError would likely be a more appropriate error */
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"cannot delete the root DSE" );
* A preoperation plugin failure will abort the
* entire operation.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "do_delete: "
- "delete preoperation plugin failed\n", 0, 0, 0 );
-#else
Debug (LDAP_DEBUG_TRACE, "do_delete: "
"delete preoperation plugin failed.\n", 0, 0, 0);
-#endif
if ( ( slapi_pblock_get( pb, SLAPI_RESULT_CODE,
(void *)&rs->sr_err ) != 0 ) ||
rs->sr_err == LDAP_SUCCESS )
if ( pb != NULL && slapi_int_call_plugins( op->o_bd,
SLAPI_PLUGIN_POST_DELETE_FN, pb ) < 0)
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_delete: delete postoperation plugins failed\n",
- 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE,
"do_delete: delete postoperation plugins failed\n",
0, 0, 0 );
-#endif
}
#endif /* defined( LDAP_SLAPI ) */
assert( val );
assert( out );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 );
-#endif
if ( val->bv_len == 0 ) {
ber_dupbv_x( out, val, ctx );
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, "<<< dnPretty: <%s>\n", out->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<<< dnPretty: <%s>\n", out->bv_val, 0, 0 );
-#endif
return LDAP_SUCCESS;
}
assert( val );
assert( out );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, ">>> dnPretty: <%s>\n", val->bv_val, 0, 0 );
-#endif
if ( val->bv_len == 0 ) {
ber_dupbv_x( out, val, ctx );
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, "<<< dnPretty: <%s>\n", out->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<<< dnPretty: <%s>\n", out->bv_val, 0, 0 );
-#endif
return LDAP_SUCCESS;
}
assert( val );
assert( dn );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, ">>> dn%sDN: <%s>\n",
- flags == SLAP_LDAPDN_PRETTY ? "Pretty" : "Normal",
- val->bv_val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, ">>> dn%sDN: <%s>\n",
flags == SLAP_LDAPDN_PRETTY ? "Pretty" : "Normal",
val->bv_val, 0 );
-#endif
if ( val->bv_len == 0 ) {
return LDAP_SUCCESS;
struct berval *normal,
void *ctx)
{
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ENTRY, ">>> dnPrettyNormal: <%s>\n", val->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, ">>> dnPrettyNormal: <%s>\n", val->bv_val, 0, 0 );
-#endif
assert( val );
assert( pretty );
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG (OPERATION, RESULTS, "<<< dnPrettyNormal: <%s>, <%s>\n",
- pretty->bv_val, normal->bv_val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<<< dnPrettyNormal: <%s>, <%s>\n",
pretty->bv_val, normal->bv_val, 0 );
-#endif
return LDAP_SUCCESS;
}
value->bv_len );
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ENTRY, "dnMatch: %d\n %s\n %s\n",
- match, value->bv_val, asserted->bv_val );
-#else
Debug( LDAP_DEBUG_ARGS, "dnMatch %d\n\t\"%s\"\n\t\"%s\"\n",
match, value->bv_val, asserted->bv_val );
-#endif
*matchp = match;
return( LDAP_SUCCESS );
value->bv_len );
}
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ENTRY, "rdnMatch: %d\n %s\n %s\n",
- match, value->bv_val, asserted->bv_val );
-#else
Debug( LDAP_DEBUG_ARGS, "rdnMatch %d\n\t\"%s\"\n\t\"%s\"\n",
match, value->bv_val, asserted->bv_val );
-#endif
*matchp = match;
* or newline.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1, "str2entry: \"%s\"\n",
- s ? s : "NULL", 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "=> str2entry: \"%s\"\n",
s ? s : "NULL", 0, 0 );
-#endif
/* initialize reader/writer lock */
e = (Entry *) ch_calloc( 1, sizeof(Entry) );
if( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "str2entry: entry allocation failed.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"<= str2entry NULL (entry allocation failed)\n",
0, 0, 0 );
-#endif
return( NULL );
}
}
if ( ldif_parse_line( s, &type, &vals[0].bv_val, &vals[0].bv_len ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1, "str2entry: NULL (parse_line)\n",0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"<= str2entry NULL (parse_line)\n", 0, 0, 0 );
-#endif
continue;
}
free( type );
if ( e->e_dn != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1, "str2entry: "
- "entry %ld has multiple DNs \"%s\" and \"%s\"\n",
- (long) e->e_id, e->e_dn, vals[0].bv_val );
-#else
Debug( LDAP_DEBUG_ANY, "str2entry: "
"entry %ld has multiple DNs \"%s\" and \"%s\"\n",
(long) e->e_id, e->e_dn, vals[0].bv_val );
-#endif
free( vals[0].bv_val );
entry_free( e );
return NULL;
rc = dnPrettyNormal( NULL, &vals[0], &e->e_name, &e->e_nname, NULL );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "str2entry: entry %ld has invalid DN \"%s\"\n",
- (long) e->e_id, vals[0].bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "str2entry: "
"entry %ld has invalid DN \"%s\"\n",
(long) e->e_id, vals[0].bv_val, 0 );
-#endif
entry_free( e );
free( vals[0].bv_val );
return NULL;
rc = slap_str2ad( type, &ad, &text );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "str2entry: str2ad(%s): %s\n", type, text, 0 );
-#else
Debug( slapMode & SLAP_TOOL_MODE
? LDAP_DEBUG_ANY : LDAP_DEBUG_TRACE,
"<= str2entry: str2ad(%s): %s\n", type, text, 0 );
-#endif
if( slapMode & SLAP_TOOL_MODE ) {
entry_free( e );
free( vals[0].bv_val );
rc = slap_str2undef_ad( type, &ad, &text );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "str2entry: str2undef_ad(%s): %s\n", type, text, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"<= str2entry: str2undef_ad(%s): %s\n",
type, text, 0 );
-#endif
entry_free( e );
free( vals[0].bv_val );
free( type );
rc = validate( ad->ad_type->sat_syntax, &vals[0] );
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "str2entry: attributeType %s #%d: "
- "no validator for syntax %s\n",
- ad->ad_cname.bv_val, attr_cnt,
- ad->ad_type->sat_syntax->ssyn_oid );
-#else
Debug( LDAP_DEBUG_ANY,
"str2entry: attributeType %s #%d: "
"no validator for syntax %s\n",
ad->ad_cname.bv_val, attr_cnt,
ad->ad_type->sat_syntax->ssyn_oid );
-#endif
entry_free( e );
free( vals[0].bv_val );
free( type );
}
if( rc != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "str2entry: invalid value "
- "for attributeType %s #%d (syntax %s)\n",
- ad->ad_cname.bv_val, attr_cnt,
- ad->ad_type->sat_syntax->ssyn_oid );
-#else
Debug( LDAP_DEBUG_ANY,
"str2entry: invalid value "
"for attributeType %s #%d (syntax %s)\n",
ad->ad_cname.bv_val, attr_cnt,
ad->ad_type->sat_syntax->ssyn_oid );
-#endif
entry_free( e );
free( vals[0].bv_val );
free( type );
&vals[0], &nvals[0], NULL );
if( rc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "str2entry: NULL (smr_normalize %d)\n" , rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"<= str2entry NULL (smr_normalize %d)\n", rc, 0, 0 );
-#endif
entry_free( e );
free( vals[0].bv_val );
rc = attr_merge( e, ad, vals, nvalsp );
if( rc != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "str2entry: NULL (attr_merge)\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"<= str2entry NULL (attr_merge)\n", 0, 0, 0 );
-#endif
entry_free( e );
free( vals[0].bv_val );
free( type );
/* check to make sure there was a dn: line */
if ( e->e_dn == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "str2entry: entry %ld has no dn.\n", (long) e->e_id, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "str2entry: entry %ld has no dn\n",
(long) e->e_id, 0, 0 );
-#endif
entry_free( e );
return NULL;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL2,
- "str2entry(%s) -> 0x%lx\n", e->e_dn, (unsigned long)e, 0 );
-#else
Debug(LDAP_DEBUG_TRACE, "<= str2entry(%s) -> 0x%lx\n",
e->e_dn, (unsigned long) e, 0 );
-#endif
return( e );
}
Attribute *a;
unsigned char *ptr;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1, "entry_encode: id: 0x%08lx \"%s\"\n",
- (long) e->e_id, e->e_dn, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "=> entry_encode(0x%08lx): %s\n",
(long) e->e_id, e->e_dn, 0 );
-#endif
dnlen = e->e_name.bv_len;
ndnlen = e->e_nname.bv_len;
i = entry_getlen(&ptr);
if (!i) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_decode: entry length was zero\n", 0, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"entry_decode: entry length was zero\n", 0, 0, 0);
-#endif
return LDAP_OTHER;
}
x = ch_calloc(1, i);
x->e_nname.bv_val = (char *) ptr;
x->e_nname.bv_len = i;
ptr += i+1;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL2, "entry_decode: \"%s\"\n", x->e_dn, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"entry_decode: \"%s\"\n",
x->e_dn, 0, 0 );
-#endif
x->e_bv = *bv;
/* A valid entry must have at least one attr, so this
rc = slap_bv2ad( &bv, &ad, &text );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_decode: str2ad(%s): %s\n", ptr, text, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"<= entry_decode: str2ad(%s): %s\n", ptr, text, 0 );
-#endif
rc = slap_bv2undef_ad( &bv, &ad, &text );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_decode: str2undef_ad(%s): %s\n", ptr, text, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"<= entry_decode: str2undef_ad(%s): %s\n",
ptr, text, 0 );
-#endif
return rc;
}
}
}
if (a) a->a_next = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1, "entry_decode: %s\n", x->e_dn, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE, "<= entry_decode(%s)\n",
x->e_dn, 0, 0 );
-#endif
*e = x;
return 0;
}
ber_tag_t tag;
ber_len_t len;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY, "do_extended: conn %d\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "do_extended\n", 0, 0, 0 );
-#endif
if( op->o_protocol < LDAP_VERSION3 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_extended: protocol version (%d) too low.\n", op->o_protocol, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_extended: protocol version (%d) too low\n",
op->o_protocol, 0 ,0 );
-#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "requires LDAPv3" );
rs->sr_err = SLAPD_DISCONNECT;
goto done;
}
if ( ber_scanf( op->o_ber, "{m" /*}*/, &op->ore_reqoid ) == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "do_extended: conn %d ber_scanf failed\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_extended: ber_scanf failed\n", 0, 0 ,0 );
-#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
rs->sr_err = SLAPD_DISCONNECT;
goto done;
if( ber_peek_tag( op->o_ber, &len ) == LDAP_TAG_EXOP_REQ_VALUE ) {
if( ber_scanf( op->o_ber, "m", &reqdata ) == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_extended: conn %d ber_scanf failed\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_extended: ber_scanf failed\n", 0, 0 ,0 );
-#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
rs->sr_err = SLAPD_DISCONNECT;
goto done;
}
if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_extended: conn %d get_ctrls failed\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_extended: get_ctrls failed\n", 0, 0 ,0 );
-#endif
return rs->sr_err;
}
if( !(ext = find_extop(supp_ext_list, &op->ore_reqoid )))
#endif
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_extended: conn %d unsupported operation \"%s\"\n",
- op->o_connid, op->ore_reqoid.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_extended: unsupported operation \"%s\"\n",
op->ore_reqoid.bv_val, 0 ,0 );
-#endif
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
"unsupported extended operation" );
goto done;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "do_extended: conn %d oid=%s\n.",
- op->o_connid, op->ore_reqoid.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n",
op->ore_reqoid.bv_val, 0 ,0 );
-#endif
#if defined(LDAP_SLAPI)
if ( funcAddr != NULL ) {
int err;
Filter f;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "get_filter: conn %d\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "begin get_filter\n", 0, 0, 0 );
-#endif
/*
* A filter looks like this coming in:
* Filter ::= CHOICE {
switch ( f.f_choice ) {
case LDAP_FILTER_EQUALITY:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL2,
- "get_filter: conn %d EQUALITY\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 );
-#endif
err = get_ava( op, ber, &f.f_ava, SLAP_MR_EQUALITY, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_FILTER_SUBSTRINGS:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_filter: conn %d SUBSTRINGS\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "SUBSTRINGS\n", 0, 0, 0 );
-#endif
err = get_ssa( op, ber, &f.f_sub, text );
if( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_FILTER_GE:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_filter: conn %d GE\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "GE\n", 0, 0, 0 );
-#endif
err = get_ava( op, ber, &f.f_ava, SLAP_MR_ORDERING, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_FILTER_LE:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_filter: conn %d LE\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "LE\n", 0, 0, 0 );
-#endif
err = get_ava( op, ber, &f.f_ava, SLAP_MR_ORDERING, text );
if ( err != LDAP_SUCCESS ) {
break;
case LDAP_FILTER_PRESENT: {
struct berval type;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_filter: conn %d PRESENT\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 );
-#endif
if ( ber_scanf( ber, "m", &type ) == LBER_ERROR ) {
err = SLAPD_DISCONNECT;
*text = "error decoding filter";
if( err != LDAP_SUCCESS ) {
/* unrecognized attribute description or other error */
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ERR,
- "get_filter: conn %d unknown attribute "
- "type=%s (%d)\n",
- op->o_connid, type.bv_val, err );
-#else
Debug( LDAP_DEBUG_ANY,
"get_filter: conn %d unknown attribute "
"type=%s (%d)\n",
op->o_connid, type.bv_val, err );
-#endif
f.f_choice = SLAPD_FILTER_COMPUTED;
f.f_result = LDAP_COMPARE_FALSE;
} break;
case LDAP_FILTER_APPROX:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_filter: conn %d APPROX\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "APPROX\n", 0, 0, 0 );
-#endif
err = get_ava( op, ber, &f.f_ava, SLAP_MR_EQUALITY_APPROX, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_FILTER_AND:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_filter: conn %d AND\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 );
-#endif
err = get_filter_list( op, ber, &f.f_and, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_FILTER_OR:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_filter: conn %d OR\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 );
-#endif
err = get_filter_list( op, ber, &f.f_or, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_FILTER_NOT:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_filter: conn %d NOT\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 );
-#endif
(void) ber_skip_tag( ber, &len );
err = get_filter( op, ber, &f.f_not, text );
if ( err != LDAP_SUCCESS ) {
break;
case LDAP_FILTER_EXT:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_filter: conn %d EXTENSIBLE\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "EXTENSIBLE\n", 0, 0, 0 );
-#endif
err = get_mra( op, ber, &f.f_mra, text );
if ( err != LDAP_SUCCESS ) {
default:
(void) ber_scanf( ber, "x" ); /* skip the element */
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ERR,
- "get_filter: conn %d unknown filter type=%lu\n",
- op->o_connid, f.f_choice, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "get_filter: unknown filter type=%lu\n",
f.f_choice, 0, 0 );
-#endif
f.f_choice = SLAPD_FILTER_COMPUTED;
f.f_result = SLAPD_COMPARE_UNDEFINED;
break;
**filt = f;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL2,
- "get_filter: conn %d exit\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "end get_filter %d\n", err, 0, 0 );
-#endif
return( err );
}
ber_len_t len;
char *last;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY,
- "get_filter_list: conn %d start\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "begin get_filter_list\n", 0, 0, 0 );
-#endif
new = f;
for ( tag = ber_first_element( ber, &len, &last );
tag != LBER_DEFAULT;
}
*new = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY,
- "get_filter_list: conn %d exit\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "end get_filter_list\n", 0, 0, 0 );
-#endif
return( LDAP_SUCCESS );
}
*text = "error decoding filter";
*out = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY,
- "get_ssa: conn %d begin\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "begin get_ssa\n", 0, 0, 0 );
-#endif
if ( ber_scanf( ber, "{m" /*}*/, &desc ) == LBER_ERROR ) {
return SLAPD_DISCONNECT;
}
rc = slap_bv2ad( &desc, &ssa.sa_desc, text );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ERR,
- "get_ssa: conn %d d unknown attribute type=%s (%d)\n",
- op->o_connid, desc.bv_val, rc );
-#else
Debug( LDAP_DEBUG_ANY,
"get_ssa: conn %d unknown attribute type=%s (%d)\n",
op->o_connid, desc.bv_val, rc );
-#endif
/* skip over the rest of this filter */
for ( tag = ber_first_element( ber, &len, &last );
default:
rc = LDAP_PROTOCOL_ERROR;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ERR,
- "get_filter_substring: conn %d unknown substring choice=%ld\n",
- op->o_connid, (long)tag, 0 );
-#else
Debug( LDAP_DEBUG_FILTER,
" unknown substring choice=%ld\n",
(long) tag, 0, 0 );
-#endif
goto return_error;
}
switch ( tag ) {
case LDAP_SUBSTRING_INITIAL:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_ssa: conn %d INITIAL\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " INITIAL\n", 0, 0, 0 );
-#endif
if ( ssa.sa_initial.bv_val != NULL
|| ssa.sa_any != NULL
break;
case LDAP_SUBSTRING_ANY:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_ssa: conn %d ANY\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " ANY\n", 0, 0, 0 );
-#endif
if ( ssa.sa_final.bv_val != NULL ) {
slap_sl_free( nvalue.bv_val, op->o_tmpmemctx );
break;
case LDAP_SUBSTRING_FINAL:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_ssa: conn %d FINAL\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " FINAL\n", 0, 0, 0 );
-#endif
if ( ssa.sa_final.bv_val != NULL ) {
slap_sl_free( nvalue.bv_val, op->o_tmpmemctx );
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, INFO,
- "get_ssa: conn %d unknown substring type %ld\n",
- op->o_connid, (long)tag, 0 );
-#else
Debug( LDAP_DEBUG_FILTER,
" unknown substring type=%ld\n",
(long) tag, 0, 0 );
-#endif
assert( 0 );
slap_sl_free( nvalue.bv_val, op->o_tmpmemctx );
return_error:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, INFO,
- "get_ssa: conn %d error %ld\n",
- op->o_connid, (long)rc, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " error=%ld\n",
(long) rc, 0, 0 );
-#endif
slap_sl_free( ssa.sa_initial.bv_val, op->o_tmpmemctx );
ber_bvarray_free_x( ssa.sa_any, op->o_tmpmemctx );
slap_sl_free( ssa.sa_final.bv_val, op->o_tmpmemctx );
**out = ssa;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY,
- "get_ssa: conn %d exit\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "end get_ssa\n", 0, 0, 0 );
-#endif
return rc /* LDAP_SUCCESS */ ;
}
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ERR,
- "filter_free: unknown filter type %lu\n", f->f_choice, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "filter_free: unknown filter type=%lu\n",
f->f_choice, 0, 0 );
-#endif
break;
}
int err;
ValuesReturnFilter vrf;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY,
- "get_simple_vrFilter: conn %d\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "begin get_simple_vrFilter\n", 0, 0, 0 );
-#endif
tag = ber_peek_tag( ber, &len );
switch ( vrf.vrf_choice ) {
case LDAP_FILTER_EQUALITY:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL2,
- "get_simple_vrFilter: conn %d EQUALITY\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 );
-#endif
err = get_ava( op, ber, &vrf.vrf_ava, SLAP_MR_EQUALITY, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_FILTER_SUBSTRINGS:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_simple_vrFilter: conn %d SUBSTRINGS\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "SUBSTRINGS\n", 0, 0, 0 );
-#endif
err = get_ssa( op, ber, &vrf.vrf_sub, text );
break;
case LDAP_FILTER_GE:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_simple_vrFilter: conn %d GE\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "GE\n", 0, 0, 0 );
-#endif
err = get_ava( op, ber, &vrf.vrf_ava, SLAP_MR_ORDERING, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_FILTER_LE:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_simple_vrFilter: conn %d LE\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "LE\n", 0, 0, 0 );
-#endif
err = get_ava( op, ber, &vrf.vrf_ava, SLAP_MR_ORDERING, text );
if ( err != LDAP_SUCCESS ) {
break;
case LDAP_FILTER_PRESENT: {
struct berval type;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_simple_vrFilter: conn %d PRESENT\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 );
-#endif
if ( ber_scanf( ber, "m", &type ) == LBER_ERROR ) {
err = SLAPD_DISCONNECT;
*text = "error decoding filter";
if( err != LDAP_SUCCESS ) {
/* unrecognized attribute description or other error */
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ERR,
- "get_simple_vrFilter: conn %d unknown "
- "attribute type=%s (%d)\n",
- op->o_connid, type.bv_val, err );
-#else
Debug( LDAP_DEBUG_ANY,
"get_simple_vrFilter: conn %d unknown "
"attribute type=%s (%d)\n",
op->o_connid, type.bv_val, err );
-#endif
vrf.vrf_choice = SLAPD_FILTER_COMPUTED;
vrf.vrf_result = LDAP_COMPARE_FALSE;
} break;
case LDAP_FILTER_APPROX:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_simple_vrFilter: conn %d APPROX\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "APPROX\n", 0, 0, 0 );
-#endif
err = get_ava( op, ber, &vrf.vrf_ava, SLAP_MR_EQUALITY_APPROX, text );
if ( err != LDAP_SUCCESS ) {
break;
break;
case LDAP_FILTER_EXT:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "get_simple_vrFilter: conn %d EXTENSIBLE\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "EXTENSIBLE\n", 0, 0, 0 );
-#endif
err = get_mra( op, ber, &vrf.vrf_mra, text );
if ( err != LDAP_SUCCESS ) {
default:
(void) ber_scanf( ber, "x" ); /* skip the element */
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ERR,
- "get_simple_vrFilter: conn %d unknown filter type=%lu\n",
- op->o_connid, vrf.vrf_choice, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "get_simple_vrFilter: unknown filter type=%lu\n",
vrf.vrf_choice, 0, 0 );
-#endif
vrf.vrf_choice = SLAPD_FILTER_COMPUTED;
vrf.vrf_result = SLAPD_COMPARE_UNDEFINED;
break;
**filt = vrf;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL2,
- "get_simple_vrFilter: conn %d exit\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "end get_simple_vrFilter %d\n", err, 0, 0 );
-#endif
return err;
}
ber_len_t len;
char *last;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY,
- "get_vrFilter: conn %d start\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "begin get_vrFilter\n", 0, 0, 0 );
-#endif
tag = ber_peek_tag( ber, &len );
}
*n = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY,
- "get_vrFilter: conn %d exit\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "end get_vrFilter\n", 0, 0, 0 );
-#endif
return( LDAP_SUCCESS );
}
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ERR, "filter_free: unknown filter type %lu\n",
- vrf->vrf_choice, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "filter_free: unknown filter type=%lu\n",
vrf->vrf_choice, 0, 0 );
-#endif
break;
}
Filter *f )
{
int rc;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "test_filter: begin\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "=> test_filter\n", 0, 0, 0 );
-#endif
switch ( f->f_choice ) {
case SLAPD_FILTER_COMPUTED:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "test_filter: COMPUTED %s (%d)\n",
- f->f_result == LDAP_COMPARE_FALSE ? "false" :
- f->f_result == LDAP_COMPARE_TRUE ? "true" :
- f->f_result == SLAPD_COMPARE_UNDEFINED ? "undefined" :
- "error", f->f_result, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " COMPUTED %s (%d)\n",
f->f_result == LDAP_COMPARE_FALSE ? "false" :
f->f_result == LDAP_COMPARE_TRUE ? "true" :
f->f_result == SLAPD_COMPARE_UNDEFINED ? "undefined" : "error",
f->f_result, 0 );
-#endif
rc = f->f_result;
break;
case LDAP_FILTER_EQUALITY:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_filter: EQUALITY\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " EQUALITY\n", 0, 0, 0 );
-#endif
rc = test_ava_filter( op, e, f->f_ava, LDAP_FILTER_EQUALITY );
break;
case LDAP_FILTER_SUBSTRINGS:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_filter SUBSTRINGS\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " SUBSTRINGS\n", 0, 0, 0 );
-#endif
rc = test_substrings_filter( op, e, f );
break;
break;
case LDAP_FILTER_PRESENT:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_filter: PRESENT\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " PRESENT\n", 0, 0, 0 );
-#endif
rc = test_presence_filter( op, e, f->f_desc );
break;
case LDAP_FILTER_APPROX:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_filter: APPROX\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " APPROX\n", 0, 0, 0 );
-#endif
rc = test_ava_filter( op, e, f->f_ava, LDAP_FILTER_APPROX );
break;
case LDAP_FILTER_AND:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_filter: AND\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " AND\n", 0, 0, 0 );
-#endif
rc = test_filter_and( op, e, f->f_and );
break;
case LDAP_FILTER_OR:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_filter: OR\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " OR\n", 0, 0, 0 );
-#endif
rc = test_filter_or( op, e, f->f_or );
break;
case LDAP_FILTER_NOT:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_filter: NOT\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " NOT\n", 0, 0, 0 );
-#endif
rc = test_filter( op, e, f->f_not );
/* Flip true to false and false to true
break;
case LDAP_FILTER_EXT:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_filter: EXT\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " EXT\n", 0, 0, 0 );
-#endif
rc = test_mra_filter( op, e, f->f_mra );
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, INFO,
- "test_filter: unknown filter type %lu\n", f->f_choice, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " unknown filter type %lu\n",
f->f_choice, 0, 0 );
-#endif
rc = LDAP_PROTOCOL_ERROR;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, RESULTS, "test_filter: return=%d\n", rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "<= test_filter %d\n", rc, 0, 0 );
-#endif
return( rc );
}
Filter *f;
int rtn = LDAP_COMPARE_TRUE; /* True if empty */
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "test_filter_and: begin\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "=> test_filter_and\n", 0, 0, 0 );
-#endif
for ( f = flist; f != NULL; f = f->f_next ) {
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, RESULTS, "test_filter_and: rc=%d\n", rtn, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "<= test_filter_and %d\n", rtn, 0, 0 );
-#endif
return rtn;
}
Filter *f;
int rtn = LDAP_COMPARE_FALSE; /* False if empty */
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "test_filter_or: begin\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "=> test_filter_or\n", 0, 0, 0 );
-#endif
for ( f = flist; f != NULL; f = f->f_next ) {
int rc = test_filter( op, e, f );
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "test_filter_or: result=%d\n", rtn, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "<= test_filter_or %d\n", rtn, 0, 0 );
-#endif
return rtn;
}
{
Attribute *a;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "test_substrings_filter: begin\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "begin test_substrings_filter\n", 0, 0, 0 );
-#endif
if ( !access_allowed( op, e,
f->f_sub_desc, NULL, ACL_SEARCH, NULL ) )
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "test_substrings_filter: return FALSE\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "end test_substrings_filter 1\n",
0, 0, 0 );
-#endif
return LDAP_COMPARE_FALSE;
}
assert( mode );
if( slapMode != SLAP_UNDEFINED_MODE ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "init: %s init called twice (old=%d, new=%d)\n",
- name, slapMode, mode );
-#else
Debug( LDAP_DEBUG_ANY,
"%s init: init called twice (old=%d, new=%d)\n",
name, slapMode, mode );
-#endif
return 1;
}
switch ( slapMode & SLAP_MODE ) {
case SLAP_SERVER_MODE:
case SLAP_TOOL_MODE:
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "init: %s initiation, initiated %s.\n",
- name, (mode & SLAP_MODE) == SLAP_TOOL_MODE ?
- "tool" : "server", 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"%s init: initiated %s.\n", name,
(mode & SLAP_MODE) == SLAP_TOOL_MODE ? "tool" : "server",
0 );
-#endif
slap_name = name;
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "init: %s init, undefined mode (%d).\n", name, mode, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s init: undefined mode (%d).\n", name, mode, 0 );
-#endif
rc = 1;
break;
{
int rc;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "slap_startup: %s started\n", slap_name, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"%s startup: initiated.\n",
slap_name, 0, 0 );
-#endif
rc = backend_startup( be );
Slapi_PBlock *pb;
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "slap_shutdown: %s shutdown initiated.\n", slap_name, 0, 0);
-#else
Debug( LDAP_DEBUG_TRACE,
"%s shutdown: initiated\n",
slap_name, 0, 0 );
-#endif
/* let backends do whatever cleanup they need to do */
rc = backend_shutdown( be );
{
int rc;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "slap_destroy: %s freeing system resources.\n", slap_name, 0, 0);
-#else
Debug( LDAP_DEBUG_TRACE,
"%s shutdown: freeing system resources.\n",
slap_name, 0, 0 );
-#endif
rc = backend_destroy();
ber_free_buf( ber );
if ( ret < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, RESULTS,
- "slap_build_sync_ctrl: ber_flatten2 failed\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_build_sync_ctrl: ber_flatten2 failed\n",
0, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
return ret;
}
ber_free_buf( ber );
if ( ret < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, RESULTS,
- "slap_build_sync_done_ctrl: ber_flatten2 failed\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_build_sync_done_ctrl: ber_flatten2 failed\n",
0, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
return ret;
}
ber_free_buf( ber );
if ( ret < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, RESULTS,
- "slap_build_sync_ctrl: ber_flatten2 failed\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_build_sync_ctrl: ber_flatten2 failed\n",
0, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
return ret;
}
ber_printf( ber, "N}" );
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, RESULTS,
- "slap_send_syncinfo: invalid syncinfo type (%d)\n",
- type, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_send_syncinfo: invalid syncinfo type (%d)\n",
type, 0, 0 );
-#endif
return LDAP_OTHER;
}
}
ret = ber_flatten2( ber, &rspdata, 0 );
if ( ret < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, RESULTS,
- "slap_send_syncinfo: ber_flatten2 failed\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_send_syncinfo: ber_flatten2 failed\n",
0, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
return ret;
}
assert( op );
assert( limit );
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, DETAIL1, "==> limits_get: conn=%lu op=%lu dn=\"%s\"\n",
- op->o_connid, op->o_opid,
- BER_BVISNULL( ndn ) ? "[anonymous]" : ndn->bv_val );
-
-#else
Debug( LDAP_DEBUG_TRACE, "==> limits_get: conn=%lu op=%lu dn=\"%s\"\n",
op->o_connid, op->o_opid,
BER_BVISNULL( ndn ) ? "[anonymous]" : ndn->bv_val );
-#endif
/*
* default values
*/
lm[0]->lm_group_ad );
if ( rc == 0 ) {
*limit = &lm[0]->lm_limits;
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=GROUP match=EXACT "
- "dn=\"%s\" oc=\"%s\" ad=\"%s\"\n",
- lm[0]->lm_pat.bv_val,
- lm[0]->lm_group_oc->soc_cname.bv_val,
- lm[0]->lm_group_ad->ad_cname.bv_val );
-#else
Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=GROUP match=EXACT "
"dn=\"%s\" oc=\"%s\" ad=\"%s\"\n",
lm[0]->lm_pat.bv_val,
lm[0]->lm_group_oc->soc_cname.bv_val,
lm[0]->lm_group_ad->ad_cname.bv_val );
-#endif
return( 0 );
}
} else {
if ( dn_match( &lm[0]->lm_pat, ndn ) ) {
*limit = &lm[0]->lm_limits;
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=DN match=EXACT dn=\"%s\"\n",
- lm[0]->lm_pat.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=DN match=EXACT dn=\"%s\"\n",
lm[0]->lm_pat.bv_val, 0, 0 );
-#endif
return( 0 );
}
}
}
*limit = &lm[0]->lm_limits;
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=DN match=%s dn=\"%s\"\n",
- limits2str( style ), lm[0]->lm_pat.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=DN match=%s dn=\"%s\"\n",
limits2str( style ), lm[0]->lm_pat.bv_val, 0 );
-#endif
return( 0 );
}
0, NULL, 0 ) == 0 )
{
*limit = &lm[0]->lm_limits;
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=DN match=%s dn=\"%s\"\n",
- limits2str( style ), lm[0]->lm_pat.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=DN match=%s dn=\"%s\"\n",
limits2str( style ), lm[0]->lm_pat.bv_val, 0 );
-#endif
return( 0 );
}
break;
case SLAP_LIMITS_ANONYMOUS:
if ( ndn->bv_len == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=DN match=%s\n",
- limits2str( style ), 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=DN match=%s\n",
limits2str( style ), 0, 0 );
-#endif
*limit = &lm[0]->lm_limits;
return( 0 );
}
case SLAP_LIMITS_USERS:
if ( ndn->bv_len != 0 ) {
*limit = &lm[0]->lm_limits;
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, DETAIL1, "<== limits_get: type=DN match=%s\n",
- limits2str( style ), 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<== limits_get: type=DN match=%s\n",
limits2str( style ), 0, 0 );
-#endif
return( 0 );
}
break;
assert( be );
if ( argc < 3 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s : line %d: missing arg(s) in "
- "\"limits <pattern> <limits>\" line.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s : line %d: missing arg(s) in "
"\"limits <pattern> <limits>\" line.\n%s",
fname, lineno, "" );
-#endif
return( -1 );
}
pattern += STRLENOF( "level" );
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, WARNING ,
- "%s : line %d: deprecated \"one\" style "
- "\"limits <pattern> <limits>\" line; "
- "use \"onelevel\" instead.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s : line %d: deprecated \"one\" style "
"\"limits <pattern> <limits>\" line; "
"use \"onelevel\" instead.\n", fname, lineno, 0 );
-#endif
}
} else if ( strncasecmp( pattern, "sub", STRLENOF( "sub" ) ) == 0 ) {
pattern += STRLENOF( "tree" );
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, WARNING ,
- "%s : line %d: deprecated \"sub\" style "
- "\"limits <pattern> <limits>\" line; "
- "use \"subtree\" instead.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s : line %d: deprecated \"sub\" style "
"\"limits <pattern> <limits>\" line; "
"use \"subtree\" instead.\n", fname, lineno, 0 );
-#endif
}
} else if ( strncasecmp( pattern, "children", STRLENOF( "children" ) ) == 0 ) {
default:
if ( pattern[0] != '=' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s : line %d: missing '=' in "
- "\"dn[.{exact|base|onelevel|subtree"
- "|children|regex|anonymous}]" "=<pattern>\" in "
- "\"limits <pattern> <limits>\" line.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s : line %d: missing '=' in "
"\"dn[.{exact|base|onelevel|subtree"
"\"limits <pattern> <limits>\" "
"line.\n%s",
fname, lineno, "" );
-#endif
return( -1 );
}
flags = SLAP_LIMITS_TYPE_GROUP | SLAP_LIMITS_EXACT;
if ( pattern[0] != '=' ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s : line %d: missing '=' in "
- "\"group[/objectClass[/attributeType]]"
- "=<pattern>\" in "
- "\"limits <pattern> <limits>\" line.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s : line %d: missing '=' in "
"\"group[/objectClass[/attributeType]]"
"=<pattern>\" in "
"\"limits <pattern> <limits>\" line.\n",
fname, lineno, 0 );
-#endif
return( -1 );
}
for ( i = 2; i < argc; i++ ) {
if ( limits_parse_one( argv[i], &limit ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s : line %d: unknown limit values \"%s\" in "
- "\"limits <pattern> <limits>\" line.\n",
- fname, lineno, argv[i] );
-#else
Debug( LDAP_DEBUG_ANY,
"%s : line %d: unknown limit values \"%s\" in "
"\"limits <pattern> <limits>\" line.\n",
fname, lineno, argv[i] );
-#endif
return( 1 );
}
rc = limits_add( be, flags, pattern, group_oc, group_ad, &limit );
if ( rc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s : line %d: unable to add limit in "
- "\"limits <pattern> <limits>\" line.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s : line %d: unable to add limit in "
"\"limits <pattern> <limits>\" line.\n",
fname, lineno, 0 );
-#endif
}
return( rc );
snprintf( buf, sizeof buf, "%s.lock", fname );
if ( (*lfp = fopen( buf, "w" )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "lock_fopen: could not open lock file \"%s\".\n", buf, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", buf, 0, 0 );
-#endif
return( NULL );
}
/* open the log file */
if ( (fp = fopen( fname, type )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "lock_fopen: could not open log file \"%s\".\n", buf, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", fname, 0, 0 );
-#endif
ldap_unlockf( fileno(*lfp) );
fclose( *lfp );
i = (int*)lutil_getRegParam( regService, "DebugLevel" );
if ( i != NULL ) {
slap_debug = *i;
-#ifdef NEW_LOGGING
- lutil_log_initialize( argc, argv );
- LDAP_LOG( SLAPD, INFO,
- "main: new debug level from registry is: %d\n",
- slap_debug, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"new debug level from registry is: %d\n", slap_debug, 0, 0 );
-#endif
}
newUrls = (char *) lutil_getRegParam(regService, "Urls");
ch_free(urls);
urls = ch_strdup(newUrls);
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, INFO,
- "main: new urls from registry: %s\n", urls, 0, 0 );
-#else
Debug(LDAP_DEBUG_ANY, "new urls from registry: %s\n",
urls, 0, 0);
-#endif
}
newConfigFile = (char*)lutil_getRegParam( regService, "ConfigFile" );
if ( newConfigFile != NULL ) {
configfile = newConfigFile;
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, INFO,
- "main: new config file from registry is: %s\n", configfile, 0, 0 );
-#else
Debug ( LDAP_DEBUG_ANY, "new config file from registry is: %s\n", configfile, 0, 0 );
-#endif
}
}
#endif
LDAP_STAILQ_FOREACH( scp_entry, &slap_sync_cookie, sc_next ) {
if ( scp->rid == scp_entry->rid ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "main: duplicated replica id in cookies\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"main: duplicated replica id in cookies\n",
0, 0, 0 );
-#endif
slap_sync_cookie_free( scp, 1 );
goto destroy;
}
}
}
-#ifdef NEW_LOGGING
- lutil_log_initialize( argc, argv );
-#else
lutil_set_debug_level( "slapd", slap_debug );
ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &slap_debug);
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &slap_debug);
ldif_debug = slap_debug;
-#endif
if ( version ) {
fprintf( stderr, "%s\n", Versionstr );
#endif
}
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, INFO, "%s", Versionstr, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s", Versionstr, 0, 0 );
-#endif
if( check == CHECK_NONE && slapd_daemon_init( urls ) != 0 ) {
rc = 1;
#endif
if ( slap_schema_init( ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "main: schema initialization error\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"schema initialization error\n",
0, 0, 0 );
-#endif
goto destroy;
}
}
if ( slap_controls_init( ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "main: controls initialization error\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"controls initialization error\n",
0, 0, 0 );
-#endif
goto destroy;
}
#ifdef LDAP_SLAPI
if ( slapi_int_initialize() != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "main: slapi initialization error\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"slapi initialization error\n",
0, 0, 0 );
-#endif
goto destroy;
}
}
if ( glue_sub_init( ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT, "main: subordinate config error\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"subordinate config error\n",
0, 0, 0 );
-#endif
goto destroy;
}
if ( slap_schema_check( ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT, "main: schema prep error\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"schema prep error\n",
0, 0, 0 );
-#endif
goto destroy;
}
#ifdef HAVE_TLS
rc = ldap_pvt_tls_init();
if( rc != 0) {
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT, "main: tls init failed: %d\n", rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"main: TLS init failed: %d\n",
0, 0, 0 );
-#endif
rc = 1;
SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 20 );
goto destroy;
rc = ldap_pvt_tls_init_def_ctx();
if( rc != 0) {
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT, "main: tls init def ctx failed: %d\n", rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"main: TLS init def ctx failed: %d\n",
rc, 0, 0 );
-#endif
rc = 1;
SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 20 );
goto destroy;
goto shutdown;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, INFO, "main: slapd starting.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 );
-#endif
if ( slapd_pid_file != NULL ) {
lutil_LogStoppedEvent( serverName );
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT, "main: slapd stopped.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "slapd stopped.\n", 0, 0, 0 );
-#endif
#ifdef HAVE_NT_SERVICE_MANAGER
ValuesReturnFilter *vrf;
int rc = LDAP_SUCCESS;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "filter_matched_values: begin\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "=> filter_matched_values\n", 0, 0, 0 );
-#endif
for ( vrf = op->o_vrFilter; vrf != NULL; vrf = vrf->vrf_next ) {
switch ( vrf->vrf_choice ) {
case SLAPD_FILTER_COMPUTED:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1,
- "test_vrFilter: COMPUTED %s (%d)\n",
- vrf->vrf_result == LDAP_COMPARE_FALSE ? "false" :
- vrf->vrf_result == LDAP_COMPARE_TRUE ? "true" :
- vrf->vrf_result == SLAPD_COMPARE_UNDEFINED ? "undefined" :
- "error", vrf->vrf_result, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " COMPUTED %s (%d)\n",
vrf->vrf_result == LDAP_COMPARE_FALSE ? "false" :
vrf->vrf_result == LDAP_COMPARE_TRUE ? "true" :
vrf->vrf_result == SLAPD_COMPARE_UNDEFINED ? "undefined" : "error",
vrf->vrf_result, 0 );
-#endif
/*This type of filter does not affect the result */
rc = LDAP_SUCCESS;
break;
case LDAP_FILTER_EQUALITY:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: EQUALITY\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " EQUALITY\n", 0, 0, 0 );
-#endif
rc = test_ava_vrFilter( op, a, vrf->vrf_ava,
LDAP_FILTER_EQUALITY, e_flags );
if( rc == -1 ) {
break;
case LDAP_FILTER_SUBSTRINGS:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_vrFilter SUBSTRINGS\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " SUBSTRINGS\n", 0, 0, 0 );
-#endif
rc = test_substrings_vrFilter( op, a,
vrf, e_flags );
break;
case LDAP_FILTER_PRESENT:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: PRESENT\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " PRESENT\n", 0, 0, 0 );
-#endif
rc = test_presence_vrFilter( op, a,
vrf->vrf_desc, e_flags );
if( rc == -1 ) {
break;
case LDAP_FILTER_EXT:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, DETAIL1, "test_vrFilter: EXT\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, " EXT\n", 0, 0, 0 );
-#endif
rc = test_mra_vrFilter( op, a,
vrf->vrf_mra, e_flags );
if( rc == -1 ) {
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, INFO,
- "test_vrFilter: unknown filter type %lu\n", vrf->vrf_choice, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " unknown filter type %lu\n",
vrf->vrf_choice, 0, 0 );
-#endif
rc = LDAP_PROTOCOL_ERROR;
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "filter_matched_values: return=%d\n", rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "<= filter_matched_values %d\n", rc, 0, 0 );
-#endif
return( rc );
}
Modifications **modtail = &modlist;
int increment = 0;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY, "do_modify: enter\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 );
-#endif
/*
* Parse the modify request. It looks like this:
*/
if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "do_modify: ber_scanf failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modify: ber_scanf failed\n", 0, 0, 0 );
-#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
return SLAPD_DISCONNECT;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, "do_modify: dn (%s)\n", dn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "do_modify: dn (%s)\n", dn.bv_val, 0, 0 );
-#endif
/* collect modifications & save for later */
for ( tag = ber_first_element( op->o_ber, &len, &last );
switch( mop ) {
case LDAP_MOD_ADD:
if ( mod->sml_values == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_modify: modify/add operation (%ld) requires values\n",
- (long)mop, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_modify: modify/add operation (%ld) requires values\n",
(long) mop, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
"modify/add operation requires values" );
if( op->o_protocol >= LDAP_VERSION3 ) {
increment++;
if ( mod->sml_values == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "do_modify: "
- "modify/increment operation (%ld) requires value\n",
- (long)mop, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modify: "
"modify/increment operation (%ld) requires value\n",
(long) mop, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
"modify/increment operation requires value" );
}
if( mod->sml_values[1].bv_val ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "do_modify: modify/increment "
- "operation (%ld) requires single value\n",
- (long)mop, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modify: modify/increment "
"operation (%ld) requires single value\n",
(long) mop, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
"modify/increment operation requires single value" );
/* fall thru */
default: {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_modify: unrecognized modify operation (%ld)\n",
- (long)mop, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_modify: unrecognized modify operation (%ld)\n",
(long) mop, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
"unrecognized modify operation" );
*modtail = NULL;
if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "do_modify: get_ctrls failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modify: get_ctrls failed\n", 0, 0, 0 );
-#endif
goto cleanup;
}
rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
op->o_tmpmemctx );
if( rs->sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "do_modify: conn %d invalid dn (%s)\n",
- op->o_connid, dn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_modify: invalid dn (%s)\n", dn.bv_val, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
goto cleanup;
}
int increment = op->orm_increment;
if( op->o_req_ndn.bv_len == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_modify: attempt to modify root DSE.\n",0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modify: root dse!\n", 0, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"modify upon the root DSE not supported" );
goto cleanup;
} else if ( bvmatch( &op->o_req_ndn, &frontendDB->be_schemandn ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_modify: attempt to modify subschema subentry.\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modify: subschema subentry!\n", 0, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"modification of subschema subentry not supported" );
}
#ifdef LDAP_DEBUG
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1, "do_modify: modifications:\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "modifications:\n", 0, 0, 0 );
-#endif
for ( tmp = modlist; tmp != NULL; tmp = tmp->sml_next ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1, "\t%s: %s\n",
- tmp->sml_op == LDAP_MOD_ADD ? "add" :
- (tmp->sml_op == LDAP_MOD_INCREMENT ? "increment" :
- (tmp->sml_op == LDAP_MOD_DELETE ? "delete" :
- "replace")), tmp->sml_type.bv_val, 0 );
-
- if ( tmp->sml_values == NULL ) {
- LDAP_LOG( OPERATION, DETAIL1, "\t\tno values", 0, 0, 0 );
- } else if ( tmp->sml_values[0].bv_val == NULL ) {
- LDAP_LOG( OPERATION, DETAIL1, "\t\tzero values", 0, 0, 0 );
- } else if ( tmp->sml_values[1].bv_val == NULL ) {
- LDAP_LOG( OPERATION, DETAIL1, "\t\tone value", 0, 0, 0 );
- } else {
- LDAP_LOG( OPERATION, DETAIL1, "\t\tmultiple values", 0, 0, 0 );
- }
-
-#else
Debug( LDAP_DEBUG_ARGS, "\t%s: %s\n",
tmp->sml_op == LDAP_MOD_ADD ? "add" :
(tmp->sml_op == LDAP_MOD_INCREMENT ? "increment" :
Debug( LDAP_DEBUG_ARGS, "%s\n",
"\t\tmultiple values", NULL, NULL );
}
-#endif
}
if ( StatslogTest( LDAP_DEBUG_STATS ) ) {
* A preoperation plugin failure will abort the
* entire operation.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_modify: modify preoperation plugin failed\n",
- 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE,
"do_modify: modify preoperation plugin failed.\n",
0, 0, 0);
-#endif
if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE,
(void *)&rs->sr_err ) != 0 ) || rs->sr_err == LDAP_SUCCESS )
{
if ( pb != NULL && slapi_int_call_plugins( op->o_bd,
SLAPI_PLUGIN_POST_MODIFY_FN, pb ) < 0 )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_modify: modify postoperation plugins failed\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE,
"do_modify: modify postoperation plugins failed.\n", 0, 0, 0);
-#endif
}
#endif /* defined( LDAP_SLAPI ) */
ad->ad_type->sat_equality,
&ml->sml_values[nvals], &ml->sml_nvalues[nvals], ctx );
if( rc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "str2entry: NULL (ssyn_normalize %d)\n",
- rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"<= str2entry NULL (ssyn_normalize %d)\n",
rc, 0, 0 );
-#endif
snprintf( textbuf, textlen,
"%s: value #%ld normalization failed",
ml->sml_type.bv_val, (long) nvals );
ber_len_t length;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY, "do_modrdn: begin\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 );
-#endif
/*
if ( ber_scanf( op->o_ber, "{mmb", &dn, &newrdn, &deloldrdn )
== LBER_ERROR )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "do_modrdn: ber_scanf failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
-#endif
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
return SLAPD_DISCONNECT;
/* Conection record indicates v2 but field
* newSuperior is present: report error.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_modrdn: (v2) invalid field newSuperior.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"modrdn(v2): invalid field newSuperior!\n",
0, 0, 0 );
-#endif
send_ldap_discon( op, rs,
LDAP_PROTOCOL_ERROR, "newSuperior requires LDAPv3" );
if ( ber_scanf( op->o_ber, "m", &newSuperior )
== LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_modrdn: ber_scanf(\"m\") failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_scanf(\"m\") failed\n",
0, 0, 0 );
-#endif
send_ldap_discon( op, rs,
LDAP_PROTOCOL_ERROR, "decoding error" );
op->orr_nnewSup = &nnewSuperior;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "do_modrdn: dn (%s) newrdn (%s) newsuperior(%s)\n",
- dn.bv_val, newrdn.bv_val,
- newSuperior.bv_len ? newSuperior.bv_val : "" );
-#else
Debug( LDAP_DEBUG_ARGS,
"do_modrdn: dn (%s) newrdn (%s) newsuperior (%s)\n",
dn.bv_val, newrdn.bv_val,
newSuperior.bv_len ? newSuperior.bv_val : "" );
-#endif
if ( ber_scanf( op->o_ber, /*{*/ "}") == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "do_modrdn: ber_scanf failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modrdn: ber_scanf failed\n", 0, 0, 0 );
-#endif
send_ldap_discon( op, rs,
LDAP_PROTOCOL_ERROR, "decoding error" );
}
if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "do_modrdn: get_ctrls failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modrdn: get_ctrls failed\n", 0, 0, 0 );
-#endif
/* get_ctrls has sent results. Now clean up. */
goto cleanup;
rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
if( rs->sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_modrdn: conn %d invalid dn (%s)\n",
- op->o_connid, dn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_modrdn: invalid dn (%s)\n", dn.bv_val, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
goto cleanup;
}
rs->sr_err = dnPrettyNormal( NULL, &newrdn, &op->orr_newrdn, &op->orr_nnewrdn, op->o_tmpmemctx );
if( rs->sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_modrdn: conn %d invalid newrdn (%s)\n",
- op->o_connid, newrdn.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_modrdn: invalid newrdn (%s)\n", newrdn.bv_val, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid new RDN" );
goto cleanup;
}
if( rdn_validate( &op->orr_newrdn ) != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_modrdn: invalid rdn (%s).\n", op->orr_newrdn.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid rdn (%s)\n",
op->orr_newrdn.bv_val, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid new RDN" );
goto cleanup;
rs->sr_err = dnPrettyNormal( NULL, &newSuperior, &pnewSuperior,
&nnewSuperior, op->o_tmpmemctx );
if( rs->sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_modrdn: conn %d invalid newSuperior (%s)\n",
- op->o_connid, newSuperior.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_modrdn: invalid newSuperior (%s)\n",
newSuperior.bv_val, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid newSuperior" );
goto cleanup;
}
struct berval pdn = BER_BVNULL;
if( op->o_req_ndn.bv_len == 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_modrdn: attempt to modify root DSE.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modrdn: root dse!\n", 0, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"cannot rename the root DSE" );
goto cleanup;
} else if ( bvmatch( &op->o_req_ndn, &frontendDB->be_schemandn ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_modrdn: attempt to modify subschema subentry: %s (%ld)\n",
- frontendDB->be_schemandn.bv_val, (long)frontendDB->be_schemandn.bv_len, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_modrdn: subschema subentry: %s (%ld)\n",
frontendDB->be_schemandn.bv_val, (long)frontendDB->be_schemandn.bv_len, 0 );
-#endif
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
"cannot rename subschema subentry" );
* A preoperation plugin failure will abort the
* entire operation.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "do_modrdn: modrdn preoperation plugin "
- "failed\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE, "do_modrdn: modrdn preoperation plugin "
"failed.\n", 0, 0, 0);
-#endif
if ( ( slapi_pblock_get( pb, SLAPI_RESULT_CODE, (void *)&rs->sr_err ) != 0 ) ||
rs->sr_err == LDAP_SUCCESS ) {
rs->sr_err = LDAP_OTHER;
#if defined( LDAP_SLAPI )
if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_MODRDN_FN, pb ) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "do_modrdn: modrdn postoperation plugins "
- "failed\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE, "do_modrdn: modrdn postoperation plugins "
"failed.\n", 0, 0, 0);
-#endif
}
#endif /* defined( LDAP_SLAPI ) */
rs->sr_err = slap_bv2ad( &new_rdn[a_cnt]->la_attr, &desc, &rs->sr_text );
if ( rs->sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "slap_modrdn2modlist: %s: %s (new)\n",
- rs->sr_text,
- new_rdn[ a_cnt ]->la_attr.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_modrdn2modlist: %s: %s (new)\n",
rs->sr_text,
new_rdn[ a_cnt ]->la_attr.bv_val, 0 );
-#endif
goto done;
}
/* ACL check of newly added attrs */
if ( op->o_bd && !access_allowed( op, e, desc,
&new_rdn[a_cnt]->la_value, ACL_WRITE, NULL ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "slap_modrdn2modlist: access to attr \"%s\" "
- "(new) not allowed\n",
- new_rdn[a_cnt]->la_attr.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_modrdn2modlist: access to attr \"%s\" "
"(new) not allowed\n",
new_rdn[ a_cnt ]->la_attr.bv_val, 0, 0 );
-#endif
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
goto done;
}
rs->sr_err = slap_bv2ad( &old_rdn[d_cnt]->la_attr, &desc, &rs->sr_text );
if ( rs->sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "slap_modrdn2modlist: %s: %s (old)\n",
- rs->sr_text,
- old_rdn[d_cnt]->la_attr.bv_val,
- 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_modrdn2modlist: %s: %s (old)\n",
rs->sr_text,
old_rdn[d_cnt]->la_attr.bv_val,
0 );
-#endif
goto done;
}
if ( op->o_bd && !access_allowed( op, e, desc,
&old_rdn[d_cnt]->la_value, ACL_WRITE,
NULL ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "slap_modrdn2modlist: access "
- "to attr \"%s\" (old) not allowed\n",
- old_rdn[ d_cnt ]->la_attr.bv_val,
- 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_modrdn2modlist: access "
"to attr \"%s\" (old) not allowed\n",
old_rdn[ d_cnt ]->la_attr.bv_val,
0, 0 );
-#endif
rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
goto done;
}
__etoa( ebuf );
error = ebuf;
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT,
- "module_init: lt_dlinit failed: %s\n", error, 0, 0 );
-#else
Debug(LDAP_DEBUG_ANY, "lt_dlinit failed: %s\n", error, 0, 0);
-#endif
return -1;
}
__etoa( ebuf );
error = ebuf;
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT, "module_kill: lt_dlexit failed: %s\n",
- error, 0, 0 );
-#else
Debug(LDAP_DEBUG_ANY, "lt_dlexit failed: %s\n", error, 0, 0);
-#endif
return -1;
}
module = (module_loaded_t *)ch_calloc(1, sizeof(module_loaded_t));
if (module == NULL) {
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT,
- "module_load: (%s) out of memory.\n", file_name, 0, 0 );
-#else
Debug(LDAP_DEBUG_ANY, "module_load failed: (%s) out of memory\n", file_name,
0, 0);
-#endif
return -1;
}
__etoa( ebuf );
error = ebuf;
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT,
- "module_load: lt_dlopenext failed: (%s) %s.\n",
- file_name, error, 0 );
-#else
Debug(LDAP_DEBUG_ANY, "lt_dlopenext failed: (%s) %s\n", file_name,
error, 0);
-#endif
ch_free(module);
return -1;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, INFO, "module_load: loaded module %s\n", file_name, 0, 0 );
-#else
Debug(LDAP_DEBUG_CONFIG, "loaded module %s\n", file_name, 0, 0);
-#endif
#ifdef HAVE_EBCDIC
#ifdef HAVE_EBCDIC
#pragma convlit(resume)
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, ERR,
- "module_load: module %s : no init_module() function found\n",
- file_name, 0, 0 );
-#else
Debug(LDAP_DEBUG_CONFIG, "module %s: no init_module() function found\n",
file_name, 0, 0);
-#endif
lt_dlclose(module->lib);
ch_free(module);
*/
rc = initialize(argc, argv);
if (rc == -1) {
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, ERR,
- "module_load: module %s init_module() failed\n", file_name, 0, 0);
-#else
Debug(LDAP_DEBUG_CONFIG, "module %s: init_module() failed\n",
file_name, 0, 0);
-#endif
lt_dlclose(module->lib);
ch_free(module);
if (rc >= (int)(sizeof(module_regtable) / sizeof(struct module_regtable_t))
|| module_regtable[rc].proc == NULL)
{
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, ERR,
- "module_load: module %s: unknown registration type (%d).\n",
- file_name, rc, 0);
-#else
Debug(LDAP_DEBUG_CONFIG, "module %s: unknown registration type (%d)\n",
file_name, rc, 0);
-#endif
module_unload(module);
return -1;
rc = (module_regtable[rc].proc)(module, file_name);
if (rc != 0) {
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, ERR,
- "module_load: module %s:%s could not be registered.\n",
- file_name, module_regtable[rc].type, 0 );
-#else
Debug(LDAP_DEBUG_CONFIG, "module %s: %s module could not be registered\n",
file_name, module_regtable[rc].type, 0);
-#endif
module_unload(module);
return rc;
module->next = module_list;
module_list = module;
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, INFO,
- "module_load: module %s:%s registered\n", file_name,
- module_regtable[rc].type, 0 );
-#else
Debug(LDAP_DEBUG_CONFIG, "module %s: %s module registered\n",
file_name, module_regtable[rc].type, 0);
-#endif
return 0;
}
if( def->mrd_usage == SLAP_MR_NONE &&
def->mrd_compat_syntaxes == NULL )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "register_matching_rule: %s not usable\n", def->mrd_desc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "register_matching_rule: not usable %s\n",
def->mrd_desc, 0, 0 );
-#endif
return -1;
}
amr = mr_find( def->mrd_associated );
if( amr == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "register_matching_rule: could not locate associated "
- "matching rule %s for %s\n",
- def->mrd_associated, def->mrd_desc, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "register_matching_rule: could not locate "
"associated matching rule %s for %s\n",
def->mrd_associated, def->mrd_desc, 0 );
-#endif
return -1;
}
if (( def->mrd_usage & SLAP_MR_EQUALITY ) &&
(( def->mrd_usage & SLAP_MR_SUBTYPE_MASK ) != SLAP_MR_NONE ))
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "register_matching_rule: inappropriate (approx) association "
- "%s for %s\n",
- def->mrd_associated, def->mrd_desc, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"register_matching_rule: inappropriate (approx) association "
"%s for %s\n",
def->mrd_associated, def->mrd_desc, 0 );
-#endif
return -1;
}
} else if (!( amr->smr_usage & SLAP_MR_EQUALITY )) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "register_matching_rule: inappropriate (equalilty) association "
- "%s for %s\n",
- def->mrd_associated, def->mrd_desc, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"register_matching_rule: inappropriate (equalilty) association "
"%s for %s\n",
def->mrd_associated, def->mrd_desc, 0 );
-#endif
return -1;
}
}
mr = ldap_str2matchingrule( def->mrd_desc, &code, &err,
LDAP_SCHEMA_ALLOW_ALL );
if ( !mr ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "register_matching_rule: %s before %s in %s.\n",
- ldap_scherr2str(code), err, def->mrd_desc );
-#else
Debug( LDAP_DEBUG_ANY,
"Error in register_matching_rule: %s before %s in %s\n",
ldap_scherr2str(code), err, def->mrd_desc );
-#endif
return -1;
}
ldap_memfree( mr );
if ( code ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "register_matching_rule: %s for %s in %s.\n",
- scherr2str(code), err, def->mrd_desc );
-#else
Debug( LDAP_DEBUG_ANY,
"Error in register_matching_rule: %s for %s in %s\n",
scherr2str(code), err, def->mrd_desc );
-#endif
return -1;
}
MatchingRule *mr;
MatchingRuleUse **mru_ptr = &LDAP_SLIST_FIRST(&mru_list);
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "matching_rule_use_init\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "matching_rule_use_init\n", 0, 0, 0 );
-#endif
LDAP_SLIST_FOREACH( mr, &mr_list, smr_next ) {
AttributeType *at;
mru->smru_names = mr->smr_names;
mru->smru_desc = mr->smr_desc;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, " %s (%s): ",
- mru->smru_oid,
- mru->smru_names ? mru->smru_names[ 0 ] : "", 0 );
-#else
Debug( LDAP_DEBUG_TRACE, " %s (%s): ",
mru->smru_oid,
mru->smru_names ? mru->smru_names[ 0 ] : "", 0 );
-#endif
at = NULL;
for ( at_start( &at ); at; at_next( &at ) ) {
*/
if ( applies_oids != NULL ) {
mru->smru_applies_oids = applies_oids;
-#ifdef NEW_LOGGING
- {
- char *str = ldap_matchingruleuse2str( &mru->smru_mruleuse );
- LDAP_LOG( OPERATION, INFO, "matchingRuleUse: %s\n", str, 0, 0 );
- ldap_memfree( str );
- }
-#else
{
char *str = ldap_matchingruleuse2str( &mru->smru_mruleuse );
Debug( LDAP_DEBUG_TRACE, "matchingRuleUse: %s\n", str, 0, 0 );
ldap_memfree( str );
}
-#endif
mru = (MatchingRuleUse *)ber_memalloc( sizeof( MatchingRuleUse ) );
/* call-forward from MatchingRule to MatchingRuleUse */
rtag = ber_scanf( ber, "{t" /*"}"*/, &tag );
if( rtag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "get_mra: ber_scanf (\"{t\") failure\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf\n", 0, 0, 0 );
-#endif
*text = "Error parsing matching rule assertion";
return SLAPD_DISCONNECT;
if ( tag == LDAP_FILTER_EXT_OID ) {
rtag = ber_scanf( ber, "m", &rule_text );
if ( rtag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "get_mra: ber_scanf(\"o\") failure.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf for mr\n", 0, 0, 0 );
-#endif
*text = "Error parsing matching rule in matching rule assertion";
return SLAPD_DISCONNECT;
rtag = ber_scanf( ber, "t", &tag );
if( rtag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "get_mra: ber_scanf (\"t\") failure\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf\n", 0, 0, 0 );
-#endif
*text = "Error parsing matching rule assertion";
return SLAPD_DISCONNECT;
if ( tag == LDAP_FILTER_EXT_TYPE ) {
rtag = ber_scanf( ber, "m", &type );
if ( rtag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "get_mra: ber_scanf (\"o\") failure.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf for ad\n", 0, 0, 0 );
-#endif
*text = "Error parsing attribute description in matching rule assertion";
return SLAPD_DISCONNECT;
rtag = ber_scanf( ber, "t", &tag );
if( rtag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "get_mra: ber_scanf (\"t\") failure.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf\n", 0, 0, 0 );
-#endif
*text = "Error parsing matching rule assertion";
return SLAPD_DISCONNECT;
}
if ( tag != LDAP_FILTER_EXT_VALUE ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "get_mra: ber_scanf missing value\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf missing value\n", 0, 0, 0 );
-#endif
*text = "Missing value in matching rule assertion";
return SLAPD_DISCONNECT;
rtag = ber_scanf( ber, "m", &value );
if( rtag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "get_mra: ber_scanf (\"o\") failure.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf\n", 0, 0, 0 );
-#endif
*text = "Error decoding value in matching rule assertion";
return SLAPD_DISCONNECT;
}
if( rtag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "get_mra: ber_scanf failure\n", 0, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY, " get_mra ber_scanf\n", 0, 0, 0 );
-#endif
*text = "Error decoding dnattrs matching rule assertion";
return SLAPD_DISCONNECT;
if( sub == NULL || sup == NULL ) return 0;
#if 0
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ARGS,
- "is_object_subclass(%s,%s) %d\n",
- sup->soc_oid, sub->soc_oid, sup == sub );
-#else
Debug( LDAP_DEBUG_TRACE, "is_object_subclass(%s,%s) %d\n",
sup->soc_oid, sub->soc_oid, sup == sub );
-#endif
#endif
if( sup == sub ) {
attr = attr_find(e->e_attrs, objectClass);
if( attr == NULL ) {
/* no objectClass attribute */
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "is_entry_objectclass: dn(%s), oid (%s), no objectClass "
- "attribute.\n", e->e_dn == NULL ? "" : e->e_dn,
- oc->soc_oclass.oc_oid, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "is_entry_objectclass(\"%s\", \"%s\") "
"no objectClass attribute\n",
e->e_dn == NULL ? "" : e->e_dn,
oc->soc_oclass.oc_oid, 0 );
-#endif
return 0;
}
char *tmp = SLAP_MALLOC( om->som_oid.bv_len
+ suflen + 1);
if( tmp == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "oidm_find: SLAP_MALLOC failed", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"oidm_find: SLAP_MALLOC failed", 0, 0, 0 );
-#endif
return NULL;
}
strcpy(tmp, om->som_oid.bv_val);
om = (OidMacro *) SLAP_MALLOC( sizeof(OidMacro) );
if( om == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "parse_oidm: SLAP_MALLOC failed", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "parse_oidm: SLAP_MALLOC failed", 0, 0, 0 );
-#endif
return 1;
}
at = ldap_str2attributetype( mat[i].schema, &code,
&err, LDAP_SCHEMA_ALLOW_ALL );
if ( !at ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "lastmod_init: "
- "in AttributeType '%s' %s before %s\n",
- mat[i].name, ldap_scherr2str(code), err );
-#else
Debug( LDAP_DEBUG_ANY, "lastmod_init: "
"in AttributeType '%s' %s before %s\n",
mat[i].name, ldap_scherr2str(code), err );
-#endif
return -1;
}
if ( at->at_oid == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "lastmod_init: "
- "null OID for attributeType '%s'\n",
- mat[i].name, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "lastmod_init: "
"null OID for attributeType '%s'\n",
mat[i].name, 0, 0 );
-#endif
return -1;
}
code = at_add(at, &err);
if ( code ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "lastmod_init: "
- "%s in attributeType '%s'\n",
- scherr2str(code), mat[i].name, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "lastmod_init: "
"%s in attributeType '%s'\n",
scherr2str(code), mat[i].name, 0 );
-#endif
return -1;
}
ldap_memfree(at);
ad = ((AttributeDescription **)&(((char *)&lastmod_schema)[mat[i].offset]));
ad[0] = NULL;
if ( slap_str2ad( mat[i].name, ad, &text ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "lastmod_init: %s\n", text, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"lastmod_init: %s\n", text, 0, 0 );
-#endif
return -1;
}
oc = ldap_str2objectclass(moc[i].schema, &code, &err,
LDAP_SCHEMA_ALLOW_ALL );
if ( !oc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "unable to parse lastmod objectClass '%s': "
- "%s before %s\n" , moc[i].name,
- ldap_scherr2str(code), err );
-#else
Debug( LDAP_DEBUG_ANY,
"unable to parse lastmod objectClass '%s': "
"%s before %s\n" , moc[i].name,
ldap_scherr2str(code), err );
-#endif
return -1;
}
if ( oc->oc_oid == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "objectClass '%s' has no OID\n" ,
- moc[i].name, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"objectClass '%s' has no OID\n" ,
moc[i].name, 0, 0 );
-#endif
return -1;
}
code = oc_add(oc, 0, &err);
if ( code ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "objectClass '%s': %s \"%s\"\n" ,
- moc[i].name, scherr2str(code), err );
-#else
Debug( LDAP_DEBUG_ANY,
"objectClass '%s': %s \"%s\"\n" ,
moc[i].name, scherr2str(code), err );
-#endif
return -1;
}
Oc = oc_find( moc[i].name );
if ( Oc == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT, "lastmod_init: "
- "unable to find objectClass %s "
- "(just added)\n", moc[i].name, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "lastmod_init: "
"unable to find objectClass %s "
"(just added)\n", moc[i].name, 0, 0 );
-#endif
return -1;
}
for ( i=0; funcs[i].name; i++ ) {
rc = funcs[i].func();
if ( rc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, ERR,
- "%s overlay setup failed, err %d\n", funcs[i].name, rc, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s overlay setup failed, err %d\n", funcs[i].name, rc, 0 );
-#endif
break;
}
}
qc->lru_down = top;
qc->lru_up = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Base of added query = %s\n",
- q->base.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Base of added query = %s\n",
q->base.bv_val, 0, 0 );
-#endif
}
/* remove_query from LRU list */
MatchingRule* mrule = NULL;
if (inputf != NULL) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Lock QC index = %d\n",
- template_index, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Lock QC index = %d\n",
template_index, 0, 0 );
-#endif
ldap_pvt_thread_rdwr_rlock(&(templa[template_index].t_rwlock));
for(qc=templa[template_index].query; qc != NULL; qc= qc->next) {
q = (Query*)qc;
&(fs->f_ava->aa_value), &text);
if (rc != LDAP_SUCCESS) {
ldap_pvt_thread_rdwr_runlock(&(templa[template_index].t_rwlock));
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "Unlock: Exiting QC index=%d\n",
- template_index, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Unlock: Exiting QC index=%d\n",
template_index, 0, 0 );
-#endif
return 0;
}
}
}
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "Not answerable: Unlock QC index=%d\n",
- template_index, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Not answerable: Unlock QC index=%d\n",
template_index, 0, 0 );
-#endif
ldap_pvt_thread_rdwr_runlock(&(templa[template_index].t_rwlock));
}
return 0;
new_cached_query->lru_up = NULL;
new_cached_query->lru_down = NULL;
new_cached_query->expiry_time = slap_get_time() + templ->ttl;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Added query expires at %ld\n",
- (long) new_cached_query->expiry_time, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Added query expires at %ld\n",
(long) new_cached_query->expiry_time, 0, 0 );
-#endif
new_query = (Query*)new_cached_query;
ber_dupbv(&new_query->base, &query->base);
new_query->attrs = query->attrs;
/* Adding a query */
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Lock AQ index = %d\n",
- template_index, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Lock AQ index = %d\n",
template_index, 0, 0 );
-#endif
ldap_pvt_thread_rdwr_wlock(&templ->t_rwlock);
if (templ->query == NULL)
templ->query_last = new_cached_query;
new_cached_query->prev = NULL;
templ->query = new_cached_query;
templ->no_of_queries++;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "TEMPLATE %d QUERIES++ %d\n",
- template_index, templ->no_of_queries, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "TEMPLATE %d QUERIES++ %d\n",
template_index, templ->no_of_queries, 0 );
-#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Unlock AQ index = %d \n",
- template_index, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Unlock AQ index = %d \n",
template_index, 0, 0 );
-#endif
ldap_pvt_thread_rdwr_wunlock(&templ->t_rwlock);
/* Adding on top of LRU list */
result->bv_len = 0;
if (!bottom) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( BACK_META, DETAIL1,
- "Cache replacement invoked without "
- "any query in LRU list\n", 0, 0, 0 );
-#else
Debug ( LDAP_DEBUG_ANY,
"Cache replacement invoked without "
"any query in LRU list\n", 0, 0, 0 );
-#endif
return;
}
*result = bottom->q_uuid;
bottom->q_uuid.bv_val = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Lock CR index = %d\n", temp_id, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Lock CR index = %d\n", temp_id, 0, 0 );
-#endif
ldap_pvt_thread_rdwr_wlock(&(qm->templates[temp_id].t_rwlock));
remove_from_template(bottom, (qm->templates+temp_id));
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "TEMPLATE %d QUERIES-- %d\n",
- temp_id, qm->templates[temp_id].no_of_queries, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "TEMPLATE %d QUERIES-- %d\n",
temp_id, qm->templates[temp_id].no_of_queries, 0 );
-#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Unlock CR index = %d\n", temp_id, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Unlock CR index = %d\n", temp_id, 0, 0 );
-#endif
ldap_pvt_thread_rdwr_wunlock(&(qm->templates[temp_id].t_rwlock));
free_query(bottom);
}
op->o_req_ndn = qi->xdn;
if ( qi->del) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "DELETING ENTRY TEMPLATE=%s\n",
- query_uuid->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "DELETING ENTRY TEMPLATE=%s\n",
query_uuid->bv_val, 0, 0 );
-#endif
op->o_tag = LDAP_REQ_DELETE;
mod.sml_values = vals;
mod.sml_nvalues = NULL;
mod.sml_next = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "REMOVING TEMP ATTR : TEMPLATE=%s\n",
- query_uuid->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"REMOVING TEMP ATTR : TEMPLATE=%s\n",
query_uuid->bv_val, 0, 0 );
-#endif
op->orm_modlist = &mod;
op_tmp.o_dn = cm->db.be_rootdn;
op_tmp.o_ndn = cm->db.be_rootndn;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "UUID for query being added = %s\n",
- uuidbuf, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "UUID for query being added = %s\n",
uuidbuf, 0, 0 );
-#endif /* !NEW_LOGGING */
for ( e=si->head; e; e=si->head ) {
si->head = e->e_private;
e->e_private = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL2, "LOCKING REMOVE MUTEX\n",
- 0, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_NONE, "LOCKING REMOVE MUTEX\n", 0, 0, 0 );
-#endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_lock(&cm->remove_mutex);
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL2, "LOCKED REMOVE MUTEX\n", 0, 0, 0);
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_NONE, "LOCKED REMOVE MUTEX\n", 0, 0, 0);
-#endif /* !NEW_LOGGING */
while ( cm->cur_entries > (cm->max_entries) ) {
qm->crfunc(qm, &crp_uuid);
if (crp_uuid.bv_val) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "Removing query UUID %s\n",
- crp_uuid.bv_val, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"Removing query UUID %s\n",
crp_uuid.bv_val, 0, 0 );
-#endif /* !NEW_LOGGING */
return_val = remove_query_data(&op_tmp, rs, &crp_uuid);
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "QUERY REMOVED, SIZE=%d\n",
- return_val, 0, 0);
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"QUERY REMOVED, SIZE=%d\n",
return_val, 0, 0);
-#endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_lock(
&cm->cache_mutex );
cm->cur_entries -= return_val;
cm->num_cached_queries--;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "STORED QUERIES = %lu\n",
- cm->num_cached_queries, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 );
-#endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_unlock(
&cm->cache_mutex );
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "QUERY REMOVED, CACHE ="
- "%d entries\n",
- cm->cur_entries, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"QUERY REMOVED, CACHE ="
"%d entries\n",
cm->cur_entries, 0, 0 );
-#endif /* !NEW_LOGGING */
}
}
ldap_pvt_thread_mutex_unlock(&cm->remove_mutex);
ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
cm->cur_entries += return_val;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "ENTRY ADDED/MERGED, CACHED ENTRIES=%d\n",
- cm->cur_entries, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"ENTRY ADDED/MERGED, CACHED ENTRIES=%d\n",
cm->cur_entries, 0, 0 );
-#endif /* !NEW_LOGGING */
return_val = 0;
ldap_pvt_thread_mutex_unlock(&cm->cache_mutex);
}
ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
cm->num_cached_queries++;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "STORED QUERIES = %lu\n",
- cm->num_cached_queries, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 );
-#endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_unlock(&cm->cache_mutex);
return return_val;
return SLAP_CB_CONTINUE;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "query template of incoming query = %s\n",
- tempstr.bv_val, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "query template of incoming query = %s\n",
tempstr.bv_val, 0, 0 );
-#endif /* !NEW_LOGGING */
/* find attr set */
attr_set = get_attr_set(op->ors_attrs, qm, cm->numattrsets);
cacheable = 1;
template_id = i;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL2,
- "Entering QC, querystr = %s\n",
- op->ors_filterstr.bv_val, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_NONE, "Entering QC, querystr = %s\n",
op->ors_filterstr.bv_val, 0, 0 );
-#endif /* !NEW_LOGGING */
answerable = (*(qm->qcfunc))(qm, &query, i);
if (answerable)
BackendDB *save_bd = op->o_bd;
slap_callback *save_cb = op->o_callback;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "QUERY ANSWERABLE\n", 0, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "QUERY ANSWERABLE\n", 0, 0, 0 );
-#endif /* !NEW_LOGGING */
free(filter_attrs);
ldap_pvt_thread_rdwr_runlock(&qm->templates[i].t_rwlock);
op->o_bd = &cm->db;
return i;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "QUERY NOT ANSWERABLE\n",
- 0, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "QUERY NOT ANSWERABLE\n", 0, 0, 0 );
-#endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
if (cm->num_cached_queries >= cm->max_queries) {
slap_callback *cb;
struct search_info *si;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "QUERY CACHEABLE\n", 0, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "QUERY CACHEABLE\n", 0, 0, 0 );
-#endif /* !NEW_LOGGING */
query.filter = str2filter(op->ors_filterstr.bv_val);
if (op->ors_attrs) {
for ( count = 0; !BER_BVISNULL( &op->ors_attrs[ count ].an_name ); count++ ) {
}
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "QUERY NOT CACHEABLE\n",
- 0, 0, 0);
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "QUERY NOT CACHEABLE\n",
0, 0, 0);
-#endif /* !NEW_LOGGING */
}
free(filter_attrs);
ldap_pvt_thread_mutex_lock(&qm->lru_mutex);
remove_query(qm, query);
ldap_pvt_thread_mutex_unlock(&qm->lru_mutex);
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Lock CR index = %d\n",
- i, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "Lock CR index = %d\n",
i, 0, 0 );
-#endif /* !NEW_LOGGING */
ldap_pvt_thread_rdwr_wlock(&templ->t_rwlock);
remove_from_template(query, templ);
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "TEMPLATE %d QUERIES-- %d\n",
- i, templ->no_of_queries, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "TEMPLATE %d QUERIES-- %d\n",
i, templ->no_of_queries, 0 );
-#endif /* !NEW_LOGGING */
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Unlock CR index = %d\n",
- i, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "Unlock CR index = %d\n",
i, 0, 0 );
-#endif /* !NEW_LOGGING */
ldap_pvt_thread_rdwr_wunlock(&templ->t_rwlock);
return_val = remove_query_data(&op, &rs, &query->q_uuid);
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "STALE QUERY REMOVED, SIZE=%d\n",
- return_val, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "STALE QUERY REMOVED, SIZE=%d\n",
return_val, 0, 0 );
-#endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
cm->cur_entries -= return_val;
cm->num_cached_queries--;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "STORED QUERIES = %lu\n",
- cm->num_cached_queries, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 );
-#endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_unlock(&cm->cache_mutex);
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "STALE QUERY REMOVED, CACHE ="
- "%d entries\n",
- cm->cur_entries, 0, 0 );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY,
"STALE QUERY REMOVED, CACHE ="
"%d entries\n",
cm->cur_entries, 0, 0 );
-#endif /* !NEW_LOGGING */
query_prev = query;
query = query->prev;
free_query(query_prev);
cm->num_entries_limit = atoi( argv[4] );
cm->cc_period = atoi( argv[5] );
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "Total # of attribute sets to be cached = %d\n",
- cm->numattrsets, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Total # of attribute sets to be cached = %d\n",
cm->numattrsets, 0, 0 );
-#endif
qm->attr_sets = ( struct attr_set * )ch_malloc( cm->numattrsets *
sizeof( struct attr_set ));
for ( i = 0; i < cm->numattrsets; i++ ) {
"<index> <attributes>\"\n", fname, lineno );
return( 1 );
}
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Attribute Set # %d\n",
- atoi( argv[1] ), 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Attribute Set # %d\n",
atoi( argv[1] ), 0, 0 );
-#endif
if (atoi(argv[1]) >= cm->numattrsets) {
fprintf( stderr, "%s; line %d index out of bounds \n",
fname, lineno );
(argc-1) * sizeof( AttributeName ));
attr_name = qm->attr_sets[index].attrs;
for ( i = 2; i < argc; i++ ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "\t %s\n",
- argv[i], 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "\t %s\n",
argv[i], 0, 0 );
-#endif
ber_str2bv( argv[i], 0, 1,
&attr_name->an_name);
attr_name->an_desc = NULL;
return( 1 );
}
if (( i = atoi( argv[2] )) >= cm->numattrsets ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "%s: line %d, template index invalid\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d, template index invalid\n",
fname, lineno, 0 );
-#endif
return 1;
}
num = cm->numtemplates;
temp->ttl = atoi( argv[3] );
temp->no_of_queries = 0;
if ( argv[1] == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "Templates string not specified "
- "for template %d\n", num, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Templates string not specified "
"for template %d\n", num, 0, 0 );
-#endif
return 1;
}
ber_str2bv( argv[1], 0, 1, &temp->querystr );
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "Template:\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Template:\n", 0, 0, 0 );
-#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, " query template: %s\n",
- temp->querystr.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " query template: %s\n",
temp->querystr.bv_val, 0, 0 );
-#endif
temp->attr_set_index = i;
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, " attributes: \n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, " attributes: \n", 0, 0, 0 );
-#endif
if ( ( attrarray = qm->attr_sets[i].attrs ) != NULL ) {
for ( i=0; attrarray[i].an_name.bv_val; i++ )
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1, "\t%s\n",
- attrarray[i].an_name.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "\t%s\n",
attrarray[i].an_name.bv_val, 0, 0 );
-#endif
}
temp++;
temp->querystr.bv_val = NULL;
* final entry is cached. */
if ( argc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "missing specifier for \"response-callback {head(default)|tail}\" "
- "callback position\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"missing specifier for \"response-callback {head(default)|tail}\" "
"callback position\n", 0, 0, 0 );
-#endif
return 1;
}
cm->response_cb = PCACHE_RESPONSE_CB_TAIL;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_META, DETAIL1,
- "unknown specifier %s for \"response-callback {head(default)|tail}\" "
- "callback position\n", argv[1], 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"unknown specifier %s for \"response-callback {head(default)|tail}\" "
"callback position\n", argv[1], 0, 0 );
-#endif
return 1;
}
}
} else {
vals = a->a_nvals;
if (vals[0].bv_val == NULL) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "ppolicy_get: NULL value for policySubEntry\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"ppolicy_get: NULL value for policySubEntry\n", 0, 0, 0 );
-#endif
goto defaultpol;
}
}
return;
defaultpol:
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, DETAIL1,
- "ppolicy_get: using default policy\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"ppolicy_get: using default policy\n", 0, 0, 0 );
-#endif
op->o_private = opr;
return;
}
if ((mod = lt_dlopen( pp->pwdCheckModule )) == NULL) {
err = lt_dlerror();
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT,
- "check_password_quality: lt_dlopen failed: (%s) %s.\n",
- pp->pwdCheckModule, err, 0 );
-#else
Debug(LDAP_DEBUG_ANY,
"check_password_quality: lt_dlopen failed: (%s) %s.\n",
pp->pwdCheckModule, err, 0 );
-#endif
ok = LDAP_OTHER; /* internal error */
} else {
int (*prog)( char *passwd, char **text, void *arg );
if ((prog = lt_dlsym( mod, "check_password" )) == NULL) {
err = lt_dlerror();
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT,
- "check_password_quality: lt_dlsym failed: (%s) %s.\n",
- pp->pwdCheckModule, err, 0 );
-#else
Debug(LDAP_DEBUG_ANY,
"check_password_quality: lt_dlsym failed: (%s) %s.\n",
pp->pwdCheckModule, err, 0 );
-#endif
ok = LDAP_OTHER;
} else {
char *txt = NULL;
ok = prog( cred->bv_val, &txt, NULL );
ldap_pvt_thread_mutex_unlock( &chk_syntax_mutex );
if (txt) {
-#ifdef NEW_LOGGING
- LDAP_LOG( SLAPD, CRIT,
- "check_password_quality: module error (%s) %s[%d].\n",
- pp->pwdCheckModule, txt, ok );
-#else
Debug(LDAP_DEBUG_ANY,
"check_password_quality: module error: (%s) %s.[%d]\n",
pp->pwdCheckModule, txt, ok );
-#endif
free(txt);
} else
ok = LDAP_SUCCESS;
* missing if the DIT was established via
* an import process.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "ppolicy_bind: Entry %s does not have valid pwdChangedTime attribute - assuming password expired\n",
- e->e_name.bv_val, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"ppolicy_bind: Entry %s does not have valid pwdChangedTime attribute - assuming password expired\n",
e->e_name.bv_val, 0, 0);
-#endif
pwExpired = 1;
} else {
/*
/*
* ngut is the number of remaining grace logins
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "ppolicy_bind: Entry %s has an expired password: %d grace logins\n",
- e->e_name.bv_val, ngut, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"ppolicy_bind: Entry %s has an expired password: %d grace logins\n",
e->e_name.bv_val, ngut, 0);
-#endif
if (ngut < 1) {
ppb->pErr = PP_passwordExpired;
warn = ppb->pp.pwdMaxAge - age; /* seconds left until expiry */
if (warn < 0) warn = 0; /* something weird here - why is pwExpired not set? */
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATIONS, DETAIL1,
- "ppolicy_bind: Setting warning for password expiry for %s = %d seconds\n",
- op->o_req_dn.bv_val, warn, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"ppolicy_bind: Setting warning for password expiry for %s = %d seconds\n",
op->o_req_dn.bv_val, warn, 0 );
-#endif
}
}
}
if ( op->o_conn && pwcons[op->o_conn->c_conn_idx].restrict ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "connection restricted to password changing only\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection restricted to password changing only\n", 0, 0, 0);
-#endif
if ( send_ctrl ) {
LDAPControl **ctrls = NULL;
}
if (pwcons[op->o_conn->c_conn_idx].restrict && !mod_pw_only) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "connection restricted to password changing only\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"connection restricted to password changing only\n", 0, 0, 0 );
-#endif
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
rs->sr_text = "Operations are restricted to bind/unbind/abandon/StartTLS/modify password";
pErr = PP_changeAfterReset;
if (!addmod) {
rs->sr_err = LDAP_OTHER;
rs->sr_text = "Internal Error";
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "cannot locate modification supplying new password\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"cannot locate modification supplying new password\n", 0, 0, 0 );
-#endif
goto return_results;
}
}
if (pp.pwdSafeModify && deladd != 2) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "change password must use DELETE followed by ADD/REPLACE\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"change password must use DELETE followed by ADD/REPLACE\n",
0, 0, 0 );
-#endif
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
rs->sr_text = "Must supply old password to be changed as well as new one";
pErr = PP_mustSupplyOldPassword;
bv = oldpw.bv_val ? &oldpw : delmod->sml_values;
rc = slap_passwd_check( op->o_conn, pa, bv, &txt );
if (rc != LDAP_SUCCESS) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "old password check failed: %s\n", txt, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"old password check failed: %s\n", txt, 0, 0 );
-#endif
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
rs->sr_text = "Must supply correct old password to change to new one";
modtail->sml_next = mods;
modtail = mods;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "ppolicy_modify: password attr lookup failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"ppolicy_modify: password attr lookup failed\n", 0, 0, 0 );
-#endif
}
}
rc = LDAP_SUCCESS;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_LDAP, DETAIL1,
- "[rw] %s: \"%s\" -> \"%s\"\n",
- dc->ctx, in->bv_val, dn ? dn->bv_val : ndn->bv_val );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS,
"[rw] %s: \"%s\" -> \"%s\"\n",
dc->ctx, in->bv_val, dn ? dn->bv_val : ndn->bv_val );
-#endif /* !NEW_LOGGING */
break;
case REWRITE_REGEXEC_UNWILLING:
out->bv_val = ch_malloc( out->bv_len + 1 );
strncpy( out->bv_val, in->bv_val, diff );
strcpy( &out->bv_val[diff], dc->rwmap->rwm_suffix_massage[i+dst].bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG ( BACK_LDAP, ARGS,
- "rwm_dn_massage: converted \"%s\" to \"%s\"\n",
- in->bv_val, out->bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ARGS,
"rwm_dn_massage:"
" converted \"%s\" to \"%s\"\n",
in->bv_val, out->bv_val, 0 );
-#endif
if ( dn && ndn ) {
rc = dnNormalize( 0, NULL, NULL, dn, ndn, NULL );
}
*fstr = ftmp;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_LDAP, DETAIL1,
- "[rw] %s: \"%s\" -> \"%s\"\n",
- dc->ctx, ftmp.bv_val, fstr->bv_val );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS,
"[rw] %s: \"%s\" -> \"%s\"\n",
dc->ctx, ftmp.bv_val, fstr->bv_val );
-#endif /* !NEW_LOGGING */
rc = LDAP_SUCCESS;
break;
tag = ber_scanf( ber, "{" /*}*/ );
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: decoding error\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_passwd_parse: decoding error\n", 0, 0, 0 );
-#endif
rc = LDAP_PROTOCOL_ERROR;
goto done;
}
tag = ber_peek_tag( ber, &len );
if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_ID ) {
if( id == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: ID not allowed.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID not allowed.\n",
0, 0, 0 );
-#endif
*text = "user must change own password";
rc = LDAP_UNWILLING_TO_PERFORM;
tag = ber_scanf( ber, "m", id );
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: ID parse failed.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID parse failed.\n",
0, 0, 0 );
-#endif
goto decoding_error;
}
if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_OLD ) {
if( oldpass == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: OLD not allowed.\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: OLD not allowed.\n",
0, 0, 0 );
-#endif
*text = "use bind to verify old password";
rc = LDAP_UNWILLING_TO_PERFORM;
tag = ber_scanf( ber, "m", oldpass );
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: ID parse failed.\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: ID parse failed.\n",
0, 0, 0 );
-#endif
goto decoding_error;
}
if( tag == LDAP_TAG_EXOP_MODIFY_PASSWD_NEW ) {
if( newpass == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: NEW not allowed.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: NEW not allowed.\n",
0, 0, 0 );
-#endif
*text = "user specified passwords disallowed";
rc = LDAP_UNWILLING_TO_PERFORM;
tag = ber_scanf( ber, "m", newpass );
if( tag == LBER_ERROR ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: OLD parse failed.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_parse: OLD parse failed.\n",
0, 0, 0 );
-#endif
goto decoding_error;
}
if( len != 0 ) {
decoding_error:
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "slap_passwd_parse: decoding error, len=%ld\n", (long)len, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_passwd_parse: decoding error, len=%ld\n",
(long) len, 0, 0 );
-#endif
*text = "data decoding error";
rc = LDAP_PROTOCOL_ERROR;
assert( cred != NULL );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "slap_passwd_return: %ld\n",(long)cred->bv_len, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_return: %ld\n",
(long) cred->bv_len, 0, 0 );
-#endif
ber_init_w_nullc( ber, LBER_USE_DER );
void
slap_passwd_generate( struct berval *pass )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY, "slap_passwd_generate: begin\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_passwd_generate\n", 0, 0, 0 );
-#endif
pass->bv_val = NULL;
pass->bv_len = 0;
muck.bv_len = ntargetDN.bv_len + nrefDN.bv_len - nbaseDN.bv_len;
muck.bv_val = SLAP_MALLOC( muck.bv_len + 1 );
if( muck.bv_val == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "referral_dn_muck: SLAP_MALLOC failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"referral_dn_muck: SLAP_MALLOC failed\n", 0, 0, 0 );
-#endif
return NULL;
}
default:
/* other error, bail */
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "referral: invalid URL (%s): %s (%d)\n",
- url, "" /* ldap_url_error2str(rc) */, rc );
-#else
Debug( LDAP_DEBUG_ANY,
"referral: invalid URL (%s): %s (%d)\n",
url, "" /* ldap_url_error2str(rc) */, rc );
-#endif
return 1;
}
rc = 0;
if( lurl->lud_dn && *lurl->lud_dn ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "referral: URL (%s): contains DN\n", url, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"referral: URL (%s): contains DN\n",
url, 0, 0 );
-#endif
rc = 1;
} else if( lurl->lud_attrs ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "referral: URL (%s): requests attributes\n", url, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"referral: URL (%s): requests attributes\n",
url, 0, 0 );
-#endif
rc = 1;
} else if( lurl->lud_scope != LDAP_SCOPE_DEFAULT ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "referral: URL (%s): contains explicit scope\n", url, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"referral: URL (%s): contains explicit scope\n",
url, 0, 0 );
-#endif
rc = 1;
} else if( lurl->lud_filter ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "referral: URL (%s): contains explicit filter\n", url, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"referral: URL (%s): contains explicit filter\n",
url, 0, 0 );
-#endif
rc = 1;
}
refs = SLAP_MALLOC( (i+1) * sizeof( struct berval ) );
if( refs == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "referral_rewrite: SLAP_MALLOC failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"referral_rewrite: SLAP_MALLOC failed\n", 0, 0, 0 );
-#endif
return NULL;
}
refs = SLAP_MALLOC( (i + 1) * sizeof(struct berval));
if( refs == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, CRIT,
- "get_entry_referrals: SLAP_MALLOC failed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"get_entry_referrals: SLAP_MALLOC failed\n", 0, 0, 0 );
-#endif
return NULL;
}
v2 = SLAP_MALLOC( len+i+sizeof("Referral:") );
if( v2 == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "v2ref: SLAP_MALLOC failed", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "v2ref: SLAP_MALLOC failed", 0, 0, 0 );
-#endif
return NULL;
}
for( i=0; ref[i].bv_val != NULL; i++ ) {
v2 = SLAP_REALLOC( v2, len + ref[i].bv_len + 1 );
if( v2 == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "v2ref: SLAP_MALLOC failed", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "v2ref: SLAP_MALLOC failed", 0, 0, 0 );
-#endif
return NULL;
}
v2[len-1] = '\n';
* it's a hard error and return.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_ldap_ber: conn %lu ber_flush failed err=%d (%s)\n",
- conn ? conn->c_connid : 0, err, sock_errstr(err) );
-#else
Debug( LDAP_DEBUG_CONNS, "ber_flush failed errno=%d reason=\"%s\"\n",
err, sock_errstr(err), 0 );
-#endif
if ( err != EWOULDBLOCK && err != EAGAIN ) {
connection_closing( conn );
ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "send_ldap_response: msgid=%d tag=%lu err=%d\n",
- rs->sr_msgid, rs->sr_tag, rs->sr_err );
-#else
Debug( LDAP_DEBUG_TRACE,
"send_ldap_response: msgid=%d tag=%lu err=%d\n",
rs->sr_msgid, rs->sr_tag, rs->sr_err );
-#endif
if( rs->sr_ref ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "send_ldap_response: conn %lu ref=\"%s\"\n",
- op->o_connid,
- rs->sr_ref[0].bv_val ? rs->sr_ref[0].bv_val : "NULL" , 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "send_ldap_response: ref=\"%s\"\n",
rs->sr_ref[0].bv_val ? rs->sr_ref[0].bv_val : "NULL",
NULL, NULL );
-#endif
}
#ifdef LDAP_CONNECTIONLESS
#endif
if ( rc == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_ldap_response: conn %lu ber_printf failed\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
-#endif
#ifdef LDAP_CONNECTIONLESS
if (!op->o_conn || op->o_conn->c_is_udp == 0)
}
if ( bytes < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_ldap_response: conn %lu ber write failed\n",
- op->o_connid ? op->o_connid : 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_ldap_response: ber write failed\n",
0, 0, 0 );
-#endif
goto cleanup;
}
rs->sr_type = REP_EXTENDED;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "send_ldap_disconnect: conn %lu %d:%s\n",
- op->o_connid, rs->sr_err, rs->sr_text ? rs->sr_text : "" );
-#else
Debug( LDAP_DEBUG_TRACE,
"send_ldap_disconnect %d:%s\n",
rs->sr_err, rs->sr_text ? rs->sr_text : "", NULL );
-#endif
if ( op->o_protocol < LDAP_VERSION3 ) {
rs->sr_rspoid = NULL;
assert( !LDAP_API_ERROR( rs->sr_err ));
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "send_ldap_result: conn=%lu op=%lu p=%d\n",
- op->o_connid, op->o_opid, op->o_protocol );
-#else
Debug( LDAP_DEBUG_TRACE,
"send_ldap_result: conn=%lu op=%lu p=%d\n",
op->o_connid, op->o_opid, op->o_protocol );
-#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "send_ldap_result: err=%d matched=\"%s\" text=\"%s\"\n",
- rs->sr_err, rs->sr_matched ? rs->sr_matched : "",
- rs->sr_text ? rs->sr_text : "" );
-#else
Debug( LDAP_DEBUG_ARGS,
"send_ldap_result: err=%d matched=\"%s\" text=\"%s\"\n",
rs->sr_err, rs->sr_matched ? rs->sr_matched : "",
rs->sr_text ? rs->sr_text : "" );
-#endif
if( rs->sr_ref ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "send_ldap_result: referral=\"%s\"\n",
- rs->sr_ref[0].bv_val ? rs->sr_ref[0].bv_val : "NULL", 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS,
"send_ldap_result: referral=\"%s\"\n",
rs->sr_ref[0].bv_val ? rs->sr_ref[0].bv_val : "NULL",
NULL, NULL );
-#endif
}
assert( rs->sr_err != LDAP_PARTIAL_RESULTS );
send_ldap_sasl( Operation *op, SlapReply *rs )
{
rs->sr_type = REP_SASL;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "send_ldap_sasl: conn %lu err=%d len=%lu\n",
- op->o_connid, rs->sr_err,
- rs->sr_sasldata ? rs->sr_sasldata->bv_len : -1 );
-#else
Debug( LDAP_DEBUG_TRACE, "send_ldap_sasl: err=%d len=%ld\n",
rs->sr_err,
rs->sr_sasldata ? (long) rs->sr_sasldata->bv_len : -1, NULL );
-#endif
rs->sr_tag = req2res( op->o_tag );
rs->sr_msgid = (rs->sr_tag != LBER_SEQUENCE) ? op->o_msgid : 0;
{
rs->sr_type = REP_EXTENDED;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "send_ldap_extended: err=%d oid=%s len=%ld\n",
- rs->sr_err, rs->sr_rspoid ? rs->sr_rspoid : "",
- rs->sr_rspdata != NULL ? rs->sr_rspdata->bv_len : 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"send_ldap_extended: err=%d oid=%s len=%ld\n",
rs->sr_err,
rs->sr_rspoid ? rs->sr_rspoid : "",
rs->sr_rspdata != NULL ? rs->sr_rspdata->bv_len : 0 );
-#endif
rs->sr_tag = req2res( op->o_tag );
rs->sr_msgid = (rs->sr_tag != LBER_SEQUENCE) ? op->o_msgid : 0;
slap_send_ldap_intermediate( Operation *op, SlapReply *rs )
{
rs->sr_type = REP_INTERMEDIATE;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "send_ldap_intermediate: err=%d oid=%s len=%ld\n",
- rs->sr_err, rs->sr_rspoid ? rs->sr_rspoid : "",
- rs->sr_rspdata != NULL ? rs->sr_rspdata->bv_len : 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"send_ldap_intermediate: err=%d oid=%s len=%ld\n",
rs->sr_err,
rs->sr_rspoid ? rs->sr_rspoid : "",
rs->sr_rspdata != NULL ? rs->sr_rspdata->bv_len : 0 );
-#endif
rs->sr_tag = LDAP_RES_INTERMEDIATE;
rs->sr_msgid = op->o_msgid;
send_ldap_response( op, rs );
if ( rc != SLAP_CB_CONTINUE ) goto error_return;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY, "send_search_entry: conn %lu dn=\"%s\"%s\n",
- op->o_connid, rs->sr_entry->e_name.bv_val,
- op->ors_attrsonly ? " (attrsOnly)" : "" );
-#else
Debug( LDAP_DEBUG_TRACE, "=> send_search_entry: conn %lu dn=\"%s\"%s\n",
op->o_connid, rs->sr_entry->e_name.bv_val,
op->ors_attrsonly ? " (attrsOnly)" : "" );
-#endif
if ( !access_allowed( op, rs->sr_entry, ad_entry, NULL, ACL_READ, NULL )) {
-#ifdef NEW_LOGGING
- LDAP_LOG( ACL, INFO,
- "send_search_entry: conn %lu access to entry (%s) not allowed\n",
- op->o_connid, rs->sr_entry->e_name.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ACL,
"send_search_entry: conn %lu access to entry (%s) not allowed\n",
op->o_connid, rs->sr_entry->e_name.bv_val, 0 );
-#endif
rc = 1;
goto error_return;
}
if ( rc == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu ber_printf failed\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu ber_printf failed\n",
op->o_connid, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER, "encoding DN error" );
char *a_flags;
e_flags = slap_sl_calloc ( 1, i * sizeof(char *) + k, op->o_tmpmemctx );
if( e_flags == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu slap_sl_calloc failed\n",
- op->o_connid ? op->o_connid : 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu slap_sl_calloc failed\n",
op->o_connid ? op->o_connid : 0, 0, 0 );
-#endif
ber_free( ber, 1 );
send_ldap_error( op, rs, LDAP_OTHER, "out of memory" );
rc = filter_matched_values(op, rs->sr_entry->e_attrs, &e_flags) ;
if ( rc == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "send_search_entry: "
- "conn %lu matched values filtering failed\n",
- op->o_connid ? op->o_connid : 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "send_search_entry: "
"conn %lu matched values filtering failed\n",
op->o_connid ? op->o_connid : 0, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER,
"matched values filtering error" );
if ( ! access_allowed( op, rs->sr_entry, desc, NULL,
ACL_READ, &acl_state ) )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( ACL, INFO,
- "send_search_entry: conn %lu access to attribute %s not "
- "allowed\n", op->o_connid, desc->ad_cname.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ACL, "send_search_entry: "
"conn %lu access to attribute %s not allowed\n",
op->o_connid, desc->ad_cname.bv_val, 0 );
-#endif
continue;
}
if (( rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname )) == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu ber_printf failed\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu ber_printf failed\n",
op->o_connid, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER,
if ( ! access_allowed( op, rs->sr_entry,
desc, &a->a_nvals[i], ACL_READ, &acl_state ) )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( ACL, INFO,
- "send_search_entry: conn %lu "
- "access to attribute %s, value #%d not allowed\n",
- op->o_connid, desc->ad_cname.bv_val, i );
-#else
Debug( LDAP_DEBUG_ACL,
"send_search_entry: conn %lu "
"access to attribute %s, value #%d not allowed\n",
op->o_connid, desc->ad_cname.bv_val, i );
-#endif
continue;
}
first = 0;
finish = 1;
if (( rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname )) == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu ber_printf failed\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu ber_printf failed\n",
op->o_connid, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER,
}
}
if (( rc = ber_printf( ber, "O", &a->a_vals[i] )) == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu "
- "ber_printf failed.\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu "
"ber_printf failed.\n", op->o_connid, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER,
}
if ( finish && ( rc = ber_printf( ber, /*{[*/ "]N}" )) == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu ber_printf failed\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu ber_printf failed\n",
op->o_connid, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER, "encode end error" );
tmp = slap_sl_realloc( e_flags, i * sizeof(char *) + k,
op->o_tmpmemctx );
if ( tmp == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu "
- "not enough memory "
- "for matched values filtering\n",
- op->o_connid, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu "
"not enough memory "
"for matched values filtering\n",
op->o_connid, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER,
"not enough memory for matched values filtering" );
rc = filter_matched_values(op, rs->sr_operational_attrs, &e_flags) ;
if ( rc == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu "
- "matched values filtering failed\n",
- op->o_connid ? op->o_connid : 0, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu "
"matched values filtering failed\n",
op->o_connid ? op->o_connid : 0, 0, 0);
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER,
"matched values filtering error" );
if ( ! access_allowed( op, rs->sr_entry, desc, NULL,
ACL_READ, &acl_state ) )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( ACL, INFO,
- "send_search_entry: conn %lu "
- "access to attribute %s not allowed\n",
- op->o_connid, desc->ad_cname.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ACL,
"send_search_entry: conn %lu "
"access to attribute %s not allowed\n",
op->o_connid, desc->ad_cname.bv_val, 0 );
-#endif
continue;
}
rc = ber_printf( ber, "{O[" /*]}*/ , &desc->ad_cname );
if ( rc == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu "
- "ber_printf failed\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu "
"ber_printf failed\n", op->o_connid, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER,
if ( ! access_allowed( op, rs->sr_entry,
desc, &a->a_vals[i], ACL_READ, &acl_state ) )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( ACL, INFO,
- "send_search_entry: conn %lu "
- "access to %s, value %d not allowed\n",
- op->o_connid, desc->ad_cname.bv_val, i );
-#else
Debug( LDAP_DEBUG_ACL,
"send_search_entry: conn %lu "
"access to %s, value %d not allowed\n",
op->o_connid, desc->ad_cname.bv_val, i );
-#endif
continue;
}
}
if (( rc = ber_printf( ber, "O", &a->a_vals[i] )) == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu ber_printf failed\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu ber_printf failed\n",
op->o_connid, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER,
}
if (( rc = ber_printf( ber, /*{[*/ "]N}" )) == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu ber_printf failed\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu ber_printf failed\n",
op->o_connid, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER, "encode end error" );
}
if ( rc == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu ber_printf failed\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
-#endif
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
send_ldap_error( op, rs, LDAP_OTHER, "encode entry end error" );
ber_free_buf( ber );
if ( bytes < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_entry: conn %lu ber write failed.\n",
- op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: conn %lu ber write failed.\n",
op->o_connid, 0, 0 );
-#endif
rc = -1;
goto error_return;
Statslog( LDAP_DEBUG_STATS2, "conn=%lu op=%lu ENTRY dn=\"%s\"\n",
op->o_connid, op->o_opid, rs->sr_entry->e_dn, 0, 0 );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "send_search_entry: conn %lu exit.\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"<= send_search_entry: conn %lu exit.\n", op->o_connid, 0, 0 );
-#endif
rc = 0;
if ( rc != SLAP_CB_CONTINUE ) goto rel;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "send_search_reference: conn %lu dn=\"%s\"\n",
- op->o_connid,
- rs->sr_entry ? rs->sr_entry->e_name.bv_val : "(null)", 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"=> send_search_reference: dn=\"%s\"\n",
rs->sr_entry ? rs->sr_entry->e_name.bv_val : "(null)", 0, 0 );
-#endif
if ( rs->sr_entry && ! access_allowed( op, rs->sr_entry,
ad_entry, NULL, ACL_READ, NULL ) )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( ACL, INFO,
- "send_search_reference: conn %lu "
- "access to entry %s not allowed\n",
- op->o_connid, rs->sr_entry->e_dn, 0 );
-#else
Debug( LDAP_DEBUG_ACL,
"send_search_reference: access to entry not allowed\n",
0, 0, 0 );
-#endif
rc = 1;
goto rel;
}
if ( rs->sr_entry && ! access_allowed( op, rs->sr_entry,
ad_ref, NULL, ACL_READ, NULL ) )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( ACL, INFO,
- "send_search_reference: conn %lu access "
- "to reference not allowed.\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ACL,
"send_search_reference: access "
"to reference not allowed\n",
0, 0, 0 );
-#endif
rc = 1;
goto rel;
}
#ifdef LDAP_CONTROL_X_DOMAIN_SCOPE
if( op->o_domain_scope ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_reference: conn %lu domainScope control in (%s).\n",
- op->o_connid, rs->sr_entry->e_dn, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_reference: domainScope control in (%s)\n",
rs->sr_entry->e_dn, 0, 0 );
-#endif
rc = 0;
goto rel;
}
#endif
if( rs->sr_ref == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_reference: conn %lu null ref in (%s).\n",
- op->o_connid, rs->sr_entry ? rs->sr_entry->e_dn : "(null)", 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_reference: null ref in (%s)\n",
rs->sr_entry ? rs->sr_entry->e_dn : "(null)", 0, 0 );
-#endif
rc = 1;
goto rel;
}
}
if ( rc == -1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "send_search_reference: conn %lu "
- "ber_printf failed.\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"send_search_reference: ber_printf failed\n", 0, 0, 0 );
-#endif
#ifdef LDAP_CONNECTIONLESS
if (!op->o_conn || op->o_conn->c_is_udp == 0)
Statslog( LDAP_DEBUG_STATS2, "conn=%lu op=%lu REF dn=\"%s\"\n",
op->o_connid, op->o_opid, rs->sr_entry ? rs->sr_entry->e_dn : "(null)", 0, 0 );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "send_search_reference: conn %lu exit.\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<= send_search_reference\n", 0, 0, 0 );
-#endif
rel:
if ( op->o_callback ) {
*info = NULL;
if ( strncasecmp( s, "RESULT", STRLENOF( "RESULT" ) ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "str2result: (%s), expecting \"RESULT\"\n", s, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "str2result (%s) expecting \"RESULT\"\n",
s, 0, 0 );
-#endif
return( -1 );
}
*info = c;
}
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "str2result: (%s) unknown.\n", s, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "str2result (%s) unknown\n",
s, 0, 0 );
-#endif
rc = -1;
}
ber_len_t siz, len;
Operation myop;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "slap_read_controls: (%s) %s\n",
- oid->bv_val, e->e_dn, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "slap_read_controls: (%s) %s\n",
oid->bv_val, e->e_dn, 0 );
-#endif
rs->sr_entry = e;
rs->sr_attrs = ( oid == &slap_pre_read_bv ) ?
e = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) );
if( e == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "root_dse_info: SLAP_CALLOC failed", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"root_dse_info: SLAP_CALLOC failed", 0, 0, 0 );
-#endif
return LDAP_OTHER;
}
usr_attr = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) );
if( usr_attr == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "read_root_dse_file: SLAP_CALLOC failed", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"read_root_dse_file: SLAP_CALLOC failed", 0, 0, 0 );
-#endif
fclose( fp );
return LDAP_OTHER;
}
!strcasecmp( cargv[0], "sasl-authz-policy" ))
{
if ( cargc != 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing policy in"
- " \"%s <policy>\" line\n",
- cargv[0], fname, lineno );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing policy in"
" \"%s <policy>\" line\n",
cargv[0], fname, lineno );
-#endif
return( 1 );
}
if ( slap_sasl_setpolicy( cargv[1] ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "unable to parse value \"%s\" in \"authz-policy "
- "<policy>\" line.\n",
- fname, lineno, cargv[1] );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"unable to parse value \"%s\" in \"authz-policy "
"<policy>\" line.\n",
fname, lineno, cargv[1] );
-#endif
return( 1 );
}
{
int rc;
if ( cargc != 3 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: need 2 args in "
- "\"authz-regexp <match> <replace>\"\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: need 2 args in "
"\"authz-regexp <match> <replace>\"\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
/* set SASL host */
} else if ( strcasecmp( cargv[0], "sasl-host" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing host in \"sasl-host <host>\" line\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing host in \"sasl-host <host>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( global_host != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: already set sasl-host!\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: already set sasl-host!\n",
fname, lineno, 0 );
-#endif
return 1;
/* set SASL realm */
} else if ( strcasecmp( cargv[0], "sasl-realm" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "missing realm in \"sasl-realm <realm>\" line.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"missing realm in \"sasl-realm <realm>\" line.\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
if ( global_realm != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: already set sasl-realm!\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: already set sasl-realm!\n",
fname, lineno, 0 );
-#endif
return 1;
char *txt;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: "
- "missing flags in \"sasl-secprops <properties>\" line\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: "
"missing flags in \"sasl-secprops <properties>\" line\n",
fname, lineno, 0 );
-#endif
return 1;
}
txt = slap_sasl_secprops( cargv[1] );
if ( txt != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d sasl-secprops: %s\n",
- fname, lineno, txt );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: sasl-secprops: %s\n",
fname, lineno, txt );
-#endif
return 1;
}
return SASL_BADPARAM;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "SASL [conn=%ld] %s: %s\n", conn ? conn->c_connid : -1, label, message);
-#else
Debug( level, "SASL [conn=%ld] %s: %s\n",
conn ? conn->c_connid: -1,
label, message );
-#endif
return SASL_OK;
ad = NULL;
rc = slap_str2ad( name, &ad, &text );
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, DETAIL1,
- "slap_ap_lookup: str2ad(%s): %s\n", name, text, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_ap_lookup: str2ad(%s): %s\n", name, text, 0 );
-#endif
continue;
}
a = attr_find( rs->sr_entry->e_attrs, ad );
*out_len = 0;
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_canonicalize: conn %d %s=\"%s\"\n",
- conn ? conn->c_connid : -1,
- (flags & SASL_CU_AUTHID) ? "authcid" : "authzid",
- in ? in : "<empty>");
-#else
Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: %s=\"%s\"\n",
conn ? conn->c_connid : -1,
(flags & SASL_CU_AUTHID) ? "authcid" : "authzid",
in ? in : "<empty>");
-#endif
/* If name is too big, just truncate. We don't care, we're
* using DNs, not the usernames.
prop_set( props, names[0], (char *)&dn, sizeof( dn ) );
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_canonicalize: conn %d %s=\"%s\"\n",
- conn ? conn->c_connid : -1, names[0]+1,
- dn.bv_val ? dn.bv_val : "<EMPTY>" );
-#else
Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: %s=\"%s\"\n",
conn ? conn->c_connid : -1, names[0]+1,
dn.bv_val ? dn.bv_val : "<EMPTY>" );
-#endif
done:
AC_MEMCPY( out, in, inlen );
if ( !conn->c_sasl_bindop ||
conn->c_sasl_bindop->orb_method != LDAP_AUTH_SASL ) return SASL_OK;
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_authorize: conn %d authcid=\"%s\" authzid=\"%s\"\n",
- conn ? conn->c_connid : -1, auth_identity, requested_user);
-#else
Debug( LDAP_DEBUG_ARGS, "SASL proxy authorize [conn=%ld]: "
"authcid=\"%s\" authzid=\"%s\"\n",
conn ? conn->c_connid : -1, auth_identity, requested_user );
-#endif
if ( conn->c_sasl_dn.bv_val ) {
ch_free( conn->c_sasl_dn.bv_val );
BER_BVZERO( &conn->c_sasl_dn );
rc = slap_sasl_authorized( conn->c_sasl_bindop, &authcDN, &authzDN );
ch_free( authcDN.bv_val );
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, INFO,
- "slap_sasl_authorize: conn %ld "
- "proxy authorization disallowed (%d)\n",
- (long)(conn ? conn->c_connid : -1), rc, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "SASL Proxy Authorize [conn=%ld]: "
"proxy authorization disallowed (%d)\n",
(long) (conn ? conn->c_connid : -1), rc, 0 );
-#endif
sasl_seterror( sconn, 0, "not authorized" );
ch_free( authzDN.bv_val );
auth_identity, 0, 0);
}
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_authorize: conn %d proxy authorization allowed\n",
- (long)(conn ? conn->c_connid : -1), 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
" proxy authorization allowed\n",
(long) (conn ? conn->c_connid : -1), 0, 0 );
-#endif
return SASL_OK;
}
#else
BER_BVZERO( &conn->c_sasl_dn );
}
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_authorize: conn %d authcid=\"%s\" authzid=\"%s\"\n",
- conn ? conn->c_connid : -1, authcid ? authcid : "<empty>",
- authzid ? authzid : "<empty>" );
-#else
Debug( LDAP_DEBUG_ARGS, "SASL Authorize [conn=%ld]: "
"authcid=\"%s\" authzid=\"%s\"\n",
(long) (conn ? conn->c_connid : -1),
authcid ? authcid : "<empty>",
authzid ? authzid : "<empty>" );
-#endif
/* Figure out how much data we have for the dn */
rc = sasl_getprop( conn->c_sasl_authctx, SASL_REALM, (void **)&realm );
if( rc != SASL_OK && rc != SASL_NOTDONE ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ERR,
- "slap_sasl_authorize: getprop(REALM) failed.\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE,
"authorize: getprop(REALM) failed!\n", 0,0,0);
-#endif
*errstr = "Could not extract realm";
return SASL_NOAUTHZ;
}
return SASL_NOAUTHZ;
}
if( ( authzid == NULL ) || !strcmp( authcid, authzid ) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_authorize: conn %d Using authcDN=%s\n",
- conn ? conn->c_connid : -1, authcDN.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
"Using authcDN=%s\n", (long) (conn ? conn->c_connid : -1), authcDN.bv_val,0 );
-#endif
conn->c_sasl_dn = authcDN;
goto ok;
rc = slap_sasl_authorized(conn->c_sasl_bindop, &authcDN, &authzDN );
ch_free( authcDN.bv_val );
if( rc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, INFO,
- "slap_sasl_authorize: conn %ld "
- "proxy authorization disallowed (%d)\n",
- (long)(conn ? conn->c_connid : -1), rc, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
"proxy authorization disallowed (%d)\n",
(long) (conn ? conn->c_connid : -1), rc, 0 );
-#endif
*errstr = "not authorized";
ch_free( authzDN.bv_val );
conn->c_sasl_dn = authzDN;
ok:
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, RESULTS,
- "slap_sasl_authorize: conn %d proxy authorization allowed\n",
- (long)(conn ? conn->c_connid : -1 ), 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
" authorization allowed\n",
(long) (conn ? conn->c_connid : -1), 0, 0 );
-#endif
if (conn->c_sasl_bindop) {
Statslog( LDAP_DEBUG_STATS,
char version[sizeof("xxx.xxx.xxxxx")];
sprintf( version, "%u.%d.%d", (unsigned)rc >> 24, (rc >> 16) & 0xff,
rc & 0xffff );
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, INFO,
- "slap_sasl_init: SASL library version mismatch:"
- " expected " SASL_VERSION_STRING ","
- " got %s\n", version, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"slap_sasl_init: SASL library version mismatch:"
" expected " SASL_VERSION_STRING ","
" got %s\n", version, 0, 0 );
-#endif
return -1;
}
#endif
rc = sasl_server_init( server_callbacks, "slapd" );
if( rc != SASL_OK ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, INFO, "slap_sasl_init: init failed.\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
0, 0, 0 );
-#endif
#if SASL_VERSION_MAJOR < 2
/* A no-op used to make sure we linked with Cyrus 1.5 */
sasl_client_auth( NULL, NULL, NULL, 0, NULL, NULL );
return -1;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, INFO, "slap_sasl_init: initialized!\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_sasl_init: initialized!\n",
0, 0, 0 );
-#endif
/* default security properties */
memset( &sasl_secprops, '\0', sizeof(sasl_secprops) );
SLAP_CALLOC( 3, sizeof(sasl_callback_t));
#endif
if( session_callbacks == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ERR,
- "slap_sasl_open: SLAP_MALLOC failed", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"slap_sasl_open: SLAP_MALLOC failed", 0, 0, 0 );
-#endif
return -1;
}
conn->c_sasl_extra = session_callbacks;
#endif
if( sc != SASL_OK ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ERR,
- "slap_sasl_open: sasl_server_new failed: %d\n", sc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "sasl_server_new failed: %d\n",
sc, 0, 0 );
-#endif
return -1;
}
SASL_SEC_PROPS, &sasl_secprops );
if( sc != SASL_OK ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ERR,
- "slap_sasl_open: sasl_setprop failed: %d \n", sc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "sasl_setprop failed: %d\n",
sc, 0, 0 );
-#endif
slap_sasl_close( conn );
return -1;
&mechstr, NULL, NULL );
if( sc != SASL_OK ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ERR,
- "slap_sasl_mechs: sasl_listmech failed: %d\n", sc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "slap_sasl_listmech failed: %d\n",
sc, 0, 0 );
-#endif
return NULL;
}
unsigned reslen = 0;
int sc;
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "sasl_bind: dn=\"%s\" mech=%s datalen=%ld\n",
- op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "",
- op->o_conn->c_sasl_bind_in_progress ? "<continuing>" :
- op->o_conn->c_sasl_bind_mech.bv_val,
- op->orb_cred.bv_len );
-#else
Debug(LDAP_DEBUG_ARGS,
"==> sasl_bind: dn=\"%s\" mech=%s datalen=%ld\n",
op->o_req_dn.bv_len ? op->o_req_dn.bv_val : "",
op->o_conn->c_sasl_bind_in_progress ? "<continuing>" :
op->o_conn->c_sasl_bind_mech.bv_val,
op->orb_cred.bv_len );
-#endif
if( ctx == NULL ) {
send_ldap_error( op, rs, LDAP_UNAVAILABLE,
}
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, RESULTS, "slap_sasl_bind: rc=%d\n", rs->sr_err, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE, "<== slap_sasl_bind: rc=%d\n", rs->sr_err, 0, 0);
-#endif
#elif defined(SLAP_BUILTIN_SASL)
/* built-in SASL implementation */
goto done;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, ENTRY,
- "slap_sasl_setpass: \"%s\"\n",
- id.bv_val ? id.bv_val : "", 0, 0);
-#else
Debug( LDAP_DEBUG_ARGS, "==> slap_sasl_setpass: \"%s\"\n",
id.bv_val ? id.bv_val : "", 0, 0 );
-#endif
rs->sr_err = slap_passwd_parse( op->ore_reqdata,
NULL, &old, &new, &rs->sr_text );
assert( conn );
assert( id );
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_getdn: conn %d id=%s [len=%d]\n",
- conn->c_connid,
- BER_BVISNULL( id ) ? "NULL" : ( BER_BVISEMPTY( id ) ? "<empty>" : id->bv_val ),
- BER_BVISNULL( id ) ? 0 : ( BER_BVISEMPTY( id ) ? 0 : id->bv_len ) );
-#else
Debug( LDAP_DEBUG_ARGS, "slap_sasl_getdn: conn %d id=%s [len=%d]\n",
conn->c_connid,
BER_BVISNULL( id ) ? "NULL" : ( BER_BVISEMPTY( id ) ? "<empty>" : id->bv_val ),
BER_BVISNULL( id ) ? 0 : ( BER_BVISEMPTY( id ) ? 0 : id->bv_len ) );
-#endif
if ( !op ) {
op = conn->c_sasl_bindop;
/* Build the new dn */
dn->bv_val = slap_sl_malloc( len + 1, op->o_tmpmemctx );
if( dn->bv_val == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ERR,
- "slap_sasl_getdn: SLAP_MALLOC failed", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"slap_sasl_getdn: SLAP_MALLOC failed", 0, 0, 0 );
-#endif
return LDAP_OTHER;
}
p = lutil_strcopy( dn->bv_val, "uid=" );
p = lutil_strcopy( p, ",cn=auth" );
dn->bv_len = p - dn->bv_val;
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_getdn: u:id converted to %s.\n", dn->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_sasl_getdn: u:id converted to %s\n", dn->bv_val,0,0 );
-#endif
} else {
/* Dup the DN in any case, so we don't risk
if( !BER_BVISNULL( &dn2 ) ) {
slap_sl_free( dn->bv_val, op->o_tmpmemctx );
*dn = dn2;
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_getdn: dn:id converted to %s.\n", dn->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "getdn: dn:id converted to %s\n",
dn->bv_val, 0, 0 );
-#endif
}
return( LDAP_SUCCESS );
*scope = -1;
*filter = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_parseURI: parsing %s\n", uri->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_parseURI: parsing %s\n", uri->bv_val, 0, 0 );
-#endif
rc = LDAP_PROTOCOL_ERROR;
/*
}
if ( *c == '$' ) {
if ( n == SASLREGEX_REPLACE ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ERR,
- "slap_sasl_rx_off: \"%s\" has too many $n "
- "placeholders (max %d)\n", rep, SASLREGEX_REPLACE, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"SASL replace pattern %s has too many $n "
"placeholders (max %d)\n",
rep, SASLREGEX_REPLACE, 0 );
-#endif
return( LDAP_OTHER );
}
/* Precompile matching pattern */
rc = regcomp( ®->sr_workspace, reg->sr_match, REG_EXTENDED|REG_ICASE );
if ( rc ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ERR,
- "slap_sasl_regexp_config: \"%s\" could not be compiled.\n",
- reg->sr_match, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"SASL match pattern %s could not be compiled by regexp engine\n",
reg->sr_match, 0, 0 );
-#endif
return( LDAP_OTHER );
}
} else {
ber_dupbv_x( out, in, ctx );
}
-#ifdef NEW_LOGGING
- LDAP_LOG( BACK_LDAP, DETAIL1,
- "[rw] %s: \"%s\" -> \"%s\"\n",
- context, in->bv_val, out->bv_val );
-#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS,
"[rw] %s: \"%s\" -> \"%s\"\n",
context, in->bv_val, out->bv_val );
-#endif /* !NEW_LOGGING */
return 1;
case REWRITE_REGEXEC_UNWILLING:
memset( out, 0, sizeof( *out ) );
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_authz_regexp: converting SASL name %s\n", saslname, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "slap_authz_regexp: converting SASL name %s\n",
saslname, 0, 0 );
-#endif
if (( saslname == NULL ) || ( nSaslRegexp == 0 )) {
return( 0 );
slap_sasl_rx_exp( reg->sr_replace, reg->sr_offset,
sr_strings, saslname, out, ctx );
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_authz_regexp: converted SASL name to %s\n",
- BER_BVISEMPTY( out ) ? "" : out->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_authz_regexp: converted SASL name to %s\n",
BER_BVISEMPTY( out ) ? "" : out->bv_val, 0, 0 );
-#endif
return( 1 );
#endif /* ! SLAP_AUTH_REWRITE */
o->o_tmpfree(ndn->bv_val, o->o_tmpmemctx);
BER_BVZERO( ndn );
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, DETAIL1,
- "slap_sc_sasl2dn: search DN returned more than 1 entry\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_sc_sasl2dn: search DN returned more than 1 entry\n", 0, 0, 0 );
-#endif
return -1;
}
sm.match = 0;
cb.sc_private = &sm;
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_match: comparing DN %s to rule %s\n",
- assertDN->bv_val, rule->bv_val,0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"===>slap_sasl_match: comparing DN %s to rule %s\n",
assertDN->bv_val, rule->bv_val, 0 );
-#endif
rc = slap_parseURI( opx, rule, &op.o_req_dn,
&op.o_req_ndn, &op.ors_scope, &op.ors_filter,
goto CONCLUDED;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, DETAIL1,
- "slap_sasl_match: performing internal search (base=%s, scope=%d)\n",
- op.o_req_ndn.bv_val, op.ors_scope, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_sasl_match: performing internal search (base=%s, scope=%d)\n",
op.o_req_ndn.bv_val, op.ors_scope, 0 );
-#endif
op.o_bd = select_backend( &op.o_req_ndn, 0, 1 );
if(( op.o_bd == NULL ) || ( op.o_bd->be_search == NULL)) {
if( op.ors_filter ) filter_free_x( opx, op.ors_filter );
if( !BER_BVISNULL( &op.ors_filterstr ) ) ch_free( op.ors_filterstr.bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_match: comparison returned %d\n", rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"<===slap_sasl_match: comparison returned %d\n", rc, 0, 0);
-#endif
return( rc );
}
int i, rc;
BerVarray vals = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_check_authz: does %s match %s rule in %s?\n",
- assertDN->bv_val, ad->ad_cname.bv_val, searchDN->bv_val);
-#else
Debug( LDAP_DEBUG_TRACE,
"==>slap_sasl_check_authz: does %s match %s rule in %s?\n",
assertDN->bv_val, ad->ad_cname.bv_val, searchDN->bv_val);
-#endif
rc = backend_attribute( op, NULL, searchDN, ad, &vals, ACL_AUTH );
if( rc != LDAP_SUCCESS ) goto COMPLETE;
COMPLETE:
if( vals ) ber_bvarray_free_x( vals, op->o_tmpmemctx );
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, RESULTS,
- "slap_sasl_check_authz: %s check returning %d\n",
- ad->ad_cname.bv_val, rc, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"<==slap_sasl_check_authz: %s check returning %d\n",
ad->ad_cname.bv_val, rc, 0);
-#endif
return( rc );
}
SlapReply rs = {REP_RESULT};
struct berval regout = BER_BVNULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl2dn: converting SASL name %s to DN.\n",
- saslname->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "==>slap_sasl2dn: "
"converting SASL name %s to a DN\n",
saslname->bv_val, 0,0 );
-#endif
sasldn->bv_val = NULL;
sasldn->bv_len = 0;
assert( 0 );
}
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, DETAIL1,
- "slap_sasl2dn: performing internal search (base=%s, scope=%d)\n",
- op.o_req_ndn.bv_val, op.ors_scope, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_sasl2dn: performing internal search (base=%s, scope=%d)\n",
op.o_req_ndn.bv_val, op.ors_scope, 0 );
-#endif
if(( op.o_bd == NULL ) || ( op.o_bd->be_search == NULL)) {
goto FINISHED;
ch_free( op.ors_filterstr.bv_val );
}
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl2dn: Converted SASL name to %s\n",
- !BER_BVISEMPTY( sasldn ) ? sasldn->bv_val : "<nothing>", 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<==slap_sasl2dn: Converted SASL name to %s\n",
!BER_BVISEMPTY( sasldn ) ? sasldn->bv_val : "<nothing>", 0, 0 );
-#endif
return;
}
goto DONE;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, ENTRY,
- "slap_sasl_authorized: can %s become %s?\n",
- authcDN->bv_val, authzDN->bv_val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"==>slap_sasl_authorized: can %s become %s?\n",
authcDN->bv_val, authzDN->bv_val, 0 );
-#endif
/* If person is authorizing to self, succeed */
if ( dn_match( authcDN, authzDN ) ) {
DONE:
-#ifdef NEW_LOGGING
- LDAP_LOG( TRANSPORT, RESULTS, "slap_sasl_authorized: return %d\n", rc,0,0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"<== slap_sasl_authorized: return %d\n", rc, 0, 0 );
-#endif
return( rc );
}
e = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) );
if( e == NULL ) {
/* Out of memory, do something about it */
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "schema_info: SLAP_CALLOC failed - out of memory.\n", 0, 0,0 );
-#else
Debug( LDAP_DEBUG_ANY,
"schema_info: SLAP_CALLOC failed - out of memory.\n", 0, 0, 0 );
-#endif
*text = "out of memory";
return LDAP_OTHER;
}
"attribute '%s' cannot have multiple values",
type );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn=\"%s\" %s\n", e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Entry (%s), %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_CONSTRAINT_VIOLATION;
}
/* find the structural object class attribute */
asc = attr_find( e->e_attrs, ad_structuralObjectClass );
if ( asc == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: No structuralObjectClass for entry (%s)\n",
- e->e_dn, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"No structuralObjectClass for entry (%s)\n",
e->e_dn, 0, 0 );
-#endif
*text = "no structuralObjectClass operational attribute";
return LDAP_OTHER;
"unrecognized structuralObjectClass '%s'",
asc->a_vals[0].bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"entry_check_schema(%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
"structuralObjectClass '%s' is not STRUCTURAL",
asc->a_vals[0].bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"entry_check_schema(%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OTHER;
}
"structuralObjectClass '%s' is OBSOLETE",
asc->a_vals[0].bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"entry_check_schema(%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
/* find the object class attribute */
aoc = attr_find( e->e_attrs, ad_objectClass );
if ( aoc == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: No objectClass for entry (%s).\n",
- e->e_dn, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "No objectClass for entry (%s)\n",
e->e_dn, 0, 0 );
-#endif
*text = "no objectClass attribute";
return LDAP_OBJECT_CLASS_VIOLATION;
"content rule '%s' is obsolete",
ldap_contentrule2name( &cr->scr_crule ));
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn=\"%s\" %s", e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Entry (%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
ldap_contentrule2name( &cr->scr_crule ),
at->sat_cname.bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn=\"%s\" %s", e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Entry (%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
ldap_contentrule2name( &cr->scr_crule ),
at->sat_cname.bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn=\"%s\" %s", e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Entry (%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
"unrecognized objectClass '%s'",
aoc->a_vals[i].bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"entry_check_schema(%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
"objectClass '%s' is OBSOLETE",
aoc->a_vals[i].bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn (%s), %s\n", e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"entry_check_schema(%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
"unrecognized objectClass '%s'",
aoc->a_vals[i].bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn (%s), %s\n",
- e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"entry_check_schema(%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
"abstract objectClass '%s' not allowed",
aoc->a_vals[i].bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn (%s), %s\n",
- e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"entry_check_schema(%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
ldap_contentrule2name( &cr->scr_crule ),
oc->soc_cname.bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn=\"%s\" %s",
- e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Entry (%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
"object class '%s' requires attribute '%s'",
aoc->a_vals[i].bv_val, s );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn=\"%s\" %s", e->e_dn, textbuf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Entry (%s): %s\n",
e->e_dn, textbuf, 0 );
-#endif
return LDAP_OBJECT_CLASS_VIOLATION;
}
"attribute '%s' not allowed",
type );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "entry_schema_check: dn=\"%s\" %s\n", e->e_dn, textbuf, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"Entry (%s), %s\n",
e->e_dn, textbuf, 0 );
-#endif
return ret;
}
int i;
Attribute *a;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "oc_check_required: dn (%s), objectClass \"%s\"\n",
- e->e_dn, ocname->bv_val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"oc_check_required entry (%s), objectClass \"%s\"\n",
e->e_dn, ocname->bv_val, 0 );
-#endif
/* check for empty oc_required */
{
int i, j;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "oc_check_allowed: type \"%s\"\n", at->sat_cname.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"oc_check_allowed type \"%s\"\n",
at->sat_cname.bv_val, 0, 0 );
-#endif
/* always allow objectClass attribute */
if ( strcasecmp( at->sat_cname.bv_val, "objectClass" ) == 0 ) {
assert( out );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, ">>> nameUIDPretty: <%s>\n", val->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, ">>> nameUIDPretty: <%s>\n", val->bv_val, 0, 0 );
-#endif
if( val->bv_len == 0 ) {
ber_dupbv_x( out, val, ctx );
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, "<<< nameUIDPretty: <%s>\n", out->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<<< nameUIDPretty: <%s>\n", out->bv_val, 0, 0 );
-#endif
return LDAP_SUCCESS;
}
assert( val );
assert( out );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, ">>> serialNumberAndIssuerPretty: <%s>\n",
- val->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, ">>> serialNumberAndIssuerPretty: <%s>\n",
val->bv_val, 0, 0 );
-#endif
if( val->bv_len < 3 ) return LDAP_INVALID_SYNTAX;
/* terminate */
out->bv_val[out->bv_len] = '\0';
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, "<<< serialNumberAndIssuerPretty: <%s>\n",
- out->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<<< serialNumberAndIssuerPretty: <%s>\n",
out->bv_val, 0, 0 );
-#endif
return LDAP_SUCCESS;
}
assert( val );
assert( out );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, ">>> serialNumberAndIssuerNormalize: <%s>\n",
- val->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, ">>> serialNumberAndIssuerNormalize: <%s>\n",
val->bv_val, 0, 0 );
-#endif
if( val->bv_len < 3 ) return LDAP_INVALID_SYNTAX;
/* terminate */
out->bv_val[out->bv_len] = '\0';
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, "<<< serialNumberAndIssuerNormalize: <%s>\n",
- out->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "<<< serialNumberAndIssuerNormalize: <%s>\n",
out->bv_val, 0, 0 );
-#endif
return rc;
}
p += issuer_dn.bv_len;
*p = '\0';
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ARGS, "certificateExactNormalize: %s\n",
- normalized->bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "certificateExactNormalize: %s\n",
normalized->bv_val, NULL, NULL );
-#endif
done:
if (xcert) X509_free(xcert);
struct berval base = BER_BVNULL;
ber_len_t siz, off, i;
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY, "do_search: conn %d\n", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 );
-#endif
/*
* Parse the search request. It looks like this:
rs->sr_err = dnPrettyNormal( NULL, &base, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
if( rs->sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_search: conn %d invalid dn (%s)\n",
- op->o_connid, base.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_search: invalid dn (%s)\n", base.bv_val, 0, 0 );
-#endif
send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
goto return_results;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, "SRCH \"%s\" %d %d",
- base.bv_val, op->ors_scope, op->ors_deref );
- LDAP_LOG( OPERATION, ARGS, " %d %d %d\n",
- op->ors_slimit, op->ors_tlimit, op->ors_attrsonly);
-#else
Debug( LDAP_DEBUG_ARGS, "SRCH \"%s\" %d %d",
base.bv_val, op->ors_scope, op->ors_deref );
Debug( LDAP_DEBUG_ARGS, " %d %d %d\n",
op->ors_slimit, op->ors_tlimit, op->ors_attrsonly);
-#endif
/* filter - returns a "normalized" version */
rs->sr_err = get_filter( op, op->o_ber, &op->ors_filter, &rs->sr_text );
}
filter2bv_x( op, op->ors_filter, &op->ors_filterstr );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "do_search: conn %d filter: %s\n",
- op->o_connid, !BER_BVISEMPTY( &op->ors_filterstr ) ? op->ors_filterstr.bv_val : "empty",
- 0 );
-#else
Debug( LDAP_DEBUG_ARGS, " filter: %s\n",
!BER_BVISEMPTY( &op->ors_filterstr ) ? op->ors_filterstr.bv_val : "empty", 0, 0 );
-#endif
/* attributes */
siz = sizeof(AttributeName);
}
if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "do_search: conn %d get_ctrls failed (%d)\n",
- op->o_connid, rs->sr_err, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_search: get_ctrls failed\n", 0, 0, 0 );
-#endif
goto return_results;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "do_search: conn %d attrs:", op->o_connid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, " attrs:", 0, 0, 0 );
-#endif
if ( siz != 0 ) {
for ( i = 0; i<siz; i++ ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "do_search: %s", op->ors_attrs[i].an_name.bv_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, " %s", op->ors_attrs[i].an_name.bv_val, 0, 0 );
-#endif
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS, "\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 );
-#endif
if ( StatslogTest( LDAP_DEBUG_STATS ) ) {
char abuf[BUFSIZ/2], *ptr = abuf;
* A preoperation plugin failure will abort the
* entire operation.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "call_search_preop_plugins: search preoperation plugin "
- "returned %d\n", rc, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE, "call_search_preop_plugins: search preoperation plugin "
"returned %d.\n", rc, 0, 0);
-#endif
if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 ) ||
rc == LDAP_SUCCESS ) {
rc = LDAP_OTHER;
slapi_pblock_get( op->o_pb, SLAPI_SEARCH_SCOPE, (void **)&op->ors_scope );
slapi_pblock_get( op->o_pb, SLAPI_SEARCH_DEREF, (void **)&op->ors_deref );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ARGS,
- "call_search_rewrite_plugins: after compute_rewrite_search filter: %s\n",
- !BER_BVISEMPTY( &op->ors_filterstr ) ? op->ors_filterstr.bv_val : "empty", 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, " after compute_rewrite_search filter: %s\n",
!BER_BVISEMPTY( &op->ors_filterstr ) ? op->ors_filterstr.bv_val : "empty", 0, 0 );
-#endif
}
return LDAP_SUCCESS;
static void call_search_postop_plugins( Operation *op )
{
if ( slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_SEARCH_FN, op->o_pb ) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "call_search_postop_plugins: search postoperation plugins "
- "failed\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE, "call_search_postop_plugins: search postoperation plugins "
"failed.\n", 0, 0, 0);
-#endif
}
}
size &= ~pad;
if ((char *) sh->h_last + size >= (char *) sh->h_end ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "slap_sl_malloc of %lu bytes failed, using ch_malloc\n",
- (long)size, 0,0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"slap_sl_malloc of %lu bytes failed, using ch_malloc\n",
(long)size, 0,0 );
-#endif
return ch_malloc( size );
}
new = sh->h_last;
if (new ) {
return new;
}
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "ch_realloc: reallocation of %lu bytes failed\n", (long)size, 0,0 );
-#else
Debug( LDAP_DEBUG_ANY, "ch_realloc of %lu bytes failed\n",
(long) size, 0, 0 );
-#endif
assert( 0 );
exit( EXIT_FAILURE );
}
Operation op;
Entry e = { 0 };
-#ifdef NEW_LOGGING
- lutil_log_initialize( argc, argv );
-#endif
slap_tool_init( progname, SLAPACL, argc, argv );
argv = &argv[ optind ];
int i;
struct berval mc;
struct sync_cookie sc;
-#ifdef NEW_LOGGING
- lutil_log_initialize(argc, argv );
-#endif
slap_tool_init( progname, SLAPADD, argc, argv );
LDAP_SLIST_INIT( &consumer_subentry );
Connection conn;
Operation op;
-#ifdef NEW_LOGGING
- lutil_log_initialize( argc, argv );
-#endif
slap_tool_init( progname, SLAPAUTH, argc, argv );
argv = &argv[ optind ];
}
if ( nosubordinates == 0 && dbnum > 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( BACKEND, ERR,
-"The first database does not allow %s; using the first available one (%d)\n",
- progname, dbnum + 1, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"The first database does not allow %s; using the first available one (%d)\n",
progname, dbnum + 1, 0 );
-#endif
}
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
int rc = 0;
const char *progname = "slapdn";
-#ifdef NEW_LOGGING
- lutil_log_initialize( argc, argv );
-#endif
slap_tool_init( progname, SLAPDN, argc, argv );
argv = &argv[ optind ];
int rc = EXIT_SUCCESS;
const char *progname = "slaptest";
-#ifdef NEW_LOGGING
- lutil_log_initialize( argc, argv );
-#endif
slap_tool_init( progname, SLAPTEST, argc, argv );
fprintf( stderr, "config file testing succeeded\n");
BerElement *ber = (BerElement *)&berbuf;
const char *text = NULL;
-#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "str2filter: \"%s\"\n", str, 0, 0 );
-#else
Debug( LDAP_DEBUG_FILTER, "str2filter \"%s\"\n", str, 0, 0 );
-#endif
if ( str == NULL || *str == '\0' ) {
return NULL;
for ( n = 0; si->si_attrs[ n ] != NULL; n++ ) /* empty */;
tmp = ( char ** ) ch_realloc( si->si_attrs, (n + 4)*sizeof( char * ));
if ( tmp == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "out of memory\n", 0,0,0 );
-#else
Debug( LDAP_DEBUG_ANY, "out of memory\n", 0,0,0 );
-#endif
}
/* Add Attributes */
} else {
tmp = ( char ** ) ch_realloc( si->si_attrs, 3 * sizeof( char * ));
if ( tmp == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "out of memory\n", 0,0,0 );
-#else
Debug( LDAP_DEBUG_ANY, "out of memory\n", 0,0,0 );
-#endif
}
tmp[ n++ ] = ch_strdup( "*" );
tmp[ n++ ] = ch_strdup( "+" );
/* Init connection to master */
rc = ldap_initialize( &si->si_ld, si->si_provideruri );
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_syncrep1: ldap_initialize failed (%s)\n",
- si->si_provideruri, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_syncrep1: ldap_initialize failed (%s)\n",
si->si_provideruri, 0, 0 );
-#endif
return rc;
}
if ( si->si_tls ) {
rc = ldap_start_tls_s( si->si_ld, NULL, NULL );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_syncrep1: "
- "%s: ldap_start_tls failed (%d)\n",
- si->si_tls == SYNCINFO_TLS_CRITICAL ? "Error" : "Warning",
- rc, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: ldap_start_tls failed (%d)\n",
si->si_tls == SYNCINFO_TLS_CRITICAL ? "Error" : "Warning",
rc, 0 );
-#endif
if( si->si_tls == SYNCINFO_TLS_CRITICAL ) goto done;
}
}
LDAP_OPT_X_SASL_SECPROPS, si->si_secprops);
if( rc != LDAP_OPT_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: Error: "
- "ldap_set_option(%s,SECPROPS,\"%s\") failed!\n",
- si->si_provideruri, si->si_secprops, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option "
"(%s,SECPROPS,\"%s\") failed!\n",
si->si_provideruri, si->si_secprops, 0 );
-#endif
goto done;
}
}
* 2) on err policy : exit, retry, backoff ...
*/
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_syncrep1: "
- "ldap_sasl_interactive_bind_s failed (%d)\n",
- rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_syncrep1: "
"ldap_sasl_interactive_bind_s failed (%d)\n",
rc, 0, 0 );
-#endif
/* FIXME (see above comment) */
/* if Kerberos credentials cache is not active, retry */
rc = ldap_bind_s( si->si_ld,
si->si_binddn, si->si_passwd, si->si_bindmethod );
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_syncrep1: "
- "ldap_bind_s failed (%d)\n", rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_syncrep1: "
"ldap_bind_s failed (%d)\n", rc, 0, 0 );
-#endif
goto done;
}
}
rc = ldap_sync_search( si, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_syncrep1: "
- "ldap_search_ext: %s (%d)\n", ldap_err2string( rc ), rc, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_syncrep1: "
"ldap_search_ext: %s (%d)\n", ldap_err2string( rc ), rc, 0 );
-#endif
}
done:
ber_init2( ber, NULL, LBER_USE_DER );
ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, DETAIL1, "do_syncrep2\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "=>do_syncrep2\n", 0, 0, 0 );
-#endif
psub = &si->si_be->be_nsuffix[0];
break;
case LDAP_RES_SEARCH_REFERENCE:
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_syncrep2 : reference received\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_syncrep2 : reference received\n", 0, 0, 0 );
-#endif
break;
case LDAP_RES_SEARCH_RESULT:
ber_memfree_x( syncUUIDs, op->o_tmpmemctx );
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_syncrep2 : unknown syncinfo tag (%ld)\n",
- (long) si_tag, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_syncrep2 : unknown syncinfo tag (%ld)\n",
(long) si_tag, 0, 0 );
-#endif
ldap_memfree( retoid );
ber_bvfree( retdata );
continue;
break;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "do_syncrep2 :"
- " unknown intermediate "
- "response\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_syncrep2 : "
"unknown intermediate response (%d)\n",
rc, 0, 0 );
-#endif
ldap_memfree( retoid );
ber_bvfree( retdata );
break;
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR, "do_syncrep2 : "
- "unknown message\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "do_syncrep2 : "
"unknown message\n", 0, 0, 0 );
-#endif
break;
}
ldap_get_option( si->si_ld, LDAP_OPT_ERROR_NUMBER, &rc );
errstr = ldap_err2string( rc );
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "do_syncrep2 : %s\n", errstr, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"do_syncrep2 : %s\n", errstr, 0, 0 );
-#endif
}
done:
ber_socket_t s;
int i, defer = 1;
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, DETAIL1, "do_syncrepl\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "=>do_syncrepl\n", 0, 0, 0 );
-#endif
if ( si == NULL )
return NULL;
*modlist = NULL;
if ( ldap_msgtype( msg ) != LDAP_RES_SEARCH_ENTRY ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "Message type should be entry (%d)", ldap_msgtype( msg ), 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Message type should be entry (%d)", ldap_msgtype( msg ), 0, 0 );
-#endif
return -1;
}
rc = ldap_get_dn_ber( si->si_ld, msg, &ber, &bdn );
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syncrepl_message_to_entry : dn get failed (%d)", rc, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"syncrepl_message_to_entry : dn get failed (%d)", rc, 0, 0 );
-#endif
return rc;
}
}
if ( *modlist == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syncrepl_message_to_entry: no attributes\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_entry: no attributes\n",
0, 0, 0 );
-#endif
rc = -1;
goto done;
}
rc = slap_mods_check( *modlist, 1, &text, txtbuf, textlen, NULL );
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syncrepl_message_to_entry: mods check (%s)\n", text, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_entry: mods check (%s)\n",
text, 0, 0 );
-#endif
goto done;
}
rc = slap_mods2entry( *modlist, &e, 1, 1, &text, txtbuf, textlen);
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syncrepl_message_to_entry: mods2entry (%s)\n", text, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_entry: mods2entry (%s)\n",
text, 0, 0 );
-#endif
}
done:
rc = be->be_modify( op, &rs_modify );
if ( rs_modify.sr_err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syncrepl_entry : be_modify failed (%d)\n",
- rs_modify.sr_err, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"syncrepl_entry : be_modify failed (%d)\n",
rs_modify.sr_err, 0, 0 );
-#endif
}
ret = 1;
goto done;
ret = 0;
goto done;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syncrepl_entry : be_add failed (%d)\n",
- rs_add.sr_err, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"syncrepl_entry : be_add failed (%d)\n",
rs_add.sr_err, 0, 0 );
-#endif
ret = 1;
goto done;
}
goto done;
}
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syncrepl_entry : be_search failed (%d)\n",
- rs_search.sr_err, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"syncrepl_entry : be_search failed (%d)\n",
rs_search.sr_err, 0, 0 );
-#endif
ret = 1;
goto done;
}
goto done;
default :
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syncrepl_entry : unknown syncstate\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"syncrepl_entry : unknown syncstate\n", 0, 0, 0 );
-#endif
ret = 1;
goto done;
}
}
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syncrepl_updateCookie: mods opattrs (%s)\n", text, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "syncrepl_updateCookie: mods opattrs (%s)\n",
text, 0, 0 );
-#endif
}
e = ( Entry * ) ch_calloc( 1, sizeof( Entry ));
rc = slap_mods2entry( modlist, &e, 1, 1, &text, txtbuf, textlen );
if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syncrepl_updateCookie: mods2entry (%s)\n", text, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "syncrepl_updateCookie: mods2entry (%s)\n",
text, 0, 0 );
-#endif
}
cb.sc_response = null_callback;
goto update_cookie_retry;
} else if ( rs_add.sr_err == LDAP_REFERRAL ||
rs_add.sr_err == LDAP_NO_SUCH_OBJECT ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "cookie will be non-persistent\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"cookie will be non-persistent\n",
0, 0, 0 );
-#endif
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "be_add failed (%d)\n", rs_add.sr_err, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"be_add failed (%d)\n", rs_add.sr_err, 0, 0 );
-#endif
}
} else {
be_entry_release_w( op, e );
goto done;
}
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "be_modify failed (%d)\n", rs_modify.sr_err, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"be_modify failed (%d)\n", rs_modify.sr_err, 0, 0 );
-#endif
}
}
if ( rs->sr_type == REP_SEARCH ) {
if ( si->si_syncUUID_ndn.bv_val != NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "dn_callback : consistency error - entryUUID is not unique\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"dn_callback : consistency error - entryUUID is not unique\n", 0, 0, 0 );
-#endif
} else {
ber_dupbv_x( &si->si_syncUUID_ndn, &rs->sr_entry->e_nname, op->o_tmpmemctx );
}
} else if ( rs->sr_type == REP_RESULT ) {
if ( rs->sr_err == LDAP_SIZELIMIT_EXCEEDED ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "dn_callback : consistency error - entryUUID is not unique\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"dn_callback : consistency error - entryUUID is not unique\n", 0, 0, 0 );
-#endif
}
}
rs->sr_err != LDAP_NO_SUCH_OBJECT &&
rs->sr_err != LDAP_NOT_ALLOWED_ON_NONLEAF )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "null_callback : error code 0x%x\n",
- rs->sr_err, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"null_callback : error code 0x%x\n",
rs->sr_err, 0, 0 );
-#endif
}
return LDAP_SUCCESS;
}
sir = (struct sindexrec *)
SLAP_CALLOC( 1, sizeof(struct sindexrec) );
if( sir == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syn_insert: SLAP_CALLOC Error\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "SLAP_CALLOC Error\n", 0, 0, 0 );
-#endif
return LDAP_OTHER;
}
sir->sir_name = ssyn->ssyn_oid;
ssyn = (Syntax *) SLAP_CALLOC( 1, sizeof(Syntax) );
if( ssyn == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "syn_add: SLAP_CALLOC Error\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "SLAP_CALLOC Error\n", 0, 0, 0 );
-#endif
return LDAP_OTHER;
}
syn = ldap_str2syntax( def->sd_desc, &code, &err, LDAP_SCHEMA_ALLOW_ALL);
if ( !syn ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ERR,
- "register_syntax: Error - %s before %s in %s.\n",
- ldap_scherr2str(code), err, def->sd_desc );
-#else
Debug( LDAP_DEBUG_ANY, "Error in register_syntax: %s before %s in %s\n",
ldap_scherr2str(code), err, def->sd_desc );
-#endif
return( -1 );
}
ldap_memfree( syn );
if ( code ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, ERR,
- "register_syntax: Error - %s %s in %s\n",
- scherr2str(code), err, def->sd_desc );
-#else
Debug( LDAP_DEBUG_ANY, "Error in register_syntax: %s %s in %s\n",
scherr2str(code), err, def->sd_desc );
-#endif
return( -1 );
}
return -1;
}
#if 0
-#ifdef NEW_LOGGING
- LDAP_LOG( config, ENTRY,
- "syn_schema_info: Merging syn [%ld] %s\n",
- (long)val.bv_len, val.bv_val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "Merging syn [%ld] %s\n",
(long) val.bv_len, val.bv_val, 0 );
-#endif
#endif
nval.bv_val = syn->ssyn_oid;
int
do_unbind( Operation *op, SlapReply *rs )
{
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY,
- "do_unbind: conn %d\n", op->o_connid ? op->o_connid : -1, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "do_unbind\n", 0, 0, 0 );
-#endif
/*
* Parse the unbind request. It looks like this:
pwd = getpwnam( user );
did_getpw:
if ( pwd == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "slap_init_user: No passwd entry for user %s\n", user, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "No passwd entry for user %s\n",
user, 0, 0 );
-#endif
exit( EXIT_FAILURE );
}
gid = grp->gr_gid;
did_group:
if ( grp == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "slap_init_user: No group entry for group %s\n", group, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "No group entry for group %s\n",
group, 0, 0 );
-#endif
exit( EXIT_FAILURE );
}
if ( user ) {
if ( getuid() == 0 && initgroups( user, gid ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "slap_init_user: Could not set the group access (gid) list.\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Could not set the group access (gid) list\n", 0, 0, 0 );
-#endif
exit( EXIT_FAILURE );
}
if ( got_gid ) {
if ( setgid( gid ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "slap_init_user: could not set real group id to %d\n",
- (int)gid, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY, "Could not set real group id to %d\n",
(int) gid, 0, 0 );
-#endif
exit( EXIT_FAILURE );
}
#ifdef HAVE_SETEGID
if ( setegid( gid ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "slap_init_user: Could not set effective group id to %d\n",
- (int)gid, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY, "Could not set effective group id to %d\n",
(int) gid, 0, 0 );
-#endif
exit( EXIT_FAILURE );
}
if ( got_uid ) {
if ( setuid( uid ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "slap_init_user: Could not set real user id to %d\n",
- (int)uid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Could not set real user id to %d\n",
(int) uid, 0, 0 );
-#endif
exit( EXIT_FAILURE );
}
#ifdef HAVE_SETEUID
if ( seteuid( uid ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO,
- "slap_init_user: Could not set effective user id to %d\n",
- (int)uid, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Could not set effective user id to %d\n",
(int) uid, 0, 0 );
-#endif
exit( EXIT_FAILURE );
}
*vals = (BerVarray) SLAP_MALLOC( (nn + 1)
* sizeof(struct berval) );
if( *vals == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "value_add: SLAP_MALLOC failed.\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE,
"value_add: SLAP_MALLOC failed.\n", 0, 0, 0 );
-#endif
return LBER_ERROR_MEMORY;
}
n = 0;
*vals = (BerVarray) SLAP_REALLOC( (char *) *vals,
(n + nn + 1) * sizeof(struct berval) );
if( *vals == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "value_add: SLAP_MALLOC failed.\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE,
"value_add: SLAP_MALLOC failed.\n", 0, 0, 0 );
-#endif
return LBER_ERROR_MEMORY;
}
}
if ( *vals == NULL ) {
*vals = (BerVarray) SLAP_MALLOC( 2 * sizeof(struct berval) );
if( *vals == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE,
"value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 );
-#endif
return LBER_ERROR_MEMORY;
}
n = 0;
*vals = (BerVarray) SLAP_REALLOC( (char *) *vals,
(n + 2) * sizeof(struct berval) );
if( *vals == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ERR,
- "value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 );
-#else
Debug(LDAP_DEBUG_TRACE,
"value_add_one: SLAP_MALLOC failed.\n", 0, 0, 0 );
-#endif
return LBER_ERROR_MEMORY;
}
}
cargv_size = ARGS_STEP + 1;
}
-#ifdef NEW_LOGGING
- LDAP_LOG ( CONFIG, ARGS,
- "slurpd_read_config: Config: opening config file \"%s\"\n",
- fname, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONFIG, "Config: opening config file \"%s\"\n",
fname, 0, 0 );
-#endif
if ( (fp = fopen( fname, "r" )) == NULL ) {
perror( fname );
continue;
}
-#ifdef NEW_LOGGING
- LDAP_LOG ( CONFIG, DETAIL1,
- "slurpd_read_config: Config: (%s)\n", line, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONFIG, "Config: (%s)\n", line, 0, 0 );
-#endif
parse_line( line );
int savelineno;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d: missing filename in \"include "
- "<filename>\" line.\n", fname, lineno , 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing filename in \"include <filename>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
} else if ( strcasecmp( cargv[0], "replica-pidfile" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: line %d missing file name in \"replica-pidfile <file>\" "
- "line.\n", fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing file name in \"replica-pidfile <file>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
} else if ( strcasecmp( cargv[0], "replica-argsfile" ) == 0 ) {
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT,
- "%s: %d: missing file name in "
- "\"argsfile <file>\" line.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing file name in \"argsfile <file>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
} else if ( strcasecmp( cargv[0], "replicationinterval" ) == 0 ) {
int c;
if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: %d: missing interval in "
- "\"replicationinterval <seconds>\" line.\n",
- fname, lineno, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: missing interval in "
"\"replicationinterval <seconds>\" line\n",
fname, lineno, 0 );
-#endif
return( 1 );
}
c = atoi( cargv[1] );
if( c < 1 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG( CONFIG, CRIT, "%s: line %d: invalid interval "
- "(%d) in \"replicationinterval <seconds>\" line\n",
- fname, lineno, c );
-#else
Debug( LDAP_DEBUG_ANY, "%s: line %d: invalid interval "
"(%d) in \"replicationinterval <seconds>\" line\n",
fname, lineno, c );
-#endif
return( 1 );
}
}
}
fclose( fp );
-#ifdef NEW_LOGGING
- LDAP_LOG ( CONFIG, RESULTS,
- "slurpd_read_config: Config: "
- "** configuration file successfully read and parsed\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_CONFIG,
"Config: ** configuration file successfully read and parsed\n",
0, 0, 0 );
-#endif
return 0;
}
sglob->replicas[ nr - 1] = NULL;
sglob->num_replicas--;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG ( CONFIG, RESULTS,
- "add_replica: Config: ** successfully added replica \"%s%d\"\n",
- sglob->replicas[ nr - 1 ]->ri_hostname == NULL ?
- "(null)" : sglob->replicas[ nr - 1 ]->ri_hostname,
- sglob->replicas[ nr - 1 ]->ri_port, 0 );
-#else
Debug( LDAP_DEBUG_CONFIG,
"Config: ** successfully added replica \"%s:%d\"\n",
sglob->replicas[ nr - 1 ]->ri_hostname == NULL ?
"(null)" : sglob->replicas[ nr - 1 ]->ri_hostname,
sglob->replicas[ nr - 1 ]->ri_port, 0 );
-#endif
sglob->replicas[ nr - 1]->ri_stel =
sglob->st->st_add( sglob->st,
sglob->replicas[ nr - 1 ] );
while ( !sglob->slurpd_shutdown ) {
if ( file_nonempty( sglob->slapd_replogfile )) {
/* New work found - copy to slurpd replog file */
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ARGS,
- "fm: new work in %s\n", sglob->slapd_replogfile, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "new work in %s\n",
sglob->slapd_replogfile, 0, 0 );
-#endif
if (( rc = copy_replog( sglob->slapd_replogfile,
sglob->slurpd_replogfile )) == 0 ) {
populate_queue( sglob->slurpd_replogfile );
} else {
if ( rc < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, CRIT,
- "fm: Fatal error while copying replication log\n" , 0, 0, 0);
-#else
Debug( LDAP_DEBUG_ANY,
"Fatal error while copying replication log\n",
0, 0, 0 );
-#endif
sglob->slurpd_shutdown = 1;
}
}
FILE *fp, *lfp;
if (( rc = acquire_lock( sglob->slurpd_replogfile, &fp,
&lfp )) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "fm: Error: cannot acquire lock on \"%s\" for trimming\n",
- sglob->slurpd_replogfile, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: cannot acquire lock on \"%s\" for trimming\n",
sglob->slurpd_replogfile, 0, 0 );
-#endif
} else {
sglob->rq->rq_write( sglob->rq, fp );
(void) relinquish_lock( sglob->slurpd_replogfile, fp, lfp );
(sglob->replicas[ i ])->ri_wake( sglob->replicas[ i ]);
}
sglob->rq->rq_unlock( sglob->rq ); /* unlock queue */
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, RESULTS, "fm: exiting\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "fm: exiting\n", 0, 0, 0 );
-#endif
return NULL;
}
char *p;
if ( acquire_lock( f, &fp, &lfp ) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "populate_queue: error: can't lock file \"%s\": %s\n",
- f, sys_errlist[ errno ], 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"error: can't lock file \"%s\": %s\n",
f, sys_errlist[ errno ], 0 );
-#endif
return;
}
* the queue.
*/
if ( fseek( fp, sglob->srpos, 0 ) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "populate_queue: error: can't seek to offset %ld in file \"%s\"\n",
- sglob->srpos, f, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"error: can't seek to offset %ld in file \"%s\"\n",
sglob->srpos, f, 0 );
-#endif
} else {
while (( p = get_record( fp )) != NULL ) {
if ( sglob->rq->rq_add( sglob->rq, p ) < 0 ) {
if (( t = strchr( p, '\n' )) != NULL ) {
*t = '\0';
}
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "populate_queue: error: malformed replog entry "
- "(begins with \"%s\")\n", p, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"error: malformed replog entry (begins with \"%s\")\n",
p, 0, 0 );
-#endif
}
free( p );
ldap_pvt_thread_yield();
case T_ADDCT:
lderr = op_ldap_add( ri, re, errmsg, errfree );
if ( lderr != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_ldap: "
- "Error: ldap_add_s failed adding \"%s\": %s\n",
- *errmsg ? *errmsg : ldap_err2string( lderr ),
- re->re_dn, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: ldap_add_s failed adding \"%s\": %s\n",
*errmsg ? *errmsg : ldap_err2string( lderr ),
re->re_dn, 0 );
-#endif
}
break;
case T_MODIFYCT:
lderr = op_ldap_modify( ri, re, errmsg, errfree );
if ( lderr != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_ldap: "
- "Error: ldap_modify_s failed modifying \"%s\": %s\n",
- *errmsg ? *errmsg : ldap_err2string( lderr ),
- re->re_dn, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: ldap_modify_s failed modifying \"%s\": %s\n",
*errmsg ? *errmsg : ldap_err2string( lderr ),
re->re_dn, 0 );
-#endif
}
break;
case T_DELETECT:
lderr = op_ldap_delete( ri, re, errmsg, errfree );
if ( lderr != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_ldap: "
- "Error: ldap_delete_s failed deleting \"%s\": %s\n",
- *errmsg ? *errmsg : ldap_err2string( lderr ),
- re->re_dn, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: ldap_delete_s failed deleting \"%s\": %s\n",
*errmsg ? *errmsg : ldap_err2string( lderr ),
re->re_dn, 0 );
-#endif
}
break;
case T_MODRDNCT:
lderr = op_ldap_modrdn( ri, re, errmsg, errfree );
if ( lderr != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_ldap: "
- "Error: ldap_modrdn_s failed modifying %s: %s\n",
- *errmsg ? *errmsg : ldap_err2string( lderr ),
- re->re_dn, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: ldap_modrdn_s failed modifying %s: %s\n",
*errmsg ? *errmsg : ldap_err2string( lderr ),
re->re_dn, 0 );
-#endif
}
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_ldap: "
- "Error: bad op \"%d\", dn = \"%s\"\n",
- re->re_changetype, re->re_dn, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: do_ldap: bad op \"%d\", dn = \"%s\"\n",
re->re_changetype, re->re_dn, 0 );
-#endif
return DO_LDAP_ERR_FATAL;
}
ldmarr[ nattrs ] = NULL;
/* Perform the operation */
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ARGS,
- "op_ldap_add: replica %s:%d - add dn \"%s\"\n",
- ri->ri_hostname, ri->ri_port, re->re_dn );
-#else
Debug( LDAP_DEBUG_ARGS, "replica %s:%d - add dn \"%s\"\n",
ri->ri_hostname, ri->ri_port, re->re_dn );
-#endif
rc = ldap_add_s( ri->ri_ldp, re->re_dn, ldmarr );
ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_NUMBER, &lderr);
} else {
*errmsg = "No modifications to do";
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_add: Error: no mods to do (%s)!\n", re->re_dn, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: op_ldap_add: no mods to do (%s)!\n", re->re_dn, 0, 0 );
-#endif
}
free_ldmarr( ldmarr );
return( lderr );
if ( re->re_mods == NULL ) {
*errmsg = "No arguments given";
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_modify: Error: no arguments\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modify: no arguments\n",
0, 0, 0 );
-#endif
return -1;
}
break;
default:
if ( state == AWAITING_OP ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_modify: Error: unknown mod type \"%s\"\n", type, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: op_ldap_modify: unknown mod type \"%s\"\n",
type, 0, 0 );
-#endif
continue;
}
* Construct the mod_bvalues part of the ldapmod struct.
*/
if ( strcasecmp( type, ldm->mod_type )) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_modify: Error: "
- "malformed modify op, %s: %s (expecting \"%s\")\n",
- type, value, ldm->mod_type );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: malformed modify op, %s: %s (expecting %s:)\n",
type, value, ldm->mod_type );
-#endif
continue;
}
ldm->mod_bvalues = ( struct berval ** )
if ( nops > 0 ) {
/* Actually perform the LDAP operation */
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, DETAIL1,
- "op_ldap_modify: replica %s:%d - modify dn \"%s\"\n",
- ri->ri_hostname, ri->ri_port, re->re_dn );
-#else
Debug( LDAP_DEBUG_ARGS, "replica %s:%d - modify dn \"%s\"\n",
ri->ri_hostname, ri->ri_port, re->re_dn );
-#endif
rc = ldap_modify_s( ri->ri_ldp, re->re_dn, ldmarr );
ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg);
*errfree = 1;
{
int rc;
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ARGS,
- "op_ldap_delete: replica %s:%d - delete dn \"%s\"\n",
- ri->ri_hostname, ri->ri_port, re->re_dn );
-#else
Debug( LDAP_DEBUG_ARGS, "replica %s:%d - delete dn \"%s\"\n",
ri->ri_hostname, ri->ri_port, re->re_dn );
-#endif
rc = ldap_delete_s( ri->ri_ldp, re->re_dn );
ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg);
*errfree = 1;
if ( re->re_mods == NULL ) {
*errmsg = "No arguments given";
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_modrdn: Error: no arguments\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: no arguments\n",
0, 0, 0 );
-#endif
return -1;
}
for ( mi = re->re_mods, i = 0; mi[ i ].mi_type != NULL; i++ ) {
if ( !strcmp( mi[ i ].mi_type, T_NEWRDNSTR )) {
if( state & GOT_NEWRDN ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_modrdn: Error: multiple newrdn arg \"%s\"\n",
- mi[ i ].mi_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: op_ldap_modrdn: multiple newrdn arg \"%s\"\n",
mi[ i ].mi_val, 0, 0 );
-#endif
*errmsg = "Multiple newrdn argument";
return -1;
}
} else if ( !strcmp( mi[ i ].mi_type, T_DELOLDRDNSTR )) {
if( state & GOT_DELOLDRDN ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_modrdn: Error: multiple deleteoldrdn arg \"%s\"\n",
- mi[ i ].mi_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: op_ldap_modrdn: multiple deleteoldrdn arg \"%s\"\n",
mi[ i ].mi_val, 0, 0 );
-#endif
*errmsg = "Multiple newrdn argument";
return -1;
}
} else if ( !strcmp( mi[ i ].mi_val, "1" )) {
drdnflag = 1;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_modrdn: Error: bad deleteoldrdn arg \"%s\"\n",
- mi[ i ].mi_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: op_ldap_modrdn: bad deleteoldrdn arg \"%s\"\n",
mi[ i ].mi_val, 0, 0 );
-#endif
*errmsg = "Incorrect argument to deleteoldrdn";
return -1;
}
} else if ( !strcmp( mi[ i ].mi_type, T_NEWSUPSTR )) {
if( state & GOT_NEWSUP ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_modrdn: Error: multiple newsuperior arg \"%s\"\n",
- mi[ i ].mi_val, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: op_ldap_modrdn: multiple newsuperior arg \"%s\"\n",
mi[ i ].mi_val, 0, 0 );
-#endif
*errmsg = "Multiple newsuperior argument";
return -1;
}
state |= GOT_NEWSUP;
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_modrdn: Error: bad type \"%s\"\n",
- mi[ i ].mi_type, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: bad type \"%s\"\n",
mi[ i ].mi_type, 0, 0 );
-#endif
*errmsg = "Bad value in replication log entry";
return -1;
}
* Punt if we don't have all the args.
*/
if ( !GOT_ALL_MODDN(state) ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "op_ldap_modrdn: Error: missing arguments\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: op_ldap_modrdn: missing arguments\n",
0, 0, 0 );
-#endif
*errmsg = "Missing argument: requires \"newrdn\" and \"deleteoldrdn\"";
return -1;
}
buf2 = (char *) ch_malloc( buf2len );
snprintf( buf2, buf2len, "(\"%s\" -> \"%s\")", re->re_dn, mi->mi_val );
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ARGS,
- "op_ldap_modrdn: replica %s - modify rdn %s (flag: %d)\n",
- buf, buf2, drdnflag );
-#else
Debug( LDAP_DEBUG_ARGS,
"replica %s - modify rdn %s (flag: %d)\n",
buf, buf2, drdnflag );
-#endif
free( buf2 );
}
#endif /* LDAP_DEBUG */
if (( ri != NULL ) && ( ri->ri_ldp != NULL )) {
rc = ldap_unbind( ri->ri_ldp );
if ( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "do_unbind: ldap_unbind failed for %s:%d: %s\n",
- ri->ri_hostname, ri->ri_port, ldap_err2string( rc ) );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: do_unbind: ldap_unbind failed for %s:%d: %s\n",
ri->ri_hostname, ri->ri_port, ldap_err2string( rc ) );
-#endif
}
ri->ri_ldp = NULL;
}
*lderr = 0;
if ( ri == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: null ri ptr\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: do_bind: null ri ptr\n", 0, 0, 0 );
-#endif
return( BIND_ERR_BADRI );
}
if ( ri->ri_ldp != NULL ) {
ldrc = ldap_unbind( ri->ri_ldp );
if ( ldrc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "do_bind: ldap_unbind failed: %s\n", ldap_err2string( ldrc ), 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: do_bind: ldap_unbind failed: %s\n",
ldap_err2string( ldrc ), 0, 0 );
-#endif
}
ri->ri_ldp = NULL;
}
if ( ri->ri_uri != NULL ) { /* new URI style */
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ARGS,
- "do_bind: Initializing session to %s\n",
- ri->ri_uri, 0, 0);
-#else
Debug( LDAP_DEBUG_ARGS, "Initializing session to %s\n",
ri->ri_uri, 0, 0 );
-#endif
ldrc = ldap_initialize( &(ri->ri_ldp), ri->ri_uri);
if (ldrc != LDAP_SUCCESS) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "do_bind: ldap_initalize (0, %s) failed: %s\n",
- ri->ri_uri, ldap_err2string(ldrc), 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: ldap_initialize(0, %s) failed: %s\n",
ri->ri_uri, ldap_err2string(ldrc), 0 );
-#endif
return( BIND_ERR_OPEN );
}
} else { /* old HOST style */
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ARGS,
- "do_bind: Initializing session to %s:%d\n",
- ri->ri_hostname, ri->ri_port, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "Initializing session to %s:%d\n",
ri->ri_hostname, ri->ri_port, 0 );
-#endif
ri->ri_ldp = ldap_init( ri->ri_hostname, ri->ri_port );
if ( ri->ri_ldp == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR,
- "do_bind: ldap_init (%s, %d) failed: %s\n",
- ri->ri_hostname, ri->ri_port, sys_errlist[ errno ] );
-#else
Debug( LDAP_DEBUG_ANY, "Error: ldap_init(%s, %d) failed: %s\n",
ri->ri_hostname, ri->ri_port, sys_errlist[ errno ] );
-#endif
return( BIND_ERR_OPEN );
}
}
LDAP_OPT_PROTOCOL_VERSION, &version);
if( err != LDAP_OPT_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: "
- "Error: ldap_set_option(%s, LDAP_OPT_VERSION, 3) failed!\n",
- ri->ri_hostname, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: ldap_set_option(%s, LDAP_OPT_VERSION, 3) failed!\n",
ri->ri_hostname, NULL, NULL );
-#endif
ldap_unbind( ri->ri_ldp );
ri->ri_ldp = NULL;
err = ldap_set_option(ri->ri_ldp, LDAP_OPT_REFERRALS, LDAP_OPT_OFF);
if( err != LDAP_OPT_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: "
- "Error: ldap_set_option(%s, REFERRALS, OFF) failed!\n",
- ri->ri_hostname, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: ldap_set_option(%s,REFERRALS, OFF) failed!\n",
ri->ri_hostname, NULL, NULL );
-#endif
ldap_unbind( ri->ri_ldp );
ri->ri_ldp = NULL;
return BIND_ERR_REFERRALS;
int err = ldap_start_tls_s(ri->ri_ldp, NULL, NULL);
if( err != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: "
- "%s: ldap_start_tls failed: %s (%d)\n",
- ri->ri_tls == TLS_CRITICAL ? "Error" : "Warning",
- ldap_err2string( err ), err );
-#else
Debug( LDAP_DEBUG_ANY,
"%s: ldap_start_tls failed: %s (%d)\n",
ri->ri_tls == TLS_CRITICAL ? "Error" : "Warning",
ldap_err2string( err ), err );
-#endif
if( ri->ri_tls == TLS_CRITICAL ) {
*lderr = err;
/*
* Bind with a plaintext password.
*/
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ARGS,
- "do_bind: bind to %s:%d as %s (simple)\n",
- ri->ri_hostname, ri->ri_port, ri->ri_bind_dn );
-#else
Debug( LDAP_DEBUG_ARGS, "bind to %s:%d as %s (simple)\n",
ri->ri_hostname, ri->ri_port, ri->ri_bind_dn );
-#endif
ldrc = ldap_simple_bind_s( ri->ri_ldp, ri->ri_bind_dn,
ri->ri_password );
if ( ldrc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: "
- "Error: ldap_simple_bind_s for %s:%d failed: %s\n",
- ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ) );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: ldap_simple_bind_s for %s:%d failed: %s\n",
ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ));
-#endif
*lderr = ldrc;
ldap_unbind( ri->ri_ldp );
ri->ri_ldp = NULL;
break;
case LDAP_AUTH_SASL:
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ARGS,
- "do_bind: bind to %s as %s via %s (SASL)\n",
- ri->ri_hostname,
- ri->ri_authcId ? ri->ri_authcId : "-",
- ri->ri_saslmech );
-#else
Debug( LDAP_DEBUG_ARGS, "bind to %s as %s via %s (SASL)\n",
ri->ri_hostname,
ri->ri_authcId ? ri->ri_authcId : "-",
ri->ri_saslmech );
-#endif
#ifdef HAVE_CYRUS_SASL
if( ri->ri_secprops != NULL ) {
LDAP_OPT_X_SASL_SECPROPS, ri->ri_secprops);
if( err != LDAP_OPT_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: "
- "Error: ldap_set_option(%s,SECPROPS,\"%s\") failed!\n",
- ri->ri_hostname, ri->ri_secprops, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: ldap_set_option(%s,SECPROPS,\"%s\") failed!\n",
ri->ri_hostname, ri->ri_secprops, NULL );
-#endif
ldap_unbind( ri->ri_ldp );
ri->ri_ldp = NULL;
return BIND_ERR_SASL_FAILED;
lutil_sasl_freedefs( defaults );
if ( ldrc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: "
- "Error: LDAP SASL for %s:%d failed: %s\n",
- ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ) );
-#else
Debug( LDAP_DEBUG_ANY, "Error: LDAP SASL for %s:%d failed: %s\n",
ri->ri_hostname, ri->ri_port, ldap_err2string( ldrc ));
-#endif
*lderr = ldrc;
ldap_unbind( ri->ri_ldp );
ri->ri_ldp = NULL;
}
}
break;
-#else
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: "
- "Error: do_bind: SASL not supported %s:%d\n",
- ri->ri_hostname, ri->ri_port, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"Error: do_bind: SASL not supported %s:%d\n",
ri->ri_hostname, ri->ri_port, NULL );
-#endif
ldap_unbind( ri->ri_ldp );
ri->ri_ldp = NULL;
return( BIND_ERR_BAD_ATYPE );
#endif
default:
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: "
- "Error: do_bind: unknown auth type \"%d\" for %s:%d\n",
- ri->ri_bind_method, ri->ri_hostname, ri->ri_port );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: do_bind: unknown auth type \"%d\" for %s:%d\n",
ri->ri_bind_method, ri->ri_hostname, ri->ri_port );
-#endif
ldap_unbind( ri->ri_ldp );
ri->ri_ldp = NULL;
return( BIND_ERR_BAD_ATYPE );
err = ldap_set_option(ri->ri_ldp, LDAP_OPT_SERVER_CONTROLS, &ctrls);
if( err != LDAP_OPT_SUCCESS ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, ERR, "do_bind: "
- "ldap_set_option(%s, SERVER_CONTROLS, ManageDSAit) failed!\n",
- ri->ri_hostname, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: "
"ldap_set_option(%s, SERVER_CONTROLS, ManageDSAit) failed!\n",
ri->ri_hostname, NULL, NULL );
-#endif
ldap_unbind( ri->ri_ldp );
ri->ri_ldp = NULL;
return BIND_ERR_MANAGEDSAIT;
for ( i = 0; ldmarr[ i ] != NULL; i++ ) {
ldm = ldmarr[ i ];
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: "
- "Trace (%ld): *** ldmarr[ %d ] contents:\n",
- (long) getpid(), i, 0 );
- LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: "
- "Trace (%ld): *** ldm->mod_op: %d\n",
- (long) getpid(), ldm->mod_op, 0 );
- LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: "
- "Trace (%ld): *** ldm->mod_type: %s\n",
- (long) getpid(), ldm->mod_type, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"Trace (%ld): *** ldmarr[ %d ] contents:\n",
(long) getpid(), i, 0 );
Debug( LDAP_DEBUG_TRACE,
"Trace (%ld): *** ldm->mod_type: %s\n",
(long) getpid(), ldm->mod_type, 0 );
-#endif
if ( ldm->mod_bvalues != NULL ) {
for ( j = 0; ( b = ldm->mod_bvalues[ j ] ) != NULL; j++ ) {
msgbuf = ch_malloc( b->bv_len + 512 );
sprintf( msgbuf, "***** bv[ %d ] len = %ld, val = <%s>",
j, b->bv_len, b->bv_val );
-#ifdef NEW_LOGGING
- LDAP_LOG ( OPERATION, INFO, "dump_ldm_array: "
- "Trace (%ld):%s\n", (long) getpid(), msgbuf, 0 );
-#else
Debug( LDAP_DEBUG_TRACE,
"Trace (%ld):%s\n", (long) getpid(), msgbuf, 0 );
-#endif
free( msgbuf );
}
}
snprintf( buf, sizeof buf, "%s.lock", fname );
if ( (*lfp = fopen( buf, "w" )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "lock_fopen: "
- "Error: could not open \"%s\"\n", buf, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: could not open \"%s\"\n", buf, 0, 0 );
-#endif
return( NULL );
}
/* open the log file */
if ( (fp = fopen( fname, type )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "lock_fopen: "
- "Error: could not open \"%s\"\n", fname, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: could not open \"%s\"\n", fname, 0, 0 );
-#endif
ldap_unlockf( fileno(*lfp) );
fclose( *lfp );
*lfp = NULL;
)
{
if (( *rfp = lock_fopen( file, "r+", lfp )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "acquire_lock: "
- "Error: acquire_lock(%ld): Could not acquire lock on \"%s\"\n",
- (long) getpid(), file, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: acquire_lock(%ld): Could not acquire lock on \"%s\"\n",
(long) getpid(), file, 0);
-#endif
return( -1 );
}
return( 0 );
)
{
if ( lock_fclose( rfp, lfp ) == EOF ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "relinguish_lock: "
- "Error: relinquish_lock (%ld): Error closing \"%s\"\n",
- (long) getpid(), file, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: relinquish_lock (%ld): Error closing \"%s\"\n",
(long) getpid(), file, 0 );
-#endif
return( -1 );
}
return( 0 );
if ( i != NULL )
{
ldap_debug = *i;
-#ifdef NEW_LOGGING
- lutil_log_initialize( argc, argv );
- LDAP_LOG( SLURPD, INFO,
- "main: new debug level from registry is: %d\n",
- ldap_debug, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "new debug level from registry is: %d\n", ldap_debug, 0, 0 );
-#endif
}
newConfigFile = (char*)lutil_getRegParam( regService, "ConfigFile" );
if ( newConfigFile != NULL )
{
sglob->slapd_configfile = newConfigFile;
-#ifdef NEW_LOGGING
- LDAP_LOG( SLURPD, INFO,
- "main: new config file from registry is: %s\n", sglob->slapd_configfile, 0, 0 );
-#else
Debug ( LDAP_DEBUG_ANY, "new config file from registry is: %s\n", sglob->slapd_configfile, 0, 0 );
-#endif
}
}
}
}
-#ifdef NEW_LOGGING
- LDAP_LOG( SLURPD, INFO, "%s\n", Versionstr, 0, 0 );
-#else
Debug ( LDAP_DEBUG_ANY, "%s\n", Versionstr, 0, 0 );
-#endif
/*
* Read slapd config file and initialize Re (per-replica) structs.
if ( ldap_pvt_thread_create( &(sglob->fm_tid),
0, fm, (void *) NULL ) != 0 )
{
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "main: file manager ldap_pvt_thread_create failed\n" , 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "file manager ldap_pvt_thread_create failed\n",
0, 0, 0 );
-#endif
SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 21 );
rc = 1;
goto stop;
ldap_pvt_tls_destroy();
#endif
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, RESULTS, "main: slurpd terminated\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "slurpd: terminated.\n", 0, 0, 0 );
-#endif
if ( slurpd_pid_file != NULL ) {
unlink( slurpd_pid_file );
return 0;
}
if ( re->re_refcnt > 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, WARNING, "Re_free: "
- "Warning: freeing re (dn: %s) with nonzero refcnt\n", re->re_dn, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Warning: freeing re (dn: %s) with nonzero refcnt\n",
re->re_dn, 0, 0 );
-#endif
}
ldap_pvt_thread_mutex_destroy( &re->re_mutex );
int nreplicas;
if ( re == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "Re_parse: Error: re is NULL\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Re_parse: error: re is NULL\n", 0, 0, 0 );
-#endif
return -1;
}
if ( replbuf == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "Re_parse: Error: replbuf is NULL\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Re_parse: error: replbuf is NULL\n", 0, 0, 0 );
-#endif
return -1;
}
}
buflen = strlen( buf );
if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "Re_parse: Error: malformed replog file\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: Re_parse: malformed replog file\n",
0, 0, 0 );
-#endif
return -1;
}
switch ( gettype( type )) {
break;
default:
if ( !( state == GOT_ALL )) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "Re_parse: Error: bad type <%s>\n", type, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: Re_parse: bad type <%s>\n",
type, 0, 0 );
-#endif
free( type );
free( value );
return -1;
}
if ( state != GOT_ALL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "Re_parse: Error: malformed replog file\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: Re_parse: malformed replog file\n",
0, 0, 0 );
-#endif
return -1;
}
value = NULL;
} else {
if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "Re_parse: Error: malformed replog line \"%s\"\n", buf, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: malformed replog line \"%s\"\n",
buf, 0, 0 );
-#endif
return -1;
}
}
rh = (Rh *) ch_realloc((char *) rh, ( nreplicas + 2 ) * sizeof( Rh ));
if ( rh == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "get_repl_hosts: Out of memory\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Out of memory in get_repl_hosts\n",
0, 0, 0 );
-#endif
return NULL;
}
rh[ nreplicas ].rh_hostname = strdup( value );
Mi *mi;
if ( re == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "Re_dump: re is NULL\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "Re_dump: re is NULL\n", 0, 0, 0 );
-#endif
return;
}
fprintf( fp, "Re_dump: ******\n" );
int rc = 0;
if ( re == NULL || fp == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "Re_write: Internal error: NULL argument\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Internal error: Re_write: NULL argument\n",
0, 0, 0 );
-#endif
return -1;
}
}
bad:
if ( rc != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "Re_write: Error while writing: %s\n", sys_errlist[ errno ], 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error while writing: %s\n",
sys_errlist[ errno ], 0, 0 );
-#endif
}
return rc;
}
}
}
if ( !found ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, WARNING, "warn_unknown_replica: "
- "Warning: unknown replica %s:%d found in replication log\n",
- host, port, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Warning: unknown replica %s:%d found in replication log\n",
host, port, 0 );
-#endif
nur++;
ur = (Rh *) ch_realloc( (char *) ur, ( nur * sizeof( Rh )));
ur[ nur - 1 ].rh_hostname = strdup( host );
int rjfd;
if (( rjfd = open( rejfile, O_RDWR|O_APPEND|O_CREAT|O_EXCL,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP )) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "write_reject: "
- "Error: Cannot create \"%s\":%s\n",
- rejfile, sys_errlist[ errno ], 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: write_reject: Cannot create \"%s\": %s\n",
rejfile, sys_errlist[ errno ], 0 );
-#endif
ldap_pvt_thread_mutex_unlock( &sglob->rej_mutex );
return;
} else {
}
}
if (( rc = acquire_lock( rejfile, &rfp, &lfp )) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "write_reject: "
- "Error: Cannot open reject file \"%s\"\n", rejfile, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: cannot open reject file \"%s\"\n",
rejfile, 0, 0 );
-#endif
} else {
fseek( rfp, 0, 2 );
fprintf( rfp, "%s: %s", ERROR_STR, ldap_err2string( lderr ));
}
fprintf( rfp, "\n" );
if ((rc = re->re_write( ri, re, rfp )) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "write_reject: "
- "Error: Cannot write reject file \"%s\"\n", rejfile, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: cannot write reject file \"%s\"\n",
rejfile, 0, 0 );
-#endif
}
(void) relinquish_lock( rejfile, rfp, lfp );
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "write_reject: "
- "Error: ldap operation failed, data written to \"%s\"\n",
- rejfile, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: ldap operation failed, data written to \"%s\"\n",
rejfile, 0, 0 );
-#endif
}
ldap_pvt_thread_mutex_unlock( &sglob->rej_mutex );
return;
{
Ri *ri = (Ri *) ri_arg;
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ARGS, "replicate: "
- "begin replication thread for %s:%d\n",
- ((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "begin replication thread for %s:%d\n",
((Ri *)ri)->ri_hostname, ((Ri *)ri)->ri_port, 0 );
-#endif
ri->ri_process( ri );
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ARGS, "replicate: "
- "begin replication thread for %s:%d\n",
- ri->ri_hostname, ri->ri_port, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "end replication thread for %s:%d\n",
ri->ri_hostname, ri->ri_port, 0 );
-#endif
return NULL;
}
/* POSIX_THREADS or compatible */
if ( ldap_pvt_thread_create( &(ri->ri_tid), 0, replicate,
(void *) ri ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "start_replica_thread: "
- "replica %s:%d ldap_pvt_thread_create failed\n",
- ri->ri_hostname, ri->ri_port, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" ldap_pvt_thread_create failed\n",
ri->ri_hostname, ri->ri_port, 0 );
-#endif
return -1;
}
static char rbuf[ 1024 ];
char *p;
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ARGS, "copy_replog: "
- "copy replog \"%s\" to \"%s\"\n", src, dst, 0 );
-#else
Debug( LDAP_DEBUG_ARGS,
"copy replog \"%s\" to \"%s\"\n",
src, dst, 0 );
-#endif
/*
* Make sure the destination directory is writable. If not, exit
*p = '\0';
}
if ( access( buf, W_OK ) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "copy_replog: "
- "Error: (%ld): Directory %s is not writable\n",
- (long) getpid(), buf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: copy_replog (%ld): Directory %s is not writable\n",
(long) getpid(), buf, 0 );
-#endif
return( -1 );
}
strcpy( buf, dst );
*p = '\0';
}
if ( access( buf, W_OK ) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "copy_replog: "
- "Error: (%ld): Directory %s is not writable\n",
- (long) getpid(), buf, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: copy_replog (%ld): Directory %s is not writable\n",
(long) getpid(), buf, 0 );
-#endif
return( -1 );
}
/* lock src */
rfp = lock_fopen( src, "r", &lfp );
if ( rfp == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "copy_replog: "
- "Error: Can't lock replog \"%s\" for read: %s\n",
- src, sys_errlist[ errno ], 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: copy_replog: Can't lock replog \"%s\" for read: %s\n",
src, sys_errlist[ errno ], 0 );
-#endif
return( 1 );
}
/* lock dst */
dfp = lock_fopen( dst, "a", &dlfp );
if ( dfp == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "copy_replog: Error: Can't lock replog \"%s\" for write: %s\n",
- dst, sys_errlist[ errno ], 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: copy_replog: Can't lock replog \"%s\" for write: %s\n",
dst, sys_errlist[ errno ], 0 );
-#endif
lock_fclose( rfp, lfp );
return( 1 );
}
}
if ( lock_fclose( dfp, dlfp ) == EOF ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR,
- "copy_replog: Error: Error closing \"%s\"\n",
- dst, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: copy_replog: Error closing \"%s\"\n",
dst, 0, 0 );
-#endif
}
if ( lock_fclose( rfp, lfp ) == EOF ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "copy_replog: "
- "Error: Error closing \"%s\"\n", src, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: copy_replog: Error closing \"%s\"\n",
src, 0, 0 );
-#endif
}
return( rc );
}
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
if ( ri == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "Ri_process: "
- "Error: ri == NULL!\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: Ri_process: ri == NULL!\n", 0, 0, 0 );
-#endif
return -1;
}
if ( re != NULL ) {
if ( !ismine( ri, re )) {
/* The Re doesn't list my host:port */
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, DETAIL1, "Ri_process: "
- "Replica %s:%d, skip repl record for %s (not mine)\n",
- ri->ri_hostname, ri->ri_port, re->re_dn );
-#else
Debug( LDAP_DEBUG_TRACE,
"Replica %s:%d, skip repl record for %s (not mine)\n",
ri->ri_hostname, ri->ri_port, re->re_dn );
-#endif
} else if ( !isnew( ri, re )) {
/* This Re is older than my saved status information */
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, DETAIL1, "Ri_process: "
- "Replica %s:%d, skip repl record for %s (old)\n",
- ri->ri_hostname, ri->ri_port, re->re_dn );
-#else
Debug( LDAP_DEBUG_TRACE,
"Replica %s:%d, skip repl record for %s (old)\n",
ri->ri_hostname, ri->ri_port, re->re_dn );
-#endif
} else {
rc = do_ldap( ri, re, &errmsg, &errfree );
switch ( rc ) {
case DO_LDAP_ERR_RETRYABLE:
ldap_pvt_thread_sleep( RETRY_SLEEP_TIME );
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, DETAIL1, "Ri_process: "
- "Retrying operation for DN %s on replica %s:%d\n",
- re->re_dn, ri->ri_hostname, ri->ri_port );
-#else
Debug( LDAP_DEBUG_ANY,
"Retrying operation for DN %s on replica %s:%d\n",
re->re_dn, ri->ri_hostname, ri->ri_port );
-#endif
continue;
break;
case DO_LDAP_ERR_FATAL: {
}
}
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "Ri_process: "
- "Error: re is null in Ri_process\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: re is null in Ri_process\n",
0, 0, 0 );
-#endif
}
rq->rq_lock( rq );
while ( !sglob->slurpd_shutdown &&
}
if ( savedhead->re_getrefcnt( savedhead ) != 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, WARNING, "Rq_delhead: "
- "Warning: attempt to delete when refcnt != 0\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Warning: attempt to delete when refcnt != 0\n",
0, 0, 0 );
-#endif
return( -1 );
}
)
{
if ( rq == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, DETAIL1, "Rq_gc: rq is NULL!\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Rq_gc: rq is NULL!\n", 0, 0, 0 );
-#endif
return;
}
rq->rq_lock( rq );
int tmpfd;
if ( rq == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ARGS, "Rq_dump: rq is NULL!\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Rq_dump: rq is NULL!\n", 0, 0, 0 );
-#endif
return;
}
if (unlink(SLURPD_DUMPFILE) == -1 && errno != ENOENT) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "Rq_dump: "
- "\"%s\" exists, cannot unlink\n", SLURPD_DUMPFILE, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Rq_dump: \"%s\" exists, and cannot unlink\n",
SLURPD_DUMPFILE, 0, 0 );
-#endif
return;
}
if (( tmpfd = open(SLURPD_DUMPFILE, O_CREAT|O_RDWR|O_EXCL, 0600)) == -1) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "Rq_dump: "
- "cannot open \"%s\" for write\n", SLURPD_DUMPFILE, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Rq_dump: cannot open \"%s\" for write\n",
SLURPD_DUMPFILE, 0, 0 );
-#endif
return;
}
if (( fp = fdopen( tmpfd, "w" )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "Rq_dump: "
- "cannot fdopen \"%s\" for write\n", SLURPD_DUMPFILE, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Rq_dump: cannot fdopen \"%s\" for write\n",
SLURPD_DUMPFILE, 0, 0 );
-#endif
return;
}
return -1;
}
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ENTRY, "Rq_write: "
- "re-write on-disk replication log\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "re-write on-disk replication log\n",
0, 0, 0 );
-#endif
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
sglob->srpos = ftell( fp ); /* update replog file position */
/* and truncate to correct len */
if ( ftruncate( fileno( fp ), sglob->srpos ) < 0 ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "Rq_write: "
- "Error truncating replication log: %s\n", sys_errlist[ errno ], 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error truncating replication log: %s\n",
sys_errlist[ errno ], 0, 0 );
-#endif
}
rq->rq_ndel = 0; /* reset count of deleted re's */
time( &now );
if (( rc = acquire_lock( sglob->slurpd_status_file, &(st->st_fp),
&(st->st_lfp))) < 0 ) {
if ( !st->st_err_logged ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "St_write: "
- "Error: cannot open status file \"%s\":%s\n",
- sglob->slurpd_status_file, sys_errlist[ errno ], 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Error: cannot open status file \"%s\": %s\n",
sglob->slurpd_status_file, sys_errlist[ errno ], 0 );
-#endif
st->st_err_logged = 1;
ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
return -1;
* File doesn't exist, so create it and return.
*/
if (( fp = fopen( sglob->slurpd_status_file, "w" )) == NULL ) {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, ERR, "St_write: "
- "Error: cannot create status file \"%s\"\n",
- sglob->slurpd_status_file, 0, 0 );
-#else
Debug( LDAP_DEBUG_ANY, "Error: cannot create status file \"%s\"\n",
sglob->slurpd_status_file, 0, 0 );
-#endif
ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
return -1;
}
(void) fclose( fp );
ldap_pvt_thread_mutex_unlock( &(st->st_mutex ));
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, DETAIL1, "St_write: "
- "No status file found, defaulting values\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS, "No status file found, defaulting values\n",
0, 0, 0 );
-#endif
return 0;
}
if (( rc = acquire_lock( sglob->slurpd_status_file, &fp, &lfp)) < 0 ) {
char tbuf[ 255 ];
sprintf( tbuf, "%s:%s (timestamp %s.%s)", hostname, port,
timestamp, seq );
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, DETAIL1, "St_write: "
- "Retrieved state information for %s\n", tbuf, 0, 0 );
-#else
Debug( LDAP_DEBUG_ARGS,
"Retrieved state information for %s\n", tbuf, 0, 0 );
-#endif
} else {
-#ifdef NEW_LOGGING
- LDAP_LOG ( SLURPD, WARNING, "St_write: "
- "Warning: saved state for %s:%s, not a known replica\n",
- hostname, port, 0 );
-#else
Debug( LDAP_DEBUG_ANY,
"Warning: saved state for %s:%s, not a known replica\n",
hostname, port, 0 );
-#endif
}
}
(void) relinquish_lock( sglob->slurpd_status_file, fp, lfp);