From: John Wolfe Date: Wed, 30 Jun 2021 18:37:27 +0000 (-0700) Subject: Use os-release preferentially for guest identification. X-Git-Tag: stable-12.0.0~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd5dede3536c30e2799fa8c788a9dc9b7f904d35;p=thirdparty%2Fopen-vm-tools.git Use os-release preferentially for guest identification. 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. --- diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c index 7e0866699..56708333f 100644 --- a/open-vm-tools/lib/misc/hostinfoPosix.c +++ b/open-vm-tools/lib/misc/hostinfoPosix.c @@ -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