s3:winbind:pwent: use wb_next_find_domain()
authorMichael Adam <obnox@samba.org>
Sat, 17 Jan 2015 22:34:37 +0000 (23:34 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 16 Mar 2015 19:26:51 +0000 (20:26 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/winbindd/wb_next_pwent.c

index ade74e342d999fb7598f637ac7413127496b39e0..77e4c965fdcd750d8f35958145c7fee7226b0713 100644 (file)
@@ -111,13 +111,7 @@ static void wb_next_pwent_fetch_done(struct tevent_req *subreq)
        }
 
        if (state->gstate->num_users == 0) {
        }
 
        if (state->gstate->num_users == 0) {
-               state->gstate->domain = state->gstate->domain->next;
-
-               if ((state->gstate->domain != NULL)
-                   && sid_check_is_our_sam(&state->gstate->domain->sid)) {
-                       state->gstate->domain = state->gstate->domain->next;
-               }
-
+               state->gstate->domain = wb_next_find_domain(state->gstate->domain);
                if (state->gstate->domain == NULL) {
                        tevent_req_nterror(req, NT_STATUS_NO_MORE_ENTRIES);
                        return;
                if (state->gstate->domain == NULL) {
                        tevent_req_nterror(req, NT_STATUS_NO_MORE_ENTRIES);
                        return;