]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add some more VMX logging
authorOliver Kurth <okurth@vmware.com>
Fri, 26 Oct 2018 17:44:56 +0000 (10:44 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 26 Oct 2018 17:44:56 +0000 (10:44 -0700)
Add some more key logging to the VMX; also put [vgauthservice] into
messages for easier grep filtering.

open-vm-tools/vgauth/common/vmxlog.c
open-vm-tools/vgauth/serviceImpl/alias.c
open-vm-tools/vgauth/serviceImpl/verify.c

index 68366f631d53d0b8f52a9b9c3c51b1a342a9e147..664b2853814d6f55c08b7b3544c6df362b528e7e 100644 (file)
@@ -67,6 +67,7 @@ static gboolean gDisableVMXLogging = TRUE;
 #define VMX_RPC_UNKNOWN  0                    // RPC disabled or not supported
 #define VMX_RPC_ERROR   -1                    // failed to send RPC
 
+#define VMXLOG_SERVICE_NAME      "[vgauthservice]"
 /*
  * Some typedefs for portability.
  */
@@ -590,9 +591,9 @@ again:
     */
    if (useNewRpc) {
       /* XXX TODO use the level */
-      cmd = g_strdup_printf("%s %s", LOG_RPC_CMD_NEW, msg);
+      cmd = g_strdup_printf("%s " VMXLOG_SERVICE_NAME " %s", LOG_RPC_CMD_NEW, msg);
    } else {
-      cmd = g_strdup_printf("%s %s", LOG_RPC_CMD, msg);
+      cmd = g_strdup_printf("%s " VMXLOG_SERVICE_NAME " %s", LOG_RPC_CMD, msg);
    }
 
    ret = SendString(cmd);
index eba0f754d6173e6d24b57c950f264eec68fd4543..66abf0859c06edf6ce62bc699492d8575d1293e7 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2018 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -40,6 +40,7 @@
 #include "serviceInt.h"
 #include "certverify.h"
 #include "VGAuthProto.h"
+#include "vmxlog.h"
 
 // puts the identity store in an easy to find place
 #undef WIN_TEST_MODE
@@ -2679,6 +2680,11 @@ check_map:
                  SU_(alias.addid,
                      "Alias added to Alias store owned by '%s' by user '%s'"),
                  userName, reqUserName);
+      VMXLog_Log(VMXLOG_LEVEL_WARNING,
+                 "%s: alias added for user '%s' with Subject '%s'",
+                 __FUNCTION__,
+                 (userName != NULL) ? userName : "<UNKNOWN>",
+                 (ai->type == SUBJECT_TYPE_ANY) ? "<ANY>" : ai->name);
    }
 
 done:
@@ -2947,6 +2953,18 @@ update:
                  SU_(alias.removeid,
                      "Alias removed from Alias store owned by '%s' by user '%s'"),
                  userName, reqUserName);
+      if (removeAll) {
+         VMXLog_Log(VMXLOG_LEVEL_WARNING,
+                    "%s: all aliases removed for user '%s'",
+                    __FUNCTION__,
+                    (userName != NULL) ? userName : "<UNKNOWN>");
+      } else {
+         VMXLog_Log(VMXLOG_LEVEL_WARNING,
+                    "%s: alias removed for user '%s' with Subject '%s'",
+                    __FUNCTION__,
+                    (userName != NULL) ? userName : "<UNKNOWN>",
+                    (subj->type == SUBJECT_TYPE_ANY) ? "<ANY>" : subj->name);
+      }
    }
 
 done:
index 9cee156efe975d0684e22265cbb6129f888d4c05..c527809b8ae6d5bd406eeda80b1b9445b45c01dd 100644 (file)
@@ -171,6 +171,9 @@ ServiceVerifyAndCheckTrustCertChainForSubject(int numCerts,
                    g_strcmp0(queryUserName, maList[j].userName) != 0) {
                   Warning("%s: found more than one user in map file chain\n",
                           __FUNCTION__);
+                  VMXLog_Log(VMXLOG_LEVEL_WARNING,
+                             "%s: found more than one user in map file chain\n",
+                          __FUNCTION__);
                   err = VGAUTH_E_MULTIPLE_MAPPINGS;
                   goto done;
                }