下面定义一个允许将myPhoto增加到任何已经存在的条目中的auxiliary对象类:
objectclass= ( 1.1.2.2.1 NAME 'myPhotoObject' DESC 'mixin myPhoto' AUXILIARY MAY myPhoto )
如果您的组织需要一个私有的结构化对象类来表示用户,你可以子类化任何一个已经存在的person类,比如inetOrgPerson(RFC2798),然后增加需要的属性:
objectclass =( 1.1.2.2.2 NAME 'myPerson' DESC 'my person' SUP inetOrgPerson MUST ( 'myUniqueName' $ 'givenName' ) MAY 'myPhoto' )
该对象类从inetOrgPerson中继承允许的或者必须的属性,但是,要求myUniqueName和givenName,允许myPhoto。
Attribute
attribute就是一个上面objectclass中可能包含的属性,对其的定义包括名称,数据类型,单值还是多值以及匹配规则等。后面用具体的例子来说明。
Attribute格式:
attributeType ( whsp numericoid whsp //全局唯一的 OID [ "NAME" qdescrs ] //属性名称 [ "DESC" qdstring ] //属性描述 [ "OBSOLETE" whsp ] [ "SUP" woid ] //本属性从其它属性中派生出来的 [ "EQUALITY" woid //相等性匹配 [ "ORDERING" woid//顺序匹配 [ "SUBSTR" woid ] //字符串匹配 [ "SYNTAX" whsp noidlen whsp ] //字段的数据类型的OID [ "SINGLE-VALUE" whsp ] //定义本属性为单值(默认多值) [ "COLLECTIVE" whsp ] //default not collective [ "NO-USER-MODIFICATION" whsp ]//default user modifiable [ "USAGE" whsp AttributeUsage ]//default userApplications whsp ")" AttributeUsage = "userApplications" / "directoryOperation" / "distributedOperation" / ; DSA-shared
whsp是空格的意思(' ')。numericoid 是全局唯一的 OID,是带.的十进制形式 (e.g. 1.1.0), qdescrs有一个或几个意思, woid 可以使名称或者是 OID 可选择的一定长度的后缀(e.g {10})。
例如,属性类型name和cn在core.schema中如下定义:
attributeType ( 2.5.4.41 NAME 'name'
DESC 'name(s) associated with the object'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
attributeType ( 2.5.4.3 NAME ( 'cn' $ 'commonName' )
DESC 'common name(s) assciated with the object'
SUP name )
attributetype ( 1.3.6.1.4.1.7914.1.2.1.6 NAME 'quota'
DESC 'The amount of space the user can use until all further messages get bounced.'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.44
SINGLE-value )
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-31257-13.html
股市跳水
中国人超日本N倍
这充分说明我国強大的国防能力
这事就算了