summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-06-15 11:15:06 +0200
committerAndrew Bartlett <abartlet@samba.org>2011-07-04 18:28:00 +1000
commit45f70db01070cfb0cdfb6ae0e8ee64da2bf42fc0 (patch)
treeced1c978daa490107838a440c1fe4a475e0c36d0 /source3/rpc_server
parent541f3cf639699d23b9a96e6c615027a5be4581a9 (diff)
downloadsamba-45f70db01070cfb0cdfb6ae0e8ee64da2bf42fc0.tar.gz
samba-45f70db01070cfb0cdfb6ae0e8ee64da2bf42fc0.tar.bz2
samba-45f70db01070cfb0cdfb6ae0e8ee64da2bf42fc0.zip
s3-auth: Added remote_address to ntlmssp server.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/dcesrv_ntlmssp.c3
-rw-r--r--source3/rpc_server/dcesrv_ntlmssp.h1
-rw-r--r--source3/rpc_server/dcesrv_spnego.c16
-rw-r--r--source3/rpc_server/dcesrv_spnego.h1
-rw-r--r--source3/rpc_server/srv_pipe.c2
5 files changed, 21 insertions, 2 deletions
diff --git a/source3/rpc_server/dcesrv_ntlmssp.c b/source3/rpc_server/dcesrv_ntlmssp.c
index e43bba732b..8c9484649a 100644
--- a/source3/rpc_server/dcesrv_ntlmssp.c
+++ b/source3/rpc_server/dcesrv_ntlmssp.c
@@ -30,12 +30,13 @@ NTSTATUS ntlmssp_server_auth_start(TALLOC_CTX *mem_ctx,
bool is_dcerpc,
DATA_BLOB *token_in,
DATA_BLOB *token_out,
+ const struct tsocket_address *remote_address,
struct auth_ntlmssp_state **ctx)
{
struct auth_ntlmssp_state *a = NULL;
NTSTATUS status;
- status = auth_ntlmssp_start(&a);
+ status = auth_ntlmssp_start(remote_address, &a);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, (__location__ ": auth_ntlmssp_start failed: %s\n",
nt_errstr(status)));
diff --git a/source3/rpc_server/dcesrv_ntlmssp.h b/source3/rpc_server/dcesrv_ntlmssp.h
index a21c512f9e..0c830f3da4 100644
--- a/source3/rpc_server/dcesrv_ntlmssp.h
+++ b/source3/rpc_server/dcesrv_ntlmssp.h
@@ -28,6 +28,7 @@ NTSTATUS ntlmssp_server_auth_start(TALLOC_CTX *mem_ctx,
bool is_dcerpc,
DATA_BLOB *token_in,
DATA_BLOB *token_out,
+ const struct tsocket_address *remote_address,
struct auth_ntlmssp_state **ctx);
NTSTATUS ntlmssp_server_step(struct auth_ntlmssp_state *ctx,
TALLOC_CTX *mem_ctx,
diff --git a/source3/rpc_server/dcesrv_spnego.c b/source3/rpc_server/dcesrv_spnego.c
index fb758e338b..515e59b7e8 100644
--- a/source3/rpc_server/dcesrv_spnego.c
+++ b/source3/rpc_server/dcesrv_spnego.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "../libcli/auth/spnego.h"
+#include "../lib/tsocket/tsocket.h"
#include "dcesrv_ntlmssp.h"
#include "dcesrv_gssapi.h"
#include "dcesrv_spnego.h"
@@ -26,6 +27,7 @@
static NTSTATUS spnego_init_server(TALLOC_CTX *mem_ctx,
bool do_sign, bool do_seal,
bool is_dcerpc,
+ const struct tsocket_address *remote_address,
struct spnego_context **spnego_ctx)
{
struct spnego_context *sp_ctx = NULL;
@@ -35,6 +37,11 @@ static NTSTATUS spnego_init_server(TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
+ sp_ctx->remote_address = tsocket_address_copy(remote_address, sp_ctx);
+ if (sp_ctx->remote_address == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
sp_ctx->do_sign = do_sign;
sp_ctx->do_seal = do_seal;
sp_ctx->is_dcerpc = is_dcerpc;
@@ -76,6 +83,7 @@ static NTSTATUS spnego_server_mech_init(struct spnego_context *sp_ctx,
sp_ctx->is_dcerpc,
token_in,
token_out,
+ sp_ctx->remote_address,
&ntlmssp_ctx);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("Failed to init ntlmssp server "
@@ -210,6 +218,7 @@ NTSTATUS spnego_server_auth_start(TALLOC_CTX *mem_ctx,
bool is_dcerpc,
DATA_BLOB *spnego_in,
DATA_BLOB *spnego_out,
+ const struct tsocket_address *remote_address,
struct spnego_context **spnego_ctx)
{
struct spnego_context *sp_ctx;
@@ -223,7 +232,12 @@ NTSTATUS spnego_server_auth_start(TALLOC_CTX *mem_ctx,
return NT_STATUS_INVALID_PARAMETER;
}
- status = spnego_init_server(mem_ctx, do_sign, do_seal, is_dcerpc, &sp_ctx);
+ status = spnego_init_server(mem_ctx,
+ do_sign,
+ do_seal,
+ is_dcerpc,
+ remote_address,
+ &sp_ctx);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
diff --git a/source3/rpc_server/dcesrv_spnego.h b/source3/rpc_server/dcesrv_spnego.h
index eeb865d805..e6187f64f4 100644
--- a/source3/rpc_server/dcesrv_spnego.h
+++ b/source3/rpc_server/dcesrv_spnego.h
@@ -28,6 +28,7 @@ NTSTATUS spnego_server_auth_start(TALLOC_CTX *mem_ctx,
bool is_dcerpc,
DATA_BLOB *spnego_in,
DATA_BLOB *spnego_out,
+ const struct tsocket_address *remote_address,
struct spnego_context **spnego_ctx);
NTSTATUS spnego_server_step(struct spnego_context *sp_ctx,
TALLOC_CTX *mem_ctx,
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index fc08d56b1e..2504ac20b3 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -442,6 +442,7 @@ static bool pipe_spnego_auth_bind(struct pipes_struct *p,
true,
&auth_info->credentials,
response,
+ p->remote_address,
&spnego_ctx);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("Failed SPNEGO negotiate (%s)\n",
@@ -596,6 +597,7 @@ static bool pipe_ntlmssp_auth_bind(struct pipes_struct *p,
true,
&auth_info->credentials,
response,
+ p->remote_address,
&ntlmssp_state);
if (!NT_STATUS_EQUAL(status, NT_STATUS_OK)) {
DEBUG(0, (__location__ ": auth_ntlmssp_start failed: %s\n",