Blob Blame History Raw
From 02a5b8945863755e8708b6a11954c1f398680e01 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@redhat.com>
Date: Thu, 2 Jun 2016 21:01:11 +0200
Subject: [PATCH 118/118] libwbclient: wbcSidsToUnixIds() don't fail on errors

Resolves: https://fedorahosted.org/sssd/ticket/3028

Reviewed-by: Alexander Bokovoy <abokovoy@redhat.com>
(cherry picked from commit 52f1093ef3d7c44132ec10c57436865b2cbb19d7)
(cherry picked from commit 15ad5f603a5797c61a01f67365c2581c7bddcdfa)
---
 src/sss_client/libwbclient/wbc_idmap_sssd.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/sss_client/libwbclient/wbc_idmap_sssd.c b/src/sss_client/libwbclient/wbc_idmap_sssd.c
index 1b0e2e10a5ce1a0c7577d391b740ff988f920903..6b5f525f0433c948e4d570d177dc6cffd82eff40 100644
--- a/src/sss_client/libwbclient/wbc_idmap_sssd.c
+++ b/src/sss_client/libwbclient/wbc_idmap_sssd.c
@@ -172,15 +172,14 @@ wbcErr wbcSidsToUnixIds(const struct wbcDomainSid *sids, uint32_t num_sids,
     wbcErr wbc_status;
 
     for (c = 0; c < num_sids; c++) {
+        type = SSS_ID_TYPE_NOT_SPECIFIED;
         wbc_status = wbcSidToString(&sids[c], &sid_str);
-        if (!WBC_ERROR_IS_OK(wbc_status)) {
-            return wbc_status;
-        }
-
-        ret = sss_nss_getidbysid(sid_str, &id, &type);
-        wbcFreeMemory(sid_str);
-        if (ret != 0) {
-            return WBC_ERR_UNKNOWN_FAILURE;
+        if (WBC_ERROR_IS_OK(wbc_status)) {
+            ret = sss_nss_getidbysid(sid_str, &id, &type);
+            wbcFreeMemory(sid_str);
+            if (ret != 0) {
+                type = SSS_ID_TYPE_NOT_SPECIFIED;
+            }
         }
 
         switch (type) {
-- 
2.4.11