1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

auth: Add unique session GUID identifier

Generate a GUID for each successful authorization, this will allow the
tying of events in the logs back to a specific session.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Gary Lockyer 2018-04-10 06:44:00 +12:00 committed by Andrew Bartlett
parent 79ba530aaf
commit 1488723a11
3 changed files with 15 additions and 0 deletions

View File

@ -105,6 +105,13 @@ interface auth
[noprint] DATA_BLOB session_key;
[value(NULL), ignore] cli_credentials *credentials;
/*
* It is really handy to have our authorization code log a
* token that can be used to tie later requests togeather.
* We generate this in auth_generate_session_info()
*/
GUID unique_session_token;
} auth_session_info;
typedef [public] struct {

View File

@ -488,6 +488,8 @@ NTSTATUS create_local_token(TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
session_info->unique_session_token = GUID_random();
*session_info_out = session_info;
return NT_STATUS_OK;
}
@ -658,6 +660,8 @@ NTSTATUS create_local_token(TALLOC_CTX *mem_ctx,
return status;
}
session_info->unique_session_token = GUID_random();
*session_info_out = session_info;
return NT_STATUS_OK;
}
@ -1209,6 +1213,8 @@ done:
return status;
}
session_info->unique_session_token = GUID_random();
*session_info_out = talloc_move(mem_ctx, &session_info);
TALLOC_FREE(frame);
return NT_STATUS_OK;

View File

@ -220,6 +220,8 @@ _PUBLIC_ NTSTATUS auth_generate_session_info(TALLOC_CTX *mem_ctx,
return nt_status;
}
session_info->unique_session_token = GUID_random();
session_info->credentials = NULL;
talloc_steal(mem_ctx, session_info);