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

Re: cleanup callback and entry free in slap_send_search_entry()



> Pierangelo Masarati wrote:
>
>> My hack doesn't work because the entry's DN has been rewritten at the
>> time
>> be_operations() is called :(  There could be a fix: bdb_cache_children
>> could try to use the e_id to do a bdb_id2entry_get and collect a new
>> instance of the original entry, but I got in trouble because I'm not
>> familiar enugh with bdb internals.  Otherwise, we could use a double
>> sr_entry field in SlapReply, one for the actual (rewritten) entry, to be
>> returned, and one for the original entry, to be used for intermediate
>> operations.  This sounds a bit involved, but at least it's not a hack.
>
> Hm. back-hdb already uses the e_id field, so there's no issue there.
>
> For back-bdb, here's another hack - you're copying the e_private from
> the original entry already, and it contains a backpointer to the
> original entry. We could have bdb_dn2id_children() use the DN from the
> original entry, by referencing
> 	BEI(e)->bei_e->e_nname
> instead of using the passed-in entry's name.

That's great, but I'm not sure it's a great idea for the copied entry to
borrow the e_private from the original entry.  I'm rather oriented towards
adding an sr_mentry item to SlapReply and use it for the modified entry. 
This way, the code modifications are concentrated in result.c and in
overlays/rwm.c, and should work for all backends (in fact, the
hasSubordnate stuff doesn't work for back-ldbm as well...).

This way, if an overlay wants to modifiy an entry that's not modifiable
from the beginning, it appends the new one in sr_mentry, and result.c
uses sr_mentry and sr_entry in this order of preference.  The original one
is left around when passing the SlapReply structure around.

p.

p.

-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it


    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497