summaryrefslogtreecommitdiff
path: root/security/gvm-libs/files/patch-osp_osp.c
diff options
context:
space:
mode:
authorJose Alonso Cardenas Marquez <acm@FreeBSD.org>2022-08-01 13:38:43 -0500
committerJose Alonso Cardenas Marquez <acm@FreeBSD.org>2022-08-01 13:41:44 -0500
commit0898eafb807f2779d3efb03c861f3e532664c1e2 (patch)
tree3c37bcdf282a9cea37b3161ab0e8e478f3d15fee /security/gvm-libs/files/patch-osp_osp.c
parentsecurity/py-gvm-tools: update to 22.6.1 (diff)
security/gvm-libs: update to 22.4.0
ChangeLog at: https://github.com/greenbone/gvm-libs/releases/tag/v22.4.0
Diffstat (limited to 'security/gvm-libs/files/patch-osp_osp.c')
-rw-r--r--security/gvm-libs/files/patch-osp_osp.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/security/gvm-libs/files/patch-osp_osp.c b/security/gvm-libs/files/patch-osp_osp.c
index a9cae258b0e4..a7ccd18fce69 100644
--- a/security/gvm-libs/files/patch-osp_osp.c
+++ b/security/gvm-libs/files/patch-osp_osp.c
@@ -1,22 +1,28 @@
---- osp/osp.c 2021-01-03 15:42:39.761321000 -0500
-+++ osp/osp.c 2021-01-03 15:48:50.962832000 -0500
-@@ -134,7 +134,6 @@
+--- osp/osp.c 2022-07-18 03:40:56.000000000 -0500
++++ osp/osp.c 2022-07-31 18:21:56.704338000 -0500
+@@ -141,7 +141,9 @@
if (host && *host == '/')
{
struct sockaddr_un addr;
-- int len;
++#if !defined(__FreeBSD__)
+ int len;
++#endif
connection = g_malloc0 (sizeof (*connection));
connection->socket = socket (AF_UNIX, SOCK_STREAM, 0);
-@@ -142,9 +141,8 @@
- return NULL;
+@@ -152,10 +154,15 @@
+ }
addr.sun_family = AF_UNIX;
-- strncpy (addr.sun_path, host, sizeof (addr.sun_path) - 1);
-- len = strlen (addr.sun_path) + sizeof (addr.sun_family);
-- if (connect (connection->socket, (struct sockaddr *) &addr, len) == -1)
++#if defined (__FreeBSD__)
+ strcpy (addr.sun_path, host);
+ if (connect (connection->socket, (struct sockaddr *) &addr, sizeof(struct sockaddr_un)) == -1)
++#else
+ memset (addr.sun_path, 0, sizeof (addr.sun_path));
+ memcpy (addr.sun_path, host, sizeof (addr.sun_path) - 1);
+ len = strlen (addr.sun_path) + sizeof (addr.sun_family);
+ if (connect (connection->socket, (struct sockaddr *) &addr, len) == -1)
++#endif
{
close (connection->socket);
- return NULL;
+ g_free (connection);