mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-29 02:59:34 -05:00
#unifdef -DSCHEMA_DN
This commit is contained in:
parent
b3906fc99d
commit
f5e6d1db41
16 changed files with 4 additions and 55 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue