mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#3748 do necessary startup when adding databases online
This commit is contained in:
parent
47daec07d5
commit
b6d515330c
@ -968,11 +968,20 @@ config_generic(ConfigArgs *c) {
|
||||
c->be = LDAP_STAILQ_FIRST(&backendDB);
|
||||
} else if ( !strcasecmp( c->argv[1], "frontend" )) {
|
||||
c->be = frontendDB;
|
||||
} else if(!(c->be = backend_db_init(c->argv[1]))) {
|
||||
sprintf( c->msg, "<%s> failed init", c->argv[0] );
|
||||
Debug(LDAP_DEBUG_ANY, "%s: %s (%s)!\n",
|
||||
c->log, c->msg, c->argv[1] );
|
||||
return(1);
|
||||
} else {
|
||||
c->be = backend_db_init(c->argv[1]);
|
||||
if ( !c->be ) {
|
||||
sprintf( c->msg, "<%s> failed init", c->argv[0] );
|
||||
Debug(LDAP_DEBUG_ANY, "%s: %s (%s)!\n",
|
||||
c->log, c->msg, c->argv[1] );
|
||||
return(1);
|
||||
}
|
||||
if ( CONFIG_ONLINE_ADD(c) && backend_startup_one( c->be )) {
|
||||
sprintf( c->msg, "<%s> failed startup", c->argv[0] );
|
||||
Debug(LDAP_DEBUG_ANY, "%s: %s (%s)!\n",
|
||||
c->log, c->msg, c->argv[1] );
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -139,6 +139,11 @@ typedef struct config_args_s {
|
||||
ConfigDriver *cleanup;
|
||||
} ConfigArgs;
|
||||
|
||||
/* If lineno is zero, we have an actual LDAP Add request from a client.
|
||||
* Otherwise, we're reading a config file or a config dir.
|
||||
*/
|
||||
#define CONFIG_ONLINE_ADD(ca) (!((ca)->lineno))
|
||||
|
||||
#define value_int values.v_int
|
||||
#define value_long values.v_long
|
||||
#define value_ber_t values.v_ber_t
|
||||
|
Loading…
Reference in New Issue
Block a user