From: Stefan Metzmacher Date: Tue, 17 Sep 2024 20:41:16 +0000 (+0200) Subject: s4:torture/rpc: make use of dcerpc_binding_handle_get_transport() X-Git-Tag: samba-4.21.7~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba777ee05324de5340fe55d098d6407fe9ef6b6a;p=thirdparty%2Fsamba.git s4:torture/rpc: make use of dcerpc_binding_handle_get_transport() Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme (cherry picked from commit 382ece66063bd8ef465e989857394e6f412df6d3) --- diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 13d54256944..5bf1d3ea8d4 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"); @@ -5316,7 +5317,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) { @@ -5416,7 +5417,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)) { @@ -5440,7 +5441,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 " @@ -5531,7 +5532,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 " @@ -5606,7 +5607,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 20b2b2adb82..9aa6f270013 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -5827,7 +5827,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"); } @@ -5919,7 +5919,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 2d3788e05b5..981196a8123 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -9034,7 +9034,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; }