From 382ece66063bd8ef465e989857394e6f412df6d3 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 17 Sep 2024 22:41:16 +0200 Subject: [PATCH] s4:torture/rpc: make use of dcerpc_binding_handle_get_transport() Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- source4/torture/rpc/lsa.c | 13 +++++++------ source4/torture/rpc/lsa_lookup.c | 5 +++-- source4/torture/rpc/netlogon.c | 4 ++-- source4/torture/rpc/samr.c | 2 +- source4/torture/rpc/spoolss.c | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 44ea8cc4bf5..8f5338bcc65 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -1145,7 +1145,8 @@ bool test_many_LookupSids(struct dcerpc_pipe *p, struct lsa_SidArray sids; int i; struct dcerpc_binding_handle *b = p->binding_handle; - enum dcerpc_transport_t transport = dcerpc_binding_get_transport(p->binding); + enum dcerpc_transport_t transport = + dcerpc_binding_handle_get_transport(b); torture_comment(tctx, "\nTesting LookupSids with lots of SIDs\n"); @@ -5313,7 +5314,7 @@ bool torture_rpc_lsa(struct torture_context *tctx) torture_assert_ntstatus_ok(tctx, status, "Error connecting to server"); b = p->binding_handle; - transport = dcerpc_binding_get_transport(p->binding); + transport = dcerpc_binding_handle_get_transport(b); /* Test lsaLookupSids3 and lsaLookupNames4 over tcpip */ if (transport == NCACN_IP_TCP) { @@ -5413,7 +5414,7 @@ bool torture_rpc_lsa_get_user(struct torture_context *tctx) torture_assert_ntstatus_ok(tctx, status, "Error connecting to server"); b = p->binding_handle; - transport = dcerpc_binding_get_transport(p->binding); + transport = dcerpc_binding_handle_get_transport(b); if (transport == NCACN_IP_TCP) { if (!test_GetUserName_fail(b, tctx)) { @@ -5437,7 +5438,7 @@ static bool testcase_LookupNames(struct torture_context *tctx, struct lsa_TransNameArray tnames; struct lsa_TransNameArray2 tnames2; struct dcerpc_binding_handle *b = p->binding_handle; - enum dcerpc_transport_t transport = dcerpc_binding_get_transport(p->binding); + enum dcerpc_transport_t transport = dcerpc_binding_handle_get_transport(b); if (transport != NCACN_NP && transport != NCALRPC) { torture_comment(tctx, "testcase_LookupNames is only available " @@ -5528,7 +5529,7 @@ static bool testcase_TrustedDomains(struct torture_context *tctx, struct lsa_trustdom_state *state = talloc_get_type_abort(data, struct lsa_trustdom_state); struct dcerpc_binding_handle *b = p->binding_handle; - enum dcerpc_transport_t transport = dcerpc_binding_get_transport(p->binding); + enum dcerpc_transport_t transport = dcerpc_binding_handle_get_transport(b); if (transport != NCACN_NP && transport != NCALRPC) { torture_comment(tctx, "testcase_TrustedDomains is only available " @@ -5603,7 +5604,7 @@ static bool testcase_Privileges(struct torture_context *tctx, { struct policy_handle *handle; struct dcerpc_binding_handle *b = p->binding_handle; - enum dcerpc_transport_t transport = dcerpc_binding_get_transport(p->binding); + enum dcerpc_transport_t transport = dcerpc_binding_handle_get_transport(b); if (transport != NCACN_NP && transport != NCALRPC) { torture_skip(tctx, "testcase_Privileges is only available " diff --git a/source4/torture/rpc/lsa_lookup.c b/source4/torture/rpc/lsa_lookup.c index f641827e6dc..51e032f3fba 100644 --- a/source4/torture/rpc/lsa_lookup.c +++ b/source4/torture/rpc/lsa_lookup.c @@ -228,7 +228,7 @@ bool torture_rpc_lsa_lookup(struct torture_context *torture) torture_fail(torture, "unable to connect to table"); } b = p->binding_handle; - transport = dcerpc_binding_get_transport(p->binding); + transport = dcerpc_binding_handle_get_transport(b); if (transport != NCACN_NP && transport != NCALRPC) { torture_comment(torture, @@ -344,7 +344,8 @@ static bool test_LookupSidsReply(struct torture_context *tctx, const char *dom_sid = "S-1-5-21-1111111111-2222222222-3333333333"; const char *dom_admin_sid; struct dcerpc_binding_handle *b = p->binding_handle; - enum dcerpc_transport_t transport = dcerpc_binding_get_transport(p->binding); + enum dcerpc_transport_t transport = + dcerpc_binding_handle_get_transport(b); ZERO_STRUCT(r); ZERO_STRUCT(sidarray); diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 87b28447c39..82152ffda27 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -5729,7 +5729,7 @@ static bool test_ManyGetDCName(struct torture_context *tctx, int i; - if (p->conn->transport.transport != NCACN_NP) { + if (dcerpc_binding_handle_get_transport(b) != NCACN_NP) { torture_skip(tctx, "test_ManyGetDCName works only with NCACN_NP"); } @@ -5821,7 +5821,7 @@ static bool test_lsa_over_netlogon(struct torture_context *tctx, struct dcerpc_binding_handle *b2; - if (p->conn->transport.transport != NCACN_NP) { + if (dcerpc_binding_handle_get_transport(p->binding_handle) != NCACN_NP) { torture_skip(tctx, "test_lsa_over_netlogon works only with NCACN_NP"); } diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 50a779db8df..302126e02c4 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -9035,7 +9035,7 @@ static bool test_samr_ValidatePassword(struct torture_context *tctx, torture_comment(tctx, "Testing samr_ValidatePassword\n"); - if (p->conn->transport.transport != NCACN_IP_TCP) { + if (dcerpc_binding_handle_get_transport(b) != NCACN_IP_TCP) { torture_comment(tctx, "samr_ValidatePassword only should succeed over NCACN_IP_TCP!\n"); } diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index d3cec7f7e25..d2b7a244c11 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -6503,7 +6503,7 @@ static bool test_SecondaryClosePrinter(struct torture_context *tctx, struct spoolss_ClosePrinter cp; /* only makes sense on SMB */ - if (p->conn->transport.transport != NCACN_NP) { + if (dcerpc_binding_handle_get_transport(p->binding_handle) != NCACN_NP) { return true; }