Accepting request 737499 from Virtualization:VMware

OBS-URL: https://build.opensuse.org/request/show/737499
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/open-vm-tools?expand=0&rev=88
This commit is contained in:
Dominique Leuenberger 2019-10-17 11:04:39 +00:00 committed by Git OBS Bridge
commit 01fe57dcf4
4 changed files with 157 additions and 1 deletions

View File

@ -0,0 +1,64 @@
commit 9bc72f0b09702754b429115658a85223cb3058bd
Author: Oliver Kurth <okurth@vmware.com>
Date: Wed Oct 2 17:48:35 2019 -0700
Fix leaks in ListAliases and ListMappedAliases.
The 'record' for each alias was being leaked.
diff --git a/open-vm-tools/services/plugins/vix/vixTools.c b/open-vm-tools/services/plugins/vix/vixTools.c
index 6352b915..9ba55073 100644
--- a/open-vm-tools/services/plugins/vix/vixTools.c
+++ b/open-vm-tools/services/plugins/vix/vixTools.c
@@ -9762,7 +9762,6 @@ VixToolsListAuthAliases(VixCommandReques
char *destPtr;
char *endDestPtr;
char *tmpBuf = NULL;
- char *recordBuf;
size_t recordSize;
char *escapedStr = NULL;
char *escapedStr2 = NULL;
@@ -9822,6 +9821,8 @@ VixToolsListAuthAliases(VixCommandReques
destPtr += Str_Sprintf(destPtr, endDestPtr - destPtr, "%s",
VIX_XML_ESCAPED_TAG);
for (i = 0; i < num; i++) {
+ char *recordBuf = NULL;
+
escapedStr = VixToolsEscapeXMLString(uaList[i].pemCert);
if (escapedStr == NULL) {
err = VIX_E_OUT_OF_MEMORY;
@@ -9895,6 +9896,8 @@ VixToolsListAuthAliases(VixCommandReques
Log("%s: ListAuth list results too large, truncating", __FUNCTION__);
goto abort;
}
+ free(recordBuf);
+ recordBuf = NULL;
}
*result = resultBuffer;
@@ -9960,7 +9963,6 @@ VixToolsListMappedAliases(VixCommandRequ
char *destPtr;
char *endDestPtr;
char *tmpBuf = NULL;
- char *recordBuf;
char *escapedStr = NULL;
char *escapedStr2 = NULL;
size_t recordSize;
@@ -10014,6 +10016,8 @@ VixToolsListMappedAliases(VixCommandRequ
destPtr += Str_Sprintf(destPtr, endDestPtr - destPtr, "%s",
VIX_XML_ESCAPED_TAG);
for (i = 0; i < num; i++) {
+ char *recordBuf = NULL;
+
escapedStr = VixToolsEscapeXMLString(maList[i].pemCert);
if (escapedStr == NULL) {
err = VIX_E_OUT_OF_MEMORY;
@@ -10085,6 +10089,8 @@ VixToolsListMappedAliases(VixCommandRequ
Log("%s: ListMapped results too large, truncating", __FUNCTION__);
goto abort;
}
+ free(recordBuf);
+ recordBuf = NULL;
}
*result = resultBuffer;

74
gcc9-static-inline.patch Normal file
View File

@ -0,0 +1,74 @@
diff --git a/open-vm-tools/lib/include/vmware/tools/plugin.h b/open-vm-tools/lib/include/vmware/tools/plugin.h
index f9acc6a29..deefd1f3d 100644
--- a/open-vm-tools/lib/include/vmware/tools/plugin.h
+++ b/open-vm-tools/lib/include/vmware/tools/plugin.h
@@ -290,7 +290,7 @@ typedef struct ToolsAppCtx {
*
* @return TRUE if COM is initialized when the function returns.
*/
-G_INLINE_FUNC gboolean
+static inline gboolean
ToolsCore_InitializeCOM(ToolsAppCtx *ctx)
{
if (!ctx->comInitialized) {
diff --git a/open-vm-tools/lib/include/vmware/tools/threadPool.h b/open-vm-tools/lib/include/vmware/tools/threadPool.h
index 3f2082b3e..5880fbcff 100644
--- a/open-vm-tools/lib/include/vmware/tools/threadPool.h
+++ b/open-vm-tools/lib/include/vmware/tools/threadPool.h
@@ -91,7 +91,7 @@ typedef struct ToolsCorePool {
*******************************************************************************
*/
-G_INLINE_FUNC ToolsCorePool *
+static inline ToolsCorePool *
ToolsCorePool_GetPool(ToolsAppCtx *ctx)
{
ToolsCorePool *pool = NULL;
@@ -123,7 +123,7 @@ ToolsCorePool_GetPool(ToolsAppCtx *ctx)
*******************************************************************************
*/
-G_INLINE_FUNC guint
+static inline guint
ToolsCorePool_SubmitTask(ToolsAppCtx *ctx,
ToolsCorePoolCb cb,
gpointer data,
@@ -153,7 +153,7 @@ ToolsCorePool_SubmitTask(ToolsAppCtx *ctx,
*******************************************************************************
*/
-G_INLINE_FUNC void
+static inline void
ToolsCorePool_CancelTask(ToolsAppCtx *ctx,
guint taskId)
{
@@ -197,7 +197,7 @@ ToolsCorePool_CancelTask(ToolsAppCtx *ctx,
*******************************************************************************
*/
-G_INLINE_FUNC gboolean
+static inline gboolean
ToolsCorePool_StartThread(ToolsAppCtx *ctx,
const gchar *threadName,
ToolsCorePoolCb cb,
diff --git a/open-vm-tools/lib/include/vmware/tools/utils.h b/open-vm-tools/lib/include/vmware/tools/utils.h
index f65745906..a3292d5c0 100644
--- a/open-vm-tools/lib/include/vmware/tools/utils.h
+++ b/open-vm-tools/lib/include/vmware/tools/utils.h
@@ -51,15 +51,6 @@
# include <sys/time.h>
#endif
-
-/* Work around a glib limitation: it doesn't set G_INLINE_FUNC on Win32. */
-#if defined(G_PLATFORM_WIN32)
-# if defined(G_INLINE_FUNC)
-# undef G_INLINE_FUNC
-# endif
-# define G_INLINE_FUNC static __inline
-#endif
-
#ifndef ABS
# define ABS(x) (((x) >= 0) ? (x) : -(x))
#endif

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Fri Oct 11 11:47:05 UTC 2019 - Bjørn Lie <bjorn.lie@gmail.com>
- Add gcc9-static-inline.patch: Fix static inline when building
with gcc9.
-------------------------------------------------------------------
Wed Oct 9 14:02:35 UTC 2019 - Kirk Allan <kallan@suse.com>
- Fix memory leak in VixToolsListAuthAliases and VixToolsListMappedAliases.
(bsc#1153271)
+ Add patch fix-leaks-Aliases-MappedAliases.patch
-------------------------------------------------------------------
Tue Oct 1 14:42:18 UTC 2019 - Kirk Allan <kallan@suse.com>

View File

@ -161,6 +161,8 @@ Obsoletes: open-vm-tools-deploypkg <= 10.0.5
Supplements: modalias(pci:v000015ADd*sv*sd*bc*sc*i*)
ExclusiveArch: %ix86 x86_64
#Upstream patches
Patch0: fix-leaks-Aliases-MappedAliases.patch
Patch1: gcc9-static-inline.patch
%systemd_requires
@ -227,6 +229,8 @@ if you intend to create own plugins for vmtoolsd.
# fix for an rpmlint warning regarding wrong line feeds
sed -i -e "s/\r//" README
#Upstream patches
%patch0 -p2
%patch1 -p2
%build
%if %{with_X}
@ -391,7 +395,8 @@ rm -rf %{buildroot}
%files
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README
%license COPYING
%doc AUTHORS ChangeLog NEWS README
%{_bindir}/vmtoolsd
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/plugins