diff options
author | 2008-09-16 13:30:55 +0000 | |
---|---|---|
committer | 2008-09-16 13:30:55 +0000 | |
commit | 16bd67bd5aca25d0514bf79c66aeb6365da8d7fa (patch) | |
tree | ed1b37a43a8ea94c747c87560d2c213876068d4d /net-analyzer | |
parent | Fixed parallel build #180988, build tests with FEATURES=-test #226207, and ge... (diff) | |
download | pva-16bd67bd5aca25d0514bf79c66aeb6365da8d7fa.tar.gz pva-16bd67bd5aca25d0514bf79c66aeb6365da8d7fa.tar.bz2 pva-16bd67bd5aca25d0514bf79c66aeb6365da8d7fa.zip |
nc6 with unix domain patches, bug #235160, thank Georgi Georgiev for report.
svn path=/; revision=193
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/netcat6/ChangeLog | 32 | ||||
-rw-r--r-- | net-analyzer/netcat6/Manifest | 5 | ||||
-rw-r--r-- | net-analyzer/netcat6/files/netcat6-1.0-unix-sockets.patch | 290 | ||||
-rw-r--r-- | net-analyzer/netcat6/metadata.xml | 5 | ||||
-rw-r--r-- | net-analyzer/netcat6/netcat6-1.0-r1.ebuild | 38 |
5 files changed, 370 insertions, 0 deletions
diff --git a/net-analyzer/netcat6/ChangeLog b/net-analyzer/netcat6/ChangeLog new file mode 100644 index 0000000..d6991d9 --- /dev/null +++ b/net-analyzer/netcat6/ChangeLog @@ -0,0 +1,32 @@ +# ChangeLog for net-analyzer/netcat6 +# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/netcat6/ChangeLog,v 1.9 2007/07/09 16:41:02 jer Exp $ + + 09 Jul 2007; Jeroen Roovers <jer@gentoo.org> netcat6-1.0.ebuild: + Stable for HPPA (as informally requested by armin76). + + 09 Jul 2007; Raúl Porcel <armin76@gentoo.org> netcat6-1.0.ebuild: + alpha stable + + 20 Mar 2007; Raúl Porcel <armin76@gentoo.org> netcat6-1.0.ebuild: + x86 stable + + 20 Feb 2007; Markus Ullmann <jokey@gentoo.org> ChangeLog: + Redigest for Manifest2 + +*netcat6-1.0 (19 Feb 2006) + + 19 Feb 2006; Mike Frysinger <vapier@gentoo.org> +netcat6-1.0.ebuild: + Version bump #123112 by Sascha Geschwandtner. + + 18 Oct 2005; Aron Griffis <agriffis@gentoo.org> netcat6-0.5.ebuild: + Mark 0.5 stable on alpha + + 17 Oct 2005; Aron Griffis <agriffis@gentoo.org> netcat6-0.5.ebuild: + Mark 0.5 stable on ia64 + +*netcat6-0.5 (02 Jun 2003) + + 02 Jun 2003; Peter Johanson <latexer@gentoo.org> netcat6-0.5.ebuild: + Initial import. Netcat version that supports IPv6 also + diff --git a/net-analyzer/netcat6/Manifest b/net-analyzer/netcat6/Manifest new file mode 100644 index 0000000..b8033aa --- /dev/null +++ b/net-analyzer/netcat6/Manifest @@ -0,0 +1,5 @@ +AUX netcat6-1.0-unix-sockets.patch 8629 RMD160 00dc87d9beafaeab65b561daf9307bc7dd402a83 SHA1 b8993f9810d29e3b6d440371b9593df6e5263dd3 SHA256 ef109b7d729f5bbbf62c96c4d7cc7ef49b64ab8b72b1ba6e9f494d3b26e12e5c +DIST nc6-1.0.tar.bz2 264257 RMD160 c5444976925ffece7f27fc1ff3c16ebe19998b78 SHA1 1c361a8060be427fe1b2209d7155e26670e0c1b9 SHA256 eb35e7a05a60bf94496075a3a246d7bf63fcdba2ca7ceb6844852a1ff6478206 +EBUILD netcat6-1.0-r1.ebuild 892 RMD160 25e0e0b5896c6d7c4907df8ad0c066315f6b6017 SHA1 f63da74d2b1bf439992666e423dec02a1e35636c SHA256 bd480956203c3dacb0ed562c0def8361fcb58786962ddb8f26d305552c3efdd7 +MISC ChangeLog 1088 RMD160 b4a0091776752a93ffaf83c10da83ab94152264b SHA1 603be1902a087ae6cbd04d617069c73001429b5b SHA256 7b2e857abd483b23e0d477d488ede493ecae0b35fc57f7863a1a407fdd138f81 +MISC metadata.xml 159 RMD160 28e799fe0fd02aaab9d4bbe5595f133101606f5b SHA1 9f5df3eabd621951a959cc8e0e2e0d352cd1fe1e SHA256 b75c711bd971e46f0ec957e833c60879b0c5023e0bb94409a6255781b69f6dc6 diff --git a/net-analyzer/netcat6/files/netcat6-1.0-unix-sockets.patch b/net-analyzer/netcat6/files/netcat6-1.0-unix-sockets.patch new file mode 100644 index 0000000..dea5194 --- /dev/null +++ b/net-analyzer/netcat6/files/netcat6-1.0-unix-sockets.patch @@ -0,0 +1,290 @@ +diff -ruN nc6-1.0.orig/src/connection.c nc6-1.0/src/connection.c +--- nc6-1.0.orig/src/connection.c 2006-01-20 07:46:23.000000000 +0900 ++++ nc6-1.0/src/connection.c 2008-07-20 18:22:42.000000000 +0900 +@@ -109,6 +109,9 @@ + fatal_internal("unavailable bluez support required"); + #endif + break; ++ case PROTO_UNIX: ++ ainfo->ai_family = PF_UNIX; ++ break; + default: + fatal_internal("unknown socket domain"); + } +@@ -144,6 +147,10 @@ + fatal_internal("unavailable bluez support required"); + #endif + break; ++ case UNIX_PROTOCOL: ++ ainfo->ai_protocol = 0; ++ ainfo->ai_socktype = SOCK_STREAM; ++ break; + default: + fatal_internal("unknown socket type"); + } +diff -ruN nc6-1.0.orig/src/connection.h nc6-1.0/src/connection.h +--- nc6-1.0.orig/src/connection.h 2006-01-20 07:46:23.000000000 +0900 ++++ nc6-1.0/src/connection.h 2008-07-20 18:22:42.000000000 +0900 +@@ -31,6 +31,7 @@ + PROTO_UNSPECIFIED, + PROTO_IPv6, + PROTO_IPv4, ++ PROTO_UNIX, + PROTO_BLUEZ + } sock_family_t; + +@@ -38,6 +39,7 @@ + TCP_PROTOCOL, + UDP_PROTOCOL, ++ UNIX_PROTOCOL, + SCO_PROTOCOL, + L2CAP_PROTOCOL + } sock_protocol_t; + +diff -ruN nc6-1.0.orig/src/Makefile.am nc6-1.0/src/Makefile.am +--- nc6-1.0.orig/src/Makefile.am 2005-08-21 02:04:25.000000000 +0900 ++++ nc6-1.0/src/Makefile.am 2008-07-20 18:22:42.000000000 +0900 +@@ -6,6 +6,7 @@ + network.h \ + afindep.h \ + bluez.h \ ++ unixsocket.h \ + netsupport.h \ + parser.h \ + readwrite.h \ +@@ -20,6 +21,7 @@ + afindep.c \ + netsupport.c \ + parser.c \ ++ unixsocket.c \ + readwrite.c \ + io_stream.c \ + connection.c +diff -ruN nc6-1.0.orig/src/network.c nc6-1.0/src/network.c +--- nc6-1.0.orig/src/network.c 2006-01-20 07:46:23.000000000 +0900 ++++ nc6-1.0/src/network.c 2008-07-20 18:22:42.000000000 +0900 +@@ -23,6 +23,7 @@ + #include "network.h" + #include "connection.h" + #include "afindep.h" ++#include "unixsocket.h" + #ifdef ENABLE_BLUEZ + #include "bluez.h" + #endif/*ENABLE_BLUEZ*/ +@@ -113,6 +114,11 @@ + + /* invoke the appropriate connector for the protocol family */ + switch (ca_family(attrs)) { ++ case PROTO_UNIX: ++ fd = unixsocket_connect(&hints, ++ remote->address, ++ timeout, &socktype); ++ break; + #ifdef ENABLE_BLUEZ + case PROTO_BLUEZ: + fd = bluez_connect(&hints, +diff -ruN nc6-1.0.orig/src/parser.c nc6-1.0/src/parser.c +--- nc6-1.0.orig/src/parser.c 2006-01-20 07:46:23.000000000 +0900 ++++ nc6-1.0/src/parser.c 2008-07-20 18:23:12.000000000 +0900 +@@ -109,7 +109,9 @@ + {"bluetooth", no_argument, NULL, 'b'}, + #define OPT_SCO 24 + {"sco", no_argument, NULL, 0 }, +-#define OPT_MAX 25 ++#define OPT_UNIX_SOCKET 25 ++ {"unix", no_argument, NULL, 'U'}, ++#define OPT_MAX 26 + {0, 0, 0, 0} + }; + +@@ -160,7 +162,7 @@ + _verbosity_level = 0; + + /* option recognition loop */ +- while ((c = getopt_long(argc, argv, "46be:hlnp:q:s:uvw:xX", ++ while ((c = getopt_long(argc, argv, "46be:hlnp:q:s:uUvw:xX", + long_options, &option_index)) >= 0) + { + switch (c) { +@@ -231,6 +233,9 @@ + family = PROTO_IPv6; + ca_set_flag(attrs, CA_STRICT_IPV6); + break; ++ case 'U': ++ family = PROTO_UNIX; ++ break; + case 'b': + family = PROTO_BLUEZ; + break; +@@ -330,6 +335,9 @@ + /* set default protocols */ + if (protocol == PROTO_UNSPECIFIED) { + switch (family) { ++ case PROTO_UNIX: ++ protocol = UNIX_PROTOCOL; ++ break; + case PROTO_BLUEZ: + protocol = L2CAP_PROTOCOL; + break; +@@ -344,6 +352,11 @@ + fatal(_("cannot specify UDP protocol and bluetooth")); + if (protocol == SCO_PROTOCOL && family != PROTO_BLUEZ) + fatal(_("--sco requires --bluetooth (-b)")); ++ if (protocol == UNIX_PROTOCOL && family != PROTO_UNIX) ++ fatal(_("--unix does not need protocol specifications")); ++ ++ if (family == PROTO_UNIX && listen_mode) ++ fatal(_("--unix cannot --listen yet")); + + /* check compiled options */ + #ifndef ENABLE_BLUEZ +@@ -380,6 +393,10 @@ + fatal_internal("unknown/unsupported bluetooth " + "protocol %d", protocol); + break; ++ case PROTO_UNIX: ++ if (protocol != UNIX_PROTOCOL) ++ fatal_internal("unknown/unsupported UNIX protocol %d", protocol); ++ break; + default: + fatal_internal("invalid protocol family %d", family); + } +@@ -425,18 +442,18 @@ + fatal(_("cannot set both --recv-only and --send-only")); + } + +- /* check ports have not been specified with --sco */ +- if (protocol == SCO_PROTOCOL) { ++ /* check ports have not been specified with --sco and --unix */ ++ if (protocol == SCO_PROTOCOL || protocol == UNIX_PROTOCOL) { + if (remote_address.service != NULL) +- fatal(_("--sco does not support remote port")); ++ fatal(_("--sco and --unix do not support remote port")); + if (local_address.service != NULL) +- fatal(_("--sco does not support local port (-p)")); ++ fatal(_("--sco and --unix do not support local port (-p)")); + } + + /* check mode specific option availability and interactions */ + if (listen_mode == true) { + /* check port has been specified (except with sco) */ +- if (local_address.service == NULL && protocol != SCO_PROTOCOL) { ++ if (local_address.service == NULL && protocol != SCO_PROTOCOL && protocol != UNIX_PROTOCOL) { + fatal(_("in listen mode you must specify a port " + "with the -p switch")); + } +@@ -450,6 +467,7 @@ + /* check port has been specified (except with sco) */ + if (remote_address.address == NULL || + (remote_address.service == NULL && ++ protocol != UNIX_PROTOCOL && + protocol != SCO_PROTOCOL)) + { + fatal(_("you must specify the address/port couple " +@@ -553,6 +571,8 @@ + fprintf(fp, " -6 %s\n", _("Use only IPv6")); + fprintf(fp, " -b, --bluetooth %s\n", + _("Use Bluetooth (defaults to L2CAP protocol)")); ++ fprintf(fp, " -U, --unix %s\n", ++ _("Connect to unix domain sockets")); + fprintf(fp, " --buffer-size=BYTES %s\n", _("Set buffer size")); + fprintf(fp, " --continuous %s\n", + _("Continuously accept connections\n" +diff -ruN nc6-1.0.orig/src/unixsocket.c nc6-1.0/src/unixsocket.c +--- nc6-1.0.orig/src/unixsocket.c 1970-01-01 09:00:00.000000000 +0900 ++++ nc6-1.0/src/unixsocket.c 2008-07-20 18:22:42.000000000 +0900 +@@ -0,0 +1,78 @@ ++/* ++ * unixsocket.c - address family independant networking functions ++ */ ++#include "system.h" ++#include "unixsocket.h" ++#include "misc.h" ++#include "netsupport.h" ++#include "parser.h" ++ ++#include <assert.h> ++#include <errno.h> ++#include <string.h> ++#include <stdlib.h> ++#include <sys/types.h> ++#include <sys/socket.h> ++#include <sys/un.h> ++#include <unistd.h> ++#include <limits.h> ++ ++RCSID("@(#) $Header: $"); ++ ++ ++int unixsocket_connect(const struct addrinfo *hints, ++ const char *remote_address, ++ time_t timeout, int *rt_socktype) ++{ ++ int err, fd = -1; ++ struct sockaddr_un sa; ++ const struct addrinfo *ptr = hints; ++ ++ /* make sure arguments are valid and preconditions are respected */ ++ assert(hints != NULL); ++ assert(remote_address != NULL && strlen(remote_address) > 0); ++ assert(sizeof(sa.sun_path) >= strlen(remote_address)); ++ ++ sa.sun_family = ptr->ai_family; ++ strncpy(sa.sun_path, remote_address, sizeof(sa.sun_path)); ++ ++ ++ /* create the socket */ ++ fd = socket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol); ++ if (fd < 0) { ++ warning("cannot create the socket: %s", strerror(errno)); ++ return -1; ++ } ++ ++ /* attempt the connection */ ++ err = connect_with_timeout(fd, (struct sockaddr *)&sa, sizeof(sa), timeout); ++ ++ if (err != 0) ++ { ++ /* check error code */ ++ if (verbose_mode()) { ++ /* use different error message for timeout */ ++ if (errno == ETIMEDOUT) { ++ /* connection timed out */ ++ warning(_("timeout while connecting to %s"), remote_address); ++ } ++ else { ++ /* connection failed */ ++ warning(_("cannot connect to %s: %s"), remote_address, strerror(errno)); ++ } ++ } ++ close(fd); ++ return -1; ++ } ++ ++ assert(ptr == NULL || fd >= 0); ++ ++ /* let the user know the connection has been established */ ++ if (verbose_mode()) warning(_("%s open"), remote_address); ++ ++ /* return the socktype */ ++ if (rt_socktype != NULL) *rt_socktype = ptr->ai_socktype; ++ ++ return fd; ++} ++ +diff -ruN nc6-1.0.orig/src/unixsocket.h nc6-1.0/src/unixsocket.h +--- nc6-1.0.orig/src/unixsocket.h 1970-01-01 09:00:00.000000000 +0900 ++++ nc6-1.0/src/unixsocket.h 2008-07-20 18:22:42.000000000 +0900 +@@ -0,0 +1,12 @@ ++#ifndef UNIXSOCKET_H ++#define UNIXSOCKET_H ++ ++#include <netdb.h> ++#include <sys/types.h> ++ ++/* establish a connection and return a new fd and socktype */ ++int unixsocket_connect(const struct addrinfo *hints, ++ const char *remote_address, ++ time_t timeout, int *socktype); ++ ++#endif diff --git a/net-analyzer/netcat6/metadata.xml b/net-analyzer/netcat6/metadata.xml new file mode 100644 index 0000000..03aa50b --- /dev/null +++ b/net-analyzer/netcat6/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>netmon</herd> +</pkgmetadata> diff --git a/net-analyzer/netcat6/netcat6-1.0-r1.ebuild b/net-analyzer/netcat6/netcat6-1.0-r1.ebuild new file mode 100644 index 0000000..2560929 --- /dev/null +++ b/net-analyzer/netcat6/netcat6-1.0-r1.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/netcat6/netcat6-1.0.ebuild,v 1.6 2007/07/09 16:41:02 jer Exp $ + +inherit eutils autotools + +DESCRIPTION="netcat clone with better IPv6 support, improved code, etc..." +HOMEPAGE="http://netcat6.sourceforge.net/" +SRC_URI="ftp://ftp.deepspace6.net/pub/ds6/sources/nc6/nc6-${PV}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~s390 ~sh ~sparc ~x86" +IUSE="ipv6 nls" + +DEPEND="" + +S=${WORKDIR}/nc6-${PV} + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/netcat6-1.0-unix-sockets.patch + eautoreconf +} + +src_compile() { + econf \ + $(use_enable ipv6) \ + $(use_enable nls) + emake || die +} + +src_install() { + make install DESTDIR="${D}" || die + dodoc AUTHORS BUGS README NEWS TODO CREDITS ChangeLog +} |