From: Oliver Kurth Date: Fri, 15 Sep 2017 18:22:52 +0000 (-0700) Subject: [Tools GuestInfo] Return proper osname for Oracle Linux 6 / 7 X-Git-Tag: stable-10.2.0~641 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73124d51a3ef2db737bf9313d93dd206851bec99;p=thirdparty%2Fopen-vm-tools.git [Tools GuestInfo] Return proper osname for Oracle Linux 6 / 7 Updated the code to detect Oracle Linux 6 and Oracle Linux 7 and return proper osname acocrdingly. --- diff --git a/open-vm-tools/lib/include/guest_os.h b/open-vm-tools/lib/include/guest_os.h index 550841ebf..1e8d12347 100644 --- a/open-vm-tools/lib/include/guest_os.h +++ b/open-vm-tools/lib/include/guest_os.h @@ -238,6 +238,8 @@ Bool Gos_InSetArray(uint32 gos, const uint32 *set); #define STR_OS_MKLINUX "MkLinux" #define STR_OS_NOVELL "nld9" #define STR_OS_NOVELL_FULL "Novell Linux Desktop 9" +#define STR_OS_ORACLE6 "oraclelinux6" +#define STR_OS_ORACLE7 "oraclelinux7" #define STR_OS_ORACLE "oraclelinux" #define STR_OS_OTHER "otherlinux" #define STR_OS_OTHER_FULL "Other Linux" diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c index ac10f66e4..33c1fc64b 100644 --- a/open-vm-tools/lib/misc/hostinfoPosix.c +++ b/open-vm-tools/lib/misc/hostinfoPosix.c @@ -611,7 +611,13 @@ HostinfoGetOSShortName(char *distro, // IN: full distro name * Not sure why they didn't brand their releases as "Oracle Enterprise * Linux". Oh well. It's fixed in 6.0, though. */ - Str_Strcpy(distroShort, STR_OS_ORACLE, distroShortSize); + if (strstr(distroLower, "6.")) { + Str_Strcpy(distroShort, STR_OS_ORACLE6, distroShortSize); + } else if (strstr(distroLower, "7.")) { + Str_Strcpy(distroShort, STR_OS_ORACLE7, distroShortSize); + } else { + Str_Strcpy(distroShort, STR_OS_ORACLE, distroShortSize); + } } else if (strstr(distroLower, "fedora")) { Str_Strcpy(distroShort, STR_OS_FEDORA, distroShortSize); } else if (strstr(distroLower, "gentoo")) {