r22612: Fix more cases where we have uninitialised values in the
authorAndrew Bartlett <abartlet@samba.org>
Mon, 30 Apr 2007 16:52:30 +0000 (16:52 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:51:52 +0000 (14:51 -0500)
composite_context, because we don't use the creation function.

Andrew Bartlett
(This used to be commit e37064e356c17d0c87bb7fa7adf0c0d04d8daba2)

source4/winbind/wb_async_helpers.c
source4/winbind/wb_cmd_getdcname.c
source4/winbind/wb_cmd_list_trustdom.c
source4/winbind/wb_cmd_lookupname.c
source4/winbind/wb_cmd_lookupsid.c
source4/winbind/wb_cmd_userdomgroups.c
source4/winbind/wb_cmd_usersids.c
source4/winbind/wb_dom_info_trusted.c
source4/winbind/wb_pam_auth.c
source4/winbind/wb_sam_logon.c
source4/winbind/wb_sid2domain.c

index 11d675d2e904f66dbb63b7c7286df90daadf204f..91e80e8cc5b20202e4c2b829fb089fa2e1833ef6 100644 (file)
@@ -60,8 +60,8 @@ struct composite_context *wb_get_schannel_creds_send(TALLOC_CTX *mem_ctx,
        struct composite_context *c, *creq;
        struct get_schannel_creds_state *state;
 
-       c = talloc_zero(mem_ctx, struct composite_context);
-       if (c == NULL) return NULL;
+       c = composite_create(mem_ctx, ev);
+       if (c == NULL) goto failed;
 
        state = talloc(c, struct get_schannel_creds_state);
        if (state == NULL) {
@@ -69,9 +69,7 @@ struct composite_context *wb_get_schannel_creds_send(TALLOC_CTX *mem_ctx,
                goto failed;
        }
 
-       c->state = COMPOSITE_STATE_IN_PROGRESS;
        c->private_data = state;
-       c->event_ctx = ev;
 
        state->wks_creds = wks_creds;
 
@@ -268,11 +266,8 @@ struct composite_context *wb_lsa_lookupsids_send(TALLOC_CTX *mem_ctx,
        struct lsa_lookupsids_state *state;
        int i;
 
-       result = talloc(mem_ctx, struct composite_context);
+       result = composite_create(mem_ctx, lsa_pipe->conn->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = lsa_pipe->conn->event_ctx;
 
        state = talloc(result, struct lsa_lookupsids_state);
        if (state == NULL) goto failed;
@@ -428,11 +423,8 @@ struct composite_context *wb_lsa_lookupnames_send(TALLOC_CTX *mem_ctx,
        struct lsa_String *lsa_names;
        int i;
 
-       result = talloc(mem_ctx, struct composite_context);
+       result = composite_create(mem_ctx, lsa_pipe->conn->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = lsa_pipe->conn->event_ctx;
 
        state = talloc(result, struct lsa_lookupnames_state);
        if (state == NULL) goto failed;
@@ -563,11 +555,8 @@ static void cmd_checkmachacc_recv_init(struct composite_context *ctx);
        struct cmd_checkmachacc_state *state;
        struct wbsrv_service *service = call->wbconn->listen_socket->service;
 
-       result = talloc(call, struct composite_context);
+       result = composite_create(mem_ctx, call->event_ctx;
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = call->event_ctx;
 
        state = talloc(result, struct cmd_checkmachacc_state);
        if (state == NULL) goto failed;
@@ -641,11 +630,8 @@ struct composite_context *wb_samr_userdomgroups_send(TALLOC_CTX *mem_ctx,
        struct rpc_request *req;
        struct samr_getuserdomgroups_state *state;
 
-       result = talloc(mem_ctx, struct composite_context);
+       result = composite_create(mem_ctx, samr_pipe->conn->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = samr_pipe->conn->event_ctx;
 
        state = talloc(result, struct samr_getuserdomgroups_state);
        if (state == NULL) goto failed;
index a9ae6098791b8265f5f1203726e83107a8f825b0..0696ff55720e261e630a79dad19ea605145d7945 100644 (file)
@@ -44,11 +44,8 @@ struct composite_context *wb_cmd_getdcname_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct cmd_getdcname_state *state;
 
-       result = talloc(mem_ctx, struct composite_context);
+       result = composite_create(mem_ctx, service->task->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = service->task->event_ctx;
 
        state = talloc(result, struct cmd_getdcname_state);
        if (state == NULL) goto failed;
index 0090879a8307c9d7301bda3e3e2858d4b069a168..4635f23312eda8a2186cf6bc02fbc5550ecf9503 100644 (file)
@@ -52,11 +52,8 @@ struct composite_context *wb_cmd_list_trustdoms_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct cmd_list_trustdom_state *state;
 
-       result = talloc_zero(mem_ctx, struct composite_context);
+       result = composite_create(mem_ctx, service->task->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = service->task->event_ctx;
 
        state = talloc(result, struct cmd_list_trustdom_state);
        if (state == NULL) goto failed;
index 51d5c5a8d8b12e7dfe8f02924bb6c4a33e3bc9d1..9b9b3d75740dd5d0554cdf9bf30a09c874e80046 100644 (file)
@@ -44,11 +44,8 @@ struct composite_context *wb_cmd_lookupname_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct cmd_lookupname_state *state;
 
-       result = talloc(mem_ctx, struct composite_context);
+       result = composite_create(mem_ctx, service->task->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = service->task->event_ctx;
 
        state = talloc(result, struct cmd_lookupname_state);
        if (state == NULL) goto failed;
index f5549a9a7fa70a7e5c77ec982a8a5a77b7233384..5e17c265e3aefd482faddf9c73ce6b5e084118a2 100644 (file)
@@ -43,11 +43,9 @@ struct composite_context *wb_cmd_lookupsid_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct cmd_lookupsid_state *state;
 
-       result = talloc(mem_ctx, struct composite_context);
+
+       result = composite_create(mem_ctx, service->task->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = service->task->event_ctx;
 
        state = talloc(result, struct cmd_lookupsid_state);
        if (state == NULL) goto failed;
index 2f994e8ea1449986793572a6112ddd9259645eda..67e3131a51757a53636bb2ec03d69f715cc97c57 100644 (file)
@@ -45,11 +45,8 @@ struct composite_context *wb_cmd_userdomgroups_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct cmd_userdomgroups_state *state;
 
-       result = talloc(mem_ctx, struct composite_context);
+       result = composite_create(mem_ctx, service->task->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = service->task->event_ctx;
 
        state = talloc(result, struct cmd_userdomgroups_state);
        if (state == NULL) goto failed;
index 1aebeae91361d9aee555a1f92acb99df64b5e926..aa8a9ea9c008761f13c53b9509cdc671631247dc 100644 (file)
@@ -57,11 +57,9 @@ struct composite_context *wb_cmd_usersids_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct cmd_usersids_state *state;
 
-       result = talloc(mem_ctx, struct composite_context);
+
+       result = composite_create(mem_ctx, service->task->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = service->task->event_ctx;
 
        state = talloc(result, struct cmd_usersids_state);
        if (state == NULL) goto failed;
index 8288c7921b6d29317d85589df9c506f9ca28b6f6..e0d074270cb80f641df6e9918b437d835ed00ec5 100644 (file)
@@ -52,11 +52,8 @@ struct composite_context *wb_trusted_dom_info_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct trusted_dom_info_state *state;
 
-       result = talloc(mem_ctx, struct composite_context);
+       result = composite_create(mem_ctx, service->task->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = service->task->event_ctx;
 
        state = talloc(result, struct trusted_dom_info_state);
        if (state == NULL) goto failed;
index b8c1cacbf0afd7d4c2a857ea65e4b4b47ddb78f1..c89870c3a285c74444cb41d290cd2b497705e80e 100644 (file)
@@ -71,11 +71,8 @@ struct composite_context *wb_cmd_pam_auth_crap_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct pam_auth_crap_state *state;
 
-       result = talloc(mem_ctx, struct composite_context);
+       result = composite_create(mem_ctx, service->task->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = service->task->event_ctx;
 
        state = talloc(result, struct pam_auth_crap_state);
        if (state == NULL) goto failed;
index 842e144c168e4d0a3dc1905de14748db3ff548d3..683773c76edaf128c8158a056391b6bc0e053588 100644 (file)
@@ -73,7 +73,7 @@ struct composite_context *wb_sam_logon_send(TALLOC_CTX *mem_ctx,
 }
 
 /*
-    Finish the connection to the DC
+    Having finished making the connection to the DC
     Send of a SamLogon request to authenticate a user.
 */
 static void wb_sam_logon_recv_domain(struct composite_context *creq)
index 516f8a115e0d259c379b16a153ce514b838871a4..cf7aef3fcaee6e5b365dc5e959c4bcc873007139 100644 (file)
@@ -64,11 +64,8 @@ struct composite_context *wb_sid2domain_send(TALLOC_CTX *mem_ctx,
        struct composite_context *result, *ctx;
        struct sid2domain_state *state;
 
-       result = talloc_zero(mem_ctx, struct composite_context);
+       result = composite_create(mem_ctx, service->task->event_ctx);
        if (result == NULL) goto failed;
-       result->state = COMPOSITE_STATE_IN_PROGRESS;
-       result->async.fn = NULL;
-       result->event_ctx = service->task->event_ctx;
 
        state = talloc(result, struct sid2domain_state);
        if (state == NULL) goto failed;