s3: Fix but 7145 -- duplicate sam and unix accounts
authorVolker Lendecke <vl@samba.org>
Sun, 28 Feb 2010 13:38:14 +0000 (14:38 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 28 Feb 2010 13:40:25 +0000 (14:40 +0100)
For me this survives the

TESTS=posix_s3 POSIX_SUBTESTS="RPC-SAMR-LARGE-DC LOCAL-NSS-WRAPPER" make test

reproducer. G√ľnther, please check!

Volker

source3/winbindd/wb_next_grent.c
source3/winbindd/wb_next_pwent.c

index 5f81bca718d247f175825d0f74163704e6410b7a..0e9dbd56d4a9335465750f002a9b3a445d7f6e2b 100644 (file)
@@ -59,6 +59,11 @@ struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
                        state->gstate->domain = state->gstate->domain->next;
                }
 
+               if ((state->gstate->domain != NULL)
+                   && sid_check_is_domain(&state->gstate->domain->sid)) {
+                       state->gstate->domain = state->gstate->domain->next;
+               }
+
                if (state->gstate->domain == NULL) {
                        tevent_req_nterror(req, NT_STATUS_NO_MORE_ENTRIES);
                        return tevent_req_post(req, ev);
@@ -109,6 +114,12 @@ static void wb_next_grent_fetch_done(struct tevent_req *subreq)
 
        if (state->gstate->num_groups == 0) {
                state->gstate->domain = state->gstate->domain->next;
+
+               if ((state->gstate->domain != NULL)
+                   && sid_check_is_domain(&state->gstate->domain->sid)) {
+                       state->gstate->domain = state->gstate->domain->next;
+               }
+
                if (state->gstate->domain == NULL) {
                        tevent_req_nterror(req, NT_STATUS_NO_MORE_ENTRIES);
                        return;
index 25ab7b38d3a27200e205e8bbe82f1ade1062a634..fbaaa48b6b89536f5ab1a3559bb8a7a53a220dcf 100644 (file)
@@ -55,6 +55,11 @@ struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
                        state->gstate->domain = state->gstate->domain->next;
                }
 
+               if ((state->gstate->domain != NULL)
+                   && sid_check_is_domain(&state->gstate->domain->sid)) {
+                       state->gstate->domain = state->gstate->domain->next;
+               }
+
                if (state->gstate->domain == NULL) {
                        tevent_req_nterror(req, NT_STATUS_NO_MORE_ENTRIES);
                        return tevent_req_post(req, ev);
@@ -101,6 +106,12 @@ static void wb_next_pwent_fetch_done(struct tevent_req *subreq)
 
        if (state->gstate->num_users == 0) {
                state->gstate->domain = state->gstate->domain->next;
+
+               if ((state->gstate->domain != NULL)
+                   && sid_check_is_domain(&state->gstate->domain->sid)) {
+                       state->gstate->domain = state->gstate->domain->next;
+               }
+
                if (state->gstate->domain == NULL) {
                        tevent_req_nterror(req, NT_STATUS_NO_MORE_ENTRIES);
                        return;