summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2017-02-23 14:31:52 +1300
committerAndrew Bartlett <abartlet@samba.org>2017-03-29 02:37:26 +0200
commit85536c1ff3513840728ba281de2b6f003e49f227 (patch)
tree8225ba99a304c6e2c09a05adf14b65dd0b4b537c /source3/auth
parentdc43000c0e15638cb4bc56ef8bbf6a50e681bb5a (diff)
downloadsamba-85536c1ff3513840728ba281de2b6f003e49f227.tar.gz
auth: Always supply both the remote and local address to the auth subsystem
This ensures that gensec, and then the NTLM auth subsystem under it, always gets the remote and local address pointers for potential logging. The local address allows us to know which interface an authentication is on Signed-off-by: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_generic.c8
-rw-r--r--source3/auth/proto.h4
2 files changed, 11 insertions, 1 deletions
diff --git a/source3/auth/auth_generic.c b/source3/auth/auth_generic.c
index 70eb5145932..7c57e18e1aa 100644
--- a/source3/auth/auth_generic.c
+++ b/source3/auth/auth_generic.c
@@ -233,6 +233,7 @@ NTSTATUS make_auth4_context(TALLOC_CTX *mem_ctx, struct auth4_context **auth4_co
NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx,
const struct tsocket_address *remote_address,
+ const struct tsocket_address *local_address,
const char *service_description,
struct gensec_security **gensec_security_out)
{
@@ -378,6 +379,13 @@ NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx,
return nt_status;
}
+ nt_status = gensec_set_local_address(gensec_security,
+ local_address);
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ TALLOC_FREE(tmp_ctx);
+ return nt_status;
+ }
+
nt_status = gensec_set_target_service_description(gensec_security,
service_description);
diff --git a/source3/auth/proto.h b/source3/auth/proto.h
index b64ebed4e07..400875f0591 100644
--- a/source3/auth/proto.h
+++ b/source3/auth/proto.h
@@ -105,7 +105,9 @@ NTSTATUS auth_domain_init(void);
/* The following definitions come from auth/auth_generic.c */
NTSTATUS make_auth4_context(TALLOC_CTX *mem_ctx, struct auth4_context **auth4_context_out);
-NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx, const struct tsocket_address *remote_address,
+NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx,
+ const struct tsocket_address *remote_address,
+ const struct tsocket_address *local_address,
const char *service_description,
struct gensec_security **gensec_security_out);