auth: Generate a human readable Authentication log message.
[nivanova/samba-autobuild/.git] / source4 / auth / ntlm / auth.c
index 9bde07323fcebdfce8bc5f56dafa628ae3f60f50..18ecf853fce01d23eb99b1ca5a03a207bd6ee78d 100644 (file)
@@ -432,7 +432,7 @@ _PUBLIC_ NTSTATUS auth_check_password_recv(struct tevent_req *req,
 {
        struct auth_check_password_state *state =
                tevent_req_data(req, struct auth_check_password_state);
-       NTSTATUS status;
+       NTSTATUS status = NT_STATUS_OK;
 
        *pauthoritative = state->authoritative;
 
@@ -448,6 +448,9 @@ _PUBLIC_ NTSTATUS auth_check_password_recv(struct tevent_req *req,
                         state->user_info->mapped.domain_name,
                         state->user_info->mapped.account_name,
                         nt_errstr(status), state->authoritative));
+
+               log_authentication_event(state->user_info, status,
+                                        NULL, NULL, NULL, NULL);
                tevent_req_received(req);
                return status;
        }
@@ -458,6 +461,12 @@ _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,
+                                state->user_info_dc->info->domain_name,
+                                state->user_info_dc->info->account_name,
+                                NULL,
+                                &state->user_info_dc->sids[0]);
+
        *user_info_dc = talloc_move(mem_ctx, &state->user_info_dc);
 
        tevent_req_received(req);