[SSSD] [PATCH] sss_userdel and sss_groupdel with use_fully_qualified_names

Simo Sorce simo at redhat.com
Mon Jan 7 15:08:57 UTC 2013


On Mon, 2013-01-07 at 16:04 +0100, Michal Židek wrote:
> +    if (dom->fqnames) {
> +        fqdn = talloc_asprintf(tmp_ctx, dom->names->fq_fmt, name,
> dom->name);
> +        if (fqdn == NULL) {
> +            DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory.\n"));
> +            ret = ENOMEM;
> +            goto done;
> +        }
> +        to_sized_string(&delete_name, fqdn);
> +        ret = sss_mmap_cache_pw_invalidate(mc_ctx, &delete_name);
> +        if (ret != EOK && ret != ENOENT) {
> +            DEBUG(SSSDBG_CRIT_FAILURE,
> +                  ("Internal failure in memory cache code: %d [%
> s]\n",
> +                   ret, strerror(ret)));
> +            goto done;
> +        }
> +    } else {
> +        to_sized_string(&delete_name, name);
> +        ret = sss_mmap_cache_pw_invalidate(mc_ctx, &delete_name);
> +        if (ret != EOK && ret != ENOENT) {
> +            DEBUG(SSSDBG_CRIT_FAILURE,
> +                  ("Internal failure in memory cache code: %d [%
> s]\n",
> +                   ret, strerror(ret)));
> +        }
> +        goto done;
> +    }

Please do not repeat the call to sss_mmap_cache_pw_invalidate() twice.

Call it just once after the if/else setup for delete_name.

Simo.

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




More information about the sssd-devel mailing list