From 40badfc6640fd2c3335a1ad834f18c2e341aaf4f Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 30 Jul 2005 12:20:52 +0000 Subject: [PATCH] fix conditional compilation of config schema --- servers/slapd/bconfig.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 419282c4e4..2307a8716c 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -573,21 +573,25 @@ static ConfigTable config_back_cf_table[] = { static ConfigLDAPadd cfAddSchema, cfAddInclude, cfAddDatabase, cfAddBackend, cfAddModule, cfAddOverlay; +/* NOTE: be careful when defining array members + * that can be conditionally compiled */ #define CFOC_GLOBAL cf_ocs[1] #define CFOC_SCHEMA cf_ocs[2] #define CFOC_BACKEND cf_ocs[3] #define CFOC_DATABASE cf_ocs[4] #define CFOC_OVERLAY cf_ocs[5] #define CFOC_INCLUDE cf_ocs[6] -#define CFOC_MODULE cf_ocs[7] -#define CFOC_FRONTEND cf_ocs[8] +#define CFOC_FRONTEND cf_ocs[7] +#ifdef SLAPD_MODULES +#define CFOC_MODULE cf_ocs[8] +#endif /* SLAPD_MODULES */ static ConfigOCs cf_ocs[] = { - { "( OLcfgGlOc:1 " + { "( OLcfgGlOc:0 " "NAME 'olcConfig' " "DESC 'OpenLDAP configuration object' " "ABSTRACT SUP top )", Cft_Abstract, NULL }, - { "( OLcfgGlOc:2 " + { "( OLcfgGlOc:1 " "NAME 'olcGlobal' " "DESC 'OpenLDAP Global configuration options' " "SUP olcConfig STRUCTURAL " @@ -613,19 +617,19 @@ static ConfigOCs cf_ocs[] = { "olcTLSRandFile $ olcTLSVerifyClient $ " "olcObjectIdentifier $ olcAttributeTypes $ olcObjectClasses $ " "olcDitContentRules ) )", Cft_Global }, - { "( OLcfgGlOc:3 " + { "( OLcfgGlOc:2 " "NAME 'olcSchemaConfig' " "DESC 'OpenLDAP schema object' " "SUP olcConfig STRUCTURAL " "MAY ( cn $ olcObjectIdentifier $ olcAttributeTypes $ " "olcObjectClasses $ olcDitContentRules ) )", Cft_Schema, NULL, cfAddSchema }, - { "( OLcfgGlOc:4 " + { "( OLcfgGlOc:3 " "NAME 'olcBackendConfig' " "DESC 'OpenLDAP Backend-specific options' " "SUP olcConfig STRUCTURAL " "MUST olcBackend )", Cft_Backend, NULL, cfAddBackend }, - { "( OLcfgGlOc:5 " + { "( OLcfgGlOc:4 " "NAME 'olcDatabaseConfig' " "DESC 'OpenLDAP Database-specific options' " "SUP olcConfig STRUCTURAL " @@ -636,36 +640,36 @@ static ConfigOCs cf_ocs[] = { "olcSchemaDN $ olcSecurity $ olcSizeLimit $ olcSyncrepl $ " "olcTimeLimit $ olcUpdateDN $ olcUpdateRef ) )", Cft_Database, NULL, cfAddDatabase }, - { "( OLcfgGlOc:6 " + { "( OLcfgGlOc:5 " "NAME 'olcOverlayConfig' " "DESC 'OpenLDAP Overlay-specific options' " "SUP olcConfig STRUCTURAL " "MUST olcOverlay )", Cft_Overlay, NULL, cfAddOverlay }, - { "( OLcfgGlOc:7 " + { "( OLcfgGlOc:6 " "NAME 'olcIncludeFile' " "DESC 'OpenLDAP configuration include file' " "SUP olcConfig STRUCTURAL " "MUST olcInclude " "MAY ( cn $ olcRootDSE ) )", Cft_Include, NULL, cfAddInclude }, -#ifdef SLAPD_MODULES - { "( OLcfgGlOc:8 " - "NAME 'olcModuleList' " - "DESC 'OpenLDAP dynamic module info' " - "SUP olcConfig STRUCTURAL " - "MAY ( cn $ olcModulePath $ olcModuleLoad ) )", - Cft_Module, NULL, cfAddModule }, -#endif /* This should be STRUCTURAL like all the other database classes, but * that would mean inheriting all of the olcDatabaseConfig attributes, * which causes them to be merged twice in config_build_entry. */ - { "( OLcfgGlOc:9 " + { "( OLcfgGlOc:7 " "NAME 'olcFrontendConfig' " "DESC 'OpenLDAP frontend configuration' " "AUXILIARY " "MAY olcDefaultSearchBase )", Cft_Database, NULL, NULL }, +#ifdef SLAPD_MODULES + { "( OLcfgGlOc:8 " + "NAME 'olcModuleList' " + "DESC 'OpenLDAP dynamic module info' " + "SUP olcConfig STRUCTURAL " + "MAY ( cn $ olcModulePath $ olcModuleLoad ) )", + Cft_Module, NULL, cfAddModule }, +#endif { NULL, 0, NULL } }; -- 2.39.5