From: Oliver Kurth Date: Fri, 26 Oct 2018 17:44:56 +0000 (-0700) Subject: Add some more VMX logging X-Git-Tag: stable-11.0.0~380 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=394c1f1c11ae4b8c3a907d46ba5c4bfe4d7bd82a;p=thirdparty%2Fopen-vm-tools.git Add some more VMX logging Add some more key logging to the VMX; also put [vgauthservice] into messages for easier grep filtering. --- diff --git a/open-vm-tools/vgauth/common/vmxlog.c b/open-vm-tools/vgauth/common/vmxlog.c index 68366f631..664b28538 100644 --- a/open-vm-tools/vgauth/common/vmxlog.c +++ b/open-vm-tools/vgauth/common/vmxlog.c @@ -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); diff --git a/open-vm-tools/vgauth/serviceImpl/alias.c b/open-vm-tools/vgauth/serviceImpl/alias.c index eba0f754d..66abf0859 100644 --- a/open-vm-tools/vgauth/serviceImpl/alias.c +++ b/open-vm-tools/vgauth/serviceImpl/alias.c @@ -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 : "", + (ai->type == SUBJECT_TYPE_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 : ""); + } else { + VMXLog_Log(VMXLOG_LEVEL_WARNING, + "%s: alias removed for user '%s' with Subject '%s'", + __FUNCTION__, + (userName != NULL) ? userName : "", + (subj->type == SUBJECT_TYPE_ANY) ? "" : subj->name); + } } done: diff --git a/open-vm-tools/vgauth/serviceImpl/verify.c b/open-vm-tools/vgauth/serviceImpl/verify.c index 9cee156ef..c527809b8 100644 --- a/open-vm-tools/vgauth/serviceImpl/verify.c +++ b/open-vm-tools/vgauth/serviceImpl/verify.c @@ -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; }