]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture/rpc: make use of dcerpc_binding_handle_get_transport()
authorStefan Metzmacher <metze@samba.org>
Tue, 17 Sep 2024 20:41:16 +0000 (22:41 +0200)
committerJule Anger <janger@samba.org>
Thu, 12 Jun 2025 11:27:15 +0000 (11:27 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 382ece66063bd8ef465e989857394e6f412df6d3)

source4/torture/rpc/lsa.c
source4/torture/rpc/lsa_lookup.c
source4/torture/rpc/netlogon.c
source4/torture/rpc/samr.c
source4/torture/rpc/spoolss.c

index 13d542569449f0a1d43b639f46f74330bf0b99fb..5bf1d3ea8d42a1b0bdd1cd73c46492414eeb6d01 100644 (file)
@@ -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 "
index f641827e6dcda5ae244070528ed1df0619b90e60..51e032f3fba1e87c11b56e929ae93b6d001f3ad0 100644 (file)
@@ -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);
index 20b2b2adb82dc04873c62bed32bc3f37045e0fa4..9aa6f2700130be93421547d6d480af4cb99df661 100644 (file)
@@ -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");
        }
 
index 2d3788e05b5c790bda6d8383b1d14b7a7cc5eab5..981196a81239752c60086352b5d022a53992635a 100644 (file)
@@ -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");
        }
 
index d3cec7f7e258d124264161bdcfd8cd408cc9b0a7..d2b7a244c113bf708804cb177269044e286044b8 100644 (file)
@@ -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;
        }