diff options
-rw-r--r-- | librpc/rpc/dcesrv_auth.c | 6 | ||||
-rw-r--r-- | librpc/rpc/dcesrv_core.c | 12 | ||||
-rw-r--r-- | librpc/rpc/dcesrv_core.h | 2 | ||||
-rw-r--r-- | source3/rpc_server/rpc_ncacn_np.c | 4 | ||||
-rw-r--r-- | source3/winbindd/winbindd_dual_ndr.c | 2 | ||||
-rw-r--r-- | testsuite/unittests/test_sambafs_srv_pipe.c | 6 |
6 files changed, 19 insertions, 13 deletions
diff --git a/librpc/rpc/dcesrv_auth.c b/librpc/rpc/dcesrv_auth.c index 1f09bf0d18e..6bbac4e0160 100644 --- a/librpc/rpc/dcesrv_auth.c +++ b/librpc/rpc/dcesrv_auth.c @@ -79,7 +79,7 @@ static bool dcesrv_auth_prepare_gensec(struct dcesrv_call_state *call) { struct dcesrv_connection *dce_conn = call->conn; struct dcesrv_auth *auth = call->auth_state; - struct dcesrv_context_callbacks *cb = &call->conn->dce_ctx->callbacks; + struct dcesrv_context_callbacks *cb = call->conn->dce_ctx->callbacks; NTSTATUS status; if (auth->auth_started) { @@ -249,7 +249,7 @@ void dcesrv_default_auth_state_prepare_request(struct dcesrv_call_state *call) { struct dcesrv_connection *dce_conn = call->conn; struct dcesrv_auth *auth = call->auth_state; - struct dcesrv_context_callbacks *cb = &call->conn->dce_ctx->callbacks; + struct dcesrv_context_callbacks *cb = call->conn->dce_ctx->callbacks; if (auth->auth_audited) { return; @@ -287,7 +287,7 @@ bool dcesrv_auth_bind(struct dcesrv_call_state *call) { struct ncacn_packet *pkt = &call->pkt; struct dcesrv_auth *auth = call->auth_state; - struct dcesrv_context_callbacks *cb = &call->conn->dce_ctx->callbacks; + struct dcesrv_context_callbacks *cb = call->conn->dce_ctx->callbacks; NTSTATUS status; if (pkt->auth_length == 0) { diff --git a/librpc/rpc/dcesrv_core.c b/librpc/rpc/dcesrv_core.c index a5bfac507f5..70e0245532e 100644 --- a/librpc/rpc/dcesrv_core.c +++ b/librpc/rpc/dcesrv_core.c @@ -952,8 +952,8 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call) conn->max_recv_frag = max_rep; conn->max_xmit_frag = max_rep; - status = dce_ctx->callbacks.assoc_group.find( - call, dce_ctx->callbacks.assoc_group.private_data); + status = dce_ctx->callbacks->assoc_group.find( + call, dce_ctx->callbacks->assoc_group.private_data); if (!NT_STATUS_IS_OK(status)) { DBG_NOTICE("Failed to find assoc_group 0x%08x: %s\n", call->pkt.u.bind.assoc_group_id, nt_errstr(status)); @@ -2311,6 +2311,10 @@ _PUBLIC_ NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx, { struct dcesrv_context *dce_ctx; + if (cb == NULL) { + return NT_STATUS_INVALID_PARAMETER; + } + dce_ctx = talloc_zero(mem_ctx, struct dcesrv_context); NT_STATUS_HAVE_NO_MEMORY(dce_ctx); @@ -2330,9 +2334,7 @@ _PUBLIC_ NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } dce_ctx->broken_connections = NULL; - if (cb != NULL) { - dce_ctx->callbacks = *cb; - } + dce_ctx->callbacks = cb; *_dce_ctx = dce_ctx; return NT_STATUS_OK; diff --git a/librpc/rpc/dcesrv_core.h b/librpc/rpc/dcesrv_core.h index d566aa53217..d8d5f903095 100644 --- a/librpc/rpc/dcesrv_core.h +++ b/librpc/rpc/dcesrv_core.h @@ -440,7 +440,7 @@ struct dcesrv_context { struct dcesrv_connection *broken_connections; - struct dcesrv_context_callbacks callbacks; + struct dcesrv_context_callbacks *callbacks; }; /* this structure is used by modules to determine the size of some critical types */ diff --git a/source3/rpc_server/rpc_ncacn_np.c b/source3/rpc_server/rpc_ncacn_np.c index 30f2d88d4bf..598efd1f339 100644 --- a/source3/rpc_server/rpc_ncacn_np.c +++ b/source3/rpc_server/rpc_ncacn_np.c @@ -488,9 +488,9 @@ static struct tevent_req *rpcint_bh_raw_call_send(TALLOC_CTX *mem_ctx, if (hs->conn->assoc_group == NULL) { ZERO_STRUCT(state->call->pkt); state->call->pkt.u.bind.assoc_group_id = 0; - status = dce_ctx->callbacks.assoc_group.find( + status = dce_ctx->callbacks->assoc_group.find( state->call, - dce_ctx->callbacks.assoc_group.private_data); + dce_ctx->callbacks->assoc_group.private_data); if (tevent_req_nterror(req, status)) { return tevent_req_post(req, ev); } diff --git a/source3/winbindd/winbindd_dual_ndr.c b/source3/winbindd/winbindd_dual_ndr.c index 39c3a146c03..5f0ec82067c 100644 --- a/source3/winbindd/winbindd_dual_ndr.c +++ b/source3/winbindd/winbindd_dual_ndr.c @@ -524,7 +524,7 @@ enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain, ZERO_STRUCT(dcesrv_call->pkt); dcesrv_call->pkt.u.bind.assoc_group_id = 0; - cb = &dcesrv_call->conn->dce_ctx->callbacks; + cb = dcesrv_call->conn->dce_ctx->callbacks; status = cb->assoc_group.find( dcesrv_call, cb->assoc_group.private_data); if (!NT_STATUS_IS_OK(status)) { diff --git a/testsuite/unittests/test_sambafs_srv_pipe.c b/testsuite/unittests/test_sambafs_srv_pipe.c index 40798b588c7..75797c9bcee 100644 --- a/testsuite/unittests/test_sambafs_srv_pipe.c +++ b/testsuite/unittests/test_sambafs_srv_pipe.c @@ -21,6 +21,10 @@ struct test_state { struct dcesrv_context *dce_ctx; }; +static struct dcesrv_context_callbacks srv_callbacks = { + .log.successful_authz = NULL, +}; + static int setup_samr(void **state) { TALLOC_CTX *mem_ctx; @@ -42,7 +46,7 @@ static int setup_samr(void **state) status = dcerpc_register_ep_server(ep_server); assert_true(NT_STATUS_IS_OK(status)); - status = dcesrv_init_context(s, NULL, NULL, &s->dce_ctx); + status = dcesrv_init_context(s, NULL, &srv_callbacks, &s->dce_ctx); assert_true(NT_STATUS_IS_OK(status)); status = dcesrv_init_ep_server(s->dce_ctx, "samr"); |