[SSSD] [PATCHES] Fix severe performance problems with initgroups

Stephen Gallagher sgallagh at redhat.com
Thu Jul 29 14:25:27 UTC 2010


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

New versions of the patch attached. Changes described below:

On 07/28/2010 03:29 PM, Stephen Gallagher wrote:
> Patch 0001: Add sysdb_attrs_to_list() utility function
> This is a simple utility to grab the values of a particular attributes
> from a sysdb_attrs list.

Added additional comments to describe the process.
Fixed a potential memory-corruption bug (I forgot a break, so it was
possible for the function to attempt to store more data than allocated).
Added a talloc_realloc() to the end of the function so as not to waste
any memory we didn't end up needing.
Updated the unit test to prove that this was safe.

> 
> Patch 0002: Add a utility function to compare two non-ordered lists of
> strings. It stores the first list as keys in a dhash table, then
> attempts to remove all the keys in the second list with dhash_remove().
> If the return value is success, that value was in both, if it's not
> found, then it was only in the second list. The leftover keys at the end
> are returned as the values only in the first list.
> 

No changes

> Patch 0003: Add sysdb_group_dn_reverse()
> This is a simple utility to just return the rdn name portion of a
> distinguished name.
> 

Changed the function name to sysdb_group_dn_name()

> Patch 0004: Add a utility routine to duplicate a NULL-terminated list of
> strings.

No changes

> 
> Patch 0005: Add sysdb_update_members function
> This function will take a user, a list of groups that this user
> should be added to and a list of groups the user should be removed
> from and will recursively call sysdb_[add|remove]_group_member
> 

Added a unit test as requested. This unit test revealed a potential
memory-corruption bug, as well as incorrect handling of NULL values for
the input lists, so I fixed those as well.

Further proof that we need to be writing more unit tests...

> Patch 0006: Clean up initgroups processing for RFC2307
> Instead of recursively updating all users of each group the user
> being queried belongs to, just add or remove membership for the
> requested user.

Fixed style issues with if(
Used SYSDB_MEMBEROF when doing sysdb lookups where appropriate.
Removed grp_attrs input value from sdap_initgr_rfc2307_send() as it is
no longer used.

> 
> This series of patches will fix
> https://bugzilla.redhat.com/show_bug.cgi?id=617623 and
> https://fedorahosted.org/sssd/ticket/478
> 
> This is a blocker for the 1.2.2 bugfix release.
> 

_______________________________________________
sssd-devel mailing list
sssd-devel at lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


- -- 
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 v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkxRj1cACgkQeiVVYja6o6M0DwCeO6Iw7hipds2/KJepTQ/jMzYI
QK8AoIo1vluVbRQ6UfEvC5EH+tw7dnrQ
=b1JV
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-sysdb_attrs_to_list-utility-function.patch
Type: text/x-patch
Size: 5483 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-diff_string_lists-utility-function.patch
Type: text/x-patch
Size: 16079 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-sysdb_group_dn_name-utility-function.patch
Type: text/x-patch
Size: 2101 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Add-dup_string_list-utility-function.patch
Type: text/x-patch
Size: 1990 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Add-sysdb_update_members-function.patch
Type: text/x-patch
Size: 13147 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Clean-up-initgroups-processing-for-RFC2307.patch
Type: text/x-patch
Size: 10686 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-sysdb_attrs_to_list-utility-function.patch.sig
Type: application/pgp-signature
Size: 72 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment.sig>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-diff_string_lists-utility-function.patch.sig
Type: application/pgp-signature
Size: 72 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment-0001.sig>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-sysdb_group_dn_name-utility-function.patch.sig
Type: application/pgp-signature
Size: 72 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment-0002.sig>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Add-dup_string_list-utility-function.patch.sig
Type: application/pgp-signature
Size: 72 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment-0003.sig>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Add-sysdb_update_members-function.patch.sig
Type: application/pgp-signature
Size: 72 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment-0004.sig>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Clean-up-initgroups-processing-for-RFC2307.patch.sig
Type: application/pgp-signature
Size: 72 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100729/3d564805/attachment-0005.sig>


More information about the sssd-devel mailing list