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

ldbmcat output not in index order (ITS#174)

Full_Name: Jochen Wiedmann
Version: 1.2.1
OS: Linux 2.2.5 (Red Hat 6.0)
URL: ftp://ftp.openldap.org/incoming/ldbmsort.pl
Submission from: (NULL) (

When exporting an LDBM database of more than 255 objects, the object order is
not 1, 2, 3, ... as expected, but 256, 1, 257, 2, 258, 3, ...

Problem is, that the database becomes corrupt when reimporting this file via

To show the problem, I have uploaded a small Perl script (ldbmsort.pl) to the
OpenLDAP incoming directory, that creates a tree of 400 objects:

	# Run "ldbmsort" for the first time and let it create an LDIF tree
	[root@gate joe]# ./ldbmsort.pl --create >/tmp/myldif

	# Import this tree
	[root@gate joe]# /usr/sbin/ldif2ldbm -i /tmp/myldif

	# Export it with ldbmcat and compare it to the original.
	# cmp shows immediate differences (object number not 1)
	[root@gate joe]# /usr/sbin/ldbmcat /var/ldap/id2entry.dbb | cmp - /tmp/myldif 
	- /tmp/myldif differ: char 1, line 1
	Broken pipe

	# Export again, but this time use ldbmsort again for sorting
	# the entries: Cmp shows no differences
	[root@gate joe]# /usr/sbin/ldbmcat /var/ldap/id2entry.dbb | ./ldbmsort.pl | cmp
- /tmp/myldif