From: Kruti Pendharkar Date: Tue, 25 Feb 2025 01:42:24 +0000 (-0800) Subject: [config] Change to tools.conf ignored when time syncs backwards. X-Git-Tag: stable-13.1.0~221 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae4edffc0dd7d7ddd0c3936205f2ebd91e345002;p=thirdparty%2Fopen-vm-tools.git [config] Change to tools.conf ignored when time syncs backwards. Originally seen on Windows 2025: A guest start with a date+time that gets updated by a time sync process (ntp, timesync) that performs a significant jump backwards in time. *: Significant here as nothing to do with the size of the jump, but rather its timing. The VMware Tools 'tools.conf' file exists and was created in the original time configuration of the VM such that it's last modified time is current on boot and when initially loaded (read) by the VMware Tools service. The service will have saved this last modified timestamp for future comparisons. At a point after the VMware Tools configuration is loaded, a time sync occurs that updates the guest time backwards (Tx becomes Tx-y) such that the new time is before the VMware Tools configuration file's (tools.conf) last modified timestamp. After the time adjustment AND before the new time catches up with the old time; the VMware Tools configuration file (tools.conf) is updated. Its last modified time changing from a time consistent with the old time to a time at or shortly later than the new time. When the VMware Tools service checks for configuration update, the saved and current 'last modified' timestamps are compared. The old comparison was performing a '<=' comparison to skip reading the configuration file, only re-loading the configuration for newer timestamps. In the conditions here, this check causes the configuration change to be ignored until the guest time catches up and passes the saved 'future' timestamp or the VMware Tools service is restarted. Change: Changing the last modified timestamp check to skip the configuration reload when the timestamp are the same (from '<=' to '=='). --- diff --git a/open-vm-tools/lib/include/vm_basic_defs.h b/open-vm-tools/lib/include/vm_basic_defs.h index f7d648dcb..351d9786b 100644 --- a/open-vm-tools/lib/include/vm_basic_defs.h +++ b/open-vm-tools/lib/include/vm_basic_defs.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (c) 2003-2024 Broadcom. All rights reserved. + * Copyright (c) 2003-2024 Broadcom. All Rights Reserved. * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or modify it diff --git a/open-vm-tools/lib/include/vm_product_versions.h b/open-vm-tools/lib/include/vm_product_versions.h index 1f1022334..6e78706f9 100644 --- a/open-vm-tools/lib/include/vm_product_versions.h +++ b/open-vm-tools/lib/include/vm_product_versions.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (c) 1998-2024 Broadcom. All rights reserved. + * Copyright (c) 1998-2024 Broadcom. All Rights Reserved. * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or modify it diff --git a/open-vm-tools/lib/include/x86cpuid.h b/open-vm-tools/lib/include/x86cpuid.h index 30dc0eb8a..f5ac23c68 100644 --- a/open-vm-tools/lib/include/x86cpuid.h +++ b/open-vm-tools/lib/include/x86cpuid.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (c) 1998-2024 Broadcom. All rights reserved. + * Copyright (c) 1998-2024 Broadcom. All Rights Reserved. * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * This program is free software; you can redistribute it and/or modify it diff --git a/open-vm-tools/libvmtools/vmtoolsConfig.c b/open-vm-tools/libvmtools/vmtoolsConfig.c index 68ef5a39f..0a2df47f4 100644 --- a/open-vm-tools/libvmtools/vmtoolsConfig.c +++ b/open-vm-tools/libvmtools/vmtoolsConfig.c @@ -1,5 +1,6 @@ /********************************************************* - * Copyright (c) 2008-2022 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2025 Broadcom. All Rights Reserved. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * 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 @@ -137,7 +138,7 @@ VMTools_LoadConfig(const gchar *path, hadConfFile = TRUE; /* Check if we really need to load the data. */ - if (mtime != NULL && confStat.st_mtime <= *mtime) { + if (mtime != NULL && confStat.st_mtime == *mtime) { goto exit; }