X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fschema_prep.c;h=5bc607d3f17d4bd8e3b1aae482b1d4f10d28ed66;hb=2c4b2b5566e14bbda986be58733d16c94f8b5e35;hp=e6d66910cae7891aa3acea3198a863ca2136a557;hpb=31727f0f4dc04e6d9d7303e0c0910a0eb673d763;p=openldap diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index e6d66910ca..5bc607d3f1 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * 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 @@ -297,8 +297,8 @@ static int objectSubClassIndexer( ocvalues[noc] = sup->soc_cname; - assert( ocvalues[noc].bv_val ); - assert( ocvalues[noc].bv_len ); + assert( ocvalues[noc].bv_val != NULL ); + assert( ocvalues[noc].bv_len != 0 ); noc++; @@ -321,7 +321,9 @@ static ObjectClassSchemaCheckFN rootDseObjectClass; static ObjectClassSchemaCheckFN aliasObjectClass; static ObjectClassSchemaCheckFN referralObjectClass; static ObjectClassSchemaCheckFN subentryObjectClass; +#ifdef LDAP_DYNAMIC_OBJECTS static ObjectClassSchemaCheckFN dynamicObjectClass; +#endif static struct slap_schema_oc_map { char *ssom_name; @@ -336,12 +338,12 @@ static struct slap_schema_oc_map { 0, 0, offsetof(struct slap_internal_schema, si_oc_top) }, { "extensibleObject", "( 1.3.6.1.4.1.1466.101.120.111 " "NAME 'extensibleObject' " - "DESC 'RFC2252: extensible object' " + "DESC 'RFC4512: extensible object' " "SUP top AUXILIARY )", 0, SLAP_OC_OPERATIONAL, offsetof(struct slap_internal_schema, si_oc_extensibleObject) }, { "alias", "( 2.5.6.1 NAME 'alias' " - "DESC 'RFC2256: an alias' " + "DESC 'RFC4512: an alias' " "SUP top STRUCTURAL " "MUST aliasedObjectName )", aliasObjectClass, SLAP_OC_ALIAS|SLAP_OC_OPERATIONAL, @@ -358,12 +360,13 @@ static struct slap_schema_oc_map { rootDseObjectClass, SLAP_OC_OPERATIONAL, offsetof(struct slap_internal_schema, si_oc_rootdse) }, { "subentry", "( 2.5.17.0 NAME 'subentry' " + "DESC 'RFC3672: subentry' " "SUP top STRUCTURAL " "MUST ( cn $ subtreeSpecification ) )", subentryObjectClass, SLAP_OC_SUBENTRY|SLAP_OC_OPERATIONAL, offsetof(struct slap_internal_schema, si_oc_subentry) }, { "subschema", "( 2.5.20.1 NAME 'subschema' " - "DESC 'RFC2252: controlling subschema (sub)entry' " + "DESC 'RFC4512: controlling subschema (sub)entry' " "AUXILIARY " "MAY ( dITStructureRules $ nameForms $ ditContentRules $ " "objectClasses $ attributeTypes $ matchingRules $ " @@ -417,7 +420,9 @@ static AttributeTypeSchemaCheckFN aliasAttribute; static AttributeTypeSchemaCheckFN referralAttribute; static AttributeTypeSchemaCheckFN subentryAttribute; static AttributeTypeSchemaCheckFN administrativeRoleAttribute; +#ifdef LDAP_DYNAMIC_OBJECTS static AttributeTypeSchemaCheckFN dynamicAttribute; +#endif static struct slap_schema_ad_map { char *ssam_name; @@ -434,7 +439,7 @@ static struct slap_schema_ad_map { size_t ssam_offset; } ad_map[] = { { "objectClass", "( 2.5.4.0 NAME 'objectClass' " - "DESC 'RFC2256: object classes of the entity' " + "DESC 'RFC4512: object classes of the entity' " "EQUALITY objectIdentifierMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )", NULL, SLAP_AT_FINAL, @@ -445,7 +450,7 @@ static struct slap_schema_ad_map { /* user entry operational attributes */ { "structuralObjectClass", "( 2.5.21.9 NAME 'structuralObjectClass' " - "DESC 'X.500(93): structural object class of entry' " + "DESC 'RFC4512: structural object class of entry' " "EQUALITY objectIdentifierMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 " "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", @@ -455,7 +460,7 @@ static struct slap_schema_ad_map { objectSubClassIndexer, objectSubClassFilter, offsetof(struct slap_internal_schema, si_ad_structuralObjectClass) }, { "createTimestamp", "( 2.5.18.1 NAME 'createTimestamp' " - "DESC 'RFC2252: time which object was created' " + "DESC 'RFC4512: time which object was created' " "EQUALITY generalizedTimeMatch " "ORDERING generalizedTimeOrderingMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 " @@ -465,7 +470,7 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_createTimestamp) }, { "modifyTimestamp", "( 2.5.18.2 NAME 'modifyTimestamp' " - "DESC 'RFC2252: time which object was last modified' " + "DESC 'RFC4512: time which object was last modified' " "EQUALITY generalizedTimeMatch " "ORDERING generalizedTimeOrderingMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 " @@ -475,7 +480,7 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_modifyTimestamp) }, { "creatorsName", "( 2.5.18.3 NAME 'creatorsName' " - "DESC 'RFC2252: name of creator' " + "DESC 'RFC4512: name of creator' " "EQUALITY distinguishedNameMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 " "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", @@ -484,7 +489,7 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_creatorsName) }, { "modifiersName", "( 2.5.18.4 NAME 'modifiersName' " - "DESC 'RFC2252: name of last modifier' " + "DESC 'RFC4512: name of last modifier' " "EQUALITY distinguishedNameMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 " "SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )", @@ -502,7 +507,7 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_hasSubordinates) }, { "subschemaSubentry", "( 2.5.18.10 NAME 'subschemaSubentry' " - "DESC 'RFC2252: name of controlling subschema entry' " + "DESC 'RFC4512: name of controlling subschema entry' " "EQUALITY distinguishedNameMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE " "NO-USER-MODIFICATION USAGE directoryOperation )", @@ -541,13 +546,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, + NULL, SLAP_AT_MANAGEABLE, NULL, NULL, NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_entryUUID) }, @@ -575,8 +580,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, @@ -623,7 +629,7 @@ static struct slap_schema_ad_map { /* root DSE attributes */ { "altServer", "( 1.3.6.1.4.1.1466.101.120.6 NAME 'altServer' " - "DESC 'RFC2252: alternative servers' " + "DESC 'RFC4512: alternative servers' " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 USAGE dSAOperation )", rootDseAttribute, 0, NULL, NULL, @@ -631,7 +637,7 @@ static struct slap_schema_ad_map { offsetof(struct slap_internal_schema, si_ad_altServer) }, { "namingContexts", "( 1.3.6.1.4.1.1466.101.120.5 " "NAME 'namingContexts' " - "DESC 'RFC2252: naming contexts' " + "DESC 'RFC4512: naming contexts' " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE dSAOperation )", rootDseAttribute, 0, NULL, NULL, @@ -639,7 +645,7 @@ static struct slap_schema_ad_map { offsetof(struct slap_internal_schema, si_ad_namingContexts) }, { "supportedControl", "( 1.3.6.1.4.1.1466.101.120.13 " "NAME 'supportedControl' " - "DESC 'RFC2252: supported controls' " + "DESC 'RFC4512: supported controls' " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation )", rootDseAttribute, 0, NULL, NULL, @@ -647,7 +653,7 @@ static struct slap_schema_ad_map { offsetof(struct slap_internal_schema, si_ad_supportedControl) }, { "supportedExtension", "( 1.3.6.1.4.1.1466.101.120.7 " "NAME 'supportedExtension' " - "DESC 'RFC2252: supported extended operations' " + "DESC 'RFC4512: supported extended operations' " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation )", rootDseAttribute, 0, NULL, NULL, @@ -655,7 +661,7 @@ static struct slap_schema_ad_map { offsetof(struct slap_internal_schema, si_ad_supportedExtension) }, { "supportedLDAPVersion", "( 1.3.6.1.4.1.1466.101.120.15 " "NAME 'supportedLDAPVersion' " - "DESC 'RFC2252: supported LDAP versions' " + "DESC 'RFC4512: supported LDAP versions' " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 USAGE dSAOperation )", rootDseAttribute, 0, NULL, NULL, @@ -663,7 +669,7 @@ static struct slap_schema_ad_map { offsetof(struct slap_internal_schema, si_ad_supportedLDAPVersion) }, { "supportedSASLMechanisms", "( 1.3.6.1.4.1.1466.101.120.14 " "NAME 'supportedSASLMechanisms' " - "DESC 'RFC2252: supported SASL mechanisms'" + "DESC 'RFC4512: supported SASL mechanisms'" "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE dSAOperation )", rootDseAttribute, 0, NULL, NULL, @@ -671,7 +677,7 @@ static struct slap_schema_ad_map { offsetof(struct slap_internal_schema, si_ad_supportedSASLMechanisms) }, { "supportedFeatures", "( 1.3.6.1.4.1.4203.1.3.5 " "NAME 'supportedFeatures' " - "DESC 'features supported by the server' " + "DESC 'RFC4512: features supported by the server' " "EQUALITY objectIdentifierMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 " "USAGE dSAOperation )", @@ -722,6 +728,7 @@ static struct slap_schema_ad_map { /* subentry attributes */ { "administrativeRole", "( 2.5.18.5 NAME 'administrativeRole' " + "DESC 'RFC3672: administrative role' " "EQUALITY objectIdentifierMatch " "USAGE directoryOperation " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )", @@ -730,6 +737,7 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_administrativeRole) }, { "subtreeSpecification", "( 2.5.18.6 NAME 'subtreeSpecification' " + "DESC 'RFC3672: subtree specification' " "SINGLE-VALUE " "USAGE directoryOperation " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.45 )", @@ -740,7 +748,7 @@ static struct slap_schema_ad_map { /* subschema subentry attributes */ { "ditStructureRules", "( 2.5.21.1 NAME 'dITStructureRules' " - "DESC 'RFC2252: DIT structure rules' " + "DESC 'RFC4512: DIT structure rules' " "EQUALITY integerFirstComponentMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.17 " "USAGE directoryOperation ) ", @@ -749,7 +757,7 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_ditStructureRules) }, { "ditContentRules", "( 2.5.21.2 NAME 'dITContentRules' " - "DESC 'RFC2252: DIT content rules' " + "DESC 'RFC4512: DIT content rules' " "EQUALITY objectIdentifierFirstComponentMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.16 USAGE directoryOperation )", subentryAttribute, SLAP_AT_HIDE, @@ -757,7 +765,7 @@ static struct slap_schema_ad_map { NULL, NULL, objectClassMatch, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_ditContentRules) }, { "matchingRules", "( 2.5.21.4 NAME 'matchingRules' " - "DESC 'RFC2252: matching rules' " + "DESC 'RFC4512: matching rules' " "EQUALITY objectIdentifierFirstComponentMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.30 USAGE directoryOperation )", subentryAttribute, 0, @@ -765,7 +773,7 @@ static struct slap_schema_ad_map { NULL, NULL, matchingRuleMatch, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_matchingRules) }, { "attributeTypes", "( 2.5.21.5 NAME 'attributeTypes' " - "DESC 'RFC2252: attribute types' " + "DESC 'RFC4512: attribute types' " "EQUALITY objectIdentifierFirstComponentMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.3 USAGE directoryOperation )", subentryAttribute, 0, @@ -773,7 +781,7 @@ static struct slap_schema_ad_map { NULL, NULL, attributeTypeMatch, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_attributeTypes) }, { "objectClasses", "( 2.5.21.6 NAME 'objectClasses' " - "DESC 'RFC2252: object classes' " + "DESC 'RFC4512: object classes' " "EQUALITY objectIdentifierFirstComponentMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.37 USAGE directoryOperation )", subentryAttribute, 0, @@ -781,7 +789,7 @@ static struct slap_schema_ad_map { NULL, NULL, objectClassMatch, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_objectClasses) }, { "nameForms", "( 2.5.21.7 NAME 'nameForms' " - "DESC 'RFC2252: name forms ' " + "DESC 'RFC4512: name forms ' " "EQUALITY objectIdentifierFirstComponentMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.35 USAGE directoryOperation )", subentryAttribute, SLAP_AT_HIDE, @@ -789,7 +797,7 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_nameForms) }, { "matchingRuleUse", "( 2.5.21.8 NAME 'matchingRuleUse' " - "DESC 'RFC2252: matching rule uses' " + "DESC 'RFC4512: matching rule uses' " "EQUALITY objectIdentifierFirstComponentMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.31 USAGE directoryOperation )", subentryAttribute, 0, @@ -798,7 +806,7 @@ static struct slap_schema_ad_map { offsetof(struct slap_internal_schema, si_ad_matchingRuleUse) }, { "ldapSyntaxes", "( 1.3.6.1.4.1.1466.101.120.16 NAME 'ldapSyntaxes' " - "DESC 'RFC2252: LDAP syntaxes' " + "DESC 'RFC4512: LDAP syntaxes' " "EQUALITY objectIdentifierFirstComponentMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.54 USAGE directoryOperation )", subentryAttribute, 0, @@ -809,7 +817,7 @@ static struct slap_schema_ad_map { /* knowledge information */ { "aliasedObjectName", "( 2.5.4.1 " "NAME ( 'aliasedObjectName' 'aliasedEntryName' ) " - "DESC 'RFC2256: name of aliased object' " + "DESC 'RFC4512: name of aliased object' " "EQUALITY distinguishedNameMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )", aliasAttribute, SLAP_AT_FINAL, @@ -817,7 +825,7 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_aliasedObjectName) }, { "ref", "( 2.16.840.1.113730.3.1.34 NAME 'ref' " - "DESC 'namedref: subordinate referral URL' " + "DESC 'RFC3296: subordinate referral URL' " "EQUALITY caseExactMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 " "USAGE distributedOperation )", @@ -850,8 +858,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' " - "EQUALITY caseExactMatch " - "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 " + "EQUALITY authzMatch " + "SYNTAX 1.3.6.1.4.1.4203.666.2.7 " + "X-ORDERED 'VALUES' " "USAGE distributedOperation )", NULL, SLAP_AT_HIDE, NULL, NULL, @@ -860,32 +869,21 @@ static struct slap_schema_ad_map { { "authzFrom", "( 1.3.6.1.4.1.4203.666.1.9 " "NAME ( 'authzFrom' 'saslAuthzFrom' ) " "DESC 'proxy authorization sources' " - "EQUALITY caseExactMatch " - "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 " + "EQUALITY authzMatch " + "SYNTAX 1.3.6.1.4.1.4203.666.2.7 " + "X-ORDERED 'VALUES' " "USAGE distributedOperation )", NULL, SLAP_AT_HIDE, NULL, NULL, NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_saslAuthzFrom) }, -#ifdef SLAPD_ACI_ENABLED - { "OpenLDAPaci", "( 1.3.6.1.4.1.4203.666.1.5 " - "NAME 'OpenLDAPaci' " - "DESC 'OpenLDAP access control information (experimental)' " - "EQUALITY OpenLDAPaciMatch " - "SYNTAX 1.3.6.1.4.1.4203.666.2.1 " - "USAGE directoryOperation )", - NULL, SLAP_AT_HIDE, - NULL, NULL, - NULL, NULL, NULL, NULL, NULL, - offsetof(struct slap_internal_schema, si_ad_aci) }, -#endif #ifdef LDAP_DYNAMIC_OBJECTS { "entryTtl", "( 1.3.6.1.4.1.1466.101.119.3 NAME 'entryTtl' " "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) }, @@ -902,7 +900,7 @@ static struct slap_schema_ad_map { /* userApplication attributes (which system schema depends upon) */ { "distinguishedName", "( 2.5.4.49 NAME 'distinguishedName' " - "DESC 'RFC2256: common supertype of DN attributes' " + "DESC 'RFC4519: common supertype of DN attributes' " "EQUALITY distinguishedNameMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )", NULL, SLAP_AT_ABSTRACT, @@ -910,7 +908,7 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_distinguishedName) }, { "name", "( 2.5.4.41 NAME 'name' " - "DESC 'RFC2256: common supertype of name attributes' " + "DESC 'RFC4519: common supertype of name attributes' " "EQUALITY caseIgnoreMatch " "SUBSTR caseIgnoreSubstringsMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )", @@ -919,14 +917,14 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_name) }, { "cn", "( 2.5.4.3 NAME ( 'cn' 'commonName' ) " - "DESC 'RFC2256: common name(s) for which the entity is known by' " + "DESC 'RFC4519: common name(s) for which the entity is known by' " "SUP name )", NULL, 0, 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' " + "DESC 'RFC4519: user identifier' " "EQUALITY caseIgnoreMatch " "SUBSTR caseIgnoreSubstringsMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )", @@ -934,8 +932,28 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_uid) }, + { "uidNumber", /* for ldapi:// */ + "( 1.3.6.1.1.1.1.0 NAME 'uidNumber' " + "DESC 'RFC2307: An integer uniquely identifying a user " + "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, + offsetof(struct slap_internal_schema, si_ad_uidNumber) }, + { "gidNumber", /* for ldapi:// */ + "( 1.3.6.1.1.1.1.1 NAME 'gidNumber' " + "DESC 'RFC2307: 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 )", + NULL, 0, + NULL, NULL, + NULL, NULL, NULL, NULL, NULL, + offsetof(struct slap_internal_schema, si_ad_gidNumber) }, { "userPassword", "( 2.5.4.35 NAME 'userPassword' " - "DESC 'RFC2256/2307: password of user' " + "DESC 'RFC4519/2307: password of user' " "EQUALITY octetStringMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128} )", NULL, 0, @@ -987,7 +1005,7 @@ static struct slap_schema_ad_map { #endif { "description", "( 2.5.4.13 NAME 'description' " - "DESC 'RFC2256: descriptive information' " + "DESC 'RFC4519: descriptive information' " "EQUALITY caseIgnoreMatch " "SUBSTR caseIgnoreSubstringsMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )", @@ -997,7 +1015,7 @@ static struct slap_schema_ad_map { offsetof(struct slap_internal_schema, si_ad_description) }, { "seeAlso", "( 2.5.4.34 NAME 'seeAlso' " - "DESC 'RFC2256: DN of related object' " + "DESC 'RFC4519: DN of related object' " "SUP distinguishedName )", NULL, 0, NULL, NULL, @@ -1008,14 +1026,31 @@ static struct slap_schema_ad_map { }; static AttributeType slap_at_undefined = { - { "1.1.1", NULL, NULL, 1, NULL, + { "1.1.1", NULL, "Catchall for undefined attribute types", 1, NULL, NULL, NULL, NULL, NULL, - 0, 0, 0, 1, 3, NULL }, /* LDAPAttributeType */ + 0, 0, 0, 1, LDAP_SCHEMA_DSA_OPERATION, NULL }, /* LDAPAttributeType */ BER_BVC("UNDEFINED"), /* cname */ NULL, /* sup */ NULL, /* subtypes */ NULL, NULL, NULL, NULL, /* matching rules routines */ - NULL, /* syntax (this may need to be defined) */ + NULL, /* syntax (will be set later to "octetString") */ + NULL, /* schema check function */ + NULL, /* oidmacro */ + SLAP_AT_ABSTRACT|SLAP_AT_FINAL, /* mask */ + { NULL }, /* next */ + NULL /* attribute description */ + /* mutex (don't know how to initialize it :) */ +}; + +static AttributeType slap_at_proxied = { + { "1.1.1", NULL, "Catchall for undefined proxied attribute types", 1, NULL, + NULL, NULL, NULL, NULL, + 0, 0, 0, 0, LDAP_SCHEMA_USER_APPLICATIONS, NULL }, /* LDAPAttributeType */ + BER_BVC("PROXIED"), /* cname */ + NULL, /* sup */ + NULL, /* subtypes */ + NULL, NULL, NULL, NULL, /* matching rules routines (will be set later) */ + NULL, /* syntax (will be set later to "octetString") */ NULL, /* schema check function */ NULL, /* oidmacro */ SLAP_AT_ABSTRACT|SLAP_AT_FINAL, /* mask */ @@ -1123,6 +1158,19 @@ slap_schema_load( void ) } } + slap_at_undefined.sat_syntax = slap_schema.si_syn_octetString; + slap_schema.si_at_undefined = &slap_at_undefined; + + slap_at_proxied.sat_equality = mr_find( "octetStringMatch" ); + slap_at_proxied.sat_approx = mr_find( "octetStringMatch" ); + slap_at_proxied.sat_ordering = mr_find( "octetStringOrderingMatch" ); + slap_at_proxied.sat_substr = mr_find( "octetStringSubstringsMatch" ); + slap_at_proxied.sat_syntax = slap_schema.si_syn_octetString; + slap_schema.si_at_proxied = &slap_at_proxied; + + ldap_pvt_thread_mutex_init( &ad_undef_mutex ); + ldap_pvt_thread_mutex_init( &oc_undef_mutex ); + for( i=0; ad_map[i].ssam_name; i++ ) { assert( ad_map[i].ssam_defn != NULL ); { @@ -1143,11 +1191,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 ); + code = at_add( at, 0, NULL, 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 ); @@ -1231,6 +1281,7 @@ slap_schema_load( void ) mr->smr_filter = ad_map[i].ssam_mr_filter; } + /* FIXME: no-one will free this at exit */ (*adp)->ad_type->sat_equality = mr; } } @@ -1256,18 +1307,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); + code = oc_add(oc,0,NULL,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 **) @@ -1292,9 +1345,6 @@ slap_schema_load( void ) } } - slap_at_undefined.sat_syntax = slap_schema.si_syn_octetString; - slap_schema.si_at_undefined = &slap_at_undefined; - return LDAP_SUCCESS; } @@ -1400,6 +1450,7 @@ static int subentryObjectClass ( return LDAP_SUCCESS; } +#ifdef LDAP_DYNAMIC_OBJECTS static int dynamicObjectClass ( Backend *be, Entry *e, @@ -1418,6 +1469,7 @@ static int dynamicObjectClass ( return LDAP_SUCCESS; } +#endif /* LDAP_DYNAMIC_OBJECTS */ static int rootDseAttribute ( Backend *be, @@ -1540,6 +1592,7 @@ static int administrativeRoleAttribute ( return LDAP_OBJECT_CLASS_VIOLATION; } +#ifdef LDAP_DYNAMIC_OBJECTS static int dynamicAttribute ( Backend *be, Entry *e, @@ -1565,3 +1618,4 @@ static int dynamicAttribute ( return LDAP_SUCCESS; } +#endif /* LDAP_DYNAMIC_OBJECTS */