From: Howard Chu Date: Thu, 5 May 2005 20:55:35 +0000 (+0000) Subject: Fix global entry setup X-Git-Tag: OPENLDAP_AC_BP~728 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4107187eccefe136533662b0129f6e2d16f877d7;p=openldap Fix global entry setup --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index dc8f429b71..71b9f6570c 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -1609,6 +1609,14 @@ config_rootdn(ConfigArgs *c) { static int config_rootpw(ConfigArgs *c) { Backend *tbe; + /* config_add_internal leaves c->be NULL for the global entry, but + * the parser stuffs frontendDB in instead. While the cn=config + * rootpw is technically inside a backend, we expose it in the + * global entry, and need to point to it properly here. + */ + if (c->be == frontendDB) + c->be = LDAP_STAILQ_FIRST(&backendDB); + if (c->op == SLAP_CONFIG_EMIT) { if (!BER_BVISEMPTY(&c->be->be_rootpw)) { ber_dupbv( &c->value_bv, &c->be->be_rootpw); @@ -2949,11 +2957,12 @@ config_add_internal( CfBackInfo *cfb, Entry *e, SlapReply *rs, int *renum ) /* The cn=schema entry is all hardcoded, so never reparse it */ if (last->ce_type == Cft_Global ) goto ok; - /* FALLTHRU */ - ca.private = ch_calloc( 1, sizeof(ConfigFile) ); - cfn = ca.private; + cfn = ch_calloc( 1, sizeof(ConfigFile) ); + ca.private = cfn; + break; case Cft_Global: - ca.be = LDAP_STAILQ_FIRST(&backendDB); + cfn = &cf_prv; + ca.private = cfn; break; case Cft_Backend: