]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/config.c
fix ITS#3753
[openldap] / servers / slapd / config.c
index fc42f496612ac0a3ff4484a9369686e3cd27a586..980e2ab105cb38b1010798cf84938dfd53d01917 100644 (file)
@@ -464,9 +464,7 @@ init_config_ocs( ConfigOCs *ocs ) {
                                ocs[i].co_def, scherr2str(code), err );
                        return code;
                }
-               if ( ocs[i].co_oc ) {
-                       *ocs[i].co_oc = oc_find(oc->oc_names[0]);
-               }
+               ocs[i].co_oc = oc_find(oc->oc_names[0]);
                ldap_memfree(oc);
        }
        return 0;
@@ -600,9 +598,9 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf, ConfigTable *cft)
                                goto leave;
                        }
                        
-               } else if ( c->bi ) {
+               } else if ( c->bi && !c->be ) {
                        rc = SLAP_CONF_UNKNOWN;
-                       if ( c->bi->bi_cf_ocs->co_table ) {
+                       if ( c->bi->bi_cf_ocs ) {
                                ct = config_find_keyword( c->bi->bi_cf_ocs->co_table, c );
                                if ( ct ) {
                                        rc = config_add_vals( ct, c );
@@ -688,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:
@@ -747,6 +733,21 @@ mask_to_verbs(slap_verbmasks *v, slap_mask_t m, BerVarray *bva) {
        return 0;
 }
 
+int
+enum_to_verb(slap_verbmasks *v, slap_mask_t m, struct berval *bv) {
+       int i;
+
+       for (i=0; !BER_BVISNULL(&v[i].word); i++) {
+               if ( m == v[i].mask ) {
+                       if ( bv != NULL ) {
+                               *bv = v[i].word;
+                       }
+                       return i;
+               }
+       }
+       return -1;
+}
+
 static slap_verbmasks tlskey[] = {
        { BER_BVC("no"),        SB_TLS_OFF },
        { BER_BVC("yes"),       SB_TLS_ON },
@@ -755,9 +756,7 @@ static slap_verbmasks tlskey[] = {
 };
 
 static slap_verbmasks methkey[] = {
-#if 0
        { BER_BVC("none"),      LDAP_AUTH_NONE },
-#endif
        { BER_BVC("simple"),    LDAP_AUTH_SIMPLE },
 #ifdef HAVE_CYRUS_SASL
        { BER_BVC("sasl"),      LDAP_AUTH_SASL },