s4: torture: Remove use of local variables that are simply mirroring popt_get_cmdline...
authorJeremy Allison <jra@samba.org>
Tue, 9 May 2017 23:28:53 +0000 (16:28 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 11 May 2017 22:37:29 +0000 (00:37 +0200)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May 12 00:37:29 CEST 2017 on sn-devel-144

source4/torture/raw/session.c
source4/torture/rpc/spoolss.c
source4/torture/smb2/acls.c
source4/torture/smb2/oplock.c
source4/torture/smb2/replay.c
source4/torture/smb2/scan.c
source4/torture/smb2/util.c
source4/torture/vfs/acl_xattr.c

index c96e970d061d0f7e440bf0561edccf498903a4d5..0c460ae306948edea6ba89216f5bca5871fe5518 100644 (file)
@@ -234,7 +234,6 @@ static bool test_session_expire1(struct torture_context *tctx)
        struct smbcli_session_options session_options;
        const char *host = torture_setting_string(tctx, "host", NULL);
        const char *share = torture_setting_string(tctx, "share", NULL);
-       struct cli_credentials *credentials = popt_get_cmdline_credentials();
        struct smbcli_state *cli = NULL;
        enum credentials_use_kerberos use_kerberos;
        char fname[256];
@@ -244,7 +243,8 @@ static bool test_session_expire1(struct torture_context *tctx)
        struct smb_composite_sesssetup io_sesssetup;
        size_t i;
 
-       use_kerberos = cli_credentials_get_kerberos_state(credentials);
+       use_kerberos = cli_credentials_get_kerberos_state(
+                               popt_get_cmdline_credentials());
        if (use_kerberos != CRED_MUST_USE_KERBEROS) {
                torture_warning(tctx, "smb2.session.expire1 requires -k yes!");
                torture_skip(tctx, "smb2.session.expire1 requires -k yes!");
@@ -264,7 +264,7 @@ static bool test_session_expire1(struct torture_context *tctx)
                                        lpcfg_smb_ports(tctx->lp_ctx),
                                        share, NULL,
                                        lpcfg_socket_options(tctx->lp_ctx),
-                                       credentials,
+                                       popt_get_cmdline_credentials(),
                                        lpcfg_resolve_context(tctx->lp_ctx),
                                        tctx->ev, &options, &session_options,
                                        lpcfg_gensec_settings(tctx, tctx->lp_ctx));
@@ -312,7 +312,8 @@ static bool test_session_expire1(struct torture_context *tctx)
         * the krb5 library may not handle expired creds
         * well, lets start with an empty ccache.
         */
-       cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED);
+       cli_credentials_invalidate_ccache(popt_get_cmdline_credentials(),
+                               CRED_SPECIFIED);
 
        /*
         * now with CAP_DYNAMIC_REAUTH
@@ -323,7 +324,7 @@ static bool test_session_expire1(struct torture_context *tctx)
        io_sesssetup.in.sesskey      = cli->transport->negotiate.sesskey;
        io_sesssetup.in.capabilities = cli->transport->negotiate.capabilities;
        io_sesssetup.in.capabilities |= CAP_DYNAMIC_REAUTH;
-       io_sesssetup.in.credentials  = credentials;
+       io_sesssetup.in.credentials  = popt_get_cmdline_credentials();
        io_sesssetup.in.workgroup    = lpcfg_workgroup(tctx->lp_ctx);
        io_sesssetup.in.gensec_settings = lpcfg_gensec_settings(tctx,
                                                        tctx->lp_ctx);
@@ -357,7 +358,8 @@ static bool test_session_expire1(struct torture_context *tctx)
                 * the krb5 library may not handle expired creds
                 * well, lets start with an empty ccache.
                 */
-               cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED);
+               cli_credentials_invalidate_ccache(
+                       popt_get_cmdline_credentials(), CRED_SPECIFIED);
 
                torture_comment(tctx, "reauth with CAP_DYNAMIC_REAUTH => OK\n");
                ZERO_STRUCT(io_sesssetup.out);
@@ -378,7 +380,8 @@ static bool test_session_expire1(struct torture_context *tctx)
         * the krb5 library may not handle expired creds
         * well, lets start with an empty ccache.
         */
-       cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED);
+       cli_credentials_invalidate_ccache(popt_get_cmdline_credentials(),
+                               CRED_SPECIFIED);
 
        /*
         * now without CAP_DYNAMIC_REAUTH
index 0e26fcd18e9f4e5d1acb6e854ef8579419afbc57..20d2f14c113ea3fb7200f34b5d6b1f03109d1248 100644 (file)
@@ -8717,7 +8717,6 @@ static bool test_print_test_smbd(struct torture_context *tctx,
 
        struct smb2_tree *tree;
        struct smb2_handle job_h;
-       struct cli_credentials *credentials = popt_get_cmdline_credentials();
        struct smbcli_options options;
        TALLOC_CTX *mem_ctx = talloc_new(tctx);
        /*
@@ -8737,7 +8736,7 @@ static bool test_print_test_smbd(struct torture_context *tctx,
                              lpcfg_smb_ports(tctx->lp_ctx),
                              share,
                              lpcfg_resolve_context(tctx->lp_ctx),
-                             credentials,
+                             popt_get_cmdline_credentials(),
                              &tree,
                              tctx->ev,
                              &options,
index fe30380df988c807f465f282965a7876b5bb08c2..7365554470ce7a02ac608759ca7fedf3a82cbda5 100644 (file)
@@ -1872,7 +1872,6 @@ static bool torture_smb2_con_share(struct torture_context *tctx,
         struct smbcli_options options;
         NTSTATUS status;
         const char *host = torture_setting_string(tctx, "host", NULL);
-        struct cli_credentials *credentials = popt_get_cmdline_credentials();
 
         lpcfg_smbcli_options(tctx->lp_ctx, &options);
 
@@ -1881,7 +1880,7 @@ static bool torture_smb2_con_share(struct torture_context *tctx,
                                   lpcfg_smb_ports(tctx->lp_ctx),
                                   share,
                                   lpcfg_resolve_context(tctx->lp_ctx),
-                                  credentials,
+                                  popt_get_cmdline_credentials(),
                                   0,
                                   tree,
                                   tctx->ev,
index 635037b7124149b62af460b9c8eedb47984400b1..858bdcfa46eb8b9c1a29de227e8f07a889440815 100644 (file)
@@ -281,7 +281,6 @@ static bool open_smb2_connection_no_level2_oplocks(struct torture_context *tctx,
        NTSTATUS status;
        const char *host = torture_setting_string(tctx, "host", NULL);
        const char *share = torture_setting_string(tctx, "share", NULL);
-       struct cli_credentials *credentials = popt_get_cmdline_credentials();
        struct smbcli_options options;
 
        lpcfg_smbcli_options(tctx->lp_ctx, &options);
@@ -290,7 +289,8 @@ static bool open_smb2_connection_no_level2_oplocks(struct torture_context *tctx,
        status = smb2_connect(tctx, host,
                              lpcfg_smb_ports(tctx->lp_ctx), share,
                              lpcfg_resolve_context(tctx->lp_ctx),
-                             credentials, tree, tctx->ev, &options,
+                             popt_get_cmdline_credentials(),
+                             tree, tctx->ev, &options,
                              lpcfg_socket_options(tctx->lp_ctx),
                              lpcfg_gensec_settings(tctx, tctx->lp_ctx));
        if (!NT_STATUS_IS_OK(status)) {
index f715cf800487dca890739553490ce45be3f19ba0..a38518aebf290b6b4e997bb96862dd71a4659999 100644 (file)
@@ -1764,7 +1764,6 @@ static bool test_replay3(struct torture_context *tctx, struct smb2_tree *tree1)
 {
        const char *host = torture_setting_string(tctx, "host", NULL);
        const char *share = torture_setting_string(tctx, "share", NULL);
-       struct cli_credentials *credentials = popt_get_cmdline_credentials();
        NTSTATUS status;
        TALLOC_CTX *mem_ctx = talloc_new(tctx);
        struct smb2_handle _h;
@@ -1845,7 +1844,7 @@ static bool test_replay3(struct torture_context *tctx, struct smb2_tree *tree1)
                        lpcfg_smb_ports(tctx->lp_ctx),
                        share,
                        lpcfg_resolve_context(tctx->lp_ctx),
-                       credentials,
+                       popt_get_cmdline_credentials(),
                        &tree2,
                        tctx->ev,
                        &transport1->options,
@@ -1923,7 +1922,6 @@ static bool test_replay4(struct torture_context *tctx, struct smb2_tree *tree1)
 {
        const char *host = torture_setting_string(tctx, "host", NULL);
        const char *share = torture_setting_string(tctx, "share", NULL);
-       struct cli_credentials *credentials = popt_get_cmdline_credentials();
        NTSTATUS status;
        TALLOC_CTX *mem_ctx = talloc_new(tctx);
        struct smb2_handle _h1;
@@ -2069,7 +2067,7 @@ static bool test_replay4(struct torture_context *tctx, struct smb2_tree *tree1)
                        lpcfg_smb_ports(tctx->lp_ctx),
                        share,
                        lpcfg_resolve_context(tctx->lp_ctx),
-                       credentials,
+                       popt_get_cmdline_credentials(),
                        &tree2,
                        tctx->ev,
                        &transport1->options,
index 24d1421430fab1df6b954d79ff6a5c49b7240a57..3e43b9dfa32b8f531594c5e616ed38a5e7e79905 100644 (file)
@@ -204,7 +204,6 @@ static bool torture_smb2_scan(struct torture_context *tctx)
        struct smb2_tree *tree;
        const char *host = torture_setting_string(tctx, "host", NULL);
        const char *share = torture_setting_string(tctx, "share", NULL);
-       struct cli_credentials *credentials = popt_get_cmdline_credentials();
        NTSTATUS status;
        int opcode;
        struct smb2_request *req;
@@ -216,7 +215,8 @@ static bool torture_smb2_scan(struct torture_context *tctx)
                              lpcfg_smb_ports(tctx->lp_ctx),
                              share,
                              lpcfg_resolve_context(tctx->lp_ctx),
-                             credentials, &tree, tctx->ev, &options,
+                             popt_get_cmdline_credentials(),
+                             &tree, tctx->ev, &options,
                              lpcfg_socket_options(tctx->lp_ctx),
                              lpcfg_gensec_settings(tctx, tctx->lp_ctx));
        torture_assert_ntstatus_ok(tctx, status, "Connection failed");
@@ -233,7 +233,8 @@ static bool torture_smb2_scan(struct torture_context *tctx)
                                              lpcfg_smb_ports(tctx->lp_ctx),
                                              share,
                                              lpcfg_resolve_context(tctx->lp_ctx),
-                                             credentials, &tree, tctx->ev, &options,
+                                             popt_get_cmdline_credentials(),
+                                             &tree, tctx->ev, &options,
                                              lpcfg_socket_options(tctx->lp_ctx),
                                              lpcfg_gensec_settings(mem_ctx, tctx->lp_ctx));
                        torture_assert_ntstatus_ok(tctx, status, "Connection failed");
index 58956be723eadc2f1f56a2fb9cf86ee70d9e59a1..52a63dd962ae96da71ed40aadeb68b1fa31bc778 100644 (file)
@@ -351,7 +351,6 @@ bool torture_smb2_session_setup(struct torture_context *tctx,
 {
        NTSTATUS status;
        struct smb2_session *session;
-       struct cli_credentials *credentials = popt_get_cmdline_credentials();
 
        session = smb2_session_init(transport,
                                    lpcfg_gensec_settings(tctx, tctx->lp_ctx),
@@ -361,7 +360,8 @@ bool torture_smb2_session_setup(struct torture_context *tctx,
                return false;
        }
 
-       status = smb2_session_setup_spnego(session, credentials,
+       status = smb2_session_setup_spnego(session,
+                                          popt_get_cmdline_credentials(),
                                           previous_session_id);
        if (!NT_STATUS_IS_OK(status)) {
                torture_comment(tctx, "session setup failed: %s\n", nt_errstr(status));
@@ -385,14 +385,13 @@ bool torture_smb2_connection_ext(struct torture_context *tctx,
        NTSTATUS status;
        const char *host = torture_setting_string(tctx, "host", NULL);
        const char *share = torture_setting_string(tctx, "share", NULL);
-       struct cli_credentials *credentials = popt_get_cmdline_credentials();
 
        status = smb2_connect_ext(tctx,
                                  host,
                                  lpcfg_smb_ports(tctx->lp_ctx),
                                  share,
                                  lpcfg_resolve_context(tctx->lp_ctx),
-                                 credentials,
+                                 popt_get_cmdline_credentials(),
                                  previous_session_id,
                                  tree,
                                  tctx->ev,
@@ -431,7 +430,6 @@ bool torture_smb2_con_sopt(struct torture_context *tctx,
        NTSTATUS status;
        const char *host = torture_setting_string(tctx, "host", NULL);
        const char *share = torture_setting_string(tctx, soption, NULL);
-       struct cli_credentials *credentials = popt_get_cmdline_credentials();
 
        lpcfg_smbcli_options(tctx->lp_ctx, &options);
 
@@ -445,7 +443,7 @@ bool torture_smb2_con_sopt(struct torture_context *tctx,
                                  lpcfg_smb_ports(tctx->lp_ctx),
                                  share,
                                  lpcfg_resolve_context(tctx->lp_ctx),
-                                 credentials,
+                                 popt_get_cmdline_credentials(),
                                  0,
                                  tree,
                                  tctx->ev,
index b043d7660f45b4a1ac4c452f9450cdd29f1d6c15..9024c33980fd94e4e149d703498619c4853175b0 100644 (file)
@@ -57,7 +57,6 @@ static bool torture_smb2_con_share(struct torture_context *tctx,
         struct smbcli_options options;
         NTSTATUS status;
         const char *host = torture_setting_string(tctx, "host", NULL);
-        struct cli_credentials *credentials = popt_get_cmdline_credentials();
 
         lpcfg_smbcli_options(tctx->lp_ctx, &options);
 
@@ -66,7 +65,7 @@ static bool torture_smb2_con_share(struct torture_context *tctx,
                                   lpcfg_smb_ports(tctx->lp_ctx),
                                   share,
                                   lpcfg_resolve_context(tctx->lp_ctx),
-                                  credentials,
+                                  popt_get_cmdline_credentials(),
                                   0,
                                   tree,
                                   tctx->ev,