diff options
author | Ralph Boehme <slow@samba.org> | 2018-11-08 15:42:46 +0100 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2018-11-13 11:13:03 +0100 |
commit | 368e1860654e737aa2fa9516cdd3668fa644009a (patch) | |
tree | fa34031da224c6f8ed2828185e734f3ad698330e /source4 | |
parent | 53fe148476a5566b7a8204d7e44b6e75ce7d45bc (diff) | |
download | samba-368e1860654e737aa2fa9516cdd3668fa644009a.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>
Diffstat (limited to 'source4')
-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); } |