Issue 174 - ldbmcat output not in index order
Summary: ldbmcat output not in index order
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-05-25 06:37 UTC by joe@ispsoft.de
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description joe@ispsoft.de 1999-05-25 06:37:44 UTC
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) (195.143.94.56)



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
ldif2ldbm.

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 

Comment 1 Kurt Zeilenga 1999-05-25 18:04:27 UTC
Jochen,

On second thought, I don't think this is a bug.

The test should be:

./ldbmsort.pl --create > initial.ldif
ldif2ldbm -i initial.ldif
ldbmcat /var/ldap-db > db.ldif
rm -f /var/ldap-db/*
ldif2ldbm -i db.ldif
ldbmcat /var/ldap-db > verify.ldif
cmp db.ldif verify.ldif

That is, even though the entry are provided out of
order each does have it's correct index.

Kurt


At 06:37 AM 5/25/99 GMT, joe@ispsoft.de wrote:
>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) (195.143.94.56)
>
>
>
>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
>ldif2ldbm.
>
>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 
>
>
>
Comment 2 Kurt Zeilenga 1999-05-26 18:08:19 UTC
changed notes
changed state Open to Closed
Comment 3 OpenLDAP project 2014-08-01 21:06:08 UTC
Behavior not a bug.