From: Gary Lockyer Date: Thu, 31 Jan 2019 20:40:10 +0000 (+1300) Subject: auth log: Log the netlogon logon id. X-Git-Tag: ldb-1.6.1~67 X-Git-Url: http://git.samba.org/samba.git/?p=gd%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=d486a199598b75014c5e897543aff51b5af8d0a1 auth log: Log the netlogon logon id. Add code to log the logonId in the JSON Authentication messages. The version number for Authentication messages changes from 1.1 to 1.2 to reflect this. Signed-off-by: Gary Lockyer Reviewed-by: Andrew Bartlett --- diff --git a/auth/auth_log.c b/auth/auth_log.c index 8f1ae61a99e..d9b83b0ea0d 100644 --- a/auth/auth_log.c +++ b/auth/auth_log.c @@ -41,7 +41,7 @@ * increment the major version. */ #define AUTH_MAJOR 1 -#define AUTH_MINOR 1 +#define AUTH_MINOR 2 #define AUTHZ_MAJOR 1 #define AUTHZ_MINOR 1 @@ -151,6 +151,7 @@ static void log_authentication_event_json( struct json_object wrapper = json_empty_object; struct json_object authentication = json_empty_object; char negotiate_flags[11]; + char logon_id[19]; int rc = 0; authentication = json_new_object(); @@ -167,6 +168,14 @@ static void log_authentication_event_json( if (rc != 0) { goto failure; } + snprintf(logon_id, + sizeof( logon_id), + "%"PRIx64"", + ui->logon_id); + rc = json_add_string(&authentication, "logonId", logon_id); + if (rc != 0) { + goto failure; + } rc = json_add_int(&authentication, "logonType", get_logon_type(ui)); if (rc != 0) { goto failure; diff --git a/auth/common_auth.h b/auth/common_auth.h index d8377eb5347..0443c4e8044 100644 --- a/auth/common_auth.h +++ b/auth/common_auth.h @@ -51,6 +51,7 @@ struct auth_usersupplied_info bool mapped_state; bool was_mapped; + uint64_t logon_id; /* the values the client gives us */ struct { const char *account_name;