[SSSD] Netgroups in SSSD

Stephen Gallagher sgallagh at redhat.com
Mon Sep 13 12:18:02 UTC 2010


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

On 09/13/2010 08:13 AM, Stephen Gallagher wrote:

> The idea behind the hash is actually to have it double as a reference
> count and a loop-detection mechanism. It doesn't need to be a hash (it
> could just as easily be a b-tree), but since we already have an
> efficient hash available, I was just going to use that.
> 
> The idea is that for every time we recurse down a level, we will add the
> name of that netgroup to the hash. Before recursing down again, we'll
> make sure that the new name is not a key in the hash. If it is, we know
> we've hit a loop and should break processing.
> 
> When we recurse up a level, we need to remove this entry from the
> tracking hash so that it's possible to recurse down into it again in a
> different branch of the tree. There is a pro and con to this approach.
> 


I forgot to mention that the other use of the hash is that it provides
an easy way to handle nesting limits. A dhash table provides an
interface for requesting the number of entries in the hash. If one more
subrequest is going to exceed the maximum nesting level, then we can
cancel the request.

So using a tracking dhash here just makes the nesting limit and
loop-detection very easy.

- -- 
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/

iEYEARECAAYFAkyOFnoACgkQeiVVYja6o6OaagCffR1twxELT7PAKYsNRya5RjZW
MFsAn2NdOiN4pnvB0eHp6sRPj8XGdRds
=Hwqr
-----END PGP SIGNATURE-----



More information about the sssd-devel mailing list