]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_prep.c
Fix strchrlen running past end of berval
[openldap] / servers / slapd / schema_prep.c
index 9cc8b5118df647000081e17c312212f48786da65..881ca16251e8569b3733b3da87b5b9c5db0d473d 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -545,13 +545,13 @@ static struct slap_schema_ad_map {
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_entryDN) },
-       { "entryUUID", "( 1.3.6.1.4.1.4203.666.1.6 NAME 'entryUUID' "   
+       { "entryUUID", "( 1.3.6.1.1.16.4 NAME 'entryUUID' "   
                        "DESC 'UUID of the entry' "
                        "EQUALITY UUIDMatch "
                        "ORDERING UUIDOrderingMatch "
-                       "SYNTAX 1.3.6.1.4.1.4203.666.2.6 "
+                       "SYNTAX 1.3.6.1.1.16.1 "
                        "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
-               NULL, SLAP_AT_HIDE|SLAP_AT_MANAGEABLE,
+               NULL, SLAP_AT_MANAGEABLE,
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_entryUUID) },
@@ -579,8 +579,9 @@ static struct slap_schema_ad_map {
 #ifdef LDAP_SUPERIOR_UUID
        { "superiorUUID", "( 1.3.6.1.4.1.4203.666.1.11 NAME 'superiorUUID' "   
                        "DESC 'UUID of the superior entry' "
-                       "EQUALITY octetStringMatch "
-                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
+                       "EQUALITY UUIDMatch "
+                       "ORDERING UUIDOrderingMatch "
+                       "SYNTAX 1.3.6.1.1.16.1 "
                        "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
                NULL, SLAP_AT_HIDE,
                NULL, NULL,
@@ -854,16 +855,9 @@ static struct slap_schema_ad_map {
        { "authzTo", "( 1.3.6.1.4.1.4203.666.1.8 "
                        "NAME ( 'authzTo' 'saslAuthzTo' ) "
                        "DESC 'proxy authorization targets' "
-#ifdef SLAP_AUTHZ_SYNTAX
                        "EQUALITY authzMatch "
                        "SYNTAX 1.3.6.1.4.1.4203.666.2.7 "
-#else /* ! SLAP_AUTHZ_SYNTAX */
-                       "EQUALITY caseExactMatch "
-                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
-#endif /* ! SLAP_AUTHZ_SYNTAX */
-#ifdef SLAP_ORDERED_PRETTYNORM
                        "X-ORDERED 'VALUES' "
-#endif /* SLAP_ORDERED_PRETTYNORM */
                        "USAGE distributedOperation )",
                NULL, SLAP_AT_HIDE,
                NULL, NULL,
@@ -872,16 +866,9 @@ static struct slap_schema_ad_map {
        { "authzFrom", "( 1.3.6.1.4.1.4203.666.1.9 "
                        "NAME ( 'authzFrom' 'saslAuthzFrom' ) "
                        "DESC 'proxy authorization sources' "
-#ifdef SLAP_AUTHZ_SYNTAX
                        "EQUALITY authzMatch "
                        "SYNTAX 1.3.6.1.4.1.4203.666.2.7 "
-#else /* ! SLAP_AUTHZ_SYNTAX */
-                       "EQUALITY caseExactMatch "
-                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
-#endif /* ! SLAP_AUTHZ_SYNTAX */
-#ifdef SLAP_ORDERED_PRETTYNORM
                        "X-ORDERED 'VALUES' "
-#endif /* SLAP_ORDERED_PRETTYNORM */
                        "USAGE distributedOperation )",
                NULL, SLAP_AT_HIDE,
                NULL, NULL,
@@ -893,7 +880,7 @@ static struct slap_schema_ad_map {
                        "DESC 'RFC2589: entry time-to-live' "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE "
                        "NO-USER-MODIFICATION USAGE dSAOperation )",
-               dynamicAttribute, 0,
+               dynamicAttribute, SLAP_AT_MANAGEABLE,
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_entryTtl) },
@@ -942,10 +929,10 @@ static struct slap_schema_ad_map {
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_uid) },
-       { "uidNumber", /* for ldapi:// "
+       { "uidNumber", /* for ldapi:// */
                "( 1.3.6.1.1.1.1.0 NAME 'uidNumber' "
                "DESC 'An integer uniquely identifying a user "
-                               in an administrative domain' "
+                               "in an administrative domain' "
                "EQUALITY integerMatch "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )",
                NULL, 0,
@@ -955,9 +942,9 @@ static struct slap_schema_ad_map {
        { "gidNumber", /* for ldapi:// */
                "( 1.3.6.1.1.1.1.1 NAME 'gidNumber' "
                "DESC 'An integer uniquely identifying a group "
-                               in an administrative domain' "
-               "EQUALITY integerMatch"
-               "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )"
+                               "in an administrative domain' "
+               "EQUALITY integerMatch "
+               "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )",
                NULL, 0,
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
@@ -1201,11 +1188,13 @@ slap_schema_load( void )
                                fprintf( stderr, "slap_schema_load: "
                                        "AttributeType \"%s\": no OID\n",
                                        ad_map[i].ssam_name );
+                               ldap_attributetype_free( at );
                                return LDAP_OTHER;
                        }
 
                        code = at_add( at, 0, NULL, &err );
                        if ( code ) {
+                               ldap_attributetype_free( at );
                                fprintf( stderr, "slap_schema_load: AttributeType "
                                        "\"%s\": %s: \"%s\"\n",
                                         ad_map[i].ssam_name, scherr2str(code), err );
@@ -1315,18 +1304,20 @@ slap_schema_load( void )
                                fprintf( stderr, "slap_schema_load: ObjectClass "
                                        "\"%s\": no OID\n",
                                        oc_map[i].ssom_name );
+                               ldap_objectclass_free( oc );
                                return LDAP_OTHER;
                        }
 
                        code = oc_add(oc,0,NULL,&err);
                        if ( code ) {
+                               ldap_objectclass_free( oc );
                                fprintf( stderr, "slap_schema_load: ObjectClass "
                                        "\"%s\": %s: \"%s\"\n",
                                        oc_map[i].ssom_name, scherr2str(code), err);
                                return code;
                        }
-
                        ldap_memfree(oc);
+
                }
                {
                        ObjectClass ** ocp = (ObjectClass **)