]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_prep.c
declare oc_bvfind_undef()
[openldap] / servers / slapd / schema_prep.c
index 594338144cdc93ee9623be151482890021ad85a0..948e8d1486f80a3324610226f2ec4abe50cad22f 100644 (file)
@@ -23,8 +23,6 @@
 #include <ac/socket.h>
 
 #include "slap.h"
-#include "ldap_pvt.h"
-#include "ldap_pvt_uc.h"
 
 #define OCDEBUG 0
 
@@ -57,33 +55,26 @@ oidValidate(
                }
 
        } else {
+               int sep = 0;
                while( OID_LEADCHAR( val.bv_val[0] ) ) {
-                       if ( val.bv_len == 1 ) {
-                               return LDAP_SUCCESS;
-                       }
-
-                       /* FIXME: the OID of 'dc' and other attributeTypes
-                        * starts with '0'! */
-                       if ( val.bv_val[0] == '0' && !OID_SEPARATOR( val.bv_val[1] ) ) {
-                               break;
-                       }
-
                        val.bv_val++;
                        val.bv_len--;
 
-                       while ( OID_LEADCHAR( val.bv_val[0] )) {
-                               val.bv_val++;
-                               val.bv_len--;
-
-                               if ( val.bv_len == 0 ) {
-                                       return LDAP_SUCCESS;
+                       if ( val.bv_val[-1] != '0' ) {
+                               while ( OID_LEADCHAR( val.bv_val[0] )) {
+                                       val.bv_val++;
+                                       val.bv_len--;
                                }
                        }
 
-                       if( !OID_SEPARATOR( val.bv_val[0] )) {
-                               break;
+                       if( val.bv_len == 0 ) {
+                               if( sep == 0 ) break;
+                               return LDAP_SUCCESS;
                        }
 
+                       if( !OID_SEPARATOR( val.bv_val[0] )) break;
+
+                       sep++;
                        val.bv_val++;
                        val.bv_len--;
                }
@@ -502,7 +493,7 @@ static struct slap_schema_ad_map {
                        "EQUALITY booleanMatch "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 "
                        "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
-               NULL, 0,
+               NULL, SLAP_AT_DYNAMIC,
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_hasSubordinates) },
@@ -511,7 +502,7 @@ static struct slap_schema_ad_map {
                        "EQUALITY distinguishedNameMatch "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE "
                        "NO-USER-MODIFICATION USAGE directoryOperation )",
-               NULL, 0,
+               NULL, SLAP_AT_DYNAMIC,
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_subschemaSubentry) },
@@ -535,6 +526,15 @@ static struct slap_schema_ad_map {
                offsetof(struct slap_internal_schema, si_ad_collectiveExclusions) },
 #endif
 
+       { "entryDN", "( 1.3.6.1.4.1.4203.666.1.33 NAME 'entryDN' "   
+                       "DESC 'DN of the entry' "
+                       "EQUALITY distinguishedNameMatch "
+                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
+                       "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
+               NULL, SLAP_AT_HIDE|SLAP_AT_DYNAMIC,
+               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' "   
                        "DESC 'UUID of the entry' "
                        "EQUALITY UUIDMatch "
@@ -547,9 +547,9 @@ static struct slap_schema_ad_map {
                offsetof(struct slap_internal_schema, si_ad_entryUUID) },
        { "entryCSN", "( 1.3.6.1.4.1.4203.666.1.7 NAME 'entryCSN' "
                        "DESC 'change sequence number of the entry content' "
-                       "EQUALITY octetStringMatch "
-                       "ORDERING octetStringOrderingMatch "
-                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
+                       "EQUALITY CSNMatch "
+                       "ORDERING CSNOrderingMatch "
+                       "SYNTAX 1.3.6.1.4.1.4203.666.11.2.1{64} "
                        "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
                NULL, SLAP_AT_HIDE,
                NULL, NULL,
@@ -557,15 +557,16 @@ static struct slap_schema_ad_map {
                offsetof(struct slap_internal_schema, si_ad_entryCSN) },
        { "namingCSN", "( 1.3.6.1.4.1.4203.666.1.13 NAME 'namingCSN' "
                        "DESC 'change sequence number of the entry naming (RDN)' "
-                       "EQUALITY octetStringMatch "
-                       "ORDERING octetStringOrderingMatch "
-                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
+                       "EQUALITY CSNMatch "
+                       "ORDERING CSNOrderingMatch "
+                       "SYNTAX 1.3.6.1.4.1.4203.666.11.2.1{64} "
                        "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
                NULL, SLAP_AT_HIDE,
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_namingCSN) },
 
+#if 0
        { "superiorUUID", "( 1.3.6.1.4.1.4203.666.1.11 NAME 'superiorUUID' "   
                        "DESC 'UUID of the superior entry' "
                        "EQUALITY octetStringMatch "
@@ -575,6 +576,7 @@ static struct slap_schema_ad_map {
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_superiorUUID) },
+#endif
 
        { "syncreplCookie", "( 1.3.6.1.4.1.4203.666.1.23 "
                        "NAME 'syncreplCookie' "
@@ -591,9 +593,9 @@ static struct slap_schema_ad_map {
        { "contextCSN", "( 1.3.6.1.4.1.4203.666.1.25 "
                        "NAME 'contextCSN' "
                        "DESC 'the largest committed CSN of a context' "
-                       "EQUALITY octetStringMatch "
-                       "ORDERING octetStringOrderingMatch "
-                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 "
+                       "EQUALITY CSNMatch "
+                       "ORDERING CSNOrderingMatch "
+                       "SYNTAX 1.3.6.1.4.1.4203.666.11.2.1{64} "
                        "SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )",
                NULL, SLAP_AT_HIDE,
                NULL, NULL,
@@ -905,6 +907,15 @@ static struct slap_schema_ad_map {
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_cn) },
+       { "uid", "( 0.9.2342.19200300.100.1.1 NAME ( 'uid' 'userid' ) "
+                       "DESC 'RFC1274: user identifier' "
+                       "EQUALITY caseIgnoreMatch "
+                       "SUBSTR caseIgnoreSubstringsMatch "
+                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )",
+               NULL, 0,
+               NULL, NULL,
+               NULL, NULL, NULL, NULL, NULL,
+               offsetof(struct slap_internal_schema, si_ad_uid) },
        { "userPassword", "( 2.5.4.35 NAME 'userPassword' "
                        "DESC 'RFC2256/2307: password of user' "
                        "EQUALITY octetStringMatch "
@@ -987,6 +998,14 @@ static struct slap_schema_mr_map {
                offsetof(struct slap_internal_schema, si_mr_caseExactSubstringsMatch) },
        { "distinguishedNameMatch",
                offsetof(struct slap_internal_schema, si_mr_distinguishedNameMatch) },
+       { "dnSubtreeMatch",
+               offsetof(struct slap_internal_schema, si_mr_dnSubtreeMatch) },
+       { "dnOneLevelMatch",
+               offsetof(struct slap_internal_schema, si_mr_dnOneLevelMatch) },
+       { "dnSubordinateMatch",
+               offsetof(struct slap_internal_schema, si_mr_dnSubordinateMatch) },
+       { "dnSuperiorMatch",
+               offsetof(struct slap_internal_schema, si_mr_dnSuperiorMatch) },
        { "integerMatch",
                offsetof(struct slap_internal_schema, si_mr_integerMatch) },
        { "integerFirstComponentMatch",
@@ -1010,7 +1029,6 @@ static struct slap_schema_syn_map {
                offsetof(struct slap_internal_schema, si_syn_integer) },
        { "1.3.6.1.4.1.1466.115.121.1.40",
                offsetof(struct slap_internal_schema, si_syn_octetString) },
-
        { "1.3.6.1.4.1.1466.115.121.1.3",
                offsetof(struct slap_internal_schema, si_syn_attributeTypeDesc) },
        { "1.3.6.1.4.1.1466.115.121.1.16",
@@ -1025,10 +1043,8 @@ static struct slap_schema_syn_map {
                offsetof(struct slap_internal_schema, si_syn_nameFormDesc) },
        { "1.3.6.1.4.1.1466.115.121.1.37",
                offsetof(struct slap_internal_schema, si_syn_objectClassDesc) },
-
        { "1.3.6.1.4.1.1466.115.121.1.17",
                offsetof(struct slap_internal_schema, si_syn_ditStructureRuleDesc) },
-
        { NULL, 0 }
 };
 
@@ -1238,7 +1254,7 @@ slap_schema_load( void )
                }
        }
 
-       slap_at_undefined.sat_syntax = slap_schema.si_syn_distinguishedName;
+       slap_at_undefined.sat_syntax = slap_schema.si_syn_octetString;
        slap_schema.si_at_undefined = &slap_at_undefined;
 
        return LDAP_SUCCESS;