winbind: Use idmap_cache_find_xid2sid
authorVolker Lendecke <vl@samba.org>
Tue, 26 Feb 2019 13:34:56 +0000 (14:34 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 28 Feb 2019 12:57:24 +0000 (12:57 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13813

source3/winbindd/wb_xids2sids.c

index 719f687258d49dc541bede1949d2995aeae4ba3e..383fc67bc8ddb97ab96ff7886c582974238b90c4 100644 (file)
@@ -473,19 +473,8 @@ struct tevent_req *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
                        struct dom_sid sid = {0};
                        bool ok, expired = true;
 
-                       switch (xids[i].type) {
-                           case ID_TYPE_UID:
-                                   ok = idmap_cache_find_uid2sid(
-                                           xids[i].id, &sid, &expired);
-                                   break;
-                           case ID_TYPE_GID:
-                                   ok = idmap_cache_find_gid2sid(
-                                           xids[i].id, &sid, &expired);
-                                   break;
-                           default:
-                                   ok = false;
-                       }
-
+                       ok = idmap_cache_find_xid2sid(
+                               &xids[i], &sid, &expired);
                        if (ok && !expired) {
                                struct dom_sid_buf buf;
                                DBG_DEBUG("Found %cID in cache: %s\n",