static NTSTATUS setup_ntlmssp_session_info(struct smbd_smb2_session *session, NTSTATUS status) { if (NT_STATUS_IS_OK(status)) { status = auth_ntlmssp_steal_session_info(session, session->auth_ntlmssp_state, &session->session_info); } else { /* Note that this session_info won't have a session * key. But for map to guest, that's exactly the right * thing - we can't reasonably guess the key the * client wants, as the password was wrong */ status = do_map_to_guest(status, &session->session_info, auth_ntlmssp_get_username(session->auth_ntlmssp_state), auth_ntlmssp_get_domain(session->auth_ntlmssp_state)); } return status; }
NTSTATUS ntlmssp_server_get_user_info(struct auth_ntlmssp_state *ctx, TALLOC_CTX *mem_ctx, struct auth_serversupplied_info **session_info) { NTSTATUS status; status = auth_ntlmssp_steal_session_info(mem_ctx, ctx, session_info); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, (__location__ ": Failed to get authenticated user " "info: %s\n", nt_errstr(status))); return status; } DEBUG(5, (__location__ "OK: user: %s domain: %s workstation: %s\n", auth_ntlmssp_get_username(ctx), auth_ntlmssp_get_domain(ctx), auth_ntlmssp_get_client(ctx))); return NT_STATUS_OK; }