https://bugs.openldap.org/show_bug.cgi?id=10231
Issue ID: 10231 Summary: slapadd segfault on non-configured backend Product: OpenLDAP Version: 2.6.8 Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: hyc@openldap.org Target Milestone: ---
If the LDIF being loaded corresponds to a different backend than the one specified (or the default backend, if none was specified), and the specified backend's configuration is incomplete and lacks a suffix, slapadd will SEGV when trying to print the error message about the LDIF not matching the specified backend, because it tries to print the suffix but the suffix is NULL.
E.g. using this setup:
### mkdir dumb dumb/db cat > dumb/slapd.conf <<EOF include schema/core.schema
backend ldif database ldif directory dumb/db EOF
slapd -Ta -f dumb/slapd.conf -l schema/inetorgperson.ldif ###
When fixed, the normal error message will be shown instead:
slapadd: line 1: database #1 ((null)) not configured to hold "cn=inetorgperson,cn=schema,cn=config"; did you mean to use database #0 (cn=config)? Closing DB...