]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
put back chain overlay into back-ldap
authorPierangelo Masarati <ando@openldap.org>
Sun, 9 Jan 2005 21:26:32 +0000 (21:26 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 9 Jan 2005 21:26:32 +0000 (21:26 +0000)
servers/slapd/back-ldap/Makefile.in
servers/slapd/back-ldap/chain.c [moved from servers/slapd/overlays/chain.c with 95% similarity]
servers/slapd/back-ldap/init.c
servers/slapd/overlays/Makefile.in
servers/slapd/overlays/overlays.c

index 2512bd3c3be44880eb408801cdebf8dcd5985bc0..8b05a86db8881cffbde6f4a3753097179659bf0a 100644 (file)
@@ -14,9 +14,9 @@
 ## <http://www.OpenLDAP.org/license.html>.
 
 SRCS   = init.c config.c search.c bind.c unbind.c add.c compare.c \
-               delete.c modify.c modrdn.c extended.c
+               delete.c modify.c modrdn.c extended.c chain.c
 OBJS   = init.lo config.lo search.lo bind.lo unbind.lo add.lo compare.lo \
-               delete.lo modify.lo modrdn.lo extended.lo
+               delete.lo modify.lo modrdn.lo extended.lo chain.lo
 
 LDAP_INCDIR= ../../../include       
 LDAP_LIBDIR= ../../../libraries
similarity index 95%
rename from servers/slapd/overlays/chain.c
rename to servers/slapd/back-ldap/chain.c
index bc703da8cb776a760f07a9ce274cf26a31ab8aeb..a580c52ff4bd4b4258bc07c08d7ac6cbc57b990a 100644 (file)
 
 #include "portable.h"
 
-#if defined(SLAPD_LDAP) 
-
-#ifdef SLAPD_OVER_CHAIN
-
 #include <stdio.h>
 
 #include <ac/string.h>
 #include <ac/socket.h>
 
 #include "slap.h"
-#include "../back-ldap/back-ldap.h"
+#include "back-ldap.h"
 
 static BackendInfo *lback;
 
@@ -388,7 +384,7 @@ end_of_searchref:;
 }
 
 static int
-ldap_chain_config(
+ldap_chain_db_config(
        BackendDB       *be,
        const char      *fname,
        int             lineno,
@@ -416,7 +412,7 @@ ldap_chain_config(
 }
 
 static int
-ldap_chain_init(
+ldap_chain_db_init(
        BackendDB *be
 )
 {
@@ -424,6 +420,14 @@ ldap_chain_init(
        void *private = be->be_private;
        int rc;
 
+       if ( lback == NULL ) {
+               lback = backend_info( "ldap" );
+
+               if ( lback == NULL ) {
+                       return -1;
+               }
+       }
+
        be->be_private = NULL;
        rc = lback->bi_db_init( be );
        on->on_bi.bi_private = be->be_private;
@@ -433,7 +437,7 @@ ldap_chain_init(
 }
 
 static int
-ldap_chain_destroy(
+ldap_chain_db_destroy(
        BackendDB *be
 )
 {
@@ -451,18 +455,12 @@ ldap_chain_destroy(
 static slap_overinst ldapchain;
 
 int
-chain_init()
+chain_init( void )
 {
-       lback = backend_info( "ldap" );
-
-       if ( !lback ) {
-               return -1;
-       }
-
        ldapchain.on_bi.bi_type = "chain";
-       ldapchain.on_bi.bi_db_init = ldap_chain_init;
-       ldapchain.on_bi.bi_db_config = ldap_chain_config;
-       ldapchain.on_bi.bi_db_destroy = ldap_chain_destroy;
+       ldapchain.on_bi.bi_db_init = ldap_chain_db_init;
+       ldapchain.on_bi.bi_db_config = ldap_chain_db_config;
+       ldapchain.on_bi.bi_db_destroy = ldap_chain_db_destroy;
        
        /* ... otherwise the underlying backend's function would be called,
         * likely passing an invalid entry; on the contrary, the requested
@@ -483,12 +481,3 @@ chain_init()
        return overlay_register( &ldapchain );
 }
 
-#if SLAPD_OVER_CHAIN == SLAPD_MOD_DYNAMIC
-int init_module(int argc, char *argv[]) {
-       return chain_init();
-}
-#endif /* SLAPD_OVER_CHAIN == SLAPD_MOD_DYNAMIC */
-
-#endif /* SLAPD_OVER_CHAIN */
-
-#endif /* ! defined(SLAPD_LDAP) */
index f3ebb20da237aeded222288ef49d2f0f43ccae05..90604606f066b6d8aaa8339c259ec10d81cd3cd2 100644 (file)
@@ -70,6 +70,10 @@ ldap_back_initialize( BackendInfo *bi )
        bi->bi_connection_init = 0;
        bi->bi_connection_destroy = ldap_back_conn_destroy;
 
+       if ( chain_init( ) ) {
+               return -1;
+       }
+
        return 0;
 }
 
index e40ed9971e24dc973e736907f3a178943fe2a95a..9f95972edc29e1c6eed49e797d7890c39224122e 100644 (file)
@@ -14,7 +14,6 @@
 ## <http://www.OpenLDAP.org/license.html>.
 
 SRCS = overlays.c \
-       chain.c \
        denyop.c \
        dyngroup.c \
        glue.c \
@@ -26,7 +25,6 @@ SRCS = overlays.c \
        syncprov.c \
        unique.c
 OBJS = overlays.lo \
-       chain.lo \
        denyop.lo \
        dyngroup.lo \
        glue.lo \
@@ -53,9 +51,6 @@ PROGRAMS = @SLAPD_DYNAMIC_OVERLAYS@
 XINCPATH = -I.. -I$(srcdir)/..
 XDEFS = $(MODULES_CPPFLAGS)
 
-chain.la : chain.lo $(@PLAT@_LINK_LIBS)
-       $(LTLINK_MOD) -module -o $@ chain.lo version.lo $(LINK_LIBS)
-
 denyop.la : denyop.lo $(@PLAT@_LINK_LIBS)
        $(LTLINK_MOD) -module -o $@ denyop.lo version.lo $(LINK_LIBS)
 
index 632bff232b5ab04fcc9951749a1f43fa4a0e890c..3e73167b208b315af15cafa3c1b8e23e3caa6959 100644 (file)
@@ -23,9 +23,6 @@
 
 #include "slap.h"
 
-#if SLAPD_OVER_CHAIN == SLAPD_MOD_STATIC
-extern int chain_init();
-#endif
 #if SLAPD_OVER_DENYOP == SLAPD_MOD_STATIC
 extern int denyop_init();
 #endif
@@ -61,9 +58,6 @@ static struct {
        char *name;
        int (*func)();
 } funcs[] = {
-#if SLAPD_OVER_CHAIN == SLAPD_MOD_STATIC
-       { "LDAP Chain Response", chain_init },
-#endif
 #if SLAPD_OVER_DENYOP == SLAPD_MOD_STATIC
        { "Deny Operation", denyop_init },
 #endif