From 12733ab92fbcc31ebd8e7ffdbf2a66c8158b6766 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 27 Sep 2005 15:10:57 +0000 Subject: [PATCH] ITS#3996 fix glue/syncprov interaction --- servers/slapd/backglue.c | 7 ++----- servers/slapd/init.c | 9 +++++++++ servers/slapd/main.c | 2 +- servers/slapd/proto-slap.h | 1 + servers/slapd/slapcommon.c | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/servers/slapd/backglue.c b/servers/slapd/backglue.c index 29a781102f..db732652a4 100644 --- a/servers/slapd/backglue.c +++ b/servers/slapd/backglue.c @@ -837,7 +837,7 @@ typedef struct glue_Addrec { static glue_Addrec *ga_list; /* Attach all the subordinate backends to their superior */ -static int +int glue_sub_attach() { glue_Addrec *ga, *gnext = NULL; @@ -939,8 +939,5 @@ glue_sub_init() glue.on_bi.bi_chk_referrals = glue_chk_referrals; glue.on_bi.bi_chk_controls = glue_chk_controls; - rc = overlay_register( &glue ); - if ( rc ) return rc; - - return glue_sub_attach(); + return overlay_register( &glue ); } diff --git a/servers/slapd/init.c b/servers/slapd/init.c index 6b45897308..ab5f17b7a7 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -216,6 +216,15 @@ slap_init( int mode, const char *name ) return 1; } + if ( glue_sub_init() ) { + ldap_debug |= 1; + Debug( LDAP_DEBUG_ANY, + "%s: glue/subordinate init failed\n", + name, 0, 0 ); + + return 1; + } + if ( acl_init() ) { ldap_debug |= 1; Debug( LDAP_DEBUG_ANY, diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 81fbed49f4..3f9b948f77 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -631,7 +631,7 @@ unhandled_option:; } } - if ( glue_sub_init( ) != 0 ) { + if ( glue_sub_attach( ) != 0 ) { Debug( LDAP_DEBUG_ANY, "subordinate config error\n", 0, 0, 0 ); diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 5261751f7f..e110c3865f 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -395,6 +395,7 @@ LDAP_SLAPD_V(BackendInfo) slap_binfo[]; */ LDAP_SLAPD_F (int) glue_sub_init( void ); +LDAP_SLAPD_F (int) glue_sub_attach( void ); LDAP_SLAPD_F (int) glue_sub_add( BackendDB *be, int advert, int online ); LDAP_SLAPD_F (int) glue_sub_del( BackendDB *be ); diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index bbdb5bb3e3..eb82e2da38 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -424,7 +424,7 @@ slap_tool_init( break; } - rc = glue_sub_init(); + rc = glue_sub_attach(); if ( rc != 0 ) { fprintf( stderr, "%s: subordinate configuration error\n", progname ); -- 2.39.5