put back chain overlay into back-ldap

This commit is contained in:
Pierangelo Masarati 2005-01-09 21:26:32 +00:00
parent 28b18b1869
commit 154ae48d69
5 changed files with 22 additions and 40 deletions

View 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

View File

@ -21,17 +21,13 @@
#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) */

View 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;
}

View 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)

View 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