自定义OpenLDAP的schema

自定义schema的时候要注意定义的名字不能和已有的名字重复,OID也不能有重复,名字中不能有“_”可以有“-”

我自己的写的一个schema:
attributetype ( 1.3.6.1.4.1.7.1.2.1.1 NAME 'id'
DESC 'id'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

objectclass ( 1.3.6.1.4.1.7.1.2.2.1 NAME 'mygroup'
DESC 'mygroup'
SUP top STRUCTURAL
MUST ( id $ userid )
MAY ( description $ name ) )

attributetype ( 1.3.6.1.4.1.7.1.2.1.2 NAME 'mobile'
DESC 'member_mobile'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

attributetype ( 1.3.6.1.4.1.7.1.2.1.3 NAME 'sex'
DESC 'member_sex'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

attributetype ( 1.3.6.1.4.1.7.1.2.1.4 NAME 'birthday'
DESC 'member_birthday'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

attributetype ( 1.3.6.1.4.1.7.1.2.1.5 NAME 'telephone'
DESC 'member_telephone'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-value )

attributetype ( 1.3.6.1.4.1.7.1.2.1.6 NAME 'company'
DESC 'member_company'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

attributetype ( 1.3.6.1.4.1.7.1.2.1.7 NAME 'department'
DESC 'member_department'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

attributetype ( 1.3.6.1.4.1.7.1.2.1.8 NAME 'job'
DESC 'member_job'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

attributetype ( 1.3.6.1.4.1.7.1.2.1.9 NAME 'office'
DESC 'member_office'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

attributetype ( 1.3.6.1.4.1.7.1.2.1.10 NAME 'memo'
DESC 'member_memo'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

objectclass ( 1.3.6.1.4.1.7.1.2.2.2 NAME 'mymember'
DESC 'mygroup'
SUP top STRUCTURAL
MUST ( id $ userid )
MAY ( name $ description $ mobile $ sex $ birthday $ telephone $ company $ department $ job $ email $ memo ) )


EQUALITY 和 SYNTAX 对应的关系:
caseIgnoreMatch 要和 1.3.6.1.4.1.1466.115.121.1.15 对应
caseIgnoreIA5Match 要和 1.3.6.1.4.1.1466.115.121.1.26 对应
integerMatch 要和 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-value 对应

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/njchenyi/archive/2008/01/15/2044812.aspx

你可能感兴趣的:(LDAP)