Bug 184288 - [patch] fix security/nmap runtime on -current
Summary: [patch] fix security/nmap runtime on -current
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Olli Hauer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-25 17:40 UTC by Ruslan Makhmatkhanov
Modified: 2013-11-25 21:00 UTC (History)
0 users

See Also:


Attachments
file.diff (1.31 KB, patch)
2013-11-25 17:40 UTC, Ruslan Makhmatkhanov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2013-11-25 17:40:00 UTC
Here is the description: http://lists.freebsd.org/pipermail/freebsd-current/2013-November/046784.html
Here is the solution: https://github.com/nmap/nmap/commit/542b0af577dabab68a63b5c20b36c6ec9061b77d#diff-d604578eada1b9284c2f74ba369b7ab9

Attached backport of upstream patch works perfectly for me.

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-11-25 17:40:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ohauer

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-11-25 20:50:05 UTC
Author: ohauer
Date: Mon Nov 25 20:49:58 2013
New Revision: 334897
URL: http://svnweb.freebsd.org/changeset/ports/334897

Log:
  - fix security/nmap runtime on current (FreeBSD 11)
  - adopt ${opt}_USE style
  - remove ${opt} PKGNAMEPREFIX
  - bump PORTREVISION
  
  PR:		ports/184288
  Submitted by:	Ruslan Makhmatkhanov <rm@FreeBSD.org>

Added:
  head/security/nmap/files/patch-libnetutil__netutil.cc   (contents, props changed)
Modified:
  head/security/nmap/Makefile

Modified: head/security/nmap/Makefile
==============================================================================
--- head/security/nmap/Makefile	Mon Nov 25 20:30:54 2013	(r334896)
+++ head/security/nmap/Makefile	Mon Nov 25 20:49:58 2013	(r334897)
@@ -3,6 +3,7 @@
 
 PORTNAME=	nmap
 DISTVERSION=	6.40
+PORTREVISION=	1
 CATEGORIES=	security ipv6
 MASTER_SITES=	http://nmap.org/dist/ \
 		LOCAL/ohauer
@@ -28,16 +29,18 @@ OPTIONS_SUB=	yes
 OPTIONS_DEFINE=	DOCS IPV6 SSL
 OPTIONS_DEFAULT=IPV6 SSL
 
+SSL_USE=		OPENSSL=yes
 SSL_CONFIGURE_ON=	--with-openssl=${OPENSSLBASE}
 SSL_CONFIGURE_OFF=	--without-openssl
 SSL_CFLAGS=		-I${OPENSSLINC}
 
+IPV6_CONFIGURE_OFF=	--with-libpcap=${LOCALBASE}/IPv6
+
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MSSL}
-USE_OPENSSL=	yes
-.else
-PKGNAMESUFFIX=	-nossl
+# PR: ports/159376  Workaround if OS is build with WITHOUT_INET6
+.if ! ${PORT_OPTIONS:MIPV6}
+LIB_DEPENDS+=		libpcap.so:${PORTSDIR}/net/libpcap
 .endif
 
 CONFIGURE_ARGS+=--without-localdirs \
@@ -58,12 +61,6 @@ NDCC=	true
 
 PORTDOCS=	CHANGELOG HACKING
 
-# PR: ports/159376  Workaround if OS is build with WITHOUT_INET6
-.if ! ${PORT_OPTIONS:MIPV6}
-LIB_DEPENDS+=		libpcap.so:${PORTSDIR}/net/libpcap
-CONFIGURE_ARGS+=	--with-libpcap=${LOCALBASE}
-.endif
-
 # XXX limit results if we do a grep in the sources!
 post-extract:
 	@${RM} -rf ${WRKSRC}/mswin32
@@ -78,10 +75,8 @@ post-configure:
 	@${REINPLACE_CMD} -e "s|^DESTDIR *=|& ${DESTDIR}|" ${WRKSRC}/Makefile
 
 post-install:
-.if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 	@${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
-.endif
 
 # gcc from ports is in use
 .if defined(NDCC)

Added: head/security/nmap/files/patch-libnetutil__netutil.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/nmap/files/patch-libnetutil__netutil.cc	Mon Nov 25 20:49:58 2013	(r334897)
@@ -0,0 +1,31 @@
+PR: ports/184288
+Fix security/nmap runtime on current (FreeBSD 11)
+==========================================================================
+--- ./libnetutil/netutil.cc.orig	2013-07-29 00:08:48.000000000 +0200
++++ ./libnetutil/netutil.cc	2013-11-25 21:26:22.000000000 +0100
+@@ -1319,7 +1319,11 @@
+     /* The first time through the loop we add the primary interface record.
+        After that we add the aliases one at a time. */
+     if (!primary_done) {
+-      if (addr_ntos(&entry->intf_addr, (struct sockaddr *) &tmpss) == -1) {
++      if ( (addr_ntos(&entry->intf_addr, (struct sockaddr *) &tmpss) == -1)
++#ifdef AF_LINK
++              || (tmpss.ss_family == AF_LINK)
++#endif
++         ) {
+         dcrn->ifaces[dcrn->numifaces].addr.ss_family = 0;
+       } else {
+         rc = canonicalize_address(&tmpss, &dcrn->ifaces[dcrn->numifaces].addr);
+@@ -1328,7 +1332,11 @@
+       dcrn->ifaces[dcrn->numifaces].netmask_bits = entry->intf_addr.addr_bits;
+       primary_done = true;
+     } else if (num_aliases_done < entry->intf_alias_num) {
+-      if (addr_ntos(&entry->intf_alias_addrs[num_aliases_done], (struct sockaddr *) &tmpss) == -1) {
++      if ( (addr_ntos(&entry->intf_alias_addrs[num_aliases_done], (struct sockaddr *) &tmpss) == -1)
++#ifdef AF_LINK
++              || (tmpss.ss_family == AF_LINK)
++#endif
++         ) {
+         dcrn->ifaces[dcrn->numifaces].addr.ss_family = 0;
+       } else {
+         rc = canonicalize_address(&tmpss, &dcrn->ifaces[dcrn->numifaces].addr);
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Olli Hauer freebsd_committer freebsd_triage 2013-11-25 20:52:21 UTC
State Changed
From-To: open->closed

Committed, 
Thanks!