0

I want to import some schemas into the LDAP. But I get this error:

ldapadd: invalid format (line 21) entry: ""

This is the file with the schemas:

# ****-Schema-Datei.
#
# OID prefix: 1.3.6.1.4.1.29508
# Attributes: 1.3.6.1.4.1.29508.1.1
#
# Depends on: nis.schema, which depends on cosine.schema
attributetype: ( 1.3.6.1.4.1.29508.1.1.1 NAME 'domain'
        DESC 'A mail domain'
        EQUALITY caseIgnoreIA5Match
        SUBSTR caseIgnoreIA5SubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
        SINGLE-VALUE )

attributetype: ( 1.3.6.1.4.1.29508.1.1.2 NAME 'forward'
        DESC 'Forward to mail address'
        EQUALITY caseIgnoreIA5Match
        SUBSTR caseIgnoreIA5SubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

objectclass: ( 1.3.6.1.4.1.29508.1.2.1 NAME '****Domain' SUP top STRUCTURAL
        DESC 'Domain used for mail server'
        MUST ( domain )
        MAY ( description ) )

objectclass: ( 1.3.6.1.4.1.29508.1.2.2 NAME '****MailAccount' SUP top STRUCTURAL
        DESC 'Mail account object'
        MUST ( mail $ uidNumber $ gidNumber $ userPassword )
        MAY ( description ) )

objectclass: ( 1.3.6.1.4.1.29508.1.2.3 NAME '****MailAlias' SUP top STRUCTURAL
        DESC 'Mail aliasing forwarding entry'
        MUST ( mail $ forward )
        MAY ( description ) )

objectclass: ( 1.3.6.1.4.1.29508.1.2.4 NAME '****Account' SUP top AUXILIARY
        DESC 'User account'
        MUST ( homeDirectory )
        MAY ( uidNumber $ gidNumber $ uid $ cn $ description $ loginShell $ userPassword $ mail ) )

I just replaced the name of our organisation with **** for this website.

Why do I get this error?

Thank you for your help.

MfG

Paul

leet
  • 13
  • 3

1 Answers1

1

ldapadd loads LDIF files, you're trying to load a schema file. Either load the LDIF version of the schema if it's available or there's a way to convert a schema file into its LDIF equivalent by following the instructions here https://www.lisenet.com/2015/convert-openldap-schema-to-ldif/ to create a minimal slapd.conf including the schema and converting it to the cn=config form.

bodgit
  • 4,661
  • 13
  • 26
  • So I have to convert the schema, and than I can add it with this command ldapadd -Y EXTERNAL -H ldapi:/// -f /home/foo/*****.schema – leet Aug 04 '16 at 19:53
  • I did this, but now I get this error: slaptest -f /home/foo/****.schema -F /tmp/ldif-test 57a3abd2 /home/foo/****.schema: line 28 objectclass: AttributeType not found: "mail" slaptest: bad configuration directory! – leet Aug 04 '16 at 20:58
  • You probably need to include the `core.schema` and `inetorgperson.schema` schemas in the minimal `slapd.conf` file to satisfy any object and attribute dependencies. – bodgit Aug 05 '16 at 12:59
  • but there is no sldapd.conf. There is only the slapd.con/ (the database). – leet Aug 05 '16 at 19:28
  • Read what I wrote and linked to again. *You* have to create the minimal `slapd.conf`, literally just containing the two or three `include` directives for the schema files. – bodgit Aug 06 '16 at 10:28