]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/config.c
Add BackendInfo.bi_extra for backend custom APIs
[openldap] / servers / slapd / config.c
index e467df82e37743384ca740418f33cf59186de50d..70a5a6375fd80a2ec5e1f84b364f30289ff7b293 100644 (file)
@@ -509,6 +509,10 @@ init_config_attrs(ConfigTable *ct) {
                        fprintf( stderr, "init_config_attrs: AttributeType \"%s\": %s\n",
                                ct[i].attribute, err );
                        return code;
+               } else {
+#ifndef LDAP_DEVEL
+                       ct[i].ad->ad_type->sat_flags |= SLAP_AT_HIDE;
+#endif
                }
        }
 
@@ -539,10 +543,14 @@ init_config_ocs( ConfigOCs *ocs ) {
                        return code;
                }
                ocs[i].co_oc = oc_find(oc->oc_names[0]);
-               if ( code )
+               if ( code ) {
                        ldap_objectclass_free(oc);
-               else
+               } else {
                        ldap_memfree(oc);
+#ifndef LDAP_DEVEL
+                       ocs[i].co_oc->soc_flags |= SLAP_OC_HIDE;
+#endif
+               }
        }
        return 0;
 }
@@ -1044,8 +1052,15 @@ static slap_verbmasks methkey[] = {
        { BER_BVNULL, 0 }
 };
 
+static slap_verbmasks versionkey[] = {
+       { BER_BVC("2"),         LDAP_VERSION2 },
+       { BER_BVC("3"),         LDAP_VERSION3 },
+       { BER_BVNULL, 0 }
+};
+
 static slap_cf_aux_table bindkey[] = {
        { BER_BVC("uri="), offsetof(slap_bindconf, sb_uri), 'b', 1, NULL },
+       { BER_BVC("version="), offsetof(slap_bindconf, sb_version), 'd', 0, versionkey },
        { BER_BVC("bindmethod="), offsetof(slap_bindconf, sb_method), 'd', 0, methkey },
        { BER_BVC("binddn="), offsetof(slap_bindconf, sb_binddn), 'b', 1, NULL },
        { BER_BVC("credentials="), offsetof(slap_bindconf, sb_cred), 'b', 1, NULL },
@@ -1408,7 +1423,7 @@ int bindconf_tls_set( slap_bindconf *bc, LDAP *ld )
  * note: should move "version" into bindconf...
  */
 int
-slap_client_connect( LDAP **ldp, slap_bindconf *sb, int version )
+slap_client_connect( LDAP **ldp, slap_bindconf *sb )
 {
        LDAP            *ld = NULL;
        int             rc;
@@ -1423,9 +1438,9 @@ slap_client_connect( LDAP **ldp, slap_bindconf *sb, int version )
                return rc;
        }
 
-       if ( version != 0 ) {
+       if ( sb->sb_version != 0 ) {
                ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION,
-                       (const void *)&version );
+                       (const void *)&sb->sb_version );
        }
 
 #ifdef HAVE_TLS