auth log: Log the netlogon logon id.
authorGary Lockyer <gary@catalyst.net.nz>
Thu, 31 Jan 2019 20:40:10 +0000 (09:40 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 20 Feb 2019 05:03:09 +0000 (06:03 +0100)
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 <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
auth/auth_log.c
auth/common_auth.h

index 8f1ae61..d9b83b0 100644 (file)
@@ -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;
index d8377eb..0443c4e 100644 (file)
@@ -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;