diff -Nru open-vm-tools-11.0.1/debian/changelog open-vm-tools-11.0.1/debian/changelog --- open-vm-tools-11.0.1/debian/changelog 2019-10-30 08:58:25.000000000 +0000 +++ open-vm-tools-11.0.1/debian/changelog 2019-12-09 10:03:56.000000000 +0000 @@ -1,3 +1,10 @@ +open-vm-tools (2:11.0.1-2ubuntu0.18.04.2) bionic; urgency=medium + + * d/p/lp-1855686-Avoid-vmtoolsd-crash-in-HostInfo.patch: fix crash with + uncommon lsb_output behavior (LP: #1855686) + + -- Christian Ehrhardt Mon, 09 Dec 2019 11:03:56 +0100 + open-vm-tools (2:11.0.1-2ubuntu0.18.04.1) bionic; urgency=medium * Update to latest release v11 (LP: #1844834) diff -Nru open-vm-tools-11.0.1/debian/patches/lp-1855686-Avoid-vmtoolsd-crash-in-HostInfo.patch open-vm-tools-11.0.1/debian/patches/lp-1855686-Avoid-vmtoolsd-crash-in-HostInfo.patch --- open-vm-tools-11.0.1/debian/patches/lp-1855686-Avoid-vmtoolsd-crash-in-HostInfo.patch 1970-01-01 00:00:00.000000000 +0000 +++ open-vm-tools-11.0.1/debian/patches/lp-1855686-Avoid-vmtoolsd-crash-in-HostInfo.patch 2019-12-09 10:03:56.000000000 +0000 @@ -0,0 +1,62 @@ +From 61b43df047e0a6666590016966b9574af21951a8 Mon Sep 17 00:00:00 2001 +From: Oliver Kurth +Date: Thu, 5 Dec 2019 11:34:43 -0800 +Subject: [PATCH] Avoid vmtoolsd crash in HostInfo. + +The guest identification code causes vmtoolsd to crash in certain +versions of some distros. The crash is caused by recent changes to +the lsb_release command. Previously, if the command existed, all +of its options worked. Now, some of the options no longer exist. + +Change the code to check for an lsb_release failure whenever it is +invoked. + +Fix for: https://github.com/vmware/open-vm-tools/issues/390 + +Origin: upstream, https://github.com/vmware/open-vm-tools/commit/61b43df047e0a6666590016966b9574af21951a8 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1855686 +Last-Update: 2019-12-09 +Note: removed non important whitespace damage from the upstream patch + +--- + open-vm-tools/lib/misc/hostinfoPosix.c | 32 +++++++++++++++----------- + 1 file changed, 19 insertions(+), 13 deletions(-) + +diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c +index 91a44ca89..26c3efd89 100644 +--- a/open-vm-tools/lib/misc/hostinfoPosix.c ++++ b/open-vm-tools/lib/misc/hostinfoPosix.c +@@ -1334,6 +1334,8 @@ HostinfoLsbRemoveQuotes(char *lsbOutput) // IN/OUT: + { + char *lsbStart = lsbOutput; + ++ ASSERT(lsbStart != NULL); ++ + if (lsbStart[0] == '"') { + char *quoteEnd = strchr(++lsbStart, '"'); + +@@ -1407,13 +1409,17 @@ HostinfoLsb(char ***args) // OUT: + + /* LSB Distributor */ + lsbOutput = HostinfoGetCmdOutput("/usr/bin/lsb_release -si 2>/dev/null"); +- (*args)[0] = Util_SafeStrdup(HostinfoLsbRemoveQuotes(lsbOutput)); +- free(lsbOutput); ++ if (lsbOutput != NULL) { ++ (*args)[0] = Util_SafeStrdup(HostinfoLsbRemoveQuotes(lsbOutput)); ++ free(lsbOutput); ++ } + + /* LSB Release */ + lsbOutput = HostinfoGetCmdOutput("/usr/bin/lsb_release -sr 2>/dev/null"); +- (*args)[1] = Util_SafeStrdup(HostinfoLsbRemoveQuotes(lsbOutput)); +- free(lsbOutput); ++ if (lsbOutput != NULL) { ++ (*args)[1] = Util_SafeStrdup(HostinfoLsbRemoveQuotes(lsbOutput)); ++ free(lsbOutput); ++ } + + /* LSB Description */ + (*args)[3] = Util_SafeStrdup((*args)[fields]); +-- +2.24.0 + diff -Nru open-vm-tools-11.0.1/debian/patches/series open-vm-tools-11.0.1/debian/patches/series --- open-vm-tools-11.0.1/debian/patches/series 2019-10-30 08:58:25.000000000 +0000 +++ open-vm-tools-11.0.1/debian/patches/series 2019-12-09 10:03:56.000000000 +0000 @@ -3,3 +3,4 @@ debian/scsi-udev-rule 89c0d4445_GitHub-Issue-367.-Remove-references-to-deprecated-G_INLINE_FUNC fix_zfs_fs_detection +lp-1855686-Avoid-vmtoolsd-crash-in-HostInfo.patch