]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_prep.c
More CLDAP tweaks, to differentiate between real LDAPv2 CLDAP and "other"
[openldap] / servers / slapd / schema_prep.c
index 57df22771a2e5ab162655ff67d62561ed7463e92..16efb4c1ee26f02cf4db075b8e149b479e08f31a 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "slap.h"
 #include "ldap_pvt.h"
+#include "ldap_pvt_uc.h"
 
 int schema_init_done = 0;
 
@@ -26,7 +27,7 @@ struct slap_internal_schema slap_schema;
 static int
 objectClassMatch(
        int *matchp,
-       unsigned flags,
+       slap_mask_t flags,
        Syntax *syntax,
        MatchingRule *mr,
        struct berval *value,
@@ -59,8 +60,15 @@ objectClassMatch(
        }
 
 #if 0
+#ifdef NEW_LOGGING
+       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
+                  "objectClassMatch(%s, %s) = %d\n",
+                  value->bv_val, a->bv_val, *matchp ));
+#else
        Debug( LDAP_DEBUG_TRACE, "objectClassMatch(%s,%s) = %d\n",
                value->bv_val, a->bv_val, *matchp );
+#endif
+
 #endif
 
        return LDAP_SUCCESS;
@@ -72,7 +80,7 @@ objectClassMatch(
 static int
 structuralObjectClassMatch(
        int *matchp,
-       unsigned flags,
+       slap_mask_t flags,
        Syntax *syntax,
        MatchingRule *mr,
        struct berval *value,
@@ -101,8 +109,15 @@ structuralObjectClassMatch(
        *matchp = ( asserted != oc );
 
 #if 0
+#ifdef NEW_LOGGING
+       LDAP_LOG(( "schema", LDAP_LEVEL_ENTRY,
+                  "structuralObjectClassMatch( %s, %s ) = %d\n",
+                  value->bv_val, a->bv_val, *matchp ));
+#else
        Debug( LDAP_DEBUG_TRACE, "structuralObjectClassMatch(%s,%s) = %d\n",
                value->bv_val, a->bv_val, *matchp );
+#endif
+
 #endif
 
        return LDAP_SUCCESS;
@@ -160,6 +175,8 @@ struct slap_schema_ad_map {
                offsetof(struct slap_internal_schema, si_ad_supportedLDAPVersion) },
        { "supportedSASLMechanisms", NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_supportedSASLMechanisms) },
+       { "supportedFeatures", NULL, NULL, NULL,
+               offsetof(struct slap_internal_schema, si_ad_supportedFeatures) },
 
        /* subschema subentry attributes */
        { "attributeTypes", NULL, NULL, NULL,
@@ -199,6 +216,17 @@ struct slap_schema_ad_map {
        { NULL, NULL, NULL, NULL, 0 }
 };
 
+static AttributeType slap_at_undefined = {
+       "UNDEFINED", /* cname */
+       { "1.1.1", NULL, NULL, 1, NULL,
+               NULL, NULL, NULL, NULL,
+               0, 0, 0, 1, 3 },
+       NULL, /* sup */
+       NULL, /* subtypes */
+       NULL, NULL, NULL, NULL, /* matching rules */
+       NULL, /* syntax (this may need to be defined) */
+       NULL  /* next */
+};
 
 int
 schema_prep( void )
@@ -245,6 +273,14 @@ schema_prep( void )
                }
        }
 
+       slap_at_undefined.sat_syntax = syn_find( SLAPD_OCTETSTRING_SYNTAX );
+       if( slap_at_undefined.sat_syntax == NULL ) {
+               fprintf( stderr,
+                       "No octetString syntax \"" SLAPD_OCTETSTRING_SYNTAX "\"\n" );
+               return LDAP_INVALID_SYNTAX;
+       }
+       slap_schema.si_at_undefined = &slap_at_undefined;
+
        ++schema_init_done;
        return LDAP_SUCCESS;
 }