From f5e6d1db410c11b26dfe5ef2e5563f51e136c830 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 29 Sep 2002 04:30:38 +0000 Subject: [PATCH] #unifdef -DSCHEMA_DN --- servers/slapd/add.c | 2 -- servers/slapd/at.c | 6 ------ servers/slapd/backend.c | 3 +-- servers/slapd/compare.c | 2 -- servers/slapd/config.c | 9 +-------- servers/slapd/delete.c | 4 ---- servers/slapd/modify.c | 2 -- servers/slapd/modrdn.c | 2 -- servers/slapd/mr.c | 4 ---- servers/slapd/oc.c | 7 ------- servers/slapd/operational.c | 2 -- servers/slapd/proto-slap.h | 2 -- servers/slapd/schema.c | 3 --- servers/slapd/search.c | 5 +---- servers/slapd/slap.h | 3 +-- servers/slapd/syntax.c | 3 --- 16 files changed, 4 insertions(+), 55 deletions(-) diff --git a/servers/slapd/add.c b/servers/slapd/add.c index a907872273..85e6f7ca50 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -188,13 +188,11 @@ do_add( Connection *conn, Operation *op ) NULL, NULL ); goto done; -#if defined( SLAPD_SCHEMA_DN ) } else if ( bvmatch( &e->e_nname, &global_schemandn ) ) { send_ldap_result( conn, op, rc = LDAP_ALREADY_EXISTS, NULL, "subschema subentry already exists", NULL, NULL ); goto done; -#endif } manageDSAit = get_manageDSAit( op ); diff --git a/servers/slapd/at.c b/servers/slapd/at.c index 5b59674b5e..7d2f6e1892 100644 --- a/servers/slapd/at.c +++ b/servers/slapd/at.c @@ -580,7 +580,6 @@ at_index_print( void ) } #endif -#if defined( SLAPD_SCHEMA_DN ) int at_schema_info( Entry *e ) { @@ -598,13 +597,8 @@ at_schema_info( Entry *e ) if( at->sat_flags & SLAP_AT_HIDE ) continue; -#if 0 - Debug( LDAP_DEBUG_TRACE, "Merging at [%ld] %s\n", - (long) vals[0].bv_len, vals[0].bv_val, 0 ); -#endif attr_merge( e, ad_attributeTypes, vals ); ldap_memfree( vals[0].bv_val ); } return 0; } -#endif diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index b5405dd351..23ee665e88 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -1104,13 +1104,12 @@ Attribute *backend_operational( * and the backend supports specific operational attributes, * add them to the attribute list */ -#ifdef SLAPD_SCHEMA_DN if ( opattrs || ( attrs && ad_inlist( slap_schema.si_ad_subschemaSubentry, attrs )) ) { *ap = slap_operational_subschemaSubentry( be ); ap = &(*ap)->a_next; } -#endif + if ( ( opattrs || attrs ) && be && be->be_operational != NULL ) { ( void )be->be_operational( be, conn, op, e, attrs, opattrs, ap ); } diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index 61a8f6882e..7934821fd4 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -169,7 +169,6 @@ do_compare( goto cleanup; } -#ifdef SLAPD_SCHEMA_DN } else if ( bvmatch( &ndn, &global_schemandn ) ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ARGS, @@ -199,7 +198,6 @@ do_compare( rc = 0; goto cleanup; } -#endif /* SLAPD_SCHEMA_DN */ } if( entry ) { diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 14b092b19c..5a58e83baf 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -52,10 +52,8 @@ char **cargv; struct berval default_search_base = { 0, NULL }; struct berval default_search_nbase = { 0, NULL }; unsigned num_subordinates = 0; -#ifdef SLAPD_SCHEMA_DN struct berval global_schemadn = { 0, NULL }; struct berval global_schemandn = { 0, NULL }; -#endif ber_len_t sockbuf_max_incoming = SLAP_SB_MAX_INCOMING_DEFAULT; ber_len_t sockbuf_max_incoming_auth= SLAP_SB_MAX_INCOMING_AUTH; @@ -568,7 +566,6 @@ read_config( const char *fname, int depth ) return 1; #endif /* HAVE_CYRUS_SASL */ -#ifdef SLAPD_SCHEMA_DN } else if ( strcasecmp( cargv[0], "schemadn" ) == 0 ) { struct berval dn; if ( cargc < 2 ) { @@ -603,7 +600,7 @@ read_config( const char *fname, int depth ) #endif return 1; } -#endif /* SLAPD_SCHEMA_DN */ + /* set UCDATA path */ } else if ( strcasecmp( cargv[0], "ucdata-path" ) == 0 ) { int err; @@ -2301,13 +2298,11 @@ read_config( const char *fname, int depth ) if ( depth == 0 ) ch_free( cargv ); -#ifdef SLAPD_SCHEMA_DN if ( !global_schemadn.bv_val ) { ber_str2bv( SLAPD_SCHEMA_DN, sizeof(SLAPD_SCHEMA_DN)-1, 1, &global_schemadn ); dnNormalize2( NULL, &global_schemadn, &global_schemandn ); } -#endif if ( load_ucdata( NULL ) < 0 ) return 1; return( 0 ); @@ -2528,10 +2523,8 @@ void config_destroy( ) { ucdata_unload( UCDATA_ALL ); -#ifdef SLAPD_SCHEMA_DN free( global_schemandn.bv_val ); free( global_schemadn.bv_val ); -#endif free( line ); if ( slapd_args_file ) free ( slapd_args_file ); diff --git a/servers/slapd/delete.c b/servers/slapd/delete.c index 057206c269..97f073e1b9 100644 --- a/servers/slapd/delete.c +++ b/servers/slapd/delete.c @@ -102,8 +102,6 @@ do_delete( NULL, "cannot delete the root DSE", NULL, NULL ); goto cleanup; -#ifdef SLAPD_SCHEMA_DN - } else if ( bvmatch( &ndn, &global_schemandn ) ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, INFO, "do_delete: conn %d: " @@ -115,8 +113,6 @@ do_delete( send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM, NULL, "cannot delete the root DSE", NULL, NULL ); goto cleanup; - -#endif } Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu DEL dn=\"%s\"\n", diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 799aefee93..0f0c716375 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -204,7 +204,6 @@ do_modify( NULL, "modify upon the root DSE not supported", NULL, NULL ); goto cleanup; -#if defined( SLAPD_SCHEMA_DN ) } else if ( bvmatch( &ndn, &global_schemandn ) ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ERR, @@ -217,7 +216,6 @@ do_modify( NULL, "modification of subschema subentry not supported", NULL, NULL ); goto cleanup; -#endif } #ifdef LDAP_DEBUG diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index 7c8b4390bf..372f0a33e8 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -201,7 +201,6 @@ do_modrdn( NULL, "cannot rename the root DSE", NULL, NULL ); goto cleanup; -#ifdef SLAPD_SCHEMA_DN } else if ( bvmatch( &ndn, &global_schemandn ) ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ERR, @@ -215,7 +214,6 @@ do_modrdn( send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM, NULL, "cannot rename subschema subentry", NULL, NULL ); goto cleanup; -#endif } /* FIXME: should have/use rdnPretty / rdnNormalize routines */ diff --git a/servers/slapd/mr.c b/servers/slapd/mr.c index 701c646c18..069b72b370 100644 --- a/servers/slapd/mr.c +++ b/servers/slapd/mr.c @@ -447,8 +447,6 @@ int mr_usable_with_at( return 0; } -#if defined( SLAPD_SCHEMA_DN ) - int mr_schema_info( Entry *e ) { MatchingRule *mr; @@ -506,5 +504,3 @@ int mru_schema_info( Entry *e ) } return 0; } - -#endif diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index 1920762bc9..16a64ebf51 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -466,7 +466,6 @@ oc_add( } #ifdef LDAP_DEBUG - static void oc_print( ObjectClass *oc ) { @@ -489,12 +488,8 @@ oc_print( ObjectClass *oc ) printf( "\n" ); } } - #endif - -#if defined( SLAPD_SCHEMA_DN ) - int oc_schema_info( Entry *e ) { @@ -521,5 +516,3 @@ oc_schema_info( Entry *e ) } return 0; } - -#endif diff --git a/servers/slapd/operational.c b/servers/slapd/operational.c index f6b45221f8..3eca598b57 100644 --- a/servers/slapd/operational.c +++ b/servers/slapd/operational.c @@ -12,7 +12,6 @@ * helpers for on-the-fly operational attribute generation */ -#ifdef SLAPD_SCHEMA_DN Attribute * slap_operational_subschemaSubentry( Backend *be ) { @@ -34,7 +33,6 @@ slap_operational_subschemaSubentry( Backend *be ) return a; } -#endif /* SLAPD_SCHEMA_DN */ Attribute * slap_operational_hasSubordinate( int hs ) diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index c77416108b..74f2b2655b 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -1073,10 +1073,8 @@ LDAP_SLAPD_V (int) ldap_syslog; LDAP_SLAPD_V (struct berval) default_search_base; LDAP_SLAPD_V (struct berval) default_search_nbase; -#ifdef SLAPD_SCHEMA_DN LDAP_SLAPD_V (struct berval) global_schemadn; LDAP_SLAPD_V (struct berval) global_schemandn; -#endif LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) num_sent_mutex; LDAP_SLAPD_V (unsigned long) num_bytes_sent; diff --git a/servers/slapd/schema.c b/servers/slapd/schema.c index 452a679ff2..bc218fcca8 100644 --- a/servers/slapd/schema.c +++ b/servers/slapd/schema.c @@ -18,8 +18,6 @@ #include "lutil.h" -#if defined( SLAPD_SCHEMA_DN ) - int schema_info( Entry **entry, const char **text ) { @@ -128,4 +126,3 @@ schema_info( Entry **entry, const char **text ) *entry = e; return LDAP_SUCCESS; } -#endif diff --git a/servers/slapd/search.c b/servers/slapd/search.c index fada8cb8cd..9b4492ea11 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -234,10 +234,8 @@ do_search( } rc = root_dse_info( conn, &entry, &text ); - } -#if defined( SLAPD_SCHEMA_DN ) - else if ( bvmatch( &nbase, &global_schemandn ) ) { + } else if ( bvmatch( &nbase, &global_schemandn ) ) { /* check restrictions */ rc = backend_check_restrictions( NULL, conn, op, NULL, &text ) ; if( rc != LDAP_SUCCESS ) { @@ -248,7 +246,6 @@ do_search( rc = schema_info( &entry, &text ); } -#endif if( rc != LDAP_SUCCESS ) { send_ldap_result( conn, op, rc, diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index d018a3e836..d5f42a69bf 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -248,6 +248,7 @@ typedef union slap_sockaddr { struct sockaddr sa_addr; struct sockaddr_in sa_in_addr; #ifdef LDAP_PF_INET6 + struct sockaddr_storage sa_storage; struct sockaddr_in6 sa_in6_addr; #endif #ifdef LDAP_PF_LOCAL @@ -1276,10 +1277,8 @@ struct slap_backend_db { BerVarray be_suffix; /* the DN suffixes of data in this backend */ BerVarray be_nsuffix; /* the normalized DN suffixes in this backend */ BerVarray be_suffixAlias; /* pairs of DN suffix aliases and deref values */ -#ifdef SLAPD_SCHEMA_DN struct berval be_schemadn; /* per-backend subschema subentry DN */ struct berval be_schemandn; /* normalized subschema DN */ -#endif struct berval be_rootdn; /* the magic "root" name (DN) for this db */ struct berval be_rootndn; /* the magic "root" normalized name (DN) for this db */ struct berval be_rootpw; /* the magic "root" password for this db */ diff --git a/servers/slapd/syntax.c b/servers/slapd/syntax.c index 994761b92c..2c1bc91f6d 100644 --- a/servers/slapd/syntax.c +++ b/servers/slapd/syntax.c @@ -188,8 +188,6 @@ register_syntax( return( 0 ); } -#if defined( SLAPD_SCHEMA_DN ) - int syn_schema_info( Entry *e ) { @@ -230,4 +228,3 @@ syn_schema_info( Entry *e ) return 0; } -#endif -- 2.39.5