]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_check.c
Bug fix for new sockbuf code under NT. Added mutex protection against
[openldap] / servers / slapd / schema_check.c
index 5ada57b7bcdfbc0b8bba23e4c54c5bc82670c56b..d1c00935c31ff32fea0427985b83de765acf6dd4 100644 (file)
 #include "slap.h"
 #include "ldap_pvt.h"
 
-#ifdef SLAPD_SCHEMA_NOT_COMPAT
-static int oc_check_allowed(
-       AttributeType *type,
-       struct berval **oclist );
-#else
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
 static int             oc_check_allowed(char *type, struct berval **oclist);
 #endif
 static char *  oc_check_required(Entry *e, struct berval *ocname);
@@ -45,6 +41,7 @@ entry_schema_check(
 #else
        static const char *ad_objectClass = "objectclass";
 #endif
+       int extensible = 0;
 
        if( !global_schemacheck ) return LDAP_SUCCESS;
 
@@ -78,6 +75,16 @@ entry_schema_check(
                                ret = LDAP_OBJECT_CLASS_VIOLATION;
                                break;
                        }
+
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                       if( oc == slap_schema.si_oc_extensibleObject )
+#else
+                       if( !strcmp( aoc->a_vals[i], "extensibleObject" ) == 0 )
+#endif
+                       {
+                               extensible=1;
+                       }
+
                }
        }
 
@@ -85,6 +92,10 @@ entry_schema_check(
            return ret;
        }
 
+       if( extensible ) {
+               return LDAP_SUCCESS;
+       }
+
        /* check that each attr in the entry is allowed by some oc */
        for ( a = e->e_attrs; a != NULL; a = a->a_next ) {
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
@@ -181,8 +192,10 @@ oc_check_required( Entry *e, struct berval *ocname )
        return( NULL );
 }
 
-static int
-oc_check_allowed(
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
+static
+#endif
+int oc_check_allowed(
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
        AttributeType *at,
 #else