From: Howard Chu Date: Tue, 24 May 2005 17:06:33 +0000 (+0000) Subject: ITS#3747 move subschemasubentry attr initialization X-Git-Tag: OPENLDAP_AC_BP~602 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5f5356567ebb1096987bfbfb6c05801c0e509422;p=openldap ITS#3747 move subschemasubentry attr initialization --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index d16e88edc4..d8726ff9f4 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -2567,8 +2567,10 @@ read_config(const char *fname, const char *dir) { return 1; /* If we read the config from back-ldif, nothing to do here */ - if ( cfb->cb_got_ldif ) - return 0; + if ( cfb->cb_got_ldif ) { + rc = 0; + goto done; + } } if ( fname ) @@ -2599,6 +2601,20 @@ read_config(const char *fname, const char *dir) { } break; } + +done: + if ( rc == 0 && BER_BVISNULL( &frontendDB->be_schemadn ) ) { + ber_str2bv( SLAPD_SCHEMA_DN, STRLENOF( SLAPD_SCHEMA_DN ), 1, + &frontendDB->be_schemadn ); + rc = dnNormalize( 0, NULL, NULL, &frontendDB->be_schemadn, &frontendDB->be_schemandn, NULL ); + if ( rc != LDAP_SUCCESS ) { + Debug(LDAP_DEBUG_ANY, "read_config: " + "unable to normalize default schema DN \"%s\"\n", + frontendDB->be_schemadn.bv_val, 0, 0 ); + /* must not happen */ + assert( 0 ); + } + } return rc; } diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 0627cc8c36..980e2ab105 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -686,18 +686,6 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft) } } - if ( BER_BVISNULL( &frontendDB->be_schemadn ) ) { - ber_str2bv( SLAPD_SCHEMA_DN, STRLENOF( SLAPD_SCHEMA_DN ), 1, - &frontendDB->be_schemadn ); - rc = dnNormalize( 0, NULL, NULL, &frontendDB->be_schemadn, &frontendDB->be_schemandn, NULL ); - if ( rc != LDAP_SUCCESS ) { - Debug(LDAP_DEBUG_ANY, "%s: " - "unable to normalize default schema DN \"%s\"\n", - c->log, frontendDB->be_schemadn.bv_val, 0 ); - /* must not happen */ - assert( 0 ); - } - } rc = 0; leave: