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

Something strange on initial ldbm db creation with ldif2ldbm



I have been staring at the code and I just don't get it.

If the ldif file contains an initial blank line, the database is created without
errors.  However, later accesses fail like this:

ldapsearch -R -s sub -b 'dc=stlinter,dc=net' 'objectclass=*'
ldap_search: No such object

A full trace of slapd shows that the error is detected in str2entry called from id2entry
because 'entry 1 has no dn'.  If the initial empty line is deleted, everything is ok.
Feeding /dev/null to ldif2ldbm and adding manually the entries with ldapadd seems to
work OK, too.

I think ldif2ldbm (ldif2id2entry?) should either be more tolerant, and skip empty initial
lines, or enter full fascist mode and complain loudly.

Anyway, I think this may explain some of the latest complaints about this.

BTW, this was tested against HEAD on a Linux RedHat 5.2 platform and kernel 2.2.5 and
using gdbm.

Julio