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

Re: cleanup callback and entry free in slap_send_search_entry()

> I've run into a problem while hacking operational attributes collection
> in slap_send_search_entry() when the "rwm" overlay is stacked.
> For bdb/hdb, the be_operational() handler requires the entry to have
> an appropriate e_private field, but rwm makes a copy.  I could
> add the original e_private value to the copy, for that purpose,
> and clean it up before entry_free(), but unfortunately entry_free(),
> if required, is called before the stack of cleanup callbacks is
> invoked.  If there's no drawbacks, I'd move cleanup callbacks invocation
> before conditional SlapReply cleanup, so that specialized cleanup
> can occur before the default catchall is run.  This seems to be
> more logical as well.

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.



Pierangelo Masarati

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