]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Use os-release preferentially for guest identification.
authorJohn Wolfe <jwolfe@vmware.com>
Wed, 30 Jun 2021 18:37:27 +0000 (11:37 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Wed, 30 Jun 2021 18:37:27 +0000 (11:37 -0700)
If the "score" of the Linux guest identification from os-release is
the same as from the LSB score, use the os-release data. The os-release
standard is well established and the LSB is deprecated.

open-vm-tools/lib/misc/hostinfoPosix.c

index 7e0866699404fd2f4d16376606ae6d68920e278f..56708333f627ffd9a146901d8e88ee99580afaa8 100644 (file)
@@ -1939,8 +1939,12 @@ HostinfoBestScore(char *distro,            // OUT:
    int lsbScore = HostinfoLsb(&lsbData);
    int osReleaseScore = HostinfoOsRelease(&osReleaseData);
 
-   /* We prefer the LSB so as to maintain the best backwards compatibility. */
-   if ((lsbScore > 0) && (lsbScore >= osReleaseScore)) {
+   /*
+    * Now that the os-release standard is long stable, choose it over the LSB
+    * standard, all things being the same.
+    */
+
+   if ((lsbScore > 0) && (lsbScore > osReleaseScore)) {
       size_t fields = ARRAYSIZE(lsbFields) - 1;  // Exclude terminator
 
       if (lsbData[0] != NULL) {  // Name