0

Trying to add a new attribute to a schema by using this command:

ldapmodify -f ./add-id-attribute.ldif -h localhost -p 50389 -D "cn=Directory Manager" -w mySecretPassword

And this LDIF file

dn: cn=schema
changetype: modify
add: attributetypes
attributetypes: ( 1.3.6.1.4.1.32474 NAME 'myAttribute'
    USAGE userApplications )
    DESC 'The attribute'

But it gives me the following response: ldapmodify: invalid format (line 5) entry: "cn=schema"

I already changed the line endings to UNIX but that did not help. I am using a docker image of OpenAM 6.5.2 which using OpenDJ as the directory server.

1 Answers1

1

Your LDiF is not formatted correctly.

The DESC line comes after the closing bracket ) on the USAGE line and can therefore not be parsed.

You need to move the ) so the attributeTypes definition becomes fully enclosed by ( )

dn: cn=schema
changetype: modify
add: attributetypes
attributetypes: ( 1.3.6.1.4.1.32474 NAME 'myAttribute'
    USAGE userApplications 
    DESC 'The attribute' )
HBruijn
  • 77,029
  • 24
  • 135
  • 201