[SSSD] Behaviour of getgrnam/getgrgid

Stephen Gallagher sgallagh at redhat.com
Fri Sep 17 17:56:15 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/17/2010 12:16 PM, Ralf Haferkamp wrote:

> Find a new version attached. Does that look better? If that is not what 
> you were referring to lets discuss it in IRC on monday.
> 
> Note, I needed to implement sdap_process_group_send() slightly differnent 
> than the other _send functions in sdap_async_accounts(). Instead of 
> returning as tevent_req* it does return a error code. The tevent_req* is 
> returned via the argument list.  I did this because there are cases where 
> sdap_process_group_send() does not need to create a new tevent_req*, e.g. 
> when the groups doesn't have any members or when all groupmembers are 
> already cached.
>  

In situations like this, the correct behavior is still to return the
request, but inside the _send() function call:

tevent_req_done(req);
tevent_req_post(req, ev);
return req;

This way it will just call the finish handler immediately after the
parent function returns. Then you don't need to have separate codepaths
for functions that do or do not have to make subrequests.

(Internally what this does is set up a tevent_immediate callback that
fires as soon as processing reenters the mainloop, rather than waiting
or looping again)


- -- 
Stephen Gallagher
RHCE 804006346421761

Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkyTq78ACgkQeiVVYja6o6M59gCfaIy+ODph8eno3gBvgLJv+sYN
PPMAnjnAB2as0pF0fccvHCJdmpw5dHpq
=TPdr
-----END PGP SIGNATURE-----



More information about the sssd-devel mailing list