winbind: Use idmap_cache_find_xid2sid
[gary/samba-autobuild/.git] / 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",