From 245c6b5db07249ecead23263f15c5c68c641134d Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 9 Oct 2012 18:03:24 +0200 Subject: Fix segfault when ID-mapping an entry without a SID If there was no SID attribute, then we would have detected it by checking the number of values of an element. We would however happily return EOK in that case and save garbage into the sid_str. This was causing segfault when the entry was supposed to be ID-mapped by had no SID. --- src/providers/ldap/ldap_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/providers/ldap/ldap_common.c') diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c index 6484556bd..da5786fbf 100644 --- a/src/providers/ldap/ldap_common.c +++ b/src/providers/ldap/ldap_common.c @@ -1491,7 +1491,7 @@ sdap_attrs_get_sid_str(TALLOC_CTX *mem_ctx, DEBUG(SSSDBG_MINOR_FAILURE, ("No [%s] attribute while id-mapping. [%d][%s]\n", sid_attr, el->num_values, strerror(ret))); - return ret; + return ENOENT; } err = sss_idmap_bin_sid_to_sid(idmap_ctx->map, -- cgit