There is a difference between openldap 2.3 and 2.4 – specifically with ldapmodify…
If no "changetype:" line is present, the default is "add" if the -a flag is set (or if the program was invoked as ldapadd) and "modify" otherwise.
If changetype is "modify" and no "add:", "replace:", or "delete:" lines appear, the default is "replace" for ldapmodify(1) and "add" for ldapadd(1).
Does anyone have any idea how to make the 2.4 version of ldapmodify act the same way? Now my script tells me:
ldapmodify: modify operation type is missing at line xxxx
I have attempted to add the line "changetype: modify" after each dn: entry in the file I'm attempting to import, however this hasn't fixed the issue.
So, can someone clue in this stupid dude here on what I'm missing?
Example in ldif format:
# inactive, group, mydomain.net
dn: cn=inactive,ou=group,dc=mydomain,dc=net
cn: inactive
gidNumber: 9999
objectClass: top
objectClass: posixGroup
Best Answer
LDAP 2.3 needs at least only changetype atribute:
Version 2.4 requires additional atributes for modifying:
Look at the string
replace: sambaSID
in the last example. On my Debian 6 first LDIF rise an errorSecond LDIF example works fine:
Refer to http://www.zytrax.com/books/ldap/ch14/ for details about
ldapadd
andldapmodify
and http://www.zytrax.com/books/ldap/ch8/index.html#changetype for details about additional attributes.Best regards.