summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-04-25 17:40:35 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-04-30 11:29:34 +0200
commitdabb0562500bb83ded8243705065c4ef6ebb5049 (patch)
tree4fd7277262561b40bf80d5a502058586e787b8e1 /source3
parent442a81e7b282eef85d3c7d978846a531b55cbd5f (diff)
downloadsamba-dabb0562500bb83ded8243705065c4ef6ebb5049.tar.gz
samba-dabb0562500bb83ded8243705065c4ef6ebb5049.tar.bz2
samba-dabb0562500bb83ded8243705065c4ef6ebb5049.zip
s3-auth_samba4: use new_server_id_task() to allocate server id values
This is rather than just picking a random number out of the air. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Mon Apr 30 11:29:34 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/auth/auth_samba4.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/source3/auth/auth_samba4.c b/source3/auth/auth_samba4.c
index 6692f187be..1bf4227b9e 100644
--- a/source3/auth/auth_samba4.c
+++ b/source3/auth/auth_samba4.c
@@ -107,6 +107,7 @@ static NTSTATUS prepare_gensec(TALLOC_CTX *mem_ctx,
struct gensec_security *gensec_ctx;
struct imessaging_context *msg_ctx;
struct cli_credentials *server_credentials;
+ struct server_id *server_id;
lp_ctx = loadparm_init_s3(frame, loadparm_s3_context());
if (lp_ctx == NULL) {
@@ -121,15 +122,25 @@ static NTSTATUS prepare_gensec(TALLOC_CTX *mem_ctx,
return NT_STATUS_INVALID_SERVER_STATE;
}
- msg_ctx = imessaging_client_init(frame,
- lp_ctx,
- event_ctx);
+ server_id = new_server_id_task(frame);
+ if (server_id == NULL) {
+ DEBUG(1, ("new_server_id_task failed\n"));
+ TALLOC_FREE(frame);
+ return NT_STATUS_INVALID_SERVER_STATE;
+ }
+
+ msg_ctx = imessaging_init(frame,
+ lp_ctx,
+ *server_id,
+ event_ctx, true);
if (msg_ctx == NULL) {
DEBUG(1, ("imessaging_init failed\n"));
TALLOC_FREE(frame);
return NT_STATUS_INVALID_SERVER_STATE;
}
+ talloc_reparent(frame, msg_ctx, server_id);
+
server_credentials
= cli_credentials_init(frame);
if (!server_credentials) {
@@ -179,6 +190,7 @@ static NTSTATUS make_auth4_context_s4(TALLOC_CTX *mem_ctx,
struct tevent_context *event_ctx;
TALLOC_CTX *frame = talloc_stackframe();
struct imessaging_context *msg_ctx;
+ struct server_id *server_id;
lp_ctx = loadparm_init_s3(frame, loadparm_s3_context());
if (lp_ctx == NULL) {
@@ -193,14 +205,23 @@ static NTSTATUS make_auth4_context_s4(TALLOC_CTX *mem_ctx,
return NT_STATUS_INVALID_SERVER_STATE;
}
- msg_ctx = imessaging_client_init(frame,
- lp_ctx,
- event_ctx);
+ server_id = new_server_id_task(frame);
+ if (server_id == NULL) {
+ DEBUG(1, ("new_server_id_task failed\n"));
+ TALLOC_FREE(frame);
+ return NT_STATUS_INVALID_SERVER_STATE;
+ }
+
+ msg_ctx = imessaging_init(frame,
+ lp_ctx,
+ *server_id,
+ event_ctx, true);
if (msg_ctx == NULL) {
DEBUG(1, ("imessaging_init failed\n"));
TALLOC_FREE(frame);
return NT_STATUS_INVALID_SERVER_STATE;
}
+ talloc_reparent(frame, msg_ctx, server_id);
status = auth_context_create(mem_ctx,
event_ctx,