From: Ralph Boehme Date: Fri, 23 Aug 2019 16:43:02 +0000 (+0200) Subject: mdssvc.idl: pass policy_handle as pointer X-Git-Tag: talloc-2.3.1~433 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9b6298249cd2f670e6953c9c3ef2e977f8bc565;p=thirdparty%2Fsamba.git mdssvc.idl: pass policy_handle as pointer No change in behaviour, this just changes all functions to take the policy_handle argument as pointer instead of passing it by value. This is how all other IDLs pass it. Signed-off-by: Ralph Boehme Reviewed-by: Noel Power Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Wed Oct 9 15:52:55 UTC 2019 on sn-devel-184 --- diff --git a/librpc/idl/mdssvc.idl b/librpc/idl/mdssvc.idl index 43447961b0d..e7004f07419 100644 --- a/librpc/idl/mdssvc.idl +++ b/librpc/idl/mdssvc.idl @@ -18,7 +18,7 @@ interface mdssvc ); void mdssvc_unknown1( - [in] policy_handle handle, + [in] policy_handle *handle, [in] uint32 unkn1, /* always 0, some status ? */ [in] uint32 device_id, [in] uint32 unkn3, /* = mdssvc_open.unkn2 ? */ @@ -37,7 +37,7 @@ interface mdssvc } mdssvc_blob; void mdssvc_cmd( - [in] policy_handle handle, + [in] policy_handle *handle, [in] uint32 unkn1, /* always 0, status ? */ [in] uint32 device_id, [in] uint32 unkn3, /* = mdssvc_open.unkn2 ? */ @@ -57,7 +57,7 @@ interface mdssvc ); void mdssvc_close( - [in] policy_handle in_handle, + [in] policy_handle *in_handle, [in] uint32 unkn1, /* always 0, some status ? */ [in] uint32 device_id, [in] uint32 unkn2, /* = mdssvc_open.unkn2 ? */ diff --git a/source3/rpc_client/cli_mdssvc.c b/source3/rpc_client/cli_mdssvc.c index 76cceb42fe0..82d14372fe4 100644 --- a/source3/rpc_client/cli_mdssvc.c +++ b/source3/rpc_client/cli_mdssvc.c @@ -124,7 +124,7 @@ static void mdscli_connect_open_done(struct tevent_req *subreq) state, state->ev, mdscli_ctx->bh, - mdscli_ctx->ph, + &mdscli_ctx->ph, 0, mdscli_ctx->dev, mdscli_ctx->mdscmd_open.unkn2, @@ -288,7 +288,7 @@ struct tevent_req *mdscli_search_send(TALLOC_CTX *mem_ctx, subreq = dcerpc_mdssvc_cmd_send(state, ev, mdscli_ctx->bh, - mdscli_ctx->ph, + &mdscli_ctx->ph, 0, mdscli_ctx->dev, mdscli_ctx->mdscmd_open.unkn2, @@ -469,7 +469,7 @@ struct tevent_req *mdscli_get_results_send( subreq = dcerpc_mdssvc_cmd_send(state, ev, mdscli_ctx->bh, - mdscli_ctx->ph, + &mdscli_ctx->ph, 0, mdscli_ctx->dev, mdscli_ctx->mdscmd_open.unkn2, @@ -693,7 +693,7 @@ struct tevent_req *mdscli_get_path_send(TALLOC_CTX *mem_ctx, subreq = dcerpc_mdssvc_cmd_send(state, ev, mdscli_ctx->bh, - mdscli_ctx->ph, + &mdscli_ctx->ph, 0, mdscli_ctx->dev, mdscli_ctx->mdscmd_open.unkn2, @@ -864,7 +864,7 @@ struct tevent_req *mdscli_close_search_send(TALLOC_CTX *mem_ctx, subreq = dcerpc_mdssvc_cmd_send(state, ev, mdscli_ctx->bh, - mdscli_ctx->ph, + &mdscli_ctx->ph, 0, mdscli_ctx->dev, mdscli_ctx->mdscmd_open.unkn2, @@ -968,7 +968,7 @@ struct tevent_req *mdscli_disconnect_send(TALLOC_CTX *mem_ctx, subreq = dcerpc_mdssvc_close_send(state, ev, mdscli_ctx->bh, - mdscli_ctx->ph, + &mdscli_ctx->ph, 0, mdscli_ctx->dev, mdscli_ctx->mdscmd_open.unkn2, diff --git a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c index 0977c12e98d..81114ce6513 100644 --- a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c +++ b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c @@ -211,8 +211,8 @@ void _mdssvc_unknown1(struct pipes_struct *p, struct mdssvc_unknown1 *r) { struct mds_ctx *mds_ctx; - if (!find_policy_by_hnd(p, &r->in.handle, (void **)(void *)&mds_ctx)) { - if (is_zero_policy_handle(&r->in.handle)) { + if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&mds_ctx)) { + if (is_zero_policy_handle(r->in.handle)) { p->fault_state = 0; } else { p->fault_state = DCERPC_NCA_S_PROTO_ERROR; @@ -238,8 +238,8 @@ void _mdssvc_cmd(struct pipes_struct *p, struct mdssvc_cmd *r) char *rbuf; struct mds_ctx *mds_ctx; - if (!find_policy_by_hnd(p, &r->in.handle, (void **)(void *)&mds_ctx)) { - if (is_zero_policy_handle(&r->in.handle)) { + if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&mds_ctx)) { + if (is_zero_policy_handle(r->in.handle)) { p->fault_state = 0; } else { p->fault_state = DCERPC_NCA_S_PROTO_ERROR; @@ -313,10 +313,10 @@ void _mdssvc_close(struct pipes_struct *p, struct mdssvc_close *r) struct mds_ctx *mds_ctx; bool ok; - ok = find_policy_by_hnd(p, &r->in.in_handle, (void **)(void *)&mds_ctx); + ok = find_policy_by_hnd(p, r->in.in_handle, (void **)(void *)&mds_ctx); if (!ok) { DBG_WARNING("invalid handle\n"); - if (is_zero_policy_handle(&r->in.in_handle)) { + if (is_zero_policy_handle(r->in.in_handle)) { p->fault_state = 0; } else { p->fault_state = DCERPC_NCA_S_PROTO_ERROR; @@ -327,8 +327,8 @@ void _mdssvc_close(struct pipes_struct *p, struct mdssvc_close *r) DBG_DEBUG("Close mdssvc handle for path: %s\n", mds_ctx->spath); TALLOC_FREE(mds_ctx); - *r->out.out_handle = r->in.in_handle; - close_policy_hnd(p, &r->in.in_handle); + *r->out.out_handle = *r->in.in_handle; + close_policy_hnd(p, r->in.in_handle); *r->out.status = 0; diff --git a/source3/rpcclient/cmd_spotlight.c b/source3/rpcclient/cmd_spotlight.c index f8bf75edde4..5bc5eb10888 100644 --- a/source3/rpcclient/cmd_spotlight.c +++ b/source3/rpcclient/cmd_spotlight.c @@ -70,7 +70,7 @@ static NTSTATUS cmd_mdssvc_fetch_properties( } status = dcerpc_mdssvc_unknown1(b, mem_ctx, - share_handle, + &share_handle, 0, device_id, unkn1, @@ -160,7 +160,7 @@ static NTSTATUS cmd_mdssvc_fetch_properties( request_blob.size = len; status = dcerpc_mdssvc_cmd(b, mem_ctx, - share_handle, + &share_handle, 0, device_id, 23, @@ -248,7 +248,7 @@ static NTSTATUS cmd_mdssvc_fetch_attributes( } status = dcerpc_mdssvc_unknown1(b, mem_ctx, - share_handle, + &share_handle, 0, device_id, unkn1, @@ -386,7 +386,7 @@ static NTSTATUS cmd_mdssvc_fetch_attributes( request_blob.size = len; status = dcerpc_mdssvc_cmd(b, mem_ctx, - share_handle, + &share_handle, 0, device_id, 23, diff --git a/source4/torture/rpc/mdssvc.c b/source4/torture/rpc/mdssvc.c index 9fd7278c8e8..afdb4d5c03e 100644 --- a/source4/torture/rpc/mdssvc.c +++ b/source4/torture/rpc/mdssvc.c @@ -128,7 +128,7 @@ static bool torture_rpc_mdssvc_open(struct torture_context *tctx, status = dcerpc_mdssvc_unknown1(b, state, - state->ph, + &state->ph, 0, state->dev, state->mdscmd_open.unkn2, @@ -145,7 +145,7 @@ done: if (!ok) { (void)dcerpc_mdssvc_close(b, state, - state->ph, + &state->ph, 0, state->dev, state->mdscmd_open.unkn2, @@ -170,7 +170,7 @@ static bool torture_rpc_mdssvc_close(struct torture_context *tctx, status = dcerpc_mdssvc_close(b, state, - state->ph, + &state->ph, 0, state->dev, state->mdscmd_open.unkn2, @@ -368,7 +368,7 @@ static bool test_mdssvc_close(struct torture_context *tctx, status = dcerpc_mdssvc_close(b, tctx, - ph, + &ph, 0, device_id, unkn2, @@ -395,7 +395,7 @@ static bool test_mdssvc_close(struct torture_context *tctx, ZERO_STRUCT(ph); status = dcerpc_mdssvc_close(b, tctx, - ph, + &ph, 0, device_id, unkn2, @@ -438,7 +438,7 @@ static bool test_mdssvc_null_ph(struct torture_context *tctx, status = dcerpc_mdssvc_unknown1(b, tctx, - ph, + &ph, 0, device_id, unkn2, @@ -484,7 +484,7 @@ static bool test_mdssvc_invalid_ph_unknown1(struct torture_context *tctx, status = dcerpc_mdssvc_unknown1(b, tctx, - ph, + &ph, 0, device_id, unkn2, @@ -546,7 +546,7 @@ static bool test_mdssvc_invalid_ph_cmd(struct torture_context *tctx, status = dcerpc_mdssvc_cmd(b, state, - ph, + &ph, 0, device_id, unkn2, @@ -592,7 +592,7 @@ static bool test_mdssvc_invalid_ph_close(struct torture_context *tctx, status = dcerpc_mdssvc_close(b, state, - ph, + &ph, 0, device_id, unkn2, @@ -716,7 +716,7 @@ static bool test_mdssvc_fetch_attr_unknown_cnid(struct torture_context *tctx, status = dcerpc_mdssvc_cmd(b, state, - state->ph, + &state->ph, 0, state->dev, state->mdscmd_open.unkn2,