Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2016 18:43:10 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r413228 - in head/security/openvas-manager: . files
Message-ID:  <201604131843.u3DIhAXw051108@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Wed Apr 13 18:43:10 2016
New Revision: 413228
URL: https://svnweb.freebsd.org/changeset/ports/413228

Log:
  Add a patch to pass the size of struct sockaddr_in or sockaddr_in6 to
  bind(2) instead of sockaddr_storage.  It doesn't accept the latter even
  though it's big enough.
  
  PR:		208753
  Tested by:	kwinkelman@mcclatchy.com

Modified:
  head/security/openvas-manager/Makefile
  head/security/openvas-manager/files/patch-src-openvasmd.c

Modified: head/security/openvas-manager/Makefile
==============================================================================
--- head/security/openvas-manager/Makefile	Wed Apr 13 18:31:35 2016	(r413227)
+++ head/security/openvas-manager/Makefile	Wed Apr 13 18:43:10 2016	(r413228)
@@ -2,7 +2,7 @@
 
 PORTNAME=	openvas-manager
 PORTVERSION=	6.0.8
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	security
 MASTER_SITES=	http://wald.intevation.org/frs/download.php/2295/
 

Modified: head/security/openvas-manager/files/patch-src-openvasmd.c
==============================================================================
--- head/security/openvas-manager/files/patch-src-openvasmd.c	Wed Apr 13 18:31:35 2016	(r413227)
+++ head/security/openvas-manager/files/patch-src-openvasmd.c	Wed Apr 13 18:43:10 2016	(r413228)
@@ -36,7 +36,38 @@
        exit (EXIT_FAILURE);
      }
  
-@@ -1468,25 +1468,25 @@ main (int argc, char** argv)
+@@ -1148,6 +1148,7 @@ manager_listen (const char *address_str,
+   struct sockaddr_storage address;
+   struct sockaddr_in *addr4 = (struct sockaddr_in *) &address;
+   struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *) &address;
++  socklen_t addrlen;
+   int port, optval;
+ 
+   if (!address_str)
+@@ -1176,11 +1177,13 @@ manager_listen (const char *address_str,
+     {
+       address.ss_family = AF_INET6;
+       addr6->sin6_port = port;
++      addrlen = sizeof (*addr6);
+     }
+   else if (inet_pton (AF_INET, address_str, &addr4->sin_addr) > 0)
+     {
+       address.ss_family = AF_INET;
+       addr4->sin_port = port;
++      addrlen = sizeof (*addr4);
+     }
+   else
+     {
+@@ -1211,7 +1214,7 @@ manager_listen (const char *address_str,
+       return -1;
+     }
+ 
+-  if (bind (*soc, (struct sockaddr *) &address, sizeof (address))
++  if (bind (*soc, (struct sockaddr *) &address, addrlen)
+       == -1)
+     {
+       g_warning ("Failed to bind manager socket: %s", strerror (errno));
+@@ -1468,25 +1471,25 @@ main (int argc, char** argv)
        switch (manage_optimize (log_config, database, optimize))
          {
            case 0:
@@ -67,7 +98,7 @@
              return EXIT_FAILURE;
          }
        return EXIT_SUCCESS;
-@@ -1524,7 +1524,7 @@ main (int argc, char** argv)
+@@ -1524,7 +1527,7 @@ main (int argc, char** argv)
                                     scanner_ca_pub, scanner_key_pub,
                                     scanner_key_priv);
        g_free (stype);
@@ -76,7 +107,7 @@
        switch (ret)
          {
            case 0:
-@@ -1576,7 +1576,7 @@ main (int argc, char** argv)
+@@ -1576,7 +1579,7 @@ main (int argc, char** argv)
                                     stype, scanner_ca_pub, scanner_key_pub,
                                     scanner_key_priv);
        g_free (stype);
@@ -85,7 +116,7 @@
        switch (ret)
          {
            case 0:
-@@ -1606,22 +1606,22 @@ main (int argc, char** argv)
+@@ -1606,22 +1609,22 @@ main (int argc, char** argv)
        switch (manage_create_user (log_config, database, create_user, role))
          {
            case 0:
@@ -112,7 +143,7 @@
              return EXIT_FAILURE;
          }
        return EXIT_SUCCESS;
-@@ -1635,32 +1635,32 @@ main (int argc, char** argv)
+@@ -1635,32 +1638,32 @@ main (int argc, char** argv)
        switch (manage_delete_user (log_config, database, delete_user))
          {
            case 0:
@@ -151,7 +182,7 @@
              return EXIT_FAILURE;
          }
      }
-@@ -1671,22 +1671,22 @@ main (int argc, char** argv)
+@@ -1671,22 +1674,22 @@ main (int argc, char** argv)
        switch (manage_get_users (log_config, database, role))
          {
            case 0:
@@ -178,7 +209,7 @@
              return EXIT_FAILURE;
          }
      }
-@@ -1695,7 +1695,7 @@ main (int argc, char** argv)
+@@ -1695,7 +1698,7 @@ main (int argc, char** argv)
      {
        /* List the users and then exit. */
        int ret = manage_get_scanners (log_config, database);
@@ -187,7 +218,7 @@
        switch (ret)
          {
            case 0:
-@@ -1720,7 +1720,7 @@ main (int argc, char** argv)
+@@ -1720,7 +1723,7 @@ main (int argc, char** argv)
  
        /* Delete the scanner and then exit. */
        ret = manage_delete_scanner (log_config, database, delete_scanner);
@@ -196,7 +227,7 @@
        switch (ret)
          {
            case 0:
-@@ -1748,7 +1748,7 @@ main (int argc, char** argv)
+@@ -1748,7 +1751,7 @@ main (int argc, char** argv)
  
        /* Delete the scanner and then exit. */
        ret = manage_verify_scanner (log_config, database, verify_scanner);
@@ -205,7 +236,7 @@
        switch (ret)
          {
            case 0:
-@@ -1783,26 +1783,26 @@ main (int argc, char** argv)
+@@ -1783,26 +1786,26 @@ main (int argc, char** argv)
        switch (manage_set_password (log_config, database, user, new_password))
          {
            case 0:
@@ -237,7 +268,7 @@
              return EXIT_FAILURE;
          }
      }
-@@ -1885,24 +1885,24 @@ main (int argc, char** argv)
+@@ -1885,24 +1888,24 @@ main (int argc, char** argv)
            case -2:
              g_critical ("%s: database is wrong version\n", __FUNCTION__);
              fprintf (stderr, "Decryption failed.\n");
@@ -266,7 +297,7 @@
        return EXIT_SUCCESS;
      }
  
-@@ -1916,24 +1916,24 @@ main (int argc, char** argv)
+@@ -1916,24 +1919,24 @@ main (int argc, char** argv)
            case -2:
              g_critical ("%s: database is wrong version\n", __FUNCTION__);
              fprintf (stderr, "Decryption failed.\n");
@@ -295,7 +326,7 @@
        return EXIT_SUCCESS;
      }
  
-@@ -2005,12 +2005,12 @@ main (int argc, char** argv)
+@@ -2005,12 +2008,12 @@ main (int argc, char** argv)
              g_critical ("%s: failed to fork into background: %s\n",
                          __FUNCTION__,
                          strerror (errno));
@@ -310,7 +341,7 @@
              exit (EXIT_SUCCESS);
              break;
          }
-@@ -2026,25 +2026,25 @@ main (int argc, char** argv)
+@@ -2026,25 +2029,25 @@ main (int argc, char** argv)
          break;
        case -2:
          g_critical ("%s: database is wrong version\n", __FUNCTION__);
@@ -340,7 +371,7 @@
          exit (EXIT_FAILURE);
      }
  
-@@ -2054,7 +2054,7 @@ main (int argc, char** argv)
+@@ -2054,7 +2057,7 @@ main (int argc, char** argv)
      {
        g_critical ("%s: failed to register `atexit' cleanup function\n",
                    __FUNCTION__);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604131843.u3DIhAXw051108>