]> git.sur5r.net Git - openldap/commitdiff
ITS#3747 move subschemasubentry attr initialization
authorHoward Chu <hyc@openldap.org>
Tue, 24 May 2005 17:06:33 +0000 (17:06 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 24 May 2005 17:06:33 +0000 (17:06 +0000)
servers/slapd/bconfig.c
servers/slapd/config.c

index d16e88edc4d6d58e3db0c0b8d5d5d1895a3f30cb..d8726ff9f481946f6ef346dc91a1aa7b9c125883 100644 (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;
 }
 
index 0627cc8c36b65107b37d192af44ea7360a301718..980e2ab105cb38b1010798cf84938dfd53d01917 100644 (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: