ITS#8859 Allow backends which do not need a database to work

This commit is contained in:
Nadezhda Ivanova 2018-05-21 15:45:21 +01:00 committed by Ondřej Kuzník
parent d10fc664f7
commit 33876e22d6
3 changed files with 7 additions and 2 deletions

View file

@ -1702,6 +1702,10 @@ config_generic(ConfigArgs *c) {
c->log, c->cr_msg, c->argv[1] );
return(1);
}
if ( c->bi->bi_flags & SLAP_BFLAG_STANDALONE ) {
c->bi->bi_nDB++;
nbackends++;
}
break;
case CFG_DATABASE:
@ -7217,7 +7221,7 @@ config_back_db_open( BackendDB *be, ConfigReply *cr )
}
continue;
}
if (!bi->bi_private) continue;
if ( !bi->bi_private && !(bi->bi_flags & SLAP_BFLAG_STANDALONE) ) continue;
rdn.bv_val = c.log;
rdn.bv_len = snprintf(rdn.bv_val, sizeof( c.log ),

View file

@ -835,7 +835,7 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft)
goto done;
}
} else if ( c->bi && !c->be ) {
} else if ( ( c->bi && !c->be ) || ( c->bi && c->bi->bi_flags & SLAP_BFLAG_STANDALONE ) ) {
rc = SLAP_CONF_UNKNOWN;
if ( c->bi->bi_cf_ocs ) {
ct = config_find_keyword( c->bi->bi_cf_ocs->co_table, c );

View file

@ -2345,6 +2345,7 @@ struct BackendInfo {
#define SLAP_BFLAG_REFERRALS 0x2000U
#define SLAP_BFLAG_SUBENTRIES 0x4000U
#define SLAP_BFLAG_DYNAMIC 0x8000U
#define SLAP_BFLAG_STANDALONE 0x10000U /* started up regardless of whether any databases use it */
/* overlay specific */
#define SLAPO_BFLAG_SINGLE 0x01000000U