diff options
author | Andrew Bartlett <abartlet@samba.org> | 2017-03-24 15:18:46 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-03-29 02:37:28 +0200 |
commit | d0041960363c981224552d4ce7ac3092679ee2c6 (patch) | |
tree | 8c76050e625360ea4955f537e73022944ac01725 /source4 | |
parent | 631f1bcce68062e1c8e653024999b79589a80eaf (diff) | |
download | samba-d0041960363c981224552d4ce7ac3092679ee2c6.tar.gz |
auth: Add hooks for notification of authentication events over the message bus
This will allow tests to be written to confirm the correct events are triggered.
We pass in a messaging context from the callers
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/auth/ntlm/auth.c | 8 | ||||
-rw-r--r-- | source4/auth/ntlm/auth_simple.c | 4 | ||||
-rw-r--r-- | source4/ldap_server/ldap_backend.c | 4 | ||||
-rw-r--r-- | source4/rpc_server/dcesrv_auth.c | 4 | ||||
-rw-r--r-- | source4/smb_server/smb/sesssetup.c | 4 |
5 files changed, 18 insertions, 6 deletions
diff --git a/source4/auth/ntlm/auth.c b/source4/auth/ntlm/auth.c index 18ecf853fce..ecb7d6b1cad 100644 --- a/source4/auth/ntlm/auth.c +++ b/source4/auth/ntlm/auth.c @@ -449,7 +449,9 @@ _PUBLIC_ NTSTATUS auth_check_password_recv(struct tevent_req *req, state->user_info->mapped.account_name, nt_errstr(status), state->authoritative)); - log_authentication_event(state->user_info, status, + log_authentication_event(state->auth_ctx->msg_ctx, + state->auth_ctx->lp_ctx, + state->user_info, status, NULL, NULL, NULL, NULL); tevent_req_received(req); return status; @@ -461,7 +463,9 @@ _PUBLIC_ NTSTATUS auth_check_password_recv(struct tevent_req *req, state->user_info_dc->info->domain_name, state->user_info_dc->info->account_name)); - log_authentication_event(state->user_info, status, + log_authentication_event(state->auth_ctx->msg_ctx, + state->auth_ctx->lp_ctx, + state->user_info, status, state->user_info_dc->info->domain_name, state->user_info_dc->info->account_name, NULL, diff --git a/source4/auth/ntlm/auth_simple.c b/source4/auth/ntlm/auth_simple.c index a00d8d4dd2b..7e434d7d3c2 100644 --- a/source4/auth/ntlm/auth_simple.c +++ b/source4/auth/ntlm/auth_simple.c @@ -130,7 +130,9 @@ _PUBLIC_ NTSTATUS authenticate_ldap_simple_bind(TALLOC_CTX *mem_ctx, talloc_steal(mem_ctx, *session_info); } - log_successful_authz_event(remote_address, + log_successful_authz_event(auth_context->msg_ctx, + auth_context->lp_ctx, + remote_address, local_address, "LDAP", "simple bind", diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c index 7aa51f293ed..d20d586d237 100644 --- a/source4/ldap_server/ldap_backend.c +++ b/source4/ldap_server/ldap_backend.c @@ -1285,7 +1285,9 @@ NTSTATUS ldapsrv_do_call(struct ldapsrv_call *call) transport_protection = AUTHZ_TRANSPORT_PROTECTION_TLS; } - log_successful_authz_event(call->conn->connection->remote_address, + log_successful_authz_event(call->conn->connection->msg_ctx, + call->conn->connection->lp_ctx, + call->conn->connection->remote_address, call->conn->connection->local_address, "LDAP", "no bind", diff --git a/source4/rpc_server/dcesrv_auth.c b/source4/rpc_server/dcesrv_auth.c index 1ebb5143b93..efcb586bfcf 100644 --- a/source4/rpc_server/dcesrv_auth.c +++ b/source4/rpc_server/dcesrv_auth.c @@ -62,7 +62,9 @@ bool dcesrv_auth_bind(struct dcesrv_call_state *call) * covered ncacn_np pass-through auth, and anonymous * DCE/RPC (eg epmapper, netlogon etc) */ - log_successful_authz_event(call->conn->remote_address, + log_successful_authz_event(call->conn->msg_ctx, + call->conn->dce_ctx->lp_ctx, + call->conn->remote_address, call->conn->local_address, "DCE/RPC", auth_type, diff --git a/source4/smb_server/smb/sesssetup.c b/source4/smb_server/smb/sesssetup.c index cc022229736..13f13934412 100644 --- a/source4/smb_server/smb/sesssetup.c +++ b/source4/smb_server/smb/sesssetup.c @@ -54,7 +54,9 @@ void smbsrv_not_spengo_sesssetup_authz_log(struct smbsrv_request *req, local_address = socket_get_local_addr(req->smb_conn->connection->socket, frame); - log_successful_authz_event(remote_address, + log_successful_authz_event(req->smb_conn->connection->msg_ctx, + req->smb_conn->lp_ctx, + remote_address, local_address, "SMB", "bare-NTLM", |