如何添加自定义属性并将其分配给sun ds中的现有自定义对象类

use*_*666 5 ldap sunone

我需要向sun ds schema添加一个属性并将其分配给现有的自定义对象类.

我知道如何添加属性,但如何将属性添加到现有的自定义对象类.

请帮忙.

谢谢

Ter*_*ner 5

创建新attributeTypes定义,并将新属性名称添加到objectClassesMUST或MAY子句中.

下面的示例使用config/schema目录中的文件显示上述内容.

dn: cn=schema
objectClass: top
objectClass: ldapSubentry
objectClass: subschema
##
## The new attribute type
##
attributeTypes: ( stackOverflowQuestionID-oid
  NAME 'stackOverflowQuestionID'
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
  SINGLE-VALUE
  DESC 'Describes the ID of a stack overflow question.'
  X-ORIGIN 'StackOverflow question.' )
##
## An existing object class
##
objectClasses: ( stackOverflow-oid NAME 'stackOverflow'
  SUP top
  STRUCTURAL
  MUST cn
  MAY (
    description $
    stackOverflowQuestionID
  ) X-ORIGIN 'StackExchange network' )
Run Code Online (Sandbox Code Playgroud)

上面的例子中可以用作在config /模式目录中的文件,或attributeTypesobjectClasses可以在下使用LDAP中被添加/修改cn=schema.

LDIF更改记录

dn: cn=schema
changetype: modify
add: attributeTypes
##
## The new attribute type
##
attributeTypes: ( stackOverflowQuestionID-oid
  NAME 'stackOverflowQuestionID'
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
  SINGLE-VALUE
  DESC 'Describes the ID of a stack overflow question.'
  X-ORIGIN 'StackOverflow question.' )
Run Code Online (Sandbox Code Playgroud)

对于现有的objectClass,创建一个删除原始的LDIF更改记录,然后将其添加回来,这次包括新的MUST或MAY子句.或者,正如您所说,使用LDAP浏览器更新objectClasses属性.