0

I am trying to following this answer How to add a new attribute to an existing LDAP objectclass? but I am getting an error

modifying entry "dc=internal,dc=domain,dc=com"
ldap_modify: Object class violation (65)
    additional info: attribute 'olcAttributeTypes' not allowed

my ldif content

version: 1

dn: dc=internal,dc=domain,dc=com
changetype: modify
add: olcAttributeTypes
olcAttributeTypes: gweReportingTo

What i want to do is add new attribute or rename existing one to something i need it to be.

shorif2000
  • 357
  • 1
  • 7
  • 26

1 Answers1

2

You try to modify a Object in the context dc=internal,dc=domain,dc=com.

This is the second step. You need to modify the Schema Configuration first.

The post you already found describe it. Look at the dn in the ldapmod dn: cn={N}test,cn=schema,cn=config

By the way it is not a good idea to modify an existing schema. You should add you own.

this will make a string 'myattribute' (SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)

dn: cn=myschema,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: myschema
olcAttributeTypes: {0}( 1.1.3.5.1 NAME 'myattribute' DESC 'description of myattribute' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
olcObjectClasses: {0}( 1.1.3.7.1 NAME 'myObjectClass' DESC 'description of myObjectClass' SUP top AUXILIARY MAY ( myattribute ) )

after adding the schema to cn=config you can add the attribute like so:

dn: dc=internal,dc=domain,dc=com
changetype: modify
add: ObjectClass
ObjectClass: myObjectClass
-
add: myattribute
myattribute: value1
myattribute: value2

The OID's 1.1.3.5.1 and 1.1.3.7.1 in this example are from a 'dead OID area' you my want to register a Private Enterprise Number: https://pen.iana.org/pen/PenApplication.page

Cram
  • 21
  • 1