]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#7074 - change olcDatabaseDummy initialization for windows
authorEmily Backes <ebackes@symas.com>
Fri, 6 Feb 2015 02:46:24 +0000 (18:46 -0800)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 2 Apr 2020 20:43:03 +0000 (20:43 +0000)
servers/slapd/back-ldap/chain.c
servers/slapd/overlays/pcache.c
servers/slapd/overlays/translucent.c

index ec685adea06682338af99a2b5b798e120768a87e..0f7bedae0397fc31a1eb52c9d6be084c3eb3678c 100644 (file)
@@ -1278,7 +1278,7 @@ static ConfigOCs chainocs[] = {
                "NAME 'olcChainDatabase' "
                "DESC 'Chain remote server configuration' "
                "AUXILIARY )",
-               Cft_Misc, olcDatabaseDummy, chain_ldadd
+               Cft_Misc, NULL, chain_ldadd
 #ifdef SLAP_CONFIG_DELETE
                , NULL, chain_lddel
 #endif
@@ -2314,6 +2314,12 @@ chain_initialize( void )
        /* Make sure we don't exceed the bits reserved for userland */
        config_check_userland( CH_LAST );
 
+       /* olcDatabaseDummy is defined in slapd, and Windows
+          will not let us initialize a struct element with a data pointer
+          from another library, so we have to initialize this element
+          "by hand".  */
+       chainocs[1].co_table = olcDatabaseDummy;
+
 #ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
        rc = register_supported_control( LDAP_CONTROL_X_CHAINING_BEHAVIOR,
                        /* SLAP_CTRL_GLOBAL| */ SLAP_CTRL_ACCESS|SLAP_CTRL_HIDE, NULL,
index f88ca09b3855347475e5367b0ca7632841ba3bc1..7efe70502783154fdd48efee2b1424358411af46 100644 (file)
@@ -3750,7 +3750,8 @@ static ConfigOCs pcocs[] = {
        { "( OLcfgOvOc:2.2 "
                "NAME 'olcPcacheDatabase' "
                "DESC 'Cache database configuration' "
-               "AUXILIARY )", Cft_Misc, olcDatabaseDummy, pc_ldadd },
+               /* co_table is initialized in pcache_initialize */
+               "AUXILIARY )", Cft_Misc, NULL, pc_ldadd },
        { NULL, 0, NULL }
 };
 
@@ -5671,6 +5672,13 @@ pcache_initialize()
        ConfigArgs c;
        char *argv[ 4 ];
 
+        /* olcDatabaseDummy is defined in slapd, and Windows
+           will not let us initialize a struct element with a data pointer
+           from another library, so we have to initialize this element
+           "by hand".  */
+        pcocs[1].co_table = olcDatabaseDummy;
+
+
        code = slap_loglevel_get( &debugbv, &pcache_debug );
        if ( code ) {
                return code;
index c7881384168745f442cc93c99faf1c7a046f45d7..fdf34d247ce13664e53205e4991658051b114b8c 100644 (file)
@@ -107,7 +107,8 @@ static ConfigOCs translucentocs[] = {
        { "( OLcfgOvOc:14.2 "
          "NAME 'olcTranslucentDatabase' "
          "DESC 'Translucent target database configuration' "
-         "AUXILIARY )", Cft_Misc, olcDatabaseDummy, translucent_ldadd },
+       /* co_table is initialized in translucent_initialize() */
+         "AUXILIARY )", Cft_Misc, NULL, translucent_ldadd },
        { NULL, 0, NULL }
 };
 /* for translucent_init() */
@@ -1382,6 +1383,12 @@ int translucent_initialize() {
 
        int rc;
 
+       /* olcDatabaseDummy is defined in slapd, and Windows
+          will not let us initialize a struct element with a data pointer
+          from another library, so we have to initialize this element
+          "by hand".  */
+       translucentocs[1].co_table = olcDatabaseDummy;
+
        Debug(LDAP_DEBUG_TRACE, "==> translucent_initialize\n", 0, 0, 0);
 
        translucent.on_bi.bi_type       = "translucent";