mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s4:torture: let smb2.session.bind_negative_* also test without session keys
This checks the result of a 2nd session setup without the BIND flags and also without signing being already enabled. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
e25a9e8f4e
commit
66673f08f7
11
selftest/knownfail.d/smb2.session
Normal file
11
selftest/knownfail.d/smb2.session
Normal file
@ -0,0 +1,11 @@
|
||||
^samba3.smb2.session.*bind_negative_smb3encGtoC
|
||||
^samba3.smb2.session.*ntlm.bind_negative_smb202.ad_dc
|
||||
^samba3.smb2.session.*ntlm.bind_negative_smb210.ad_dc
|
||||
^samba3.smb2.session.*ntlm.bind_negative_smb2to3.ad_dc
|
||||
^samba3.smb2.session.*ntlm.bind_negative_smb3to2.ad_dc
|
||||
^samba3.smb2.session.*ntlm.bind_negative_smb3to3.ad_dc
|
||||
^samba3.smb2.session.*krb5.bind_negative_smb202.ad_dc
|
||||
^samba3.smb2.session.*krb5.bind_negative_smb210.ad_dc
|
||||
^samba3.smb2.session.*krb5.bind_negative_smb2to3.ad_dc
|
||||
^samba3.smb2.session.*krb5.bind_negative_smb3to2.ad_dc
|
||||
^samba3.smb2.session.*krb5.bind_negative_smb3to3.ad_dc
|
@ -2514,6 +2514,8 @@ static bool test_session_bind_negative_smbXtoX(struct torture_context *tctx,
|
||||
struct smb2_tree *tree2_0 = NULL;
|
||||
struct smb2_transport *transport2 = NULL;
|
||||
struct smb2_session *session1_2 = NULL;
|
||||
uint64_t session1_id = 0;
|
||||
uint16_t session1_flags = 0;
|
||||
|
||||
status = smb2_connect(tctx,
|
||||
host,
|
||||
@ -2530,6 +2532,8 @@ static bool test_session_bind_negative_smbXtoX(struct torture_context *tctx,
|
||||
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
|
||||
"smb2_connect options1 failed");
|
||||
session1_1 = tree1->session;
|
||||
session1_id = smb2cli_session_current_id(session1_1->smbXcli);
|
||||
session1_flags = smb2cli_session_get_flags(session1_1->smbXcli);
|
||||
|
||||
/* Add some random component to the file name. */
|
||||
snprintf(fname, sizeof(fname), "%s_%s.dat",
|
||||
@ -2611,6 +2615,25 @@ static bool test_session_bind_negative_smbXtoX(struct torture_context *tctx,
|
||||
"smb2_session_setup_spnego failed");
|
||||
TALLOC_FREE(session1_2);
|
||||
|
||||
/*
|
||||
* ... and we should also check the status without any existing
|
||||
* session keys.
|
||||
*/
|
||||
session1_2 = smb2_session_init(transport2,
|
||||
lpcfg_gensec_settings(tctx, tctx->lp_ctx),
|
||||
tree2_0);
|
||||
torture_assert(tctx, session1_2 != NULL, "smb2_session_channel failed");
|
||||
talloc_steal(tree2_0->session, transport2);
|
||||
smb2cli_session_set_id_and_flags(session1_2->smbXcli,
|
||||
session1_id, session1_flags);
|
||||
|
||||
status = smb2_session_setup_spnego(session1_2,
|
||||
credentials,
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_USER_SESSION_DELETED, ret, done,
|
||||
"smb2_session_setup_spnego failed");
|
||||
TALLOC_FREE(session1_2);
|
||||
|
||||
/* Check the initial session is still alive */
|
||||
ZERO_STRUCT(qfinfo1);
|
||||
qfinfo1.generic.level = RAW_FILEINFO_POSITION_INFORMATION;
|
||||
|
Loading…
Reference in New Issue
Block a user