mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
ITS#5925, allow online glue_sub_attach to be deferred
This commit is contained in:
parent
37b19874e9
commit
1861632db1
@ -942,6 +942,14 @@ glue_tool_sync (
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef struct glue_Addrec {
|
||||
struct glue_Addrec *ga_next;
|
||||
BackendDB *ga_be;
|
||||
} glue_Addrec;
|
||||
|
||||
/* List of added subordinates */
|
||||
static glue_Addrec *ga_list;
|
||||
|
||||
static int
|
||||
glue_db_init(
|
||||
BackendDB *be,
|
||||
@ -994,6 +1002,9 @@ glue_db_init(
|
||||
|
||||
SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLUE_INSTANCE;
|
||||
|
||||
if ( ga_list )
|
||||
glue_sub_attach( 1 );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1068,17 +1079,10 @@ glue_sub_del( BackendDB *b0 )
|
||||
return rc;
|
||||
}
|
||||
|
||||
typedef struct glue_Addrec {
|
||||
struct glue_Addrec *ga_next;
|
||||
BackendDB *ga_be;
|
||||
} glue_Addrec;
|
||||
|
||||
/* List of added subordinates */
|
||||
static glue_Addrec *ga_list;
|
||||
|
||||
/* Attach all the subordinate backends to their superior */
|
||||
int
|
||||
glue_sub_attach()
|
||||
glue_sub_attach( int online )
|
||||
{
|
||||
glue_Addrec *ga, *gnext = NULL;
|
||||
int rc = 0;
|
||||
@ -1127,6 +1131,11 @@ glue_sub_attach()
|
||||
if ( !be ) {
|
||||
Debug( LDAP_DEBUG_ANY, "glue: no superior found for sub %s!\n",
|
||||
ga->ga_be->be_suffix[0].bv_val, 0, 0 );
|
||||
/* allow this for now, assume a superior will
|
||||
* be added later
|
||||
*/
|
||||
if ( online )
|
||||
return 0;
|
||||
rc = LDAP_NO_SUCH_OBJECT;
|
||||
}
|
||||
ch_free( ga );
|
||||
@ -1160,7 +1169,7 @@ glue_sub_add( BackendDB *be, int advert, int online )
|
||||
ga_list = ga;
|
||||
|
||||
if ( online )
|
||||
rc = glue_sub_attach();
|
||||
rc = glue_sub_attach( online );
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
@ -792,7 +792,7 @@ unhandled_option:;
|
||||
}
|
||||
}
|
||||
|
||||
if ( glue_sub_attach( ) != 0 ) {
|
||||
if ( glue_sub_attach( 0 ) != 0 ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"subordinate config error\n",
|
||||
0, 0, 0 );
|
||||
|
@ -426,7 +426,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_attach( int online );
|
||||
LDAP_SLAPD_F (int) glue_sub_add( BackendDB *be, int advert, int online );
|
||||
LDAP_SLAPD_F (int) glue_sub_del( BackendDB *be );
|
||||
|
||||
|
@ -564,7 +564,7 @@ slap_tool_init(
|
||||
}
|
||||
|
||||
if ( use_glue ) {
|
||||
rc = glue_sub_attach();
|
||||
rc = glue_sub_attach( 0 );
|
||||
|
||||
if ( rc != 0 ) {
|
||||
fprintf( stderr,
|
||||
|
Loading…
Reference in New Issue
Block a user