ubuntu 12.10 openldap issue Invalid DN syntax (34)”

I’m following: https://help.ubuntu.com/12.10/serverguide/openldap-server.html and when I get to the part that says

ldapsearch -x -LLL -H ldap:/// -b dc=example,dc=com dn

I get:

Invalid DN syntax (34)
Additional information: invalid DN

I noticed:

sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config dn
dn: cn=config
dn: cn=schema,cn=config
dn: olcDatabase={-1}frontend,cn=config
dn: olcDatabase={0}config,cn=config

Thanks for any help

Answer

You have no schema defined. In order to perform your example search you need a schema with something close to the following definitions which are taken from core.schema.

olcAttributeTypes: ( 0.9.2342.19200300.100.1.25 NAME ( 'dc' 'domainComponent' ) DESC 'RFC1274/2247: domain component' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )  
olcObjectClasses: ( 1.3.6.1.4.1.1466.344 NAME 'dcObject' DESC 'RFC2247: domain component object' SUP top AUXILIARY MUST dc )

In fact, you should probably just add core.schema to your slapd, ubuntu-12.10 uses slapd-config so, you’ll actually be adding a .ldif file.

sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/core.ldif

Depending on what you’re doing you’ll probably also want:

  • cosine (required for inetorgperson)
  • inetorgperson
  • nis (I recommend rfc2307bis, but you’d have to take it from elsewhere.)
  • misc (mail routing)

Attribution
Source : Link , Question Author : jgreenberg , Answer Author : 84104

Leave a Comment