分享

OpenLDAP的Schema扩展

 king9413 2015-04-16
原文地址: 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文件。

OpenLDAP的Schema扩展

Schema扩展

扩展Schema的步骤:

  1. 获得Object Identifier。
  2. 选择名字的前缀。
  3. 创建本地Schema文件。
  4. 自定义属性类型,如果有必要。
  5. 自定义object classes

OID

 
Schema中每个element都有一个全局唯一的OID。如果一个组织分配了一个OID,假定为1.1,那么可以按照下表分配使用。

OpenLDAP的Schema扩展

顺便说一下,我在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的定义如下:

OpenLDAP的Schema扩展


OpenLDAP的Schema扩展

其中whsp表示空格。Syntax和Matchrule如下表所示:

OpenLDAP的Schema扩展

OpenLDAP的Schema扩展

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的定义如下:

OpenLDAP的Schema扩展



    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多