Blame SOURCES/ovt-Address-two-Coverity-reported-issues-in-hostinfoPosi.patch

d75d53
From 805d013a5604b124177149be4d10384f58eff74b Mon Sep 17 00:00:00 2001
d75d53
From: Cathy Avery <cavery@redhat.com>
d75d53
Date: Tue, 3 Dec 2019 14:30:49 +0100
d75d53
Subject: [PATCH 3/4] Address two Coverity-reported issues in hostinfoPosix.c.
d75d53
d75d53
RH-Author: Cathy Avery <cavery@redhat.com>
d75d53
Message-id: <20191203143050.23065-4-cavery@redhat.com>
d75d53
Patchwork-id: 92834
d75d53
O-Subject: [RHEL8.2 open-vm-tools PATCH 3/4] Address two Coverity-reported issues in hostinfoPosix.c.
d75d53
Bugzilla: 1769881
d75d53
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
d75d53
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
d75d53
d75d53
commit 8a01c912927b5bb8cdbfa57f5e8c92e8cf792bef
d75d53
Author: Oliver Kurth <okurth@vmware.com>
d75d53
Date:   Fri Nov 22 14:52:35 2019 -0800
d75d53
d75d53
    Address two Coverity-reported issues in hostinfoPosix.c.
d75d53
d75d53
    Rework some code with the intent of making it more straightfoward,
d75d53
    which also eliminates a false positive.
d75d53
d75d53
    Check the return value from PosixUnlink and log a warning on error.
d75d53
d75d53
Signed-off-by: Cathy Avery <cavery@redhat.com>
d75d53
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
d75d53
---
d75d53
 open-vm-tools/lib/misc/hostinfoPosix.c | 10 +++++-----
d75d53
 1 file changed, 5 insertions(+), 5 deletions(-)
d75d53
d75d53
diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c
d75d53
index 348a67e..302452e 100644
d75d53
--- a/open-vm-tools/lib/misc/hostinfoPosix.c
d75d53
+++ b/open-vm-tools/lib/misc/hostinfoPosix.c
d75d53
@@ -1127,10 +1127,7 @@ out:
d75d53
    if (success) {
d75d53
       result[nArgs - 1] = DynBuf_Detach(&b);
d75d53
    } else {
d75d53
-      if (nArgs != 0) {
d75d53
-         Util_FreeStringList(result, nArgs);
d75d53
-      }
d75d53
-
d75d53
+      Util_FreeStringList(result, nArgs);
d75d53
       result = NULL;
d75d53
    }
d75d53
 
d75d53
@@ -2884,7 +2881,10 @@ Hostinfo_Daemonize(const char *path,             // IN: NUL-terminated UTF-8
d75d53
           * with another process attempting to daemonize and unlinking the
d75d53
           * file it created instead.
d75d53
           */
d75d53
-         Posix_Unlink(pidPath);
d75d53
+         if (Posix_Unlink(pidPath) != 0) {
d75d53
+            Warning("%s: Unable to unlink %s: %u\n",
d75d53
+                    __FUNCTION__, pidPath, errno);
d75d53
+         }
d75d53
       }
d75d53
 
d75d53
       errno = err;
d75d53
-- 
d75d53
1.8.3.1
d75d53