diff options
author | Ralph Boehme <slow@samba.org> | 2018-11-08 15:42:46 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2018-11-23 09:01:26 +0100 |
commit | 288a79d997b30acbd611b17b024cec1cc33fba10 (patch) | |
tree | 5e793a031a9bc4fa91bebd0b778335f6e5ec35af /source4/torture/smb2/session.c | |
parent | 7a5077d7e9a5ef8c346877f10426355a298ea6e4 (diff) | |
download | samba-288a79d997b30acbd611b17b024cec1cc33fba10.tar.gz |
s4:torture/smb2/session: invalidate credential cache
Invalidate credential cache before connecting to the server, otherwise
we will reuse the credentials from the credential cache populated by the
preceeding tests.
Also invalidate it at the end, otherwise subsequent tests might run into
problems if the credentials expire while authenticating.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 368e1860654e737aa2fa9516cdd3668fa644009a)
Diffstat (limited to 'source4/torture/smb2/session.c')
-rw-r--r-- | source4/torture/smb2/session.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/torture/smb2/session.c b/source4/torture/smb2/session.c index 7dc9ba19ee6..65cc53ba337 100644 --- a/source4/torture/smb2/session.c +++ b/source4/torture/smb2/session.c @@ -1073,6 +1073,8 @@ static bool test_session_expire1i(struct torture_context *tctx, torture_assert_int_equal(tctx, use_kerberos, CRED_MUST_USE_KERBEROS, "please use -k yes"); + cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); + lpcfg_set_option(tctx->lp_ctx, "gensec_gssapi:requested_life_time=4"); lpcfg_smbcli_options(tctx->lp_ctx, &options); @@ -1167,6 +1169,8 @@ static bool test_session_expire1i(struct torture_context *tctx, ret = true; done: + cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); + if (h1 != NULL) { smb2_util_close(tree, *h1); } @@ -1236,6 +1240,8 @@ static bool test_session_expire2i(struct torture_context *tctx, torture_assert_int_equal(tctx, use_kerberos, CRED_MUST_USE_KERBEROS, "please use -k yes"); + cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); + lpcfg_set_option(tctx->lp_ctx, "gensec_gssapi:requested_life_time=4"); lpcfg_smbcli_options(tctx->lp_ctx, &options); @@ -1547,6 +1553,8 @@ static bool test_session_expire2i(struct torture_context *tctx, ret = true; done: + cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); + if (h1 != NULL) { smb2_util_close(tree, *h1); } |