2000-05-25 09:49:21 +08:00
|
|
|
/* schema_init.c - init builtin schema */
|
|
|
|
/* $OpenLDAP$ */
|
|
|
|
/*
|
2002-01-05 05:17:25 +08:00
|
|
|
* Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
|
2000-05-25 09:49:21 +08:00
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "portable.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <ac/ctype.h>
|
|
|
|
#include <ac/string.h>
|
|
|
|
#include <ac/socket.h>
|
|
|
|
|
|
|
|
#include "slap.h"
|
|
|
|
#include "ldap_pvt.h"
|
2000-09-08 07:19:10 +08:00
|
|
|
#include "ldap_pvt_uc.h"
|
2000-05-25 09:49:21 +08:00
|
|
|
|
|
|
|
int schema_init_done = 0;
|
|
|
|
|
|
|
|
struct slap_internal_schema slap_schema;
|
|
|
|
|
|
|
|
static int
|
|
|
|
objectClassMatch(
|
2000-06-20 00:14:12 +08:00
|
|
|
int *matchp,
|
2000-08-29 06:20:19 +08:00
|
|
|
slap_mask_t flags,
|
2000-05-25 09:49:21 +08:00
|
|
|
Syntax *syntax,
|
|
|
|
MatchingRule *mr,
|
|
|
|
struct berval *value,
|
|
|
|
void *assertedValue )
|
|
|
|
{
|
2000-06-20 00:14:12 +08:00
|
|
|
struct berval *a = (struct berval *) assertedValue;
|
2001-12-28 19:45:25 +08:00
|
|
|
ObjectClass *oc = oc_bvfind( value );
|
|
|
|
ObjectClass *asserted = oc_bvfind( a );
|
2000-06-20 00:14:12 +08:00
|
|
|
|
2002-02-10 07:13:59 +08:00
|
|
|
#if 1
|
|
|
|
#ifdef NEW_LOGGING
|
2002-07-12 04:33:24 +08:00
|
|
|
LDAP_LOG( CONFIG, ENTRY,
|
|
|
|
"> objectClassMatch(%s, %s)\n", value->bv_val, a->bv_val, 0 );
|
2002-02-10 07:13:59 +08:00
|
|
|
#else
|
|
|
|
Debug( LDAP_DEBUG_TRACE, "> objectClassMatch(%s,%s)\n",
|
|
|
|
value->bv_val, a->bv_val, 0 );
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2000-06-20 04:53:56 +08:00
|
|
|
if( asserted == NULL ) {
|
2000-06-26 13:13:41 +08:00
|
|
|
if( OID_LEADCHAR( *a->bv_val ) ) {
|
2000-06-20 04:53:56 +08:00
|
|
|
/* OID form, return FALSE */
|
|
|
|
*matchp = 1;
|
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* desc form, return undefined */
|
2000-06-20 11:54:50 +08:00
|
|
|
return SLAPD_COMPARE_UNDEFINED;
|
2000-06-20 04:53:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( oc == NULL ) {
|
2000-06-20 11:54:50 +08:00
|
|
|
/* unrecognized stored value */
|
|
|
|
return SLAPD_COMPARE_UNDEFINED;
|
2000-06-20 00:14:12 +08:00
|
|
|
}
|
|
|
|
|
2001-11-28 05:59:56 +08:00
|
|
|
if( SLAP_IS_MR_VALUE_SYNTAX_MATCH( flags ) ) {
|
2000-06-26 13:13:41 +08:00
|
|
|
*matchp = ( asserted != oc );
|
|
|
|
} else {
|
|
|
|
*matchp = !is_object_subclass( asserted, oc );
|
|
|
|
}
|
|
|
|
|
2002-02-10 07:13:59 +08:00
|
|
|
#if 1
|
2001-01-16 03:17:29 +08:00
|
|
|
#ifdef NEW_LOGGING
|
2002-07-12 04:33:24 +08:00
|
|
|
LDAP_LOG( CONFIG, ENTRY,
|
|
|
|
"< objectClassMatch(%s, %s) = %d\n",
|
|
|
|
value->bv_val, a->bv_val, *matchp );
|
2001-01-16 03:17:29 +08:00
|
|
|
#else
|
2002-02-10 07:13:59 +08:00
|
|
|
Debug( LDAP_DEBUG_TRACE, "< objectClassMatch(%s,%s) = %d\n",
|
2000-06-26 13:13:41 +08:00
|
|
|
value->bv_val, a->bv_val, *matchp );
|
2001-01-16 03:17:29 +08:00
|
|
|
#endif
|
2000-06-20 00:14:12 +08:00
|
|
|
#endif
|
|
|
|
|
2000-06-26 13:13:41 +08:00
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-02-10 07:13:59 +08:00
|
|
|
#if 1
|
|
|
|
#define structuralObjectClassMatch objectClassMatch
|
|
|
|
#else
|
2000-06-26 13:13:41 +08:00
|
|
|
static int
|
|
|
|
structuralObjectClassMatch(
|
|
|
|
int *matchp,
|
2000-08-29 06:20:19 +08:00
|
|
|
slap_mask_t flags,
|
2000-06-26 13:13:41 +08:00
|
|
|
Syntax *syntax,
|
|
|
|
MatchingRule *mr,
|
|
|
|
struct berval *value,
|
|
|
|
void *assertedValue )
|
|
|
|
{
|
|
|
|
struct berval *a = (struct berval *) assertedValue;
|
2001-12-28 19:45:25 +08:00
|
|
|
ObjectClass *oc = oc_bvfind( value );
|
|
|
|
ObjectClass *asserted = oc_bvfind( a );
|
2000-06-26 13:13:41 +08:00
|
|
|
|
2002-02-10 07:13:59 +08:00
|
|
|
#if 1
|
|
|
|
#ifdef NEW_LOGGING
|
2002-07-12 04:33:24 +08:00
|
|
|
LDAP_LOG( CONFIG, ENTRY,
|
|
|
|
"> structuralObjectClassMatch(%s, %s)\n", value->bv_val, a->bv_val, 0 );
|
2002-02-10 07:13:59 +08:00
|
|
|
#else
|
|
|
|
Debug( LDAP_DEBUG_TRACE, "> structuralObjectClassMatch(%s,%s)\n",
|
|
|
|
value->bv_val, a->bv_val, 0 );
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2000-06-26 13:13:41 +08:00
|
|
|
if( asserted == NULL ) {
|
|
|
|
if( OID_LEADCHAR( *a->bv_val ) ) {
|
|
|
|
/* OID form, return FALSE */
|
|
|
|
*matchp = 1;
|
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* desc form, return undefined */
|
|
|
|
return SLAPD_COMPARE_UNDEFINED;
|
|
|
|
}
|
2000-06-20 00:14:12 +08:00
|
|
|
|
2000-06-26 13:13:41 +08:00
|
|
|
if ( oc == NULL ) {
|
|
|
|
/* unrecognized stored value */
|
|
|
|
return SLAPD_COMPARE_UNDEFINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
*matchp = ( asserted != oc );
|
|
|
|
|
2002-02-10 07:13:59 +08:00
|
|
|
#if 1
|
2001-01-16 03:17:29 +08:00
|
|
|
#ifdef NEW_LOGGING
|
2002-07-12 04:33:24 +08:00
|
|
|
LDAP_LOG( CONFIG, ENTRY,
|
|
|
|
"< structuralObjectClassMatch( %s, %s ) = %d\n",
|
|
|
|
value->bv_val, a->bv_val, *matchp );
|
2001-01-16 03:17:29 +08:00
|
|
|
#else
|
2002-02-10 07:13:59 +08:00
|
|
|
Debug( LDAP_DEBUG_TRACE, "< structuralObjectClassMatch(%s,%s) = %d\n",
|
2000-06-26 13:13:41 +08:00
|
|
|
value->bv_val, a->bv_val, *matchp );
|
2001-01-16 03:17:29 +08:00
|
|
|
#endif
|
2000-06-26 13:13:41 +08:00
|
|
|
#endif
|
2000-05-25 09:49:21 +08:00
|
|
|
|
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
2002-02-10 07:13:59 +08:00
|
|
|
#endif
|
2000-05-25 09:49:21 +08:00
|
|
|
|
2002-01-10 14:30:26 +08:00
|
|
|
static ObjectClassSchemaCheckFN rootDseObjectClass;
|
2002-01-12 02:56:01 +08:00
|
|
|
static ObjectClassSchemaCheckFN aliasObjectClass;
|
|
|
|
static ObjectClassSchemaCheckFN referralObjectClass;
|
2002-01-10 14:30:26 +08:00
|
|
|
static ObjectClassSchemaCheckFN subentryObjectClass;
|
2002-01-12 02:56:01 +08:00
|
|
|
static ObjectClassSchemaCheckFN dynamicObjectClass;
|
2002-01-10 14:30:26 +08:00
|
|
|
|
2001-12-24 14:36:44 +08:00
|
|
|
static struct slap_schema_oc_map {
|
2000-05-25 09:49:21 +08:00
|
|
|
char *ssom_name;
|
2002-01-10 08:17:21 +08:00
|
|
|
char *ssom_defn;
|
|
|
|
ObjectClassSchemaCheckFN *ssom_check;
|
2002-01-14 03:38:12 +08:00
|
|
|
slap_mask_t ssom_flags;
|
2000-05-25 09:49:21 +08:00
|
|
|
size_t ssom_offset;
|
|
|
|
} oc_map[] = {
|
2002-01-10 13:31:49 +08:00
|
|
|
{ "top", "( 2.5.6.0 NAME 'top' "
|
|
|
|
"DESC 'top of the superclass chain' "
|
|
|
|
"ABSTRACT MUST objectClass )",
|
2002-01-14 03:38:12 +08:00
|
|
|
0, 0, offsetof(struct slap_internal_schema, si_oc_top) },
|
2002-01-10 13:31:49 +08:00
|
|
|
{ "extensibleObject", "( 1.3.6.1.4.1.1466.101.120.111 "
|
|
|
|
"NAME 'extensibleObject' "
|
|
|
|
"DESC 'RFC2252: extensible object' "
|
|
|
|
"SUP top AUXILIARY )",
|
2002-05-30 13:23:37 +08:00
|
|
|
0, SLAP_OC_OPERATIONAL,
|
|
|
|
offsetof(struct slap_internal_schema, si_oc_extensibleObject) },
|
2002-01-10 13:31:49 +08:00
|
|
|
{ "alias", "( 2.5.6.1 NAME 'alias' "
|
|
|
|
"DESC 'RFC2256: an alias' "
|
|
|
|
"SUP top STRUCTURAL "
|
|
|
|
"MUST aliasedObjectName )",
|
2002-05-30 13:23:37 +08:00
|
|
|
aliasObjectClass, SLAP_OC_ALIAS|SLAP_OC_OPERATIONAL,
|
2002-01-12 02:56:01 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_oc_alias) },
|
2002-01-10 13:31:49 +08:00
|
|
|
{ "referral", "( 2.16.840.1.113730.3.2.6 NAME 'referral' "
|
|
|
|
"DESC 'namedref: named subordinate referral' "
|
|
|
|
"SUP top STRUCTURAL MUST ref )",
|
2002-05-30 13:23:37 +08:00
|
|
|
referralObjectClass, SLAP_OC_REFERRAL|SLAP_OC_OPERATIONAL,
|
2002-01-12 02:56:01 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_oc_referral) },
|
2002-01-10 13:31:49 +08:00
|
|
|
{ "LDAProotDSE", "( 1.3.6.1.4.1.4203.1.4.1 "
|
|
|
|
"NAME ( 'OpenLDAProotDSE' 'LDAProotDSE' ) "
|
|
|
|
"DESC 'OpenLDAP Root DSE object' "
|
2002-01-12 02:56:01 +08:00
|
|
|
"SUP top STRUCTURAL MAY cn )",
|
2002-05-30 13:23:37 +08:00
|
|
|
rootDseObjectClass, SLAP_OC_OPERATIONAL,
|
2002-01-10 14:30:26 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_oc_rootdse) },
|
2002-01-10 13:31:49 +08:00
|
|
|
{ "subentry", "( 2.5.20.0 NAME 'subentry' "
|
|
|
|
"SUP top STRUCTURAL "
|
|
|
|
"MUST ( cn $ subtreeSpecification ) )",
|
2002-05-30 13:23:37 +08:00
|
|
|
subentryObjectClass, SLAP_OC_SUBENTRY|SLAP_OC_OPERATIONAL,
|
2002-01-12 02:56:01 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_oc_subentry) },
|
2002-01-10 13:31:49 +08:00
|
|
|
{ "subschema", "( 2.5.20.1 NAME 'subschema' "
|
|
|
|
"DESC 'RFC2252: controlling subschema (sub)entry' "
|
2002-01-10 13:54:50 +08:00
|
|
|
"AUXILIARY "
|
2002-01-10 13:31:49 +08:00
|
|
|
"MAY ( dITStructureRules $ nameForms $ ditContentRules $ "
|
|
|
|
"objectClasses $ attributeTypes $ matchingRules $ "
|
2002-01-12 02:56:01 +08:00
|
|
|
"matchingRuleUse ) )",
|
2002-05-30 13:23:37 +08:00
|
|
|
subentryObjectClass, SLAP_OC_OPERATIONAL,
|
2002-01-10 14:30:26 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_oc_subschema) },
|
2002-01-12 19:36:23 +08:00
|
|
|
{ "monitor", "( 1.3.6.1.4.1.4203.666.3.2 NAME 'monitor' "
|
|
|
|
"DESC 'OpenLDAP system monitoring' "
|
|
|
|
"STRUCTURAL "
|
|
|
|
"MUST cn )",
|
2002-05-30 13:23:37 +08:00
|
|
|
0, SLAP_OC_OPERATIONAL,
|
|
|
|
offsetof(struct slap_internal_schema, si_oc_monitor) },
|
2002-01-20 06:33:07 +08:00
|
|
|
{ "collectiveAttributeSubentry", "( 2.5.20.2 "
|
|
|
|
"NAME 'collectiveAttributeSubentry' "
|
2002-01-12 02:56:01 +08:00
|
|
|
"AUXILIARY )",
|
2002-05-30 13:23:37 +08:00
|
|
|
subentryObjectClass,
|
|
|
|
SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY|SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
|
2002-01-20 06:33:07 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_oc_collectiveAttributeSubentry) },
|
2002-01-10 14:58:57 +08:00
|
|
|
{ "dynamicObject", "( 1.3.6.1.4.1.1466.101.119.2 "
|
|
|
|
"NAME 'dynamicObject' "
|
|
|
|
"DESC 'RFC2589: Dynamic Object' "
|
|
|
|
"SUP top AUXILIARY )",
|
2002-01-19 10:58:00 +08:00
|
|
|
dynamicObjectClass, SLAP_OC_DYNAMICOBJECT,
|
2002-01-10 14:58:57 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_oc_dynamicObject) },
|
2002-01-14 04:06:53 +08:00
|
|
|
{ NULL, NULL, NULL, 0, 0 }
|
2000-05-25 09:49:21 +08:00
|
|
|
};
|
|
|
|
|
2002-01-10 13:31:49 +08:00
|
|
|
static AttributeTypeSchemaCheckFN rootDseAttribute;
|
2002-01-12 03:11:46 +08:00
|
|
|
static AttributeTypeSchemaCheckFN aliasAttribute;
|
2002-01-10 13:31:49 +08:00
|
|
|
static AttributeTypeSchemaCheckFN referralAttribute;
|
2002-01-12 03:11:46 +08:00
|
|
|
static AttributeTypeSchemaCheckFN subentryAttribute;
|
2002-01-15 15:29:15 +08:00
|
|
|
static AttributeTypeSchemaCheckFN administrativeRoleAttribute;
|
2002-01-12 03:11:46 +08:00
|
|
|
static AttributeTypeSchemaCheckFN dynamicAttribute;
|
2002-01-10 13:31:49 +08:00
|
|
|
|
2001-12-24 14:36:44 +08:00
|
|
|
static struct slap_schema_ad_map {
|
2000-05-25 09:49:21 +08:00
|
|
|
char *ssam_name;
|
2002-01-10 08:17:21 +08:00
|
|
|
char *ssam_defn;
|
|
|
|
AttributeTypeSchemaCheckFN *ssam_check;
|
2002-01-14 03:38:12 +08:00
|
|
|
slap_mask_t ssam_flags;
|
2000-05-25 09:49:21 +08:00
|
|
|
slap_mr_match_func *ssam_match;
|
2000-06-20 00:14:12 +08:00
|
|
|
slap_mr_indexer_func *ssam_indexer;
|
|
|
|
slap_mr_filter_func *ssam_filter;
|
2000-05-25 09:49:21 +08:00
|
|
|
size_t ssam_offset;
|
|
|
|
} ad_map[] = {
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "objectClass", "( 2.5.4.0 NAME 'objectClass' "
|
|
|
|
"DESC 'RFC2256: object classes of the entity' "
|
|
|
|
"EQUALITY objectIdentifierMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )",
|
2002-06-01 04:24:26 +08:00
|
|
|
NULL, SLAP_AT_FINAL, objectClassMatch, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_objectClass) },
|
2002-01-10 11:31:11 +08:00
|
|
|
|
|
|
|
/* user entry operational attributes */
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "structuralObjectClass", "( 2.5.21.9 NAME 'structuralObjectClass' "
|
|
|
|
"DESC 'X.500(93): structural object class of entry' "
|
|
|
|
"EQUALITY objectIdentifierMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 "
|
2002-03-25 01:37:27 +08:00
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
NULL, 0, structuralObjectClassMatch, NULL, NULL,
|
2000-06-26 13:13:41 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_structuralObjectClass) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "createTimestamp", "( 2.5.18.1 NAME 'createTimestamp' "
|
|
|
|
"DESC 'RFC2252: time which object was created' "
|
|
|
|
"EQUALITY generalizedTimeMatch "
|
|
|
|
"ORDERING generalizedTimeOrderingMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
NULL, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_createTimestamp) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "modifyTimestamp", "( 2.5.18.2 NAME 'modifyTimestamp' "
|
|
|
|
"DESC 'RFC2252: time which object was last modified' "
|
|
|
|
"EQUALITY generalizedTimeMatch "
|
|
|
|
"ORDERING generalizedTimeOrderingMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
NULL, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_modifyTimestamp) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "creatorsName", "( 2.5.18.3 NAME 'creatorsName' "
|
|
|
|
"DESC 'RFC2252: name of creator' "
|
|
|
|
"EQUALITY distinguishedNameMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
NULL, 0, NULL, NULL, NULL,
|
2002-01-10 08:17:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_creatorsName) },
|
|
|
|
{ "modifiersName", "( 2.5.18.4 NAME 'modifiersName' "
|
|
|
|
"DESC 'RFC2252: 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 )",
|
2002-01-14 03:38:12 +08:00
|
|
|
NULL, 0, NULL, NULL, NULL,
|
2002-01-10 08:17:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_modifiersName) },
|
|
|
|
{ "hasSubordinates", "( 2.5.18.9 NAME 'hasSubordinates' "
|
|
|
|
"DESC 'X.501: entry has children' "
|
|
|
|
"EQUALITY booleanMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
NULL, 0, NULL, NULL, NULL,
|
2001-12-22 19:50:16 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_hasSubordinates) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "subschemaSubentry", "( 2.5.18.10 NAME 'subschemaSubentry' "
|
|
|
|
"DESC 'RFC2252: name of controlling subschema entry' "
|
|
|
|
"EQUALITY distinguishedNameMatch "
|
2002-03-25 01:37:27 +08:00
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE "
|
|
|
|
"NO-USER-MODIFICATION USAGE directoryOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
NULL, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_subschemaSubentry) },
|
2002-01-20 06:33:07 +08:00
|
|
|
{ "collectiveAttributeSubentries", "( 2.5.18.12 "
|
|
|
|
"NAME 'collectiveAttributeSubentries' "
|
2002-01-10 11:31:11 +08:00
|
|
|
"EQUALITY distinguishedNameMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
|
2002-03-25 01:37:27 +08:00
|
|
|
"NO-USER-MODIFICATION USAGE directoryOperation )",
|
2002-05-29 14:14:55 +08:00
|
|
|
NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-01-20 06:33:07 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_collectiveSubentries) },
|
2002-01-10 11:31:11 +08:00
|
|
|
{ "collectiveExclusions", "( 2.5.18.7 NAME 'collectiveExclusions' "
|
|
|
|
"EQUALITY objectIdentifierMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 "
|
|
|
|
"USAGE directoryOperation )",
|
2002-05-29 14:14:55 +08:00
|
|
|
NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_collectiveExclusions) },
|
2000-05-25 09:49:21 +08:00
|
|
|
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "entryUUID", "( 1.3.6.1.4.1.4203.666.1.6 NAME 'entryUUID' "
|
|
|
|
"DESC 'LCUP/LDUP: universally unique identifier' "
|
|
|
|
"EQUALITY octetStringMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
|
2002-05-30 13:23:37 +08:00
|
|
|
NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-01-10 08:17:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_entryUUID) },
|
|
|
|
{ "entryCSN", "( 1.3.6.1.4.1.4203.666.1.7 NAME 'entryCSN' "
|
|
|
|
"DESC 'LCUP/LDUP: change sequence number' "
|
|
|
|
"EQUALITY octetStringMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{64} "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )",
|
2002-05-30 13:23:37 +08:00
|
|
|
NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-01-10 08:17:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_entryCSN) },
|
|
|
|
|
2000-05-28 03:33:08 +08:00
|
|
|
/* root DSE attributes */
|
2002-01-10 11:31:11 +08:00
|
|
|
{ "altServer", "( 1.3.6.1.4.1.1466.101.120.6 NAME 'altServer' "
|
|
|
|
"DESC 'RFC2252: alternative servers' "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
rootDseAttribute, 0, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_altServer) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "namingContexts", "( 1.3.6.1.4.1.1466.101.120.5 "
|
|
|
|
"NAME 'namingContexts' "
|
|
|
|
"DESC 'RFC2252: naming contexts' "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
rootDseAttribute, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_namingContexts) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "supportedControl", "( 1.3.6.1.4.1.1466.101.120.13 "
|
|
|
|
"NAME 'supportedControl' "
|
2002-03-25 01:37:27 +08:00
|
|
|
"DESC 'RFC2252: supported controls' "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
rootDseAttribute, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_supportedControl) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "supportedExtension", "( 1.3.6.1.4.1.1466.101.120.7 "
|
|
|
|
"NAME 'supportedExtension' "
|
|
|
|
"DESC 'RFC2252: supported extended operations' "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
rootDseAttribute, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_supportedExtension) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "supportedLDAPVersion", "( 1.3.6.1.4.1.1466.101.120.15 "
|
|
|
|
"NAME 'supportedLDAPVersion' "
|
|
|
|
"DESC 'RFC2252: supported LDAP versions' "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
rootDseAttribute, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_supportedLDAPVersion) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "supportedSASLMechanisms", "( 1.3.6.1.4.1.1466.101.120.14 "
|
|
|
|
"NAME 'supportedSASLMechanisms' "
|
|
|
|
"DESC 'RFC2252: supported SASL mechanisms'"
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
rootDseAttribute, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_supportedSASLMechanisms) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "supportedFeatures", "( 1.3.6.1.4.1.4203.1.3.5 "
|
|
|
|
"NAME 'supportedFeatures' "
|
|
|
|
"DESC 'features supported by the server' "
|
|
|
|
"EQUALITY objectIdentifierMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 "
|
|
|
|
"USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
rootDseAttribute, 0, NULL, NULL, NULL,
|
2001-09-09 12:01:07 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_supportedFeatures) },
|
2002-06-19 14:44:16 +08:00
|
|
|
{ "monitorContext", "( 1.3.6.1.4.1.4203.666.1.10 "
|
|
|
|
"NAME 'monitorContext' "
|
|
|
|
"DESC 'monitor context' "
|
|
|
|
"EQUALITY objectIdentifierMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION "
|
|
|
|
"USAGE dSAOperation )",
|
|
|
|
rootDseAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
|
|
|
|
offsetof(struct slap_internal_schema, si_ad_monitorContext) },
|
2002-01-10 11:31:11 +08:00
|
|
|
{ "vendorName", "( 1.3.6.1.1.4 NAME 'vendorName' "
|
|
|
|
"DESC 'RFC3045: name of implementation vendor' "
|
|
|
|
"EQUALITY 1.3.6.1.4.1.1466.109.114.1 "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION "
|
|
|
|
"USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
rootDseAttribute, 0, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_vendorName) },
|
|
|
|
{ "vendorVersion", "( 1.3.6.1.1.5 NAME 'vendorVersion' "
|
|
|
|
"DESC 'RFC3045: version of implementation' "
|
|
|
|
"EQUALITY 1.3.6.1.4.1.1466.109.114.1 "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION "
|
|
|
|
"USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
rootDseAttribute, 0, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_vendorVersion) },
|
|
|
|
|
|
|
|
/* subentry attributes */
|
|
|
|
{ "administrativeRole", "( 2.5.18.5 NAME 'administrativeRole' "
|
|
|
|
"EQUALITY objectIdentifierMatch "
|
|
|
|
"USAGE directoryOperation "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )",
|
2002-05-29 14:14:55 +08:00
|
|
|
administrativeRoleAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_administrativeRole) },
|
|
|
|
{ "subtreeSpecification", "( 2.5.18.6 NAME 'subtreeSpecification' "
|
|
|
|
"SINGLE-VALUE "
|
|
|
|
"USAGE directoryOperation "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.45 )",
|
2002-05-29 14:14:55 +08:00
|
|
|
subentryAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_subtreeSpecification) },
|
2000-05-25 09:49:21 +08:00
|
|
|
|
2000-05-28 03:33:08 +08:00
|
|
|
/* subschema subentry attributes */
|
2002-01-10 11:31:11 +08:00
|
|
|
{ "ditStructureRules", "( 2.5.21.1 NAME 'dITStructureRules' "
|
|
|
|
"DESC 'RFC2252: DIT structure rules' "
|
|
|
|
"EQUALITY integerFirstComponentMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.17 "
|
|
|
|
"USAGE directoryOperation ) ",
|
2002-05-29 14:14:55 +08:00
|
|
|
subentryAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_ditStructureRules) },
|
|
|
|
{ "ditContentRules", "( 2.5.21.2 NAME 'dITContentRules' "
|
|
|
|
"DESC 'RFC2252: DIT content rules' "
|
|
|
|
"EQUALITY objectIdentifierFirstComponentMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.16 USAGE directoryOperation )",
|
2002-05-29 14:14:55 +08:00
|
|
|
subentryAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_ditContentRules) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "matchingRules", "( 2.5.21.4 NAME 'matchingRules' "
|
|
|
|
"DESC 'RFC2252: matching rules' "
|
|
|
|
"EQUALITY objectIdentifierFirstComponentMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.30 USAGE directoryOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
subentryAttribute, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_matchingRules) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "attributeTypes", "( 2.5.21.5 NAME 'attributeTypes' "
|
|
|
|
"DESC 'RFC2252: attribute types' "
|
|
|
|
"EQUALITY objectIdentifierFirstComponentMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.3 USAGE directoryOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
subentryAttribute, 0, NULL, NULL, NULL,
|
2002-01-10 08:17:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_attributeTypes) },
|
|
|
|
{ "objectClasses", "( 2.5.21.6 NAME 'objectClasses' "
|
|
|
|
"DESC 'RFC2252: object classes' "
|
|
|
|
"EQUALITY objectIdentifierFirstComponentMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.37 USAGE directoryOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
subentryAttribute, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_objectClasses) },
|
2002-01-10 11:31:11 +08:00
|
|
|
{ "nameForms", "( 2.5.21.7 NAME 'nameForms' "
|
|
|
|
"DESC 'RFC2252: name forms ' "
|
|
|
|
"EQUALITY objectIdentifierFirstComponentMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.35 USAGE directoryOperation )",
|
2002-05-29 14:14:55 +08:00
|
|
|
subentryAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_nameForms) },
|
2002-01-10 12:10:54 +08:00
|
|
|
{ "matchingRuleUse", "( 2.5.21.8 NAME 'matchingRuleUse' "
|
2002-01-10 11:31:11 +08:00
|
|
|
"DESC 'RFC2252: matching rule uses' "
|
|
|
|
"EQUALITY objectIdentifierFirstComponentMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.31 USAGE directoryOperation )",
|
2002-05-29 14:14:55 +08:00
|
|
|
subentryAttribute, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-01-10 12:10:54 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_matchingRuleUse) },
|
2000-05-25 09:49:21 +08:00
|
|
|
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "ldapSyntaxes", "( 1.3.6.1.4.1.1466.101.120.16 NAME 'ldapSyntaxes' "
|
|
|
|
"DESC 'RFC2252: LDAP syntaxes' "
|
|
|
|
"EQUALITY objectIdentifierFirstComponentMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.54 USAGE directoryOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
subentryAttribute, 0, NULL, NULL, NULL,
|
2002-01-10 08:17:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_ldapSyntaxes) },
|
|
|
|
|
2000-05-28 03:33:08 +08:00
|
|
|
/* knowledge information */
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "aliasedObjectName", "( 2.5.4.1 "
|
|
|
|
"NAME ( 'aliasedObjectName' 'aliasedEntryName' ) "
|
|
|
|
"DESC 'RFC2256: name of aliased object' "
|
|
|
|
"EQUALITY distinguishedNameMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )",
|
2002-06-01 04:24:26 +08:00
|
|
|
aliasAttribute, SLAP_AT_FINAL, NULL, NULL, NULL,
|
2000-05-28 03:33:08 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_aliasedObjectName) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "ref", "( 2.16.840.1.113730.3.1.34 NAME 'ref' "
|
|
|
|
"DESC 'namedref: subordinate referral URL' "
|
|
|
|
"EQUALITY caseExactMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
|
|
|
|
"USAGE distributedOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
referralAttribute, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_ref) },
|
|
|
|
|
2000-05-29 02:58:09 +08:00
|
|
|
/* access control internals */
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "entry", "( 1.3.6.1.4.1.4203.1.3.1 "
|
|
|
|
"NAME 'entry' "
|
|
|
|
"DESC 'OpenLDAP ACL entry pseudo-attribute' "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.4203.1.1.1 "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )",
|
2002-05-29 14:14:55 +08:00
|
|
|
NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_entry) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "children", "( 1.3.6.1.4.1.4203.1.3.2 "
|
|
|
|
"NAME 'children' "
|
|
|
|
"DESC 'OpenLDAP ACL children pseudo-attribute' "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.4203.1.1.1 "
|
|
|
|
"SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )",
|
2002-05-29 14:14:55 +08:00
|
|
|
NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_children) },
|
2002-06-14 16:25:14 +08:00
|
|
|
{ "saslAuthzTo", "( 1.3.6.1.4.1.4203.666.1.8 "
|
2002-06-14 16:10:14 +08:00
|
|
|
"NAME 'saslAuthzTo' "
|
|
|
|
"DESC 'SASL proxy authorization targets' "
|
|
|
|
"EQUALITY caseExactMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
|
2002-06-14 16:25:14 +08:00
|
|
|
"USAGE distributedOperation )",
|
|
|
|
NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-06-14 16:10:14 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_saslAuthzTo) },
|
2002-06-14 16:25:14 +08:00
|
|
|
{ "saslAuthzFrom", "( 1.3.6.1.4.1.4203.666.1.9 "
|
2002-06-14 16:10:14 +08:00
|
|
|
"NAME 'saslAuthzFrom' "
|
|
|
|
"DESC 'SASL proxy authorization sources' "
|
|
|
|
"EQUALITY caseExactMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
|
2002-06-14 16:25:14 +08:00
|
|
|
"USAGE distributedOperation )",
|
|
|
|
NULL, SLAP_AT_HIDE, NULL, NULL, NULL,
|
2002-06-14 16:10:14 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_saslAuthzFrom) },
|
2000-05-31 05:34:55 +08:00
|
|
|
#ifdef SLAPD_ACI_ENABLED
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "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 )",
|
2002-01-14 03:38:12 +08:00
|
|
|
NULL, 0, NULL, NULL, NULL,
|
2000-05-31 05:34:55 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_aci) },
|
|
|
|
#endif
|
2000-05-25 09:49:21 +08:00
|
|
|
|
2002-01-10 11:31:11 +08:00
|
|
|
{ "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 )",
|
2002-01-14 03:38:12 +08:00
|
|
|
dynamicAttribute, 0, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_entryTtl) },
|
|
|
|
{ "dynamicSubtrees", "( 1.3.6.1.4.1.1466.101.119.4 "
|
|
|
|
"NAME 'dynamicSubtrees' "
|
|
|
|
"DESC 'RFC2589: dynamic subtrees' "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION "
|
|
|
|
"USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
rootDseAttribute, 0, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_dynamicSubtrees) },
|
|
|
|
|
2002-01-12 02:56:01 +08:00
|
|
|
/* userApplication attributes (which system schema depends upon) */
|
2002-01-10 11:31:11 +08:00
|
|
|
{ "distinguishedName", "( 2.5.4.49 NAME 'distinguishedName' "
|
|
|
|
"DESC 'RFC2256: common supertype of DN attributes' "
|
|
|
|
"EQUALITY distinguishedNameMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )",
|
2002-06-01 04:24:26 +08:00
|
|
|
NULL, SLAP_AT_ABSTRACT, NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_distinguishedName) },
|
2002-01-10 08:17:21 +08:00
|
|
|
{ "name", "( 2.5.4.41 NAME 'name' "
|
|
|
|
"DESC 'RFC2256: common supertype of name attributes' "
|
|
|
|
"EQUALITY caseIgnoreMatch "
|
|
|
|
"SUBSTR caseIgnoreSubstringsMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )",
|
2002-06-01 04:24:26 +08:00
|
|
|
NULL, SLAP_AT_ABSTRACT, NULL, NULL, NULL,
|
2002-01-10 08:17:21 +08:00
|
|
|
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' "
|
|
|
|
"SUP name )",
|
2002-01-14 03:38:12 +08:00
|
|
|
NULL, 0, NULL, NULL, NULL,
|
2002-01-10 08:17:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_cn) },
|
|
|
|
{ "userPassword", "( 2.5.4.35 NAME 'userPassword' "
|
|
|
|
"DESC 'RFC2256/2307: password of user' "
|
|
|
|
"EQUALITY octetStringMatch "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128} )",
|
2002-06-08 04:32:06 +08:00
|
|
|
NULL, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_userPassword) },
|
2002-01-10 08:17:21 +08:00
|
|
|
|
|
|
|
#ifdef SLAPD_AUTHPASSWD
|
2002-01-10 11:31:11 +08:00
|
|
|
{ "authPassword", "( 1.3.6.1.4.1.4203.1.3.4 "
|
|
|
|
"NAME 'authPassword' "
|
|
|
|
"DESC 'RFC3112: authentication password attribute' "
|
|
|
|
"EQUALITY 1.3.6.1.4.1.4203.1.2.2 "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.4203.1.1.2 )",
|
2002-06-08 04:32:06 +08:00
|
|
|
NULL, 0,
|
2002-01-14 03:38:12 +08:00
|
|
|
NULL, NULL, NULL,
|
2002-01-10 11:31:11 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_authPassword) },
|
|
|
|
{ "supportedAuthPasswordSchemes", "( 1.3.6.1.4.1.4203.1.3.3 "
|
|
|
|
"NAME 'supportedAuthPasswordSchemes' "
|
|
|
|
"DESC 'RFC3112: supported authPassword schemes' "
|
|
|
|
"EQUALITY caseExactIA5Match "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} "
|
|
|
|
"USAGE dSAOperation )",
|
2002-01-14 03:38:12 +08:00
|
|
|
subschemaAttribute, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_authPassword) },
|
2002-01-10 08:17:21 +08:00
|
|
|
#endif
|
2000-05-25 09:49:21 +08:00
|
|
|
#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
|
2002-06-27 02:43:55 +08:00
|
|
|
{ "krbName", "( 1.3.6.1.4.1.250.1.32 "
|
|
|
|
"NAME ( 'krbName' 'kerberosName' ) "
|
|
|
|
"DESC 'Kerberos principal associated with object' "
|
|
|
|
"EQUALITY caseIgnoreIA5Match "
|
|
|
|
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 "
|
|
|
|
"SINGLE-VALUE )",
|
2002-06-08 04:32:06 +08:00
|
|
|
NULL, 0, NULL, NULL, NULL,
|
2000-05-25 09:49:21 +08:00
|
|
|
offsetof(struct slap_internal_schema, si_ad_krbName) },
|
|
|
|
#endif
|
|
|
|
|
2002-01-14 03:38:12 +08:00
|
|
|
{ NULL, NULL, NULL, 0, NULL, NULL, NULL, 0 }
|
2000-05-25 09:49:21 +08:00
|
|
|
};
|
|
|
|
|
2000-07-03 01:16:18 +08:00
|
|
|
static AttributeType slap_at_undefined = {
|
|
|
|
{ "1.1.1", NULL, NULL, 1, NULL,
|
|
|
|
NULL, NULL, NULL, NULL,
|
2001-11-17 22:09:38 +08:00
|
|
|
0, 0, 0, 1, 3 }, /* LDAPAttributeType */
|
2002-01-03 01:06:56 +08:00
|
|
|
{ sizeof("UNDEFINED")-1, "UNDEFINED" }, /* cname */
|
2000-07-03 01:16:18 +08:00
|
|
|
NULL, /* sup */
|
|
|
|
NULL, /* subtypes */
|
|
|
|
NULL, NULL, NULL, NULL, /* matching rules */
|
|
|
|
NULL, /* syntax (this may need to be defined) */
|
2002-06-01 04:24:26 +08:00
|
|
|
(AttributeTypeSchemaCheckFN *) 0, /* schema check function */
|
|
|
|
SLAP_AT_ABSTRACT|SLAP_AT_FINAL, /* mask */
|
2002-01-14 04:19:40 +08:00
|
|
|
NULL, /* next */
|
|
|
|
NULL /* attribute description */
|
2001-11-17 22:09:38 +08:00
|
|
|
/* mutex (don't know how to initialize it :) */
|
2000-07-03 01:16:18 +08:00
|
|
|
};
|
2000-05-25 09:49:21 +08:00
|
|
|
|
2001-12-24 14:36:44 +08:00
|
|
|
static struct slap_schema_mr_map {
|
2001-10-20 18:15:09 +08:00
|
|
|
char *ssmm_name;
|
|
|
|
size_t ssmm_offset;
|
|
|
|
} mr_map[] = {
|
|
|
|
{ "distinguishedNameMatch",
|
|
|
|
offsetof(struct slap_internal_schema, si_mr_distinguishedNameMatch) },
|
|
|
|
{ "integerMatch",
|
|
|
|
offsetof(struct slap_internal_schema, si_mr_integerMatch) },
|
|
|
|
{ NULL, 0 }
|
|
|
|
};
|
|
|
|
|
2001-12-24 14:36:44 +08:00
|
|
|
static struct slap_schema_syn_map {
|
2001-10-20 18:15:09 +08:00
|
|
|
char *sssm_name;
|
|
|
|
size_t sssm_offset;
|
|
|
|
} syn_map[] = {
|
2002-03-30 09:07:20 +08:00
|
|
|
{ "1.3.6.1.4.1.1466.115.121.1.40",
|
|
|
|
offsetof(struct slap_internal_schema, si_syn_octetString) },
|
2001-10-20 18:15:09 +08:00
|
|
|
{ "1.3.6.1.4.1.1466.115.121.1.12",
|
|
|
|
offsetof(struct slap_internal_schema, si_syn_distinguishedName) },
|
|
|
|
{ "1.3.6.1.4.1.1466.115.121.1.27",
|
|
|
|
offsetof(struct slap_internal_schema, si_syn_integer) },
|
|
|
|
{ NULL, 0 }
|
|
|
|
};
|
|
|
|
|
2000-05-25 09:49:21 +08:00
|
|
|
int
|
2002-01-10 08:17:21 +08:00
|
|
|
slap_schema_load( void )
|
|
|
|
{
|
2002-01-10 09:46:08 +08:00
|
|
|
int i;
|
2002-03-30 09:28:34 +08:00
|
|
|
|
|
|
|
for( i=0; syn_map[i].sssm_name; i++ ) {
|
|
|
|
Syntax ** synp = (Syntax **)
|
|
|
|
&(((char *) &slap_schema)[syn_map[i].sssm_offset]);
|
|
|
|
|
|
|
|
assert( *synp == NULL );
|
|
|
|
|
|
|
|
*synp = syn_find( syn_map[i].sssm_name );
|
|
|
|
|
|
|
|
if( *synp == NULL ) {
|
|
|
|
fprintf( stderr, "slap_schema_check: "
|
|
|
|
"No syntax \"%s\" defined in schema\n",
|
|
|
|
syn_map[i].sssm_name );
|
|
|
|
return LDAP_INVALID_SYNTAX;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for( i=0; mr_map[i].ssmm_name; i++ ) {
|
|
|
|
MatchingRule ** mrp = (MatchingRule **)
|
|
|
|
&(((char *) &slap_schema)[mr_map[i].ssmm_offset]);
|
|
|
|
|
|
|
|
assert( *mrp == NULL );
|
|
|
|
|
|
|
|
*mrp = mr_find( mr_map[i].ssmm_name );
|
|
|
|
|
|
|
|
if( *mrp == NULL ) {
|
|
|
|
fprintf( stderr, "slap_schema_check: "
|
|
|
|
"No matching rule \"%s\" defined in schema\n",
|
|
|
|
mr_map[i].ssmm_name );
|
|
|
|
return LDAP_INAPPROPRIATE_MATCHING;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-01-10 09:46:08 +08:00
|
|
|
for( i=0; ad_map[i].ssam_name; i++ ) {
|
2002-03-30 09:28:34 +08:00
|
|
|
assert( ad_map[i].ssam_defn != NULL );
|
|
|
|
{
|
2002-01-10 09:46:08 +08:00
|
|
|
LDAPAttributeType *at;
|
|
|
|
int code;
|
|
|
|
const char *err;
|
|
|
|
|
|
|
|
at = ldap_str2attributetype( ad_map[i].ssam_defn,
|
|
|
|
&code, &err, LDAP_SCHEMA_ALLOW_ALL );
|
|
|
|
if ( !at ) {
|
|
|
|
fprintf( stderr,
|
|
|
|
"slap_schema_load: %s: %s before %s\n",
|
|
|
|
ad_map[i].ssam_name, ldap_scherr2str(code), err );
|
|
|
|
return code;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( at->at_oid == NULL ) {
|
|
|
|
fprintf( stderr, "slap_schema_load: "
|
|
|
|
"attributeType \"%s\" has no OID\n",
|
|
|
|
ad_map[i].ssam_name );
|
|
|
|
return LDAP_OTHER;
|
|
|
|
}
|
|
|
|
|
|
|
|
code = at_add( at, &err );
|
|
|
|
if ( code ) {
|
|
|
|
fprintf( stderr, "slap_schema_load: "
|
|
|
|
"%s: %s: \"%s\"\n",
|
|
|
|
ad_map[i].ssam_name, scherr2str(code), err );
|
|
|
|
return code;
|
|
|
|
}
|
|
|
|
ldap_memfree( at );
|
|
|
|
}
|
2002-03-30 09:28:34 +08:00
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
const char *text;
|
|
|
|
|
|
|
|
AttributeDescription ** adp = (AttributeDescription **)
|
|
|
|
&(((char *) &slap_schema)[ad_map[i].ssam_offset]);
|
|
|
|
|
|
|
|
assert( *adp == NULL );
|
|
|
|
|
|
|
|
rc = slap_str2ad( ad_map[i].ssam_name, adp, &text );
|
|
|
|
if( rc != LDAP_SUCCESS ) {
|
|
|
|
fprintf( stderr, "slap_schema_check: "
|
|
|
|
"No attribute \"%s\" defined in schema\n",
|
|
|
|
ad_map[i].ssam_name );
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( ad_map[i].ssam_check ) {
|
|
|
|
/* install check routine */
|
|
|
|
(*adp)->ad_type->sat_check = ad_map[i].ssam_check;
|
|
|
|
}
|
|
|
|
/* install flags */
|
|
|
|
(*adp)->ad_type->sat_flags |= ad_map[i].ssam_flags;
|
|
|
|
|
|
|
|
if( ad_map[i].ssam_match ) {
|
|
|
|
/* install custom matching routine */
|
|
|
|
(*adp)->ad_type->sat_equality->smr_match = ad_map[i].ssam_match;
|
|
|
|
}
|
|
|
|
}
|
2002-01-10 09:46:08 +08:00
|
|
|
}
|
2002-01-10 13:31:49 +08:00
|
|
|
|
|
|
|
for( i=0; oc_map[i].ssom_name; i++ ) {
|
2002-03-30 09:28:34 +08:00
|
|
|
assert( oc_map[i].ssom_defn != NULL );
|
|
|
|
{
|
2002-01-10 13:54:50 +08:00
|
|
|
LDAPObjectClass *oc;
|
|
|
|
int code;
|
|
|
|
const char *err;
|
2002-01-10 13:31:49 +08:00
|
|
|
|
2002-01-10 13:54:50 +08:00
|
|
|
oc = ldap_str2objectclass( oc_map[i].ssom_defn, &code, &err,
|
|
|
|
LDAP_SCHEMA_ALLOW_ALL );
|
|
|
|
if ( !oc ) {
|
|
|
|
fprintf( stderr, "slap_schema_load: "
|
|
|
|
"%s: %s before %s\n",
|
|
|
|
oc_map[i].ssom_name, ldap_scherr2str(code), err );
|
|
|
|
return code;
|
|
|
|
}
|
2002-01-10 13:31:49 +08:00
|
|
|
|
2002-01-10 13:54:50 +08:00
|
|
|
if ( oc->oc_oid == NULL ) {
|
|
|
|
fprintf( stderr, "slap_schema_load: "
|
|
|
|
"%s: objectclass has no OID\n",
|
|
|
|
oc_map[i].ssom_name );
|
|
|
|
return LDAP_OTHER;
|
|
|
|
}
|
2002-01-10 13:31:49 +08:00
|
|
|
|
2002-05-30 13:23:37 +08:00
|
|
|
code = oc_add(oc,0,&err);
|
2002-01-10 13:54:50 +08:00
|
|
|
if ( code ) {
|
|
|
|
fprintf( stderr, "slap_schema_load: "
|
|
|
|
"%s: %s: \"%s\"\n",
|
|
|
|
oc_map[i].ssom_name, scherr2str(code), err);
|
|
|
|
return code;
|
|
|
|
}
|
|
|
|
|
|
|
|
ldap_memfree(oc);
|
|
|
|
}
|
2002-03-30 09:28:34 +08:00
|
|
|
{
|
|
|
|
ObjectClass ** ocp = (ObjectClass **)
|
|
|
|
&(((char *) &slap_schema)[oc_map[i].ssom_offset]);
|
2000-05-25 09:49:21 +08:00
|
|
|
|
2002-03-30 09:28:34 +08:00
|
|
|
assert( *ocp == NULL );
|
2002-01-10 08:17:21 +08:00
|
|
|
|
2002-03-30 09:28:34 +08:00
|
|
|
*ocp = oc_find( oc_map[i].ssom_name );
|
|
|
|
if( *ocp == NULL ) {
|
|
|
|
fprintf( stderr, "slap_schema_check: "
|
|
|
|
"No objectClass \"%s\" defined in schema\n",
|
|
|
|
oc_map[i].ssom_name );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
2002-01-10 08:17:21 +08:00
|
|
|
|
2002-03-30 09:28:34 +08:00
|
|
|
if( oc_map[i].ssom_check ) {
|
|
|
|
/* install check routine */
|
|
|
|
(*ocp)->soc_check = oc_map[i].ssom_check;
|
|
|
|
}
|
|
|
|
/* install flags */
|
|
|
|
(*ocp)->soc_flags |= oc_map[i].ssom_flags;
|
2002-01-10 08:17:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-03-30 09:07:20 +08:00
|
|
|
slap_at_undefined.sat_syntax = slap_schema.si_syn_distinguishedName;
|
2002-01-10 08:17:21 +08:00
|
|
|
slap_schema.si_at_undefined = &slap_at_undefined;
|
|
|
|
|
2002-03-30 09:28:34 +08:00
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
2002-01-14 03:38:12 +08:00
|
|
|
|
2002-03-30 09:28:34 +08:00
|
|
|
int
|
|
|
|
slap_schema_check( void )
|
|
|
|
{
|
|
|
|
/* we should only be called once after schema_init() was called */
|
|
|
|
assert( schema_init_done == 1 );
|
2001-10-20 18:15:09 +08:00
|
|
|
|
2000-05-25 09:49:21 +08:00
|
|
|
++schema_init_done;
|
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
2002-01-10 13:31:49 +08:00
|
|
|
|
2002-01-10 14:30:26 +08:00
|
|
|
static int rootDseObjectClass (
|
2002-01-12 02:00:22 +08:00
|
|
|
Backend *be,
|
2002-01-10 14:30:26 +08:00
|
|
|
Entry *e,
|
|
|
|
ObjectClass *oc,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
|
|
|
*text = textbuf;
|
2002-01-12 03:11:46 +08:00
|
|
|
|
2002-01-10 14:30:26 +08:00
|
|
|
if( e->e_nname.bv_len ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"objectClass \"%s\" only allowed in the root DSE",
|
|
|
|
oc->soc_oid );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we should not be called for the root DSE */
|
|
|
|
assert( 0 );
|
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-01-12 02:56:01 +08:00
|
|
|
static int aliasObjectClass (
|
|
|
|
Backend *be,
|
|
|
|
Entry *e,
|
|
|
|
ObjectClass *oc,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
2002-01-12 03:11:46 +08:00
|
|
|
*text = textbuf;
|
|
|
|
|
2002-01-12 02:56:01 +08:00
|
|
|
if( !SLAP_ALIASES(be) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"objectClass \"%s\" not supported in context",
|
|
|
|
oc->soc_oid );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
2002-01-12 03:11:46 +08:00
|
|
|
|
2002-01-12 02:56:01 +08:00
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int referralObjectClass (
|
|
|
|
Backend *be,
|
|
|
|
Entry *e,
|
|
|
|
ObjectClass *oc,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
2002-01-12 03:11:46 +08:00
|
|
|
*text = textbuf;
|
|
|
|
|
2002-01-12 02:56:01 +08:00
|
|
|
if( !SLAP_REFERRALS(be) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"objectClass \"%s\" not supported in context",
|
|
|
|
oc->soc_oid );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
2002-01-12 03:11:46 +08:00
|
|
|
|
2002-01-12 02:56:01 +08:00
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-01-10 14:30:26 +08:00
|
|
|
static int subentryObjectClass (
|
2002-01-12 02:00:22 +08:00
|
|
|
Backend *be,
|
2002-01-10 14:30:26 +08:00
|
|
|
Entry *e,
|
|
|
|
ObjectClass *oc,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
2002-01-12 03:11:46 +08:00
|
|
|
*text = textbuf;
|
|
|
|
|
2002-01-12 02:56:01 +08:00
|
|
|
if( !SLAP_SUBENTRIES(be) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"objectClass \"%s\" not supported in context",
|
|
|
|
oc->soc_oid );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( oc != slap_schema.si_oc_subentry && !is_entry_subentry( e ) ) {
|
2002-01-10 14:30:26 +08:00
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"objectClass \"%s\" only allowed in subentries",
|
|
|
|
oc->soc_oid );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
2002-01-12 03:11:46 +08:00
|
|
|
|
2002-01-10 14:30:26 +08:00
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-01-12 02:56:01 +08:00
|
|
|
static int dynamicObjectClass (
|
|
|
|
Backend *be,
|
|
|
|
Entry *e,
|
|
|
|
ObjectClass *oc,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
2002-01-12 03:11:46 +08:00
|
|
|
*text = textbuf;
|
|
|
|
|
2002-01-12 02:56:01 +08:00
|
|
|
if( !SLAP_DYNAMIC(be) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"objectClass \"%s\" not supported in context",
|
|
|
|
oc->soc_oid );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
2002-01-12 03:11:46 +08:00
|
|
|
|
2002-01-12 02:56:01 +08:00
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-01-10 13:31:49 +08:00
|
|
|
static int rootDseAttribute (
|
2002-01-12 02:00:22 +08:00
|
|
|
Backend *be,
|
2002-01-10 13:31:49 +08:00
|
|
|
Entry *e,
|
|
|
|
Attribute *attr,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
|
|
|
*text = textbuf;
|
2002-01-12 03:11:46 +08:00
|
|
|
|
2002-01-10 13:31:49 +08:00
|
|
|
if( e->e_nname.bv_len ) {
|
|
|
|
snprintf( textbuf, textlen,
|
2002-01-10 14:30:26 +08:00
|
|
|
"attribute \"%s\" only allowed in the root DSE",
|
2002-01-10 13:31:49 +08:00
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we should not be called for the root DSE */
|
|
|
|
assert( 0 );
|
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-01-12 03:11:46 +08:00
|
|
|
static int aliasAttribute (
|
2002-01-12 02:00:22 +08:00
|
|
|
Backend *be,
|
2002-01-10 13:31:49 +08:00
|
|
|
Entry *e,
|
|
|
|
Attribute *attr,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
|
|
|
*text = textbuf;
|
2002-01-12 03:11:46 +08:00
|
|
|
|
|
|
|
if( !SLAP_ALIASES(be) ) {
|
2002-01-10 13:31:49 +08:00
|
|
|
snprintf( textbuf, textlen,
|
2002-01-12 03:11:46 +08:00
|
|
|
"attribute \"%s\" not supported in context",
|
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !is_entry_alias( e ) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"attribute \"%s\" only allowed in the alias",
|
2002-01-10 13:31:49 +08:00
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int referralAttribute (
|
2002-01-12 02:00:22 +08:00
|
|
|
Backend *be,
|
2002-01-10 13:31:49 +08:00
|
|
|
Entry *e,
|
|
|
|
Attribute *attr,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
|
|
|
*text = textbuf;
|
2002-01-12 03:11:46 +08:00
|
|
|
|
|
|
|
if( !SLAP_REFERRALS(be) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"attribute \"%s\" not supported in context",
|
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
2002-01-10 13:31:49 +08:00
|
|
|
if( !is_entry_referral( e ) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
2002-01-10 14:30:26 +08:00
|
|
|
"attribute \"%s\" only allowed in the referral",
|
2002-01-10 13:31:49 +08:00
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
2002-01-12 03:11:46 +08:00
|
|
|
|
|
|
|
static int subentryAttribute (
|
|
|
|
Backend *be,
|
|
|
|
Entry *e,
|
|
|
|
Attribute *attr,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
|
|
|
*text = textbuf;
|
|
|
|
|
|
|
|
if( !SLAP_SUBENTRIES(be) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"attribute \"%s\" not supported in context",
|
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !is_entry_subentry( e ) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"attribute \"%s\" only allowed in the subentry",
|
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2002-01-15 15:29:15 +08:00
|
|
|
static int administrativeRoleAttribute (
|
|
|
|
Backend *be,
|
|
|
|
Entry *e,
|
|
|
|
Attribute *attr,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
|
|
|
*text = textbuf;
|
|
|
|
|
|
|
|
if( !SLAP_SUBENTRIES(be) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"attribute \"%s\" not supported in context",
|
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"attribute \"%s\" not supported!",
|
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
2002-01-12 03:11:46 +08:00
|
|
|
static int dynamicAttribute (
|
|
|
|
Backend *be,
|
|
|
|
Entry *e,
|
|
|
|
Attribute *attr,
|
|
|
|
const char** text,
|
|
|
|
char *textbuf, size_t textlen )
|
|
|
|
{
|
|
|
|
*text = textbuf;
|
|
|
|
|
|
|
|
if( !SLAP_DYNAMIC(be) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"attribute \"%s\" not supported in context",
|
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !is_entry_dynamicObject( e ) ) {
|
|
|
|
snprintf( textbuf, textlen,
|
|
|
|
"attribute \"%s\" only allowed in dynamic object",
|
|
|
|
attr->a_desc->ad_cname.bv_val );
|
|
|
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
return LDAP_SUCCESS;
|
|
|
|
}
|