winbind: Simplify wb_gettoken
authorVolker Lendecke <vl@samba.org>
Sun, 25 Dec 2016 10:19:38 +0000 (10:19 +0000)
committerVolker Lendecke <vl@samba.org>
Mon, 2 Jan 2017 17:04:14 +0000 (18:04 +0100)
All we need from the domain struct is it's sid. Directly use it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/wb_gettoken.c

index a2643b57604dc151663612c747da99e5ee55e514..1386c7d8d3fe8a22bb3ad48255d96d10a1657703 100644 (file)
@@ -148,13 +148,8 @@ static void wb_gettoken_gotlocalgroups(struct tevent_req *subreq)
        if (tevent_req_nterror(req, status)) {
                return;
        }
-       domain = find_domain_from_sid_noinit(get_global_sam_sid());
-       if (domain == NULL) {
-               tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
-               return;
-       }
        if (!wb_add_rids_to_sids(state, &state->num_sids, &state->sids,
-                                &domain->sid, num_rids, rids)) {
+                                get_global_sam_sid(), num_rids, rids)) {
                tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
                return;
        }