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

RE: using callback mechanism



> -----Original Message-----
> From: owner-openldap-devel@OpenLDAP.org
> [mailto:owner-openldap-devel@OpenLDAP.org]On Behalf Of Mikhail Sahalayev

> Hi,
>
> I'm trying to use callback mechanism and I need a little help.
> I need to perform search during the delete operation before calling
> be->be_search. So I've got to use callback to get the results
> to myself.
> I've been using slap_sasl_match() function code as a reference, but
> still couldn't make it work properly. The code looks like this:
>
> slap_callback cb = {
> 	slap_cb_null_response,
> 	slap_cb_null_sresult,
> 	sasl_sort_search_entry,// instead of send_search_entry
> 	NULL
> };
>
> Operation op = {0};
>
> op.o_tag = LDAP_REQ_SEARCH;
> op.o_protocol = LDAP_VERSION3;
> op.o_ndn = *my_dn;
> op.o_callback = &cb;
> op.o_time = slap_get_time();
> op.o_do_not_cache = 1;
> op.o_is_auth_check = 0;
> op.o_threadctx = ??? // was conn->c_sasl_bindop->o_threadctx;
>
> Could anyone tell me, what should op.o_threadctx be and what other
> fields in 'op' I should specify in my case.
>
> Thanks in advance,
> Mikhail.

Use the o_threadctx from the current operation. (The delete operation, in
your case.) You need to set all of the search parameters as well, just follow
what the saslauthz.c code does.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support