From: John Wolfe Date: Fri, 13 Aug 2021 18:35:58 +0000 (-0700) Subject: Use os-release preferentially for guest identification. X-Git-Tag: stable-11.3.5~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a6491b17b2a7a71a60f94c8c9796b93cf914726;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