原文地址: http://www./doc/admin24/schema.html
本章介绍了如何对OpenLDAP中的Schema进行扩展,阅读本章内容的预备知识是LDAP/X.500信息模型。在介绍对Schema如何进行扩展之前,介绍了发行包中的已有的Schema。
随软件发行的Schema文件
随软件发行Schema文件通过在配置文件slapd.conf中include进来即可使用。不同的发行版Schema文件的位置不一样,Ubuntu
Server把Schema文件存在/etc/ldap/schema目录。下表是随软件发行的Schema文件。
Schema扩展
扩展Schema的步骤:
- 获得Object Identifier。
- 选择名字的前缀。
- 创建本地Schema文件。
- 自定义属性类型,如果有必要。
- 自定义object classes
OID
Schema中每个element都有一个全局唯一的OID。如果一个组织分配了一个OID,假定为1.1,那么可以按照下表分配使用。
顺便说一下,我在IANA申请了一个Object Identifier,36688。
给elements命名
每个element都需要一个名字。名字需要向IANA申请,当然也可以加一个x-前缀,表明是一个私用的名字。
属性类型
attributetype指令用来定义一个新的属性类型。参照RFC4512。The directive uses the same
Attribute Type Description (as defined in RFC4512) used by the
attributeTypes attribute found in the subschema subentry,
e.g.:
attributetype
<RFC4512 Attribute Type
Description>
Attribute Type Description的定义如下:
其中whsp表示空格。Syntax和Matchrule如下表所示:
Object Class
objectclasses 指令用于定义一个新的object class。The directive uses the same
Object Class Description (as defined in RFC4512) used by the
objectClasses attribute found in the subschema subentry,
e.g.:
objectclass <RFC4512
Object Class Description>
Object Class Description的定义如下:
|