Attention is currently required from: plaisthos.

Hello flichtenheld,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/770?usp=email

to look at the new patch set (#2).


Change subject: Fix socketpair return status not being checked in port share 
code
......................................................................

Fix socketpair return status not being checked in port share code

found by Coverity after tun_afunix introduced another call to
socketpair, so it started to complain that we only check the
return code in 4 of 5 cases.

Change-Id: Id99a3ba13c0f1d0bc7e4699fb67ee9dff6221639
Signed-off-by: Arne Schwabe <a...@rfc2549.org>
---
M src/openvpn/ps.c
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/70/770/2

diff --git a/src/openvpn/ps.c b/src/openvpn/ps.c
index 4ca3a12..04bee8d 100644
--- a/src/openvpn/ps.c
+++ b/src/openvpn/ps.c
@@ -234,7 +234,12 @@
         }
         else
         {
-            socketpair(PF_UNIX, SOCK_DGRAM, 0, sd_null);
+            if (!(socketpair(AF_UNIX, SOCK_DGRAM, 0, sd_null) == 0))
+            {
+                msg(M_WARN|M_ERRNO, "PORT SHARE: socketpair failed -- unable 
to communicate with background process "
+                    "(%d, %d)", sd, sd_send);
+                goto done;
+            }
             memcpy(CMSG_DATA(h), &sd_null[0], sizeof(sd_null[0]));
         }

@@ -246,6 +251,7 @@
                 );
         }

+done:
         close_socket_if_defined(sd_null[0]);
         close_socket_if_defined(sd_null[1]);
         free(mesg.msg_control);
@@ -845,7 +851,7 @@
      * Make a socket for foreground and background processes
      * to communicate.
      */
-    if (socketpair(PF_UNIX, SOCK_DGRAM, 0, fd) == -1)
+    if (!(socketpair(PF_UNIX, SOCK_DGRAM, 0, fd) == 0))
     {
         msg(M_WARN, "PORT SHARE: socketpair call failed");
         goto error;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/770?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id99a3ba13c0f1d0bc7e4699fb67ee9dff6221639
Gerrit-Change-Number: 770
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-open...@rfc2549.org>
Gerrit-Reviewer: flichtenheld <fr...@lichtenheld.com>
Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Gerrit-Attention: plaisthos <arne-open...@rfc2549.org>
Gerrit-MessageType: newpatchset
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to