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

idl_delete bug in back-ldbm?

Hi everybody,

I had a problem that deleting entries from my gdbm OpenLDAP 1.2 directory 
gave me an Operations Error. Stepping through idl.c I found that it barfed

        if ( ! ID_BLOCK_INDIRECT( idl ) ) {
                for ( i=0; i < ID_BLOCK_NIDS(idl); i++ ) {
                        if ( ID_BLOCK_ID(idl, i) == id ) {
                                if( --ID_BLOCK_NIDS(idl) == 0 ) {
                                        ldbm_cache_delete( db, key );

                                } else {
                                        SAFEMEMCPY (
                                                &ID_BLOCK_ID(idl, i),
                                                &ID_BLOCK_ID(idl, i+1),
                                                (ID_BLOCK_NIDS(idl)-i) *
					sizeof ID_BLOCK_ID(idl,ID_BLOCK_NIDS(idl)) =

                                        idl_store( be, db, key, idl );

                                return 0;
                        /*  We didn't find the ID.  Hmmm... */
		return -1;

It returned -1 because it couldn't find the ID. I don't quite understand
what this idl_delete_key does - I can't find any line actually deleting
anything. All it seems to do is store a key somewhere - that also doesn't
seem to be used.

I've replaced the return -1; by:

                return 0; /* deleted already - don't bother - AHU */

Now my setup is working again and the entry was properly removed from my

Was this the right thing to do? What does it mean when it can't find the

We're about to go live with our setup and are still in between buying Sun
Directory server and using OpenLDAP. I'd prefer OpenLDAP, so anything
that helps me clear this up is welcome..


            Delft University of Technology, department of Physics
    Phone: +31-15-2786122 / Lorentzweg 1, 2628 CJ, Delft, The Netherlands

                      Inspice et cautus eris - D11T'95