ITS#3747 move subschemasubentry attr initialization

This commit is contained in:
Howard Chu 2005-05-24 17:06:33 +00:00
parent 2f0d712492
commit 5f5356567e
2 changed files with 18 additions and 14 deletions

View File

@ -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;
}

View File

@ -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: