From 45f70db01070cfb0cdfb6ae0e8ee64da2bf42fc0 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 15 Jun 2011 11:15:06 +0200 Subject: s3-auth: Added remote_address to ntlmssp server. Signed-off-by: Andrew Bartlett --- source3/auth/auth_ntlmssp.c | 11 ++++++++++- source3/auth/proto.h | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'source3/auth') diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index ad08981d2f..54f7e6d5fc 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -26,6 +26,7 @@ #include "ntlmssp_wrap.h" #include "../librpc/gen_ndr/netlogon.h" #include "smbd/smbd.h" +#include "../lib/tsocket/tsocket.h" NTSTATUS auth_ntlmssp_steal_session_info(TALLOC_CTX *mem_ctx, struct auth_ntlmssp_state *auth_ntlmssp_state, @@ -173,7 +174,8 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state, static int auth_ntlmssp_state_destructor(void *ptr); -NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state **auth_ntlmssp_state) +NTSTATUS auth_ntlmssp_start(const struct tsocket_address *remote_address, + struct auth_ntlmssp_state **auth_ntlmssp_state) { NTSTATUS nt_status; bool is_standalone; @@ -205,6 +207,12 @@ NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state **auth_ntlmssp_state) return NT_STATUS_NO_MEMORY; } + ans->remote_address = tsocket_address_copy(remote_address, ans); + if (ans->remote_address == NULL) { + DEBUG(0,("auth_ntlmssp_start: talloc failed!\n")); + return NT_STATUS_NO_MEMORY; + } + nt_status = ntlmssp_server_start(ans, is_standalone, netbios_name, @@ -240,6 +248,7 @@ static int auth_ntlmssp_state_destructor(void *ptr) ans = talloc_get_type(ptr, struct auth_ntlmssp_state); + TALLOC_FREE(ans->remote_address); TALLOC_FREE(ans->server_info); TALLOC_FREE(ans->ntlmssp_state); return 0; diff --git a/source3/auth/proto.h b/source3/auth/proto.h index 46846ac907..a4330155d1 100644 --- a/source3/auth/proto.h +++ b/source3/auth/proto.h @@ -69,7 +69,8 @@ NTSTATUS auth_netlogond_init(void); NTSTATUS auth_ntlmssp_steal_session_info(TALLOC_CTX *mem_ctx, struct auth_ntlmssp_state *auth_ntlmssp_state, struct auth_serversupplied_info **session_info); -NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state **auth_ntlmssp_state); +NTSTATUS auth_ntlmssp_start(const struct tsocket_address *remote_address, + struct auth_ntlmssp_state **auth_ntlmssp_state); /* The following definitions come from auth/auth_sam.c */ -- cgit