[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#6843) Can't slapadd cn=config LDIF with global chaining overlay

Full_Name: Ralf Haferkamp
Version: HEAD
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

slapadd-ing the following LDIF (a stripped down slapcat output) fails:
dn: cn=config
objectClass: olcGlobal
cn: config

dn: olcDatabase={-1}frontend,cn=config
objectClass: olcDatabaseConfig
objectClass: olcFrontendConfig
olcDatabase: {-1}frontend

dn: olcOverlay={0}chain,olcDatabase={-1}frontend,cn=config
objectClass: olcOverlayConfig
objectClass: olcChainConfig
olcOverlay: {0}chain

dn: olcDatabase={0}ldap,olcOverlay={0}chain,olcDatabase={-1}frontend,cn=config
objectClass: olcChainDatabase
objectClass: olcLDAPConfig
olcDatabase: {0}ldap

dn: olcDatabase={0}config,cn=config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
The error message is:
slapadd: could not add entry dn="olcDatabase={0}config,cn=config" (line=20):
Already exists

The problem is the olcChainDatabase Entry. As it appears before the
config-database entry config_tool_entry_put() will autocreate an
olcDatabase={0}config,cn=config and after that choke up when trying to add the
olcDatabase={0}config,cn=config that appears later in the LDIF file.

I have a fix for this mostly ready. (Just skipping autocreation of the
config-Database if child-entries of the frontendDatabase are added)