]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
[config] Change to tools.conf ignored when time syncs backwards.
authorKruti Pendharkar <kp025370@broadcom.com>
Tue, 25 Feb 2025 01:42:24 +0000 (17:42 -0800)
committerKruti Pendharkar <kp025370@broadcom.com>
Tue, 25 Feb 2025 01:42:24 +0000 (17:42 -0800)
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 '==').

open-vm-tools/lib/include/vm_basic_defs.h
open-vm-tools/lib/include/vm_product_versions.h
open-vm-tools/lib/include/x86cpuid.h
open-vm-tools/libvmtools/vmtoolsConfig.c

index f7d648dcb87b5ee7d51f527bb48a8259bc2dc2ec..351d9786b31d9dddf0467e61ada8c8d360e30e56 100644 (file)
@@ -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
index 1f102233418c8be145fee65333d4b341de1bdb08..6e78706f97a711b30164ef7729531311f426196a 100644 (file)
@@ -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
index 30dc0eb8a2d4f5326e2963ac409a0f9ff0a9b3e6..f5ac23c6823a8cda099ac9541a33d81314f057cf 100644 (file)
@@ -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
index 68ef5a39f8baeb9d43e109fda0a85e75b69c024c..0a2df47f4ffa19625ded3576ccc884a41a6f26a8 100644 (file)
@@ -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;
    }