]> 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)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2024 15:22:46 +0000 (15:22 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
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 44ea8cc4bf5c97e16311b4d018d19fe3c9afc44b..8f5338bcc652f529eed96f39bc860538370121a5 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");
 
@@ -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 "
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 87b28447c3919c6f010af979caedb9da9c685b69..82152ffda279980d0764382be0a3d972c750531d 100644 (file)
@@ -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");
        }
 
index 50a779db8df3cc268015d75d29adac447ace8be5..302126e02c4323ff2027fed05aab7def84b08638 100644 (file)
@@ -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");
        }
 
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;
        }