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

Simo Sorce ssorce at redhat.com
Wed Jul 28 20:19:19 UTC 2010


On Wed, 28 Jul 2010 15:29:47 -0400
Stephen Gallagher <sgallagh at redhat.com> wrote:

Comments for patch 6 inline:

> @@ -1514,6 +1520,18 @@ struct tevent_req
> *sdap_initgr_rfc2307_send(TALLOC_CTX *memctx, state->dom = dom;
>      state->sh = sh;
>      state->op = NULL;
> +    state->name = talloc_strdup(state, name);
> +    if(!state->name) {

style issue, use "if (" not "if("

[..]

> +static void
> +sdap_initgr_rfc2307_update_sysdb_groups_done(struct tevent_req
> *subreq); +static void sdap_initgr_rfc2307_update_sysdb_groups(struct
> tevent_req *subreq) +{
> +    struct tevent_req *req =
> +            tevent_req_callback_data(subreq, struct tevent_req);
> +    struct sdap_initgr_rfc2307_state *state =
> +            tevent_req_data(req, struct sdap_initgr_rfc2307_state);
> +    int ret, i;
> +    struct ldb_message *reply;
> +    struct ldb_message_element *groups;
> +    char **sysdb_grouplist;
> +    char **add_groups;
> +    char **del_groups;
> +
> +    ret = sysdb_search_user_recv(subreq, state, &reply);
> +    talloc_zfree(subreq);
> +    if (ret) {
> +        tevent_req_error(req, ret);
> +        return;
> +    }
> +
> +    groups = ldb_msg_find_element(
> +                reply,
> +                state->opts->user_map[SDAP_AT_USER_MEMBEROF].name);

If I read it right, here you are receiving the results from sysdb,
therefore you should look for SYSDB_MEMBEROF, and not the name of the
attribute of the remote LDAP server.

> +    if(!groups || groups->num_values == 0) {

style issue again on if(

The rest of patch 6 looks good.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York



More information about the sssd-devel mailing list