[SSSD] [PATCH] nested groups: fix group lookup hangs if member dn is incorrect

Pavel Březina pbrezina at redhat.com
Wed Jan 23 14:51:40 UTC 2013


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.




More information about the sssd-devel mailing list