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

Re: commit: ldap/servers/slapd/back-bdb add.c cache.c



Howard Chu wrote:
Of course this change affected a few other modules (ITS#4767, #4768). The entry in op->ora_e used to always be owned by the caller of be_add, so the caller would either free it unconditionally to cleanup or just allocate it from local/temporary memory. Now back-bdb/hdb takes ownership of the entry and zeroes out op->ora_e before returning, so the caller must always provide a normally allocated entry. The caller must also check for op->ora_e being non-NULL instead of freeing it unconditionally.

Currently the patches I wrote for the two ITS's instead check if op->ora_e == the orignally passed in entry, on the assumption that a response callback might change the entry after it's been added to the back-bdb entry cache. Frankly I can't think of any good reason for an overlay to change things at that point in time, so just checking for NULL ought to be sufficient.

I think it should be explicitly forbidden. For anything else, an overlay should replace an entry it's not allowed to modify, and modify the copy, under the assumption someone else (the overlay's cleanup handler?) will free the copy...


p.