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 8f1ae61a99ec4030d48e2096f94207a6347205b0..d9b83b0ea0d5624ca9c335e3726cc5914d029258 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 d8377eb5347ce5f17b8607935b3465879a3dbc35..0443c4e8044a2a39a4f7ab64086bb18bb4b0e0fc 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;