packages: netcat-openbsd/netcat-openbsd.spec, netcat-openbsd/0001-port-to-l...

baggins baggins at pld-linux.org
Mon Apr 2 13:50:40 CEST 2012


Author: baggins                      Date: Mon Apr  2 11:50:40 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- updated to 1.105-5

---- Files affected:
packages/netcat-openbsd:
   netcat-openbsd.spec (1.3 -> 1.4) , 0001-port-to-linux-with-libsd.patch (NONE -> 1.1)  (NEW), 0002-connect-timeout.patch (NONE -> 1.1)  (NEW), 0003-get-sev-by-name.patch (NONE -> 1.1)  (NEW), 0004-poll-hup.patch (NONE -> 1.1)  (NEW), 0005-send-crlf.patch (NONE -> 1.1)  (NEW), 0006-quit-timer.patch (NONE -> 1.1)  (NEW), 0007-udp-scan-timeout.patch (NONE -> 1.1)  (NEW), 0008-verbose-numeric-port.patch (NONE -> 1.1)  (NEW), 0009-dccp-support.patch (NONE -> 1.1)  (NEW), 0010-serialized-handling-multiple-clients.patch (NONE -> 1.1)  (NEW), 0011-misc-failures-and-features.patch (NONE -> 1.1)  (NEW), netcat-openbsd_1.89-4.diff (1.2 -> NONE)  (REMOVED)

---- Diffs:

================================================================
Index: packages/netcat-openbsd/netcat-openbsd.spec
diff -u packages/netcat-openbsd/netcat-openbsd.spec:1.3 packages/netcat-openbsd/netcat-openbsd.spec:1.4
--- packages/netcat-openbsd/netcat-openbsd.spec:1.3	Sun Jul 10 12:08:32 2011
+++ packages/netcat-openbsd/netcat-openbsd.spec	Mon Apr  2 13:50:34 2012
@@ -4,15 +4,27 @@
 Summary(pl.UTF-8):	Proste narzędzie do testowania sieci
 Summary(pt_BR.UTF-8):	Ferramenta de teste e depuração para serviços de rede
 Name:		netcat-openbsd
-Version:	1.89
-Release:	2
+Version:	1.105
+Release:	0.1
 License:	Public Domain
 Group:		Networking/Utilities
-Source0:	http://ftp.de.debian.org/debian/pool/main/n/%{name}/%{name}_%{version}.orig.tar.gz
-# Source0-md5:	7238ce15aae43069e96ba7faf03f153e
-# http://cdn.debian.net/debian/pool/main/n/%{name}/%{name}_%{version}-4.diff.gz
-Patch0:		%{name}_%{version}-4.diff
+Source0:	http://ftp.debian.org/debian/pool/main/n/%{name}/%{name}_%{version}.orig.tar.gz
+# Source0-md5:	7e67b22f1ad41a1b7effbb59ff28fca1
+# http://ftp.debian.org/debian/pool/main/n/%{name}/netcat-openbsd_1.105-5.debian.tar.gz
+Patch0:		0001-port-to-linux-with-libsd.patch
+Patch1:		0002-connect-timeout.patch
+Patch2:		0003-get-sev-by-name.patch
+Patch3:		0004-poll-hup.patch
+Patch4:		0005-send-crlf.patch
+Patch5:		0006-quit-timer.patch
+Patch6:		0007-udp-scan-timeout.patch
+Patch7:		0008-verbose-numeric-port.patch
+Patch8:		0009-dccp-support.patch
+Patch9:		0010-serialized-handling-multiple-clients.patch
+Patch10:	0011-misc-failures-and-features.patch
 URL:		http://packages.debian.org/sid/netcat-openbsd
+BuildRequires:	libbsd-devel
+Provides:	nc
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -49,18 +61,21 @@
 UDP. Também pode receber conexões.
 
 %prep
-%setup -q -n %{name}-%{version}.orig
+%setup -q
 %patch0 -p1
-
-# taken from arch linux
-for i in `cat debian/patches/series`
-	do
-		echo "** patch $i" 1>&2
-		cat "debian/patches/$i"
-	done | patch -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
 
 %build
-%{__make} CFLAGS="%{rpmcflags} -DDEBIAN_VERSION=\"\""
+%{__make} CFLAGS="%{rpmcflags}"
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -83,6 +98,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.4  2012/04/02 11:50:34  baggins
+- updated to 1.105-5
+
 Revision 1.3  2011/07/10 10:08:32  baggins
 - rel 2
 

================================================================
Index: packages/netcat-openbsd/0001-port-to-linux-with-libsd.patch
diff -u /dev/null packages/netcat-openbsd/0001-port-to-linux-with-libsd.patch:1.1
--- /dev/null	Mon Apr  2 13:50:40 2012
+++ packages/netcat-openbsd/0001-port-to-linux-with-libsd.patch	Mon Apr  2 13:50:34 2012
@@ -0,0 +1,466 @@
+From: Aron Xu <aron at debian.org>
+Date: Mon, 13 Feb 2012 15:59:31 +0800
+Subject: [PATCH] port to linux with libsd
+
+---
+ Makefile |   17 +++++++++-
+ nc.1     |    2 +-
+ netcat.c |  105 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------
+ socks.c  |   46 +++++++++++++-------------
+ 4 files changed, 130 insertions(+), 40 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,19 @@
+-#	$OpenBSD: Makefile,v 1.6 2001/09/02 18:45:41 jakob Exp $
++#       $OpenBSD: Makefile,v 1.6 2001/09/02 18:45:41 jakob Exp $
+ 
+ PROG=	nc
+ SRCS=	netcat.c atomicio.c socks.c
+ 
+-.include <bsd.prog.mk>
++LIBS=  `pkg-config --libs libbsd` -lresolv
++OBJS=  $(SRCS:.c=.o)
++CFLAGS=  -g -O2
++LDFLAGS=  -Wl,--no-add-needed
++
++all: nc
++nc: $(OBJS)
++	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o nc
++
++$(OBJS): %.o: %.c
++	$(CC) $(CFLAGS) -c $< -o $@
++
++clean:
++	rm -f $(OBJS) nc
+--- a/nc.1
++++ b/nc.1
+@@ -146,9 +146,6 @@
+ Specifies the source port
+ .Nm
+ should use, subject to privilege restrictions and availability.
+-It is an error to use this option in conjunction with the
+-.Fl l
+-option.
+ .It Fl r
+ Specifies that source and/or destination ports should be chosen randomly
+ instead of sequentially within a range or in the order that the system
+@@ -170,6 +167,7 @@
+ may be one of
+ .Ar critical ,
+ .Ar inetcontrol ,
++.Ar lowcost ,
+ .Ar lowdelay ,
+ .Ar netcontrol ,
+ .Ar throughput ,
+--- a/netcat.c
++++ b/netcat.c
+@@ -42,6 +42,46 @@
+ #include <netinet/ip.h>
+ #include <arpa/telnet.h>
+ 
++#ifndef IPTOS_LOWDELAY
++# define IPTOS_LOWDELAY 0x10
++# define IPTOS_THROUGHPUT 0x08
++# define IPTOS_RELIABILITY 0x04
++# define IPTOS_LOWCOST 0x02
++# define IPTOS_MINCOST IPTOS_LOWCOST
++#endif /* IPTOS_LOWDELAY */
++
++# ifndef IPTOS_DSCP_AF11
++# define	IPTOS_DSCP_AF11		0x28
++# define	IPTOS_DSCP_AF12		0x30
++# define	IPTOS_DSCP_AF13		0x38
++# define	IPTOS_DSCP_AF21		0x48
++# define	IPTOS_DSCP_AF22		0x50
++# define	IPTOS_DSCP_AF23		0x58
++# define	IPTOS_DSCP_AF31		0x68
++# define	IPTOS_DSCP_AF32		0x70
++# define	IPTOS_DSCP_AF33		0x78
++# define	IPTOS_DSCP_AF41		0x88
++# define	IPTOS_DSCP_AF42		0x90
++# define	IPTOS_DSCP_AF43		0x98
++# define	IPTOS_DSCP_EF		0xb8
++#endif /* IPTOS_DSCP_AF11 */
++
++#ifndef IPTOS_DSCP_CS0
++# define	IPTOS_DSCP_CS0		0x00
++# define	IPTOS_DSCP_CS1		0x20
++# define	IPTOS_DSCP_CS2		0x40
++# define	IPTOS_DSCP_CS3		0x60
++# define	IPTOS_DSCP_CS4		0x80
++# define	IPTOS_DSCP_CS5		0xa0
++# define	IPTOS_DSCP_CS6		0xc0
++# define	IPTOS_DSCP_CS7		0xe0
++#endif /* IPTOS_DSCP_CS0 */
++
++#ifndef IPTOS_DSCP_EF
++# define	IPTOS_DSCP_EF		0xb8
++#endif /* IPTOS_DSCP_EF */
++
++
+ #include <err.h>
+ #include <errno.h>
+ #include <netdb.h>
+@@ -53,6 +93,8 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <limits.h>
++#include <stdlib.h>
++#include <string.h>
+ #include "atomicio.h"
+ 
+ #ifndef SUN_LEN
+@@ -118,7 +160,7 @@
+ 	struct servent *sv;
+ 	socklen_t len;
+ 	struct sockaddr_storage cliaddr;
+-	char *proxy;
++	char *proxy = NULL;
+ 	const char *errstr, *proxyhost = "", *proxyport = NULL;
+ 	struct addrinfo proxyhints;
+ 	char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE];
+@@ -164,7 +206,11 @@
+ 				errx(1, "interval %s: %s", errstr, optarg);
+ 			break;
+ 		case 'j':
++# if defined(SO_JUMBO)
+ 			jflag = 1;
++# else
++			errx(1, "no jumbo frame support available");
++# endif
+ 			break;
+ 		case 'k':
+ 			kflag = 1;
+@@ -194,10 +240,14 @@
+ 			uflag = 1;
+ 			break;
+ 		case 'V':
++# if defined(RT_TABLEID_MAX)
+ 			rtableid = (unsigned int)strtonum(optarg, 0,
+ 			    RT_TABLEID_MAX, &errstr);
+ 			if (errstr)
+ 				errx(1, "rtable %s: %s", errstr, optarg);
++# else
++			errx(1, "no alternate routing table support available");
++# endif
+ 			break;
+ 		case 'v':
+ 			vflag = 1;
+@@ -232,7 +282,11 @@
+ 				    errstr, optarg);
+ 			break;
+ 		case 'S':
++# if defined(TCP_MD5SIG)
+ 			Sflag = 1;
++# else
++			errx(1, "no TCP MD5 signature support available");
++# endif
+ 			break;
+ 		case 'T':
+ 			errstr = NULL;
+@@ -259,6 +313,15 @@
+ 	if (argv[0] && !argv[1] && family == AF_UNIX) {
+ 		host = argv[0];
+ 		uport = NULL;
++	} else if (!argv[0] && lflag) {
++		if (sflag)
++			errx(1, "cannot use -s and -l");
++		if (zflag)
++			errx(1, "cannot use -z and -l");
++		if (pflag)
++			uport=pflag;
++	} else if (!lflag && kflag) {
++		errx(1, "cannot use -k without -l");
+ 	} else if (argv[0] && !argv[1]) {
+ 		if  (!lflag)
+ 			usage(1);
+@@ -270,14 +333,7 @@
+ 	} else
+ 		usage(1);
+ 
+-	if (lflag && sflag)
+-		errx(1, "cannot use -s and -l");
+-	if (lflag && pflag)
+-		errx(1, "cannot use -p and -l");
+-	if (lflag && zflag)
+-		errx(1, "cannot use -z and -l");
+-	if (!lflag && kflag)
+-		errx(1, "must use -l with -k");
++
+ 
+ 	/* Get name of temporary socket for unix datagram client */
+ 	if ((family == AF_UNIX) && uflag && !lflag) {
+@@ -286,8 +342,8 @@
+ 		} else {
+ 			strlcpy(unix_dg_tmp_socket_buf, "/tmp/nc.XXXXXXXXXX",
+ 				UNIX_DG_TMP_SOCKET_SIZE);
+-			if (mktemp(unix_dg_tmp_socket_buf) == NULL)
+-				err(1, "mktemp");
++			if (mkstemp(unix_dg_tmp_socket_buf) == -1)
++				err(1, "mkstemp");
+ 			unix_dg_tmp_socket = unix_dg_tmp_socket_buf;
+ 		}
+ 	}
+@@ -563,18 +619,22 @@
+ 		    res0->ai_protocol)) < 0)
+ 			continue;
+ 
++# if defined(RT_TABLEID_MAX)
+ 		if (rtableid) {
+ 			if (setsockopt(s, SOL_SOCKET, SO_RTABLE, &rtableid,
+ 			    sizeof(rtableid)) == -1)
+ 				err(1, "setsockopt SO_RTABLE");
+ 		}
++# endif
+ 
+ 		/* Bind to a local port or source address if specified. */
+ 		if (sflag || pflag) {
+ 			struct addrinfo ahints, *ares;
+ 
++# if defined (SO_BINDANY)
+ 			/* try SO_BINDANY, but don't insist */
+ 			setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on));
++# endif
+ 			memset(&ahints, 0, sizeof(struct addrinfo));
+ 			ahints.ai_family = res0->ai_family;
+ 			ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM;
+@@ -674,15 +734,23 @@
+ 		    res0->ai_protocol)) < 0)
+ 			continue;
+ 
++# if defined(RT_TABLEID_MAX)
+ 		if (rtableid) {
+ 			if (setsockopt(s, IPPROTO_IP, SO_RTABLE, &rtableid,
+ 			    sizeof(rtableid)) == -1)
+ 				err(1, "setsockopt SO_RTABLE");
+ 		}
++# endif
++
++		ret = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &x, sizeof(x));
++		if (ret == -1)
++			err(1, NULL);
+ 
++# if defined(SO_REUSEPORT)
+ 		ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));
+ 		if (ret == -1)
+ 			err(1, NULL);
++# endif
+ 
+ 		set_common_sockopts(s);
+ 
+@@ -886,21 +954,25 @@
+ {
+ 	int x = 1;
+ 
++# if defined(TCP_MD5SIG)
+ 	if (Sflag) {
+ 		if (setsockopt(s, IPPROTO_TCP, TCP_MD5SIG,
+ 			&x, sizeof(x)) == -1)
+ 			err(1, NULL);
+ 	}
++# endif
+ 	if (Dflag) {
+ 		if (setsockopt(s, SOL_SOCKET, SO_DEBUG,
+ 			&x, sizeof(x)) == -1)
+ 			err(1, NULL);
+ 	}
++# if defined(SO_JUMBO)
+ 	if (jflag) {
+ 		if (setsockopt(s, SOL_SOCKET, SO_JUMBO,
+ 			&x, sizeof(x)) == -1)
+ 			err(1, NULL);
+ 	}
++# endif
+ 	if (Tflag != -1) {
+ 		if (setsockopt(s, IPPROTO_IP, IP_TOS,
+ 		    &Tflag, sizeof(Tflag)) == -1)
+@@ -949,6 +1021,7 @@
+ 		{ "cs7",		IPTOS_DSCP_CS7 },
+ 		{ "ef",			IPTOS_DSCP_EF },
+ 		{ "inetcontrol",	IPTOS_PREC_INTERNETCONTROL },
++		{ "lowcost",		IPTOS_LOWCOST },
+ 		{ "lowdelay",		IPTOS_LOWDELAY },
+ 		{ "netcontrol",		IPTOS_PREC_NETCONTROL },
+ 		{ "reliability",	IPTOS_RELIABILITY },
+@@ -969,6 +1042,9 @@
+ void
+ help(void)
+ {
++# if defined(DEBIAN_VERSION)
++        fprintf(stderr, "OpenBSD netcat (Debian patchlevel " DEBIAN_VERSION ")\n");
++# endif
+ 	usage(0);
+ 	fprintf(stderr, "\tCommand Summary:\n\
+ 	\t-4		Use IPv4\n\
+@@ -978,6 +1054,7 @@
+ 	\t-h		This help text\n\
+ 	\t-I length	TCP receive buffer length\n\
+ 	\t-i secs\t	Delay interval for lines sent, ports scanned\n\
++	\t-j		Use jumbo frame\n\
+ 	\t-k		Keep inbound sockets open for multiple connects\n\
+ 	\t-l		Listen mode, for inbound connects\n\
+ 	\t-n		Suppress name/port resolutions\n\
+@@ -998,15 +1075,15 @@
+ 	\t-x addr[:port]\tSpecify proxy address and port\n\
+ 	\t-z		Zero-I/O mode [used for scanning]\n\
+ 	Port numbers can be individual or ranges: lo-hi [inclusive]\n");
+-	exit(1);
++	exit(0);
+ }
+ 
+ void
+ usage(int ret)
+ {
+ 	fprintf(stderr,
+-	    "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n"
+-	    "\t  [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n"
++	    "usage: nc [-46DdhjklnrStUuvz] [-I length] [-i interval] [-O length]\n"
++	    "\t  [-P proxy_username] [-p source_port] [-s source] [-T toskeyword]\n"
+ 	    "\t  [-V rtable] [-w timeout] [-X proxy_protocol]\n"
+ 	    "\t  [-x proxy_address[:port]] [destination] [port]\n");
+ 	if (ret)
+--- a/socks.c
++++ b/socks.c
+@@ -38,7 +38,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <resolv.h>
+-#include <readpassphrase.h>
++#include <bsd/readpassphrase.h>
+ #include "atomicio.h"
+ 
+ #define SOCKS_PORT	"1080"
+@@ -167,11 +167,11 @@
+ 		buf[2] = SOCKS_NOAUTH;
+ 		cnt = atomicio(vwrite, proxyfd, buf, 3);
+ 		if (cnt != 3)
+-			err(1, "write failed (%zu/3)", cnt);
++			err(1, "write failed (%zu/3)", (size_t)cnt);
+ 
+ 		cnt = atomicio(read, proxyfd, buf, 2);
+ 		if (cnt != 2)
+-			err(1, "read failed (%zu/3)", cnt);
++			err(1, "read failed (%zu/3)", (size_t)cnt);
+ 
+ 		if (buf[1] == SOCKS_NOMETHOD)
+ 			errx(1, "authentication method negotiation failed");
+@@ -220,23 +220,23 @@
+ 
+ 		cnt = atomicio(vwrite, proxyfd, buf, wlen);
+ 		if (cnt != wlen)
+-			err(1, "write failed (%zu/%zu)", cnt, wlen);
++			err(1, "write failed (%zu/%zu)", (size_t)cnt, (size_t)wlen);
+ 
+ 		cnt = atomicio(read, proxyfd, buf, 4);
+ 		if (cnt != 4)
+-			err(1, "read failed (%zu/4)", cnt);
++			err(1, "read failed (%zu/4)", (size_t)cnt);
+ 		if (buf[1] != 0)
+ 			errx(1, "connection failed, SOCKS error %d", buf[1]);
+ 		switch (buf[3]) {
+ 		case SOCKS_IPV4:
+ 			cnt = atomicio(read, proxyfd, buf + 4, 6);
+ 			if (cnt != 6)
+-				err(1, "read failed (%d/6)", cnt);
++				err(1, "read failed (%lu/6)", (unsigned long)cnt);
+ 			break;
+ 		case SOCKS_IPV6:
+ 			cnt = atomicio(read, proxyfd, buf + 4, 18);
+ 			if (cnt != 18)
+-				err(1, "read failed (%d/18)", cnt);
++				err(1, "read failed (%lu/18)", (unsigned long)cnt);
+ 			break;
+ 		default:
+ 			errx(1, "connection failed, unsupported address type");
+@@ -256,11 +256,11 @@
+ 
+ 		cnt = atomicio(vwrite, proxyfd, buf, wlen);
+ 		if (cnt != wlen)
+-			err(1, "write failed (%zu/%zu)", cnt, wlen);
++			err(1, "write failed (%zu/%zu)", (size_t)cnt, (size_t)wlen);
+ 
+ 		cnt = atomicio(read, proxyfd, buf, 8);
+ 		if (cnt != 8)
+-			err(1, "read failed (%zu/8)", cnt);
++			err(1, "read failed (%zu/8)", (size_t)cnt);
+ 		if (buf[1] != 90)
+ 			errx(1, "connection failed, SOCKS error %d", buf[1]);
+ 	} else if (socksv == -1) {
+@@ -272,39 +272,39 @@
+ 
+ 		/* Try to be sane about numeric IPv6 addresses */
+ 		if (strchr(host, ':') != NULL) {
+-			r = snprintf(buf, sizeof(buf),
++			r = snprintf((char*)buf, sizeof(buf),
+ 			    "CONNECT [%s]:%d HTTP/1.0\r\n",
+ 			    host, ntohs(serverport));
+ 		} else {
+-			r = snprintf(buf, sizeof(buf),
++			r = snprintf((char*)buf, sizeof(buf),
+ 			    "CONNECT %s:%d HTTP/1.0\r\n",
+ 			    host, ntohs(serverport));
+ 		}
+ 		if (r == -1 || (size_t)r >= sizeof(buf))
+ 			errx(1, "hostname too long");
+-		r = strlen(buf);
++		r = strlen((char*)buf);
+ 
+ 		cnt = atomicio(vwrite, proxyfd, buf, r);
+ 		if (cnt != r)
+-			err(1, "write failed (%zu/%d)", cnt, r);
++			err(1, "write failed (%zu/%d)", (size_t)cnt, (int)r);
+ 
+ 		if (authretry > 1) {
+ 			char resp[1024];
+ 
+ 			proxypass = getproxypass(proxyuser, proxyhost);
+-			r = snprintf(buf, sizeof(buf), "%s:%s",
++			r = snprintf((char*)buf, sizeof(buf), "%s:%s",
+ 			    proxyuser, proxypass);
+ 			if (r == -1 || (size_t)r >= sizeof(buf) ||
+-			    b64_ntop(buf, strlen(buf), resp,
++			    b64_ntop(buf, strlen((char*)buf), resp,
+ 			    sizeof(resp)) == -1)
+ 				errx(1, "Proxy username/password too long");
+-			r = snprintf(buf, sizeof(buf), "Proxy-Authorization: "
++			r = snprintf((char*)buf, sizeof((char*)buf), "Proxy-Authorization: "
+ 			    "Basic %s\r\n", resp);
+ 			if (r == -1 || (size_t)r >= sizeof(buf))
+ 				errx(1, "Proxy auth response too long");
+-			r = strlen(buf);
++			r = strlen((char*)buf);
+ 			if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r)
+-				err(1, "write failed (%zu/%d)", cnt, r);
++				err(1, "write failed (%zu/%d)", (size_t)cnt, r);
+ 		}
+ 
+ 		/* Terminate headers */
+@@ -312,22 +312,22 @@
+ 			err(1, "write failed (2/%d)", r);
+ 
+ 		/* Read status reply */
+-		proxy_read_line(proxyfd, buf, sizeof(buf));
++		proxy_read_line(proxyfd, (char*)buf, sizeof(buf));
+ 		if (proxyuser != NULL &&
+-		    strncmp(buf, "HTTP/1.0 407 ", 12) == 0) {
++		    strncmp((char*)buf, "HTTP/1.0 407 ", 12) == 0) {
+ 			if (authretry > 1) {
+ 				fprintf(stderr, "Proxy authentication "
+ 				    "failed\n");
+ 			}
+ 			close(proxyfd);
+ 			goto again;
+-		} else if (strncmp(buf, "HTTP/1.0 200 ", 12) != 0 &&
+-		    strncmp(buf, "HTTP/1.1 200 ", 12) != 0)
++		} else if (strncmp((char*)buf, "HTTP/1.0 200 ", 12) != 0 &&
++		    strncmp((char*)buf, "HTTP/1.1 200 ", 12) != 0)
+ 			errx(1, "Proxy error: \"%s\"", buf);
+ 
+ 		/* Headers continue until we hit an empty line */
+ 		for (r = 0; r < HTTP_MAXHDRS; r++) {
+-			proxy_read_line(proxyfd, buf, sizeof(buf));
++			proxy_read_line(proxyfd, (char*)buf, sizeof(buf));
+ 			if (*buf == '\0')
+ 				break;
+ 		}

================================================================
Index: packages/netcat-openbsd/0002-connect-timeout.patch
diff -u /dev/null packages/netcat-openbsd/0002-connect-timeout.patch:1.1
--- /dev/null	Mon Apr  2 13:50:40 2012
+++ packages/netcat-openbsd/0002-connect-timeout.patch	Mon Apr  2 13:50:34 2012
@@ -0,0 +1,118 @@
+From: Aron Xu <aron at debian.org>
+Date: Mon, 13 Feb 2012 14:43:56 +0800
+Subject: [PATCH] connect timeout
+
+---
+ netcat.c |   77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 75 insertions(+), 2 deletions(-)
+
+--- a/netcat.c
++++ b/netcat.c
+@@ -106,6 +106,10 @@
+ #define PORT_MAX_LEN	6
+ #define UNIX_DG_TMP_SOCKET_SIZE	19
+ 
++#define CONNECTION_SUCCESS 0
++#define CONNECTION_FAILED 1
++#define CONNECTION_TIMEOUT 2
++
+ /* Command Line Options */
+ int	dflag;					/* detached, no stdin */
+ unsigned int iflag;				/* Interval Flag */
+@@ -151,6 +155,9 @@
+ int	map_tos(char *, int *);
+ void	usage(int);
+ 
++static int connect_with_timeout(int fd, const struct sockaddr *sa,
++        socklen_t salen, int ctimeout);
++
+ int
+ main(int argc, char *argv[])
+ {
+@@ -651,11 +658,14 @@
+ 
+ 		set_common_sockopts(s);
+ 
+-		if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0)
++                if ((error = connect_with_timeout(s, res0->ai_addr, res0->ai_addrlen, timeout))== CONNECTION_SUCCESS)
+ 			break;
+-		else if (vflag)
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/packages/netcat-openbsd/netcat-openbsd.spec?r1=1.3&r2=1.4



More information about the pld-cvs-commit mailing list