[SSSD] [PATCH] LDAP: Don't add a user member twice when adding a primary group

Pavel Reichl preichl at redhat.com
Mon Aug 25 15:23:44 UTC 2014


Hello,

I tested the patch and it fixes the problem described in the ticket.

I personally dislike the break and mainly the continue check - I believe 
that people reading the code would benefit from encapsulating the inner 
loop into function (return value would indicate what is happening and 
function name is the best comment anyway) and same would go for the 
outer loop IMO.

Still I am aware that this is a taste of personal preference and I'm 
willing to ACK the patch even without the changes.

Thanks!

On 08/17/2014 08:47 PM, Jakub Hrozek wrote:
> +        for (ii = 0; ii < el->num_values; ii++) {
> +            if (strcmp(userdns[i], (const char *) el->values[ii].data) == 0) {
> +                DEBUG(SSSDBG_TRACE_INTERNAL,
> +                      "Member %s already included, skipping\n", userdns[i]);
> +                break;
> +            }
> +        }
> +
> +        if (ii < el->num_values) {
> +            continue;
> +        }




More information about the sssd-devel mailing list