summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/smb_server/sesssetup.c4
-rw-r--r--source4/torture/raw/context.c21
2 files changed, 23 insertions, 2 deletions
diff --git a/source4/smb_server/sesssetup.c b/source4/smb_server/sesssetup.c
index a7005e39c5..6f976f0cc6 100644
--- a/source4/smb_server/sesssetup.c
+++ b/source4/smb_server/sesssetup.c
@@ -142,14 +142,14 @@ static NTSTATUS sesssetup_nt1(struct smbsrv_request *req, union smb_sesssetup *s
return NT_STATUS_ACCESS_DENIED;
}
- status = make_user_info_anonymous(req->smb_conn, &user_info);
+ status = make_user_info_anonymous(mem_ctx, &user_info);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(mem_ctx);
return status;
}
/* TODO: should we use just "anonymous" here? */
- status = auth_context_create(req->smb_conn, lp_auth_methods(),
+ status = auth_context_create(mem_ctx, lp_auth_methods(),
&auth_context,
req->smb_conn->connection->event.ctx);
if (!NT_STATUS_IS_OK(status)) {
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");