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

StackOverflow https://stackoverflow.com/questions/19486854

  •  01-07-2022
  •  | 
  •  

Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top