winbind: Use idmap_cache_find_xid2sid
authorVolker Lendecke <vl@samba.org>
Tue, 26 Feb 2019 13:34:56 +0000 (14:34 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 12 Mar 2019 11:25:43 +0000 (11:25 +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
(cherry picked from commit bc9824bd42d9370279819ea0d927e236f6041324)

source3/winbindd/wb_xids2sids.c

index 55c24822925dfb4b7ace93527ccae33af3363452..036902788562a3688d10a40fc349f122a0fc2c9c 100644 (file)
@@ -470,19 +470,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) {
                                sid_copy(&state->sids[i], &sid);
                                state->cached[i] = true;