summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-05-09 16:28:53 -0700
committerJeremy Allison <jra@samba.org>2017-05-12 00:37:29 +0200
commit91852dd0816a745f501b765a556b5985521c8119 (patch)
tree0713cf045dbadeb155433bbbef7e1a6870887785 /source4/torture
parent4039e51a6fdb476d9865df74dfccf7a020ead141 (diff)
downloadsamba-91852dd0816a745f501b765a556b5985521c8119.tar.gz
s4: torture: Remove use of local variables that are simply mirroring popt_get_cmdline_credentials().
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
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/session.c17
-rw-r--r--source4/torture/rpc/spoolss.c3
-rw-r--r--source4/torture/smb2/acls.c3
-rw-r--r--source4/torture/smb2/oplock.c4
-rw-r--r--source4/torture/smb2/replay.c6
-rw-r--r--source4/torture/smb2/scan.c7
-rw-r--r--source4/torture/smb2/util.c10
-rw-r--r--source4/torture/vfs/acl_xattr.c3
8 files changed, 25 insertions, 28 deletions
diff --git a/source4/torture/raw/session.c b/source4/torture/raw/session.c
index c96e970d061..0c460ae3069 100644
--- a/source4/torture/raw/session.c
+++ b/source4/torture/raw/session.c
@@ -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
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 0e26fcd18e9..20d2f14c113 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -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,
diff --git a/source4/torture/smb2/acls.c b/source4/torture/smb2/acls.c
index fe30380df98..7365554470c 100644
--- a/source4/torture/smb2/acls.c
+++ b/source4/torture/smb2/acls.c
@@ -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,
diff --git a/source4/torture/smb2/oplock.c b/source4/torture/smb2/oplock.c
index 635037b7124..858bdcfa46e 100644
--- a/source4/torture/smb2/oplock.c
+++ b/source4/torture/smb2/oplock.c
@@ -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)) {
diff --git a/source4/torture/smb2/replay.c b/source4/torture/smb2/replay.c
index f715cf80048..a38518aebf2 100644
--- a/source4/torture/smb2/replay.c
+++ b/source4/torture/smb2/replay.c
@@ -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,
diff --git a/source4/torture/smb2/scan.c b/source4/torture/smb2/scan.c
index 24d1421430f..3e43b9dfa32 100644
--- a/source4/torture/smb2/scan.c
+++ b/source4/torture/smb2/scan.c
@@ -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");
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c
index 58956be723e..52a63dd962a 100644
--- a/source4/torture/smb2/util.c
+++ b/source4/torture/smb2/util.c
@@ -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,
diff --git a/source4/torture/vfs/acl_xattr.c b/source4/torture/vfs/acl_xattr.c
index b043d7660f4..9024c33980f 100644
--- a/source4/torture/vfs/acl_xattr.c
+++ b/source4/torture/vfs/acl_xattr.c
@@ -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,