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 /source3 | |
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 'source3')
-rw-r--r-- | source3/auth/auth.c | 5 | ||||
-rw-r--r-- | source3/auth/auth_generic.c | 4 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe.c | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/source3/auth/auth.c b/source3/auth/auth.c index 45bcabd2721..28d0955c327 100644 --- a/source3/auth/auth.c +++ b/source3/auth/auth.c @@ -299,7 +299,8 @@ NTSTATUS auth_check_ntlm_password(TALLOC_CTX *mem_ctx, sid = (struct dom_sid) {0}; } - log_authentication_event(user_info, nt_status, + log_authentication_event(NULL, NULL, + user_info, nt_status, server_info->info3->base.logon_domain.string, server_info->info3->base.account_name.string, unix_username, &sid); @@ -330,7 +331,7 @@ fail: user_info->client.account_name, user_info->mapped.account_name, nt_errstr(nt_status), *pauthoritative)); - log_authentication_event(user_info, nt_status, NULL, NULL, NULL, NULL); + log_authentication_event(NULL, NULL, user_info, nt_status, NULL, NULL, NULL, NULL); ZERO_STRUCTP(pserver_info); diff --git a/source3/auth/auth_generic.c b/source3/auth/auth_generic.c index c18b5435ac4..6dedeedd302 100644 --- a/source3/auth/auth_generic.c +++ b/source3/auth/auth_generic.c @@ -443,7 +443,9 @@ NTSTATUS auth_check_password_session_info(struct auth4_context *auth_context, * log all authorizations consistently (be they NLTM, NTLMSSP * or krb5) we log this info again as an authorization. */ - log_successful_authz_event(user_info->remote_host, + log_successful_authz_event(auth_context->msg_ctx, + auth_context->lp_ctx, + user_info->remote_host, user_info->local_host, user_info->service_description, user_info->auth_description, diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index c8b0fdccf42..95e2cebee8b 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -836,7 +836,8 @@ static bool api_pipe_bind_req(struct pipes_struct *p, * covered ncacn_np pass-through auth, and anonymous * DCE/RPC (eg epmapper, netlogon etc) */ - log_successful_authz_event(p->remote_address, + log_successful_authz_event(NULL, NULL, + p->remote_address, p->local_address, table->name, derpc_transport_string_by_transport(p->transport), |