Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i add an custom attribute and assign it to an existing custom object class in sun ds

Tags:

ldap

sunone

I need to add an attribute to sun ds schema and assign it to an existing custom object class.

I know how to add an attribute but how can i add the attribute to an existing custom object class.

Please help.

Thanks

like image 826
user2818666 Avatar asked Oct 21 '13 05:10

user2818666


1 Answers

Create the new attributeTypes definition, and add the new attribute name to the objectClasses MUST or MAY clause.

This example below shows the above using a file in the config/schema directory.

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' )

The example above can be used as a file in the config/schema directory, or the attributeTypes and objectClasses can be added/modified using LDAP in under cn=schema.

LDIF change records

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.' )

For the existing objectClass, create an LDIF change record that deletes the original and then adds it back, this time including the new MUST or MAY clause. Or, as you say, use an LDAP browser to update the objectClasses attribute.

like image 89
Terry Gardner Avatar answered Oct 21 '22 13:10

Terry Gardner