Score:0

ldap_add - Invalid Syntax - Additional Info: ObjectClass - Value #1 Invalid Peer Syntax

cn flag

I have the following content in adam.ldif

dn: uid=adam,ou=users,dc=wesgibbs,dc=com
objectClass: top
objectClass: account
objectClass: posixAccount
objectClass: shadowAccount
cn: adam
uid: adam
uidNumber: 16859
gidNumber: 100
homeDirectory: /home/adam
loginShell: /bin/bash
gecos: adam
userPassword: {crypt}x
shadowLastChange: 0
shadowMax: 0
shadowWarning: 0

I then attempt to add the above adam user to my LDAP server w/the following command

ldapadd -x -D "cn=Manager,dc=wesgibbs,dc=com" -W -f adam.ldif

I get the following feedback:

Enter LDAP Password:
adding new entry "uid=adam,ou=users,dc=wesgibbs,dc=com"
ldap_add: Invalid syntax (21)
        additional info: objectClass: value #1 invalid per syntax

My understanding at this point is that the objectClass entries in the .ldif file start at index 0. So index 1 that the feedback is referring too for the error is the objectClass: account portion. My other understanding, and what I suspect is the issue, is that I'm not including the correct module in my slapd.conf file. I'm new to OpenLDAP and am trying to get the basics down. Any help is appreciated.

Score:0
bw flag

You may find your answer here: Why does this ldapadd command quit with an "Invalid syntax" error?

For example, by using slapd.conf, you will need to include the schema definition (I'm using the path from FreeBSD 13.2-RELEASE, openldap26):

# For objectClass account
include /usr/local/etc/openldap/schema/cosine.schema
# For objectClass posixAccount
include /usr/local/etc/openldap/schema/nis.schema

To activate new schemas, slapd will need to be restart afterwards.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.