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

Creating entries on the fly, destroying them when operation is over

Hey folks,

In the search callback, I need to check whether an entry exists, and
if not, create it based on an another entry used as template
(duplicating also eventual tree elements below it, if they exist).

For example, if cn=a,cn=TESTVAL1,ou=group,dc,dc doesn't exist, it should
be created from cn=a,cn=TEMPLATE,ou=group,dc,dc.

The created entry (and the eventual subtree) should not persist and
should be dropped after the operation finishes.


1) What's an elegant way to duplicate an entry in this way where an
exact copy should be made, just with a different DN?

2) Since the entry creation is done in search callback, it
can't be just "slipped in" like it would be possible in response 
callback alone, so how do I mark the created entry for removal when
the operation is done?

Can this be scheduled automatically with entry flags (like
REP_ENTRY_MUSTBEFREED), or there would have to be a manual mechanism
for deleting entries in response callback?