[SSSD] [PATCH] IPA: Do not download or store the member attribute of host groups

Jakub Hrozek jhrozek at redhat.com
Tue Jun 25 08:41:11 UTC 2013


On Sun, Jun 23, 2013 at 09:12:01PM +0200, Jakub Hrozek wrote:
> The attached patch applies on both master and sssd-1-9 and fixes:
> https://fedorahosted.org/sssd/ticket/1806
> 
> The IPA provider attempted to store the original value of member attribute
> to the cache. That caused the memberof plugin to process the values which
> was really CPU intensive.
> 
> We don't use the values anywhere and rely on the originalDN instead, so
> it's safe to avoid even downloading them.
> 
> Many thanks to Andreas and Simo for their help debugging the problem.

Attached is also a sssd-1-5 version of the patch.
-------------- next part --------------
>From b573903ec7a6f78f646831d7e6e4123c1f1b166b Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Sun, 23 Jun 2013 17:39:50 +0200
Subject: [PATCH] IPA: Do not download or store the member attribute of host
 groups

https://fedorahosted.org/sssd/ticket/1806

The IPA provider attempted to store the original value of member attribute
to the cache. That caused the memberof plugin to process the values which
was really CPU intensive.
---
 src/providers/ipa/ipa_hbac_hosts.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/providers/ipa/ipa_hbac_hosts.c b/src/providers/ipa/ipa_hbac_hosts.c
index 667cf90661ecdd7920c2a3172e9b26aa12afe722..1fd5aa2f15d4e313d01da3ae2f854c5d6149a2d1 100644
--- a/src/providers/ipa/ipa_hbac_hosts.c
+++ b/src/providers/ipa/ipa_hbac_hosts.c
@@ -106,7 +106,7 @@ ipa_hbac_host_info_send(TALLOC_CTX *mem_ctx,
         goto immediate;
     }
 
-    state->attrs = talloc_array(state, const char *, 8);
+    state->attrs = talloc_array(state, const char *, 7);
     if (state->attrs == NULL) {
         DEBUG(1, ("Failed to allocate host attribute list.\n"));
         ret = ENOMEM;
@@ -116,10 +116,9 @@ ipa_hbac_host_info_send(TALLOC_CTX *mem_ctx,
     state->attrs[1] = IPA_HOST_SERVERHOSTNAME;
     state->attrs[2] = IPA_HOST_FQDN;
     state->attrs[3] = IPA_UNIQUE_ID;
-    state->attrs[4] = IPA_MEMBER;
-    state->attrs[5] = IPA_MEMBEROF;
-    state->attrs[6] = IPA_CN;
-    state->attrs[7] = NULL;
+    state->attrs[4] = IPA_MEMBEROF;
+    state->attrs[5] = IPA_CN;
+    state->attrs[6] = NULL;
 
     subreq = sdap_get_generic_send(state, ev, opts, sh, search_base,
                                    LDAP_SCOPE_SUB, host_filter,
-- 
1.8.3.1



More information about the sssd-devel mailing list