summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-06-17 06:30:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:21 -0500
commitb523bde4998b95c676c01b660511ad77029471d2 (patch)
tree8546b1486954b33a50b80cb3d9f5f02e678de49f /source4/torture
parentb11efd3e505c281bbf5b80aa5d0018134c99eb2d (diff)
downloadsamba-b523bde4998b95c676c01b660511ad77029471d2.tar.gz
samba-b523bde4998b95c676c01b660511ad77029471d2.tar.bz2
samba-b523bde4998b95c676c01b660511ad77029471d2.zip
r7675: Use correct memory context for anonymous session setup auth context
(no need for it to hang around forever). Add test for this behaviour. Andrew Bartlett (This used to be commit 36dc2491d778fbbff32c4abdf95faa9f83024e12)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/context.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 11065648b0..948dc4e3e5 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -62,6 +62,8 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
struct smbcli_session *session;
struct smbcli_session *session2;
struct smbcli_session *session3;
+ struct smbcli_session *session4;
+ struct cli_credentials *anon_creds;
struct smbcli_session *sessions[15];
struct composite_context *composite_contexts[15];
struct smbcli_tree *tree;
@@ -137,6 +139,25 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
talloc_free(session3);
+
+ printf("create a fouth anonymous security context on the same transport, without extended security\n");
+ session4 = smbcli_session_init(cli->transport, mem_ctx, False);
+
+ session4->vuid = session->vuid;
+ setup.in.sesskey = cli->transport->negotiate.sesskey;
+ setup.in.capabilities = 0; /* force a non extended security login (should fail) */
+ setup.in.workgroup = lp_workgroup();
+
+ anon_creds = cli_credentials_init(mem_ctx);
+ cli_credentials_set_conf(anon_creds);
+ cli_credentials_set_anonymous(anon_creds);
+
+ setup.in.credentials = anon_creds;
+
+ status = smb_composite_sesssetup(session3, &setup);
+ CHECK_STATUS(status, NT_STATUS_OK);
+
+ talloc_free(session4);
}
printf("use the same tree as the existing connection\n");