On Mon, Jan 28, 2013 at 11:03:41AM +0100, Pavel Březina wrote: > On 01/23/2013 03:51 PM, Pavel Březina wrote: > >On 01/23/2013 03:46 PM, Pavel Březina wrote: > >>On 01/23/2013 03:21 PM, Jakub Hrozek wrote: > >>>On Wed, Jan 23, 2013 at 02:56:59PM +0100, Pavel Březina wrote: > >>>>https://fedorahosted.org/sssd/ticket/1783 > >>>> > >>>>The proper way to fix this would be to rewrite return codes of involved > >>>>functions, so that we call tevent_req_done() and tevent_req_post() in > >>>>_send(). However, rewriting return codes may be tricky and > >>>>given the circumstances (blocker for 6.4 and deadline), I chose to call > >>>>tevent_req_post() directly and open a new ticket for the return codes: > >>>> > >>>>https://fedorahosted.org/sssd/ticket/1784 > >>> > >>>I'm not sure if this is the right approach if there already *is* a > >>>callback, please check if this fix also works for scenarios where there > >>>is both correct and incorrect DN. > >> > >>Right. Good catch. Tevent code says that the callback would be > >>triggered twice. Tevent doesn't provider any function to determine > >>whether there is a callback set or not. Possible hack: > >> > >>tevent_req_post() adds new immediate event, that fires the callback. > >> > >> tevent_req_done(req); > >> tevent_req_set_callback(req, NULL, NULL); > >> tevent_req_post(req, state->ev); > >> > >>If a callback is set, it will be triggered with tevent_req_done() and > >>then removed. Immediate event will be processed but basically as noop. > >> > >>If it is not set, the callback will be triggered in immediate event. > > > >I'm taking back my words. Callback usually frees the request so this > >would likely end up with crash. > > I'm attaching new patch. It is not pretty but it is the least > invasive way that crossed my mind. >
Ack While this is not the optimal solution, it is one that works and refactoring the group processing to be more readable and maintanable (https://fedorahosted.org/sssd/ticket/1784) is too invasive for 1.9.4 at this point. We will get to the full refactor in 1.10 development phase. _______________________________________________ sssd-devel mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/sssd-devel
