debian/0000755000000000000000000000000012163102041007154 5ustar debian/NEWS0000644000000000000000000000123311550307557007674 0ustar netpipes (4.2-6) unstable; urgency=low The executable `timelimit` has been renamed, since an independent and actively maintained package is available for that service, with better features. The old binary is now available as `timelimit.netpipes`. Please check and update your scripts, if the old binary was in use. -- Mats Erik Andersson Sun, 10 Apr 2011 13:03:30 +0200 netpipes (4.2-5) unstable; urgency=low TCP/IP sockets are now supporting the IPv6 address family. Detection of abstract, unnamed, and named UNIX sockets. -- Mats Erik Andersson Fri, 23 Apr 2010 15:24:37 +0200 debian/control0000644000000000000000000000120612163101655010570 0ustar Source: netpipes Section: net Priority: optional Maintainer: Mats Erik Andersson Build-Depends: debhelper (>= 8) Standards-Version: 3.9.4 Homepage: http://web.purplefrog.com/~thoth/netpipes/ Package: netpipes Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: timelimit Suggests: psmisc Description: manipulate BSD TCP/IP stream sockets The netpipes package makes TCP/IP streams usable in shell scripts. It can also simplify client/server code by allowing the programmer to skip all the tedious programming bits related to sockets and concentrate on writing a filter, or other service. debian/copyright0000644000000000000000000000053011355203771011123 0ustar This package was debianized by Klaus Knopper on Wed, 3 Apr 2002 01:40:54 +0200. It was downloaded from http://web.purplefrog.com/~thoth/netpipes/ftp/ Upstream Author: Robert Forsman Copyright (C) 1992-1998 Robert Forsman Released under the terms of the GPL; see /usr/share/common-licenses/GPL. debian/changelog0000644000000000000000000000603712163102040011033 0ustar netpipes (4.2-7) unstable; urgency=low * Updating to Standards 3.9.4, compatibility 8. * Hardening of source. + debian/control: Build-Depends on debhelper (>= 8). + debian/rules: Use dpkg-buildflags. + debian/patches/40-hardening.diff: New file. -- Mats Erik Andersson Thu, 27 Jun 2013 20:27:34 +0200 netpipes (4.2-6) unstable; urgency=low * Rename `timelimit`, favouring an external package. + debian/patches/32-newline_timelimit.diff: New file. + debian/patches/33-rename_timelimit.diff: New file. + debian/NEWS: Mention this change. * debian/control: Fields for binary package. + Recommends `timelimit`. + Suggests `psmisc`. + Remove an outdated Conflicts field. * Progress to Standards 3.9.1. -- Mats Erik Andersson Tue, 12 Apr 2011 11:45:02 +0200 netpipes (4.2-5) unstable; urgency=low * New maintainer. (Closes: #482399) * Migration to format "3.0 (quilt)". * Updating to Standards 3.8.4, compatibility 7: + Insert ${misc:Depends}. * debian/control: + Reformulation of description. (Closes: #503341) + Build depend on debhelper (>= 7.0.50~). * Previous patches to upstream source recovered and put to use: + 01-cleanup_manpage.diff + 02-tailored_makefile.diff + 11-missing_include-1.diff + 12-manpages_formatting.diff * Silence compiler warnings caused by missing prototypes. + debian/patches/20-socklen_typing.diff: New file. * Use debhelper 'dh': + debian/rules: Minimal target collection. + debian/patches/24-makefile_for_dh.diff: New file * Implement IPv6 support: + Closes: #203290 + debian/patches/30-support_ipv6.diff: New file. * debian/README.Debian: Updated. * debian/NEWS: New file. * debian/watch: New file. * [lintian] debian/patches/22-manpage_width_error.diff: New file. -- Mats Erik Andersson Fri, 23 Apr 2010 16:29:31 +0200 netpipes (4.2-4) unstable; urgency=low * QA Upload + change maintainer address to QA group * Improve copyright file + Add real copyright notice + Update upstream URL * Fix author of first Debian changelog entry * Debhelper update: + Bump compat level to 7 + Increase dependency to >= 7 * Remove unused cruft from rules * Add missing string.h include in timelimit.h (for strlen) * Support noopt build option * Fix various formatting errors in man pages -- Frank Lichtenheld Thu, 22 May 2008 15:44:18 +0200 netpipes (4.2-3) unstable; urgency=low * Added twisted/stable to conflicts. * Renamed getpeername to getsockname. Closes: #202513 -- Fabian Franz Mon, 28 Jul 2003 23:37:38 +0200 netpipes (4.2-2) unstable; urgency=low * Some fixes to make it linda and lintian compatible. * Initial upload. Closes: #201612 -- Fabian Franz Thu, 17 Jul 2003 18:22:33 +0200 netpipes (4.2-1) unstable; urgency=low * Initial Release. -- Klaus Knopper Wed, 3 Apr 2002 01:40:54 +0200 debian/compat0000644000000000000000000000000212163077414010371 0ustar 8 debian/watch0000644000000000000000000000015311355230352010215 0ustar version=3 http://web.purplefrog.com/~thoth/netpipes/ftp/netpipes-([0-9.]+)-export\.tar\.gz debian uupdate debian/patches/0000755000000000000000000000000012163101601010604 5ustar debian/patches/20-socklen_typing.diff0000644000000000000000000000141011355225551014716 0ustar Description: Use an unsigned integer type. In order to silence compiler warnings, the integer type 'int' is replaced with the correct 'socklen_t' for socket manipulations. Author: Mats Erik Andersson Forwarded: no Last-Update: 2010-04-02 --- netpipes-4.2.orig/encapsulate.c +++ netpipes-4.2/encapsulate.c @@ -182,7 +182,8 @@ static int Im_server_p(sock_fd) int sock_fd; { struct sockaddr_in me, him; - int len, i; + socklen_t len; + int i; len = sizeof(me); getsockname(sock_fd, (struct sockaddr*)&me, &len); --- netpipes-4.2.orig/faucet.c +++ netpipes-4.2/faucet.c @@ -599,7 +599,7 @@ char ** argv; while (running) { { - int length; + socklen_t length; length = sizeof(saddr); debian/patches/12-manpages_formatting.diff0000644000000000000000000000405211355222420015711 0ustar Description: Minor corrections to several manpages. Author: Frank Lichtenheld Forwarded: no Last-Update: 2008-05-22 --- netpipes-4.2.orig/getpeername.1 +++ netpipes-4.2/getpeername.1 @@ -123,7 +123,7 @@ .nf client$ hose web.cise.ufl.edu 80 \-in ./getpeername -./getpeername: getpeername failed on descriptor 0: Socket is not connected +\&\./getpeername: getpeername failed on descriptor 0: Socket is not connected .fi The HTTP daemon tries to read a request, finds that half of the full --- netpipes-4.2.orig/faucet.1 +++ netpipes-4.2/faucet.1 @@ -178,9 +178,9 @@ forms of the flags. Here is a correspondence chart: .TS H +box; |lw(0.4i)|lw(1.2i)| |cBw(0.4i)|lBw(1.2i)|. -.TB Short Long \fBi\fP \fBin\fP \fBo\fP \fBout\fP --- netpipes-4.2.orig/hose.1 +++ netpipes-4.2/hose.1 @@ -65,7 +65,7 @@ \fBhose\fP redirects the socket to stdin, stdout, stderr, and/or arbitrary file descriptors according to the -\fB\-\-in \-\-out \-\-err \-\-fd \fIn\fP\fP +.B \-\-in \-\-out \-\-err \-\-fd \fIn\fP flags. \fBhose\fP also automagically shuts down the unused half of the connection if only \fB\-\-in\fP is specified or if only \fB\-\-out\fP and/or \fB\-\-err\fP are specified. See the @@ -183,9 +183,9 @@ forms of the flags. Here is a correspondence chart: .TS H +box; |lw(0.4i)|lw(1.2i)| |cw(0.4i)|lw(1.2i)|. -.TB Short Long \fBi\fP \fBin\fP \fBo\fP \fBout\fP --- netpipes-4.2.orig/sockdown.1 +++ netpipes-4.2/sockdown.1 @@ -18,8 +18,8 @@ specified by \fIfd\fP. The possible values for \fIhow\fP are .TS H +box; |lw(0.4i)|lw(2i)|. -.TB writeonly convert to write\-only file descriptor 0 convert to write\-only file descriptor writeonly symbolic for same as above --- netpipes-4.2.orig/encapsulate.1 +++ netpipes-4.2/encapsulate.1 @@ -134,7 +134,6 @@ .TS H lw(2i) lw(2i) lw(2i) lw(2i). -.TB Local Remote \fB\-\-infd\fP w/subproc \fB\-\-outfd\fP w/subproc \fB\-\-infd\fP w/subproc \fB\-\-infd\fP @@ -311,4 +310,4 @@ thoth@purplefrog.com Purple Frog Software http://web.purplefrog.com/~thoth/ - \ No newline at end of file + debian/patches/33-rename_timelimit.diff0000644000000000000000000001613411550307164015225 0ustar Description: Rename internal timelimit(1). There exists an independent and actively maintained service timelimit(1), which is an enhanced replacement for the program produced by this source. The in-house executable is therefore renamed `timelimit.netpipes`. . An old left-over, referencing `ssl-auth` in the manual page, is also removed from the page netpipes(1). The executable was never built by the Debian package. Author: Mats Erik Andersson Forwarded: not-needed Last-Update: 2011-04-10 diff -Nru netpipes-4.2.debian/Makefile netpipes-4.2/Makefile --- netpipes-4.2.debian/Makefile 2011-04-08 17:30:47.000000000 +0200 +++ netpipes-4.2/Makefile 2011-04-10 12:29:08.000000000 +0200 @@ -98,15 +98,19 @@ EOBJS = encapsulate.o common.o version.o memmove.o SSLOBJS = ssl-auth.o ssl-criteria.o common.o version.o memmove.o +# Avoid conflict with an independent service `timelimit`. +TIMELIMIT = timelimit.netpipes + SSLDIR = /usr/local/ssl SSLINC = -I${SSLDIR}/include #SSLLIB = -L${SSLDIR}/lib -lssl -lcrypto SSLLIB = -L../SSLeay-0.8.1 -lssl -lcrypto MANPAGES = netpipes.1 faucet.1 hose.1 \ - sockdown.1 getpeername.1 timelimit.1 encapsulate.1 + sockdown.1 getpeername.1 encapsulate.1 +# timelimit.1 # ssl-auth.1 -PROGRAMS = faucet hose sockdown getpeername timelimit encapsulate +PROGRAMS = faucet hose sockdown getpeername ${TIMELIMIT} encapsulate all : ${PROGRAMS} @@ -122,7 +126,7 @@ getpeername: ${GOBJS} ${CC} ${CFLAGS} -o $@ ${GOBJS} ${LDLIBS} -timelimit: ${TOBJS} +${TIMELIMIT}: ${TOBJS} ${CC} ${CFLAGS} -o $@ ${TOBJS} ${LDLIBS} encapsulate: ${EOBJS} @@ -146,6 +150,7 @@ #- [ -x ssl-auth ] && cp ssl-auth ${INSTBIN}/ mkdir -p ${INSTMAN}/man1 cp ${MANPAGES} ${INSTMAN}/man1/ + cp timelimit.1 ${INSTMAN}/man1/${TIMELIMIT}.1 mv -f ${INSTMAN}/man1/getpeername.1 ${INSTMAN}/man1/getsockname.1 #ln -s getpeername.1 ${INSTMAN}/man1/getsockname.1 diff -Nru netpipes-4.2.debian/netpipes.1 netpipes-4.2/netpipes.1 --- netpipes-4.2.debian/netpipes.1 1998-10-28 21:30:31.000000000 +0100 +++ netpipes-4.2/netpipes.1 2011-04-10 12:35:27.000000000 +0200 @@ -64,17 +64,17 @@ \fB\-\fP[\fB#\fP\fIn\fP][\fBv\fP][\fBs\fP[\fBi\fP\fIn\fP][\fBo\fP\fIn\fP][\fBd\fP\fIn\fP][\fBio\fP\fIn\fP][\fBoi\fP\fIn\fP][\fBl\fP][\fBr\fP][\fBL\fP][\fBR\fP]] \fIcommand args ...\fP -\fBssl\-auth\fP \fB\-\-fd\fP \fIn\fP ( \fB\-\-server\fP | \fB\-\-client\fP ) -[ \fB\-\-cert\fP \fIfile\fP ] -[ \fB\-\-key\fP \fIfile\fP ] -[ \fB\-\-verbose\fP ] -[ \fB\-\-verify\fP \fIn\fP ] -[ \fB\-\-CApath\fP \fIpath/\fP ] -[ \fB\-\-CAfile\fP \fIfile\fP ] -[ \fB\-\-cipher\fP \fIcipher\-list\fP ] -[ \fB\-\-criteria\fP \fIcriteria\-expr\fP ] -[ \fB\-\-subproc\fP [ \fB\-\-infd\fP \fIn\fP ] [ \fB\-\-outfd\fP \fIn\fP ] ] -[ \fB\-\fP[\fB#\fP\fIn\fP][\fBv\fP][\fBs\fP[\fBi\fP\fIn\fP][\fBo\fP\fIn\fP]] ] +.\" \fBssl\-auth\fP \fB\-\-fd\fP \fIn\fP ( \fB\-\-server\fP | \fB\-\-client\fP ) +.\" [ \fB\-\-cert\fP \fIfile\fP ] +.\" [ \fB\-\-key\fP \fIfile\fP ] +.\" [ \fB\-\-verbose\fP ] +.\" [ \fB\-\-verify\fP \fIn\fP ] +.\" [ \fB\-\-CApath\fP \fIpath/\fP ] +.\" [ \fB\-\-CAfile\fP \fIfile\fP ] +.\" [ \fB\-\-cipher\fP \fIcipher\-list\fP ] +.\" [ \fB\-\-criteria\fP \fIcriteria\-expr\fP ] +.\" [ \fB\-\-subproc\fP [ \fB\-\-infd\fP \fIn\fP ] [ \fB\-\-outfd\fP \fIn\fP ] ] +.\" [ \fB\-\fP[\fB#\fP\fIn\fP][\fBv\fP][\fBs\fP[\fBi\fP\fIn\fP][\fBo\fP\fIn\fP]] ] \fBsockdown\fP [\fIfd\fP @@ -90,7 +90,7 @@ [ \fB\-peer\fP ] [ \fIfd\fP ] -\fBtimelimit\fP +\fBtimelimit.netpipes\fP [ \fB\-v\fP ] [ \fB\-nokill\fP ] \fItime\fP @@ -118,12 +118,12 @@ Protocol. It allows you to multiplex several streams across a single TCP session and also transmits remote exit status. -\fBssl\-auth\fP is an encryption filter that encapsulates -stdin/stdout from a subprocess (or its own stdin/stdout) in the Secure -Socket Layer protocol as implemented by the SSLeay library. It -can be used to communicate with encrypted daemons (HTTPS daemons, or -SSL IMAP daemons) and can sometimes be used to jury\-rig secure -versions of such services. +.\" \fBssl\-auth\fP is an encryption filter that encapsulates +.\" stdin/stdout from a subprocess (or its own stdin/stdout) in the Secure +.\" Socket Layer protocol as implemented by the SSLeay library. It +.\" can be used to communicate with encrypted daemons (HTTPS daemons, or +.\" SSL IMAP daemons) and can sometimes be used to jury\-rig secure +.\" versions of such services. \fBsockdown\fP is a simple program designed to shut down part or all of the socket connection. It is primarily useful when the processes @@ -134,9 +134,9 @@ \fBgetpeername\fP prints the address of the remote end and \fBgetsockname\fP prints the address of the local end. -\fBtimelimit\fP limits the amount of foreground wallclock time a -process can consume. After the time limit runs out it either kills -the process or exits and leaves it in the background. +\fBtimelimit.netpipes \fP limits the amount of foreground wallclock time a +process may consume. After the time limit runs out, it either kills +the process, or exits and leaves it in the background. .SH EXAMPLES @@ -234,14 +234,21 @@ encapsulate \-\-fd 3 \-\-client .fi +.SH REMARK +The Debian package maintainer has renamed \fBtimelimit\fR to +the more expressive \fBtimelimit.netpipes\fR, as there exists +a better alternative using the same short name, but which is +actively maintained as an independent software. + .SH SEE ALSO -faucet\ (1), -hose\ (1), -encapsulate\ (1), -sockdown\ (1), -getpeername\ (1), -timelimit\ (1), -ssl\-auth\ (1) +.BR faucet (1), +.BR hose (1), +.BR encapsulate (1), +.BR sockdown (1), +.BR getpeername (1), +.BR timelimit.netpipes (1), +.BR timelimit (1). +.\"ssl\-auth\ (1) .SH BUGS diff -Nru netpipes-4.2.debian/timelimit.1 netpipes-4.2/timelimit.1 --- netpipes-4.2.debian/timelimit.1 1998-10-28 21:30:39.000000000 +0100 +++ netpipes-4.2/timelimit.1 2011-04-10 12:40:02.000000000 +0200 @@ -3,33 +3,35 @@ .TH TIMELIMIT 1 "February 12, 1998" .SH NAME -timelimit \- spawn a subprocess and if the child does not finish -within the time limit either kill it, or exit, leaving the child in -the background. +.\" timelimit \- spawn a subprocess and if the child does not finish +.\" within the time limit either kill it, or exit, leaving the child in +.\" the background. +timelimit.netpipes \- limit execution time of foreground tasks netpipes 4.2 .SH SYNOPSIS -\fBtimelimit\fP +\fBtimelimit.netpipes\fP [ \fB\-v\fP ] [ \fB\-nokill\fP ] \fItime\fP \fIcommand args\fP .SH DESCRIPTION -\fBtimelimit\fP is used to limit the amount of foreground wallclock -time a process consumes. Once the time limit expires \fBtimelimit\fP -will kill the process unless \fB\-nokill\fP is specified. +\fBtimelimit.netpipes\fP is used to limit the amount of foreground wallclock +time a process consumes. Once the time limit expires, \fBtimelimit.netpipes\fP +will kill the process, unless \fB\-nokill\fP had been specified. \fB\-v\fP adds some diagnostic messages. .SH EXAMPLES -.nf timelimit 5m faucet 3000 \-\-out cat time\-sensitive\-info +.nf +remote$ \ timelimit.netpipes 5m faucet 3000 \-\-out cat time\-sensitive\-info .fi .SH SEE ALSO -netpipes (1) +.BR netpipes (1) .SH BUGS debian/patches/30-support_ipv6.diff0000644000000000000000000005772411364317401014366 0ustar Description: Implement support for IPv6. In addition to IPv6 code and address independ code, some select cleanup could not be avoided. . Every port number is internally handled in host byte order. All network byte order manipulations are hidden inside get_port() and set_port(). . UNIX sockets are distinguished as 'named', 'unnamed', or 'abstract'. This effects printout. Author: Mats Erik Andersson Forwarded: no Last-Update: 2010-04-23 diff -Naurp netpipes-4.2.debian//common.c netpipes-4.2//common.c --- netpipes-4.2.debian//common.c +++ netpipes-4.2//common.c @@ -99,11 +99,35 @@ void dup_n(socket) /**********************************************************************/ +inline int get_port(ss) +struct sockaddr_storage *ss; +/* Extract port number. Return value in host byte order. */ +{ + return ntohs((ss->ss_family == AF_INET6) + ? ((struct sockaddr_in6 *) ss)->sin6_port + : ((struct sockaddr_in *) ss)->sin_port); +} /* get_port(struct sockaddr_storage *) */ + +void set_port(ss, port) +struct sockaddr_storage *ss; +int port; +/* Set port number. Input value in host byte order. */ +{ + switch (ss->ss_family) { + case AF_INET6: + ((struct sockaddr_in6 *) ss)->sin6_port = htons(port); + break; + case AF_INET: + default: + ((struct sockaddr_in *) ss)->sin_port = htons(port); + } +} /* set_port(struct sockaddr_storage *, short int) */ + int name_to_inet_port(portname) char *portname; /* This procedure converts a character string to a port number. It looks up the service by name and if there is none, then it converts the string - to a number with sscanf */ + to a number with sscanf. Return value in host byte order! */ { struct servent *p; @@ -123,18 +147,54 @@ char *portname; return 0; } else - return htons(port); + return port; } } -struct in_addr ** /* addr_array */ +struct sockaddr_storage ** /* addr_array */ convert_hostname(name, count_ret) char *name; int *count_ret; { - struct hostent *hp; - struct in_addr **rval; + //struct hostent *hp; + struct addrinfo hints, *ai, *aiptr; + struct sockaddr_storage **rval; + int rc, count = 0; + + memset(&hints, 0, sizeof(hints)); + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_ADDRCONFIG | AI_CANONNAME; + hints.ai_family = AF_UNSPEC; + + if ( (rc = getaddrinfo(name, NULL, &hints, &aiptr)) == 0 ) { + /* Count the relevant entries. */ + for (ai = aiptr; ai; ai = ai->ai_next) + if ( ai->ai_family == AF_INET6 || ai->ai_family == AF_INET ) + ++count; + + if (count) { + int i = 0; + + *count_ret = count; + rval = (struct sockaddr_storage **) malloc(sizeof(*rval) * (count+1)); + + /* Recover the found address structures. */ + for (ai = aiptr; ai; ai = ai->ai_next) { + if ( ai->ai_family != AF_INET6 && ai->ai_family != AF_INET ) + continue; + + rval[i] = (struct sockaddr_storage *) malloc(sizeof(**rval)); + memcpy(rval[i], ai->ai_addr, ai->ai_addrlen); + ++i; + } + rval[count] = NULL; + } + freeaddrinfo(aiptr); + if (count) + return rval; + } +#if 0 hp = gethostbyname(name); if (hp != NULL) { int i; @@ -144,20 +204,24 @@ convert_hostname(name, count_ret) for (i = 0; hp->h_addr_list[i]; i++) { } *count_ret = i; - rval = (struct in_addr **)malloc(sizeof(*rval) * (i+1)); + rval = (struct sockaddr_storage **)malloc(sizeof(*rval) * (i+1)); for (i=0; i<*count_ret; i++) { - rval[i] = (struct in_addr*)malloc(hp->h_length); + rval[i] = (struct sockaddr_storage *)malloc(hp->h_length); memcpy((char*)rval[i], hp->h_addr_list[i], hp->h_length); } rval[*count_ret] = 0; return rval; } else { +#endif + +#if 0 #ifndef HAVE_INET_ATON int count, len; unsigned int a1,a2,a3,a4; #endif - rval = (struct in_addr**)malloc(2*sizeof(*rval)); - rval[0] = (struct in_addr*)malloc(sizeof(struct in_addr)); + rval = (struct sockaddr_storage **)malloc(2*sizeof(*rval)); + rval[0] = (struct sockaddr_storage *) + malloc(sizeof(struct sockaddr_storage)); #ifdef HAVE_INET_ATON if (0==inet_aton(name, rval[0])) { *count_ret = 0; @@ -176,27 +240,23 @@ convert_hostname(name, count_ret) return rval; } +#else + return NULL; +#endif } /* print an internet host address prettily */ void printhost(fp, addr) FILE *fp; - struct in_addr *addr; + struct sockaddr *addr; { - struct hostent *h; - char *s,**p; + int rc; + char hostip[INET6_ADDRSTRLEN]; - h = gethostbyaddr((char*)addr, sizeof(*addr),AF_INET); - s = (h==NULL) ? NULL : (char*)/*gratuitous cast away const*/h->h_name; - - fputs(inet_ntoa(*addr), fp); - - fprintf(fp, "(%s",s?s:"name unknown"); - if (s) - for (p=h->h_aliases; *p; p++) - fprintf(fp, ",%s",*p); - fprintf(fp, ")"); + rc = getnameinfo(addr, sizeof(struct sockaddr_storage), + hostip, sizeof(hostip), NULL, 0, NI_NUMERICHOST); + fprintf(fp, "%s", hostip); } #ifdef NO_STRERROR @@ -228,9 +288,9 @@ bindlocal(fd, name, addrname, domain, re struct sockaddr *laddr; int addrlen; int countdown; - int rval; + int rval, port; - if (reuseaddr && domain == AF_INET) { + if (reuseaddr && (domain == AF_INET || domain == AF_INET6)) { #ifdef SO_REUSEADDR /* The below fix is based on articles that came from comp.sys.hp.hpux with the problem of having FIN_WAIT_2 statuses on sockets. But even @@ -251,39 +311,44 @@ bindlocal(fd, name, addrname, domain, re #endif } - if (domain==AF_INET) + if (domain==AF_INET || domain==AF_INET6) { - static struct sockaddr_in srv; + static struct sockaddr_storage srv; static int initted=0; laddr = (struct sockaddr*)&srv; addrlen = sizeof(srv); + memset(&srv, 0, sizeof(srv)); if (!initted) { - srv.sin_family = AF_INET; + srv.ss_family = domain; if (addrname) { - int count; - struct in_addr **addresses; + int count, j = 0; + struct sockaddr_storage **addresses; addresses = convert_hostname(addrname, &count); if (addresses == 0) { fprintf(stderr, "%s: Unable to convert %s to an internet address\n", progname, addrname); errno=0; return 0; } - srv.sin_addr = *(addresses[0]); - } else { - srv.sin_addr.s_addr = INADDR_ANY; + while (addresses[j] && addresses[j]->ss_family != AF_INET + && addresses[j]->ss_family != AF_INET6) + ++j; + if (addresses[j]) + memcpy(&srv, addresses[j], sizeof(srv)); } - srv.sin_port = name_to_inet_port(name); + port = name_to_inet_port(name); - if (srv.sin_port==0) + if (port==0) { fprintf(stderr, "%s: port %s unknown\n", progname, name); errno = 0; return 0; } + + set_port(&srv, port); } initted = 1; /* bindlocal is only called once in each netpipes program */ @@ -307,7 +372,7 @@ bindlocal(fd, name, addrname, domain, re exit(EXITCODE_ARGS); } - countdown= (domain!=AF_INET || reuseaddr)?1:10; + countdown= ((domain!=AF_INET && domain!=AF_INET6)|| reuseaddr)?1:10; do { rval = bind(fd, laddr, addrlen); if (rval != 0) diff -Naurp netpipes-4.2.debian//common.h netpipes-4.2//common.h --- netpipes-4.2.debian//common.h +++ netpipes-4.2//common.h @@ -50,17 +50,20 @@ void dup_n(/*int socket */); /**********************************************************************/ +inline int get_port(/* struct sockaddr_storage * */); +void set_port(/* struct sockaddr_storage *, int */); + int name_to_inet_port(/* char* */); /**********************************************************************/ -struct in_addr ** /* addr_array */ +struct sockaddr_storage ** /* addr_array */ convert_hostname(/* char *, int * */); /**********************************************************************/ void -printhost(/* struct in_addr * */); +printhost(/* FILE, struct sockaddr * */); /**********************************************************************/ diff -Naurp netpipes-4.2.debian//encapsulate.c netpipes-4.2//encapsulate.c --- netpipes-4.2.debian//encapsulate.c +++ netpipes-4.2//encapsulate.c @@ -181,7 +181,7 @@ static void probe_child(); static int Im_server_p(sock_fd) int sock_fd; { - struct sockaddr_in me, him; + struct sockaddr_storage me, him; socklen_t len; int i; @@ -191,13 +191,24 @@ static int Im_server_p(sock_fd) len = sizeof(him); getpeername(sock_fd, (struct sockaddr*)&him, &len); - i = memcmp(&me.sin_addr, &him.sin_addr, 4); + if(me.ss_family != him.ss_family) + return (me.ss_family == AF_INET) ? 1 : 0; + + if(me.ss_family == AF_INET) + i = memcmp(&(((struct sockaddr_in *) &me)->sin_addr), + &(((struct sockaddr_in *) &me)->sin_addr), + sizeof(struct in_addr)); + else + i = memcmp(&((struct sockaddr_in6 *) &me)->sin6_addr, + &((struct sockaddr_in6 *) &me)->sin6_addr, + sizeof(struct in6_addr)); if (i<0) return 1; else if (i>0) return 0; - if (me.sin_port (--in|--out|--err|--fd N)+ [--once] [--verb(|ose)] [--quiet] [--unix] [--foreignport ] [--foreignhost ] [--localhost ] [--daemon] [--serial] [--shutdown (r|w)] [--pidfile fname] [--noreuseaddr] [--backlog n] -[i][o][e][#3[,4[,5...]]][v][1][q][u][d][s] [-p ] [-h ] [-H ] command args\n", progname); @@ -111,7 +106,7 @@ int reuseaddr; /* This procedure creates a socket and handles retries on the inet domain. Sockets seem to "stick" on my system (SunOS [43].x) */ { - int sock; + int sock, zero = 0; int family; #ifdef DOUNIX @@ -119,7 +114,7 @@ int reuseaddr; family = AF_UNIX; else #endif - family = AF_INET; + family = AF_INET6; sock = socket(family, SOCK_STREAM, #ifdef DOUNIX @@ -135,6 +130,8 @@ int reuseaddr; exit(EXITCODE_CONNECTION); } + setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &zero, sizeof(zero)); + if (!bindlocal(sock, name, localhost, family, reuseaddr)) { @@ -146,7 +143,9 @@ int reuseaddr; /* We used to ask for NOFILE (max number of open files) for the size of the connect queue. Linux didn't like it (NOFILE=256) so we hardcoded a smaller value. */ - listen(sock, (backlog>0 ? backlog : 5) ); + if (listen(sock, (backlog>0 ? backlog : 5)) < 0) { + perror("listen failed"); + } return(sock); } @@ -173,7 +172,7 @@ authorize_address(sin) if (foreignport != NULL && 0!=strcmp(foreignport, srv->sun_path)) { if (doflags&DOVERBOSE) { - fprintf(stderr, "%s: refusing connection from port %s\n", + fprintf(stderr, "%s: Refusing UNIX connection from port %s\n", progname, srv->sun_path); } return 0; @@ -181,29 +180,45 @@ authorize_address(sin) } else #endif { - struct sockaddr_in *srv = (struct sockaddr_in*)sin; + int is_ipv6 = (sin->sa_family == AF_INET6); + struct sockaddr_in *srv = (struct sockaddr_in *) sin; + struct sockaddr_in6 *srv6 = (struct sockaddr_in6 *) sin; int i; + if (doflags&DOVERBOSE) { + fprintf(stderr, "%s: Incoming connection from ", progname); + printhost(stderr, sin); + fprintf(stderr, " port %d\n", + get_port((struct sockaddr_storage *) sin)); + } + if (foreignhost) { for (i=0; isin_addr, - foreignHOST[i], sizeof(struct in_addr))) + if (!is_ipv6 && foreignHOST[i]->ss_family==AF_INET && + 0==memcmp(&srv->sin_addr, + &((struct sockaddr_in *)foreignHOST[i])->sin_addr, + sizeof(struct in_addr))) + break; + if (is_ipv6 && foreignHOST[i]->ss_family==AF_INET6 && + IN6_ARE_ADDR_EQUAL(&srv6->sin6_addr, + &((struct sockaddr_in6 *)foreignHOST[i])->sin6_addr)) break; } if (i>=foreignCOUNT) { if (doflags&DOVERBOSE) { - fprintf(stderr, "refusing connection from host "); - printhost(stderr, &srv->sin_addr); + fprintf(stderr, "%s: Refusing connection from host ", progname); + printhost(stderr, sin); fprintf(stderr, ".\n"); } return 0; } } - if (foreignport!=NULL && foreignPORT != srv->sin_port) { + if (foreignport!=NULL && + ! (foreignPORT == get_port((struct sockaddr_storage *) sin)) ) { if (doflags&DOVERBOSE) { - fprintf(stderr, "refusing connection from port %d.\n", - ntohs(srv->sin_port)); + fprintf(stderr, "%s: Refusing connection from port %d.\n", progname, + get_port((struct sockaddr_storage *) sin)); } return 0; } @@ -279,12 +294,13 @@ char ** argv; { int rval, i; union { - struct sockaddr_in in; + struct sockaddr sa; + struct sockaddr_storage ss; #ifdef DOUNIX struct sockaddr_un un; #endif } saddr; - struct sockaddr_in *sinp = &saddr.in; + #ifdef DOUNIX struct sockaddr_un *sunp = &saddr.un; #endif @@ -601,13 +617,12 @@ char ** argv; { socklen_t length; - length = sizeof(saddr); - - rval = accept(mastersocket,(struct sockaddr*)&saddr,&length); + length = sizeof(saddr.ss); + memset(&saddr, 0, sizeof(saddr)); + rval = accept(mastersocket, &saddr.sa, &length); } if (rval<0) { - if (errno==EWOULDBLOCK) { /* this can't happen, but why take chances? */ fprintf(stderr, "%s: No more connections to talk to.\n",progname); @@ -618,22 +633,25 @@ char ** argv; } continue; } - - if (!authorize_address(&saddr)) { + + if (!authorize_address(&saddr.sa)) { close(rval); continue; } - + if ( doflags&DOVERBOSE ) { fprintf(stderr, "%s: Got connection from ",progname); #ifdef DOUNIX if ( doflags&DOUNIX ) { - puts(sunp->sun_path); + fprintf(stderr, "UNIX %s\n", + (*sunp->sun_path == '\0') ? "(abstract)" + : (*sunp->sun_path == '/') ? sunp->sun_path + : "(unnamed)"); } else #endif { - printhost(stderr, &sinp->sin_addr); - fprintf(stderr, " port %d\n",ntohs(sinp->sin_port)); + printhost(stderr, &saddr.sa); + fprintf(stderr, " port %d\n", get_port(&saddr.ss)); } } diff -Naurp netpipes-4.2.debian//getpeername.c netpipes-4.2//getpeername.c --- netpipes-4.2.debian//getpeername.c +++ netpipes-4.2//getpeername.c @@ -63,11 +63,14 @@ int main(argc, argv) peer_not_sock = 0; for (i=1; isun_path); /* with newline */ + if (saddr.base.ss_family == AF_UNIX) { + if (verbose) + printf("UNIX, path "); + printf("%s\n", (*sunp->sun_path == '\0') ? "(abstract)" + : (*sunp->sun_path == '/') ? sunp->sun_path + : "(unnamed)"); } else #endif - if (saddr.base.sa_family == AF_INET) { - if (verbose) puts("Internet\nPort"); - printf("%d\n", ntohs(sinp->sin_port)); - if (verbose) puts("Host"); + if (saddr.base.ss_family == AF_INET || + saddr.base.ss_family == AF_INET6) { + const int is_inet6 = ( saddr.base.ss_family == AF_INET6 ); + + if (verbose) + printf("Internet, port "); + printf("%d\n", ntohs( is_inet6 ? sin6p->sin6_port + : sinp->sin_port)); + if (verbose) + printf("Host "); + { - struct in_addr* addr = &sinp->sin_addr; - int i; - printf("%d", ((u_char*)addr)[0]); - for (i=1; isin_addr, sizeof(sinp->sin_addr), - AF_INET); - if (host) { - int j,k; - for (j=0; host->h_addr_list[j]; j++) { - struct in_addr *ia = - (struct in_addr *)host->h_addr_list[j]; - if (0==memcmp(host->h_addr_list[j], - &sinp->sin_addr, host->h_length)) { - continue; /* skip this one */ - } - printf("%d", ((u_char*)ia)[0]); - for (k=1; kh_name); - for (j=0; host->h_aliases[j]; j++) { - puts(host->h_aliases[j]); - } - } else { - puts(" (no name for host)"); - } + char host[NI_MAXHOST]; + + getnameinfo((struct sockaddr *) &saddr.base, + sizeof(struct sockaddr_storage), + host, sizeof(host), NULL, 0, 0); + printf("%s\n", host); } } else { - fprintf(stderr, "%s: unknown address family (%d) returned by get%sname\n", progname, saddr.base.sa_family, name); + fprintf(stderr, "%s: unknown address family (%d) returned by get%sname\n", progname, saddr.base.ss_family, name); } } diff -Naurp netpipes-4.2.debian//hose.c netpipes-4.2//hose.c --- netpipes-4.2.debian//hose.c +++ netpipes-4.2//hose.c @@ -78,7 +78,6 @@ static char info[] = "hose: a network ut #define EXITCODE_FAILED_SYSCALL 125 #define EXITCODE_PIPE 124 -struct in_addr ** /* addr_array */ convert_hostname(); long doflags=0; int retry=0; /* how many times to retry after ECONNREFUSED */ @@ -103,15 +102,16 @@ int reuseaddr; { int sock = -1; - struct in_addr ** addresses=0; + struct sockaddr_storage ** addresses=0; #ifdef DOUNIX struct sockaddr_un unix_addr; #endif - struct sockaddr_in inet_addr; + struct sockaddr_storage inet_addr; int num_addresses; int length; int tries; int cstat; + int port = 0; #ifdef DOUNIX if (doflags&DOUNIX) { @@ -122,104 +122,100 @@ int reuseaddr; num_addresses = 1; } else #endif - { - inet_addr.sin_family = AF_INET; - - if (0==(addresses = convert_hostname(hostname, &num_addresses))) { - fprintf(stderr, "%s: could not translate %s to a host address\n", + { + if (0==(addresses = convert_hostname(hostname, &num_addresses))) { + fprintf(stderr, "%s: could not translate %s to a host address\n", progname, hostname); - exit(EXITCODE_CONNECTION); - } - - inet_addr.sin_port = name_to_inet_port(portname); - if (inet_addr.sin_port==0) { - fprintf(stderr,"%s: bogus port number %s\n",progname,portname); - exit(EXITCODE_CONNECTION); - } + exit(EXITCODE_CONNECTION); + } - length = sizeof(struct sockaddr_in); + if( (port = name_to_inet_port(portname)) == 0 ) { + fprintf(stderr,"%s: bogus port number %s\n",progname,portname); + exit(EXITCODE_CONNECTION); } + } for (tries = 0; retry<0 || tries <= retry; tries++) { int j; int family; -#ifdef DOUNIX - if (doflags&DOUNIX) - family = AF_UNIX; - else -#endif - family = AF_INET; - /* multi-homed hosts are a little tricky */ for ( j=0; jss_family; - sock = socket(family, SOCK_STREAM, 0); - if (sock <0) { - perror("opening stream socket"); - exit(EXITCODE_CONNECTION); - } + sock = socket(family, SOCK_STREAM, 0); + if (sock <0) { + perror("opening stream socket"); + exit(EXITCODE_CONNECTION); + } - if ((localport) && - !bindlocal(sock, localport, localaddr, - family, reuseaddr) ) { - fprintf(stderr,"%s: error binding stream socket %s (%s)\n", + if ((localport) && !bindlocal(sock, localport, localaddr, + family, reuseaddr) ) { + fprintf(stderr,"%s: error binding stream socket %s (%s)\n", progname,localport,strerror(errno)); - exit(EXITCODE_CONNECTION); - } + exit(EXITCODE_CONNECTION); + } #ifdef DOUNIX - if (!(doflags&DOUNIX)) + if (!(doflags&DOUNIX)) #endif - { - inet_addr.sin_addr = *(addresses[j]); - } - if (doflags&DOVERBOSE) { - fprintf(stderr, "%s: attempting to connect to ", progname); + { + memcpy(&inet_addr, addresses[j], sizeof(struct sockaddr_storage)); + set_port(&inet_addr, port); + } + if (doflags&DOVERBOSE) { + fprintf(stderr, "%s: attempting to connect to ", progname); #ifdef DOUNIX - if (doflags&DOUNIX) { - fputs(unix_addr.sun_path, stderr); - } else + if (doflags&DOUNIX) { + fprintf(stderr, "UNIX %s\n", unix_addr.sun_path); + } else #endif - { - printhost(stderr, &inet_addr.sin_addr); - fprintf(stderr, " port %d\n", ntohs(inet_addr.sin_port)); - } + { + printhost(stderr, (struct sockaddr *) &inet_addr); + fprintf(stderr, " port %d\n", get_port(&inet_addr)); } - cstat=connect(sock, + } + + length = (inet_addr.ss_family == AF_INET6) + ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in); #ifdef DOUNIX - (doflags&DOUNIX) ? - ((struct sockaddr*)&unix_addr) : + cstat=connect(sock, (doflags&DOUNIX) ? ((struct sockaddr*)&unix_addr) + : ((struct sockaddr*)&inet_addr), + length); +#else + cstat=connect(sock, ((struct sockaddr*)&inet_addr), length); #endif - ((struct sockaddr*)&inet_addr) , - length); - if (cstat==0) - break; /* success */ + if (cstat==0) + break; /* success */ - if (errno==ECONNREFUSED) { - close(sock); - sock = -1; - } else { - perror("connecting"); - exit(EXITCODE_CONNECTION); - } + if ( errno == ECONNREFUSED || errno == ETIMEDOUT) { + close(sock); + sock = -1; + continue; + } else { + perror("connecting"); + exit(EXITCODE_CONNECTION); + } } - if (j Fabian Franz Forwarded: not-needed Last-Update: 2003-07-28 --- netpipes-4.2.orig/Makefile +++ netpipes-4.2/Makefile @@ -20,7 +20,7 @@ INSTROOT = /depot/collections0/netpipes4.1 #INSTROOT = /usr/local INSTBIN = ${INSTROOT}/bin -INSTMAN = ${INSTROOT}/man +INSTMAN = ${INSTROOT}/share/man # For those who wish to use gcc instead of the vendor's compiler. #CC=gcc -Wall @@ -104,8 +104,8 @@ SSLLIB = -L../SSLeay-0.8.1 -lssl -lcrypto MANPAGES = netpipes.1 faucet.1 hose.1 \ - sockdown.1 getpeername.1 timelimit.1 encapsulate.1 \ - ssl-auth.1 + sockdown.1 getpeername.1 timelimit.1 encapsulate.1 +# ssl-auth.1 PROGRAMS = faucet hose sockdown getpeername timelimit encapsulate all : ${PROGRAMS} @@ -138,20 +138,21 @@ ${CC} ${CFLAGS} ${SSLINC} -c $< install : all - test -d ${INSTROOT} || mkdir ${INSTROOT} - test -d ${INSTBIN} || mkdir ${INSTBIN} + mkdir -p ${INSTBIN} cp ${PROGRAMS} ${INSTBIN}/ - - rm -f ${INSTBIN}/getsockname - ln -s getpeername ${INSTBIN}/getsockname - - [ -x ssl-auth ] && cp ssl-auth ${INSTBIN}/ - test -d ${INSTMAN} || mkdir ${INSTMAN} - test -d ${INSTMAN}/man1 || mkdir ${INSTMAN}/man1 + #- rm -f ${INSTBIN}/getsockname + #ln -s getpeername ${INSTBIN}/getsockname + mv -f ${INSTBIN}/getpeername ${INSTBIN}/getsockname + #- [ -x ssl-auth ] && cp ssl-auth ${INSTBIN}/ + mkdir -p ${INSTMAN}/man1 cp ${MANPAGES} ${INSTMAN}/man1/ + mv -f ${INSTMAN}/man1/getpeername.1 ${INSTMAN}/man1/getsockname.1 + #ln -s getpeername.1 ${INSTMAN}/man1/getsockname.1 # clean : - rm -f ${FOBJS} ${HOBJS} ${SOBJS} ${GOBJS} ${TOBJS} ${EOBJS} ${SSLOBJS} + rm -f ${FOBJS} ${HOBJS} ${SOBJS} ${GOBJS} ${TOBJS} ${EOBJS} ${SSLOBJS} ${PROGRAMS} spotless: clean rm -f *~ core ${PROGRAMS} debian/patches/40-hardening.diff0000644000000000000000000000333212163100623013622 0ustar Description: Better use of compiler flags. The original source is neglecting the use of CPPFLAGS and LDFLAGS. They are needed for hardening. Author: Mats Erik Andersson Forwarded: no Last-Update: 2013-06-27 --- netpipes-4.2.debian/Makefile +++ netpipes-4.2/Makefile @@ -59,7 +59,7 @@ #CFLAGS = -DPOSIX_SIG -DHAVE_INET_ATON $(CDEBUGFLAGS) # Linux (developed with RedHat 4.2, libc5) -CFLAGS = -DUSE_IOCTL -DPOSIX_SIG -DHAVE_INET_ATON $(CDEBUGFLAGS) +CFLAGS += -DUSE_IOCTL -DPOSIX_SIG -DHAVE_INET_ATON $(CDEBUGFLAGS) # SGI #CFLAGS = -DSYSV $(CDEBUGFLAGS) @@ -115,31 +115,31 @@ all : ${PROGRAMS} faucet : ${FOBJS} - ${CC} ${CFLAGS} -o $@ ${FOBJS} ${LDLIBS} + ${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${FOBJS} ${LDLIBS} hose : ${HOBJS} - ${CC} ${CFLAGS} -o $@ ${HOBJS} ${LDLIBS} + ${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${HOBJS} ${LDLIBS} sockdown: ${SOBJS} - ${CC} ${CFLAGS} -o $@ ${SOBJS} ${LDLIBS} + ${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${SOBJS} ${LDLIBS} getpeername: ${GOBJS} - ${CC} ${CFLAGS} -o $@ ${GOBJS} ${LDLIBS} + ${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${GOBJS} ${LDLIBS} ${TIMELIMIT}: ${TOBJS} - ${CC} ${CFLAGS} -o $@ ${TOBJS} ${LDLIBS} + ${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${TOBJS} ${LDLIBS} encapsulate: ${EOBJS} - ${CC} ${CFLAGS} -o $@ ${EOBJS} ${LDLIBS} + ${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${EOBJS} ${LDLIBS} ssl-auth: ${SSLOBJS} - ${CC} ${CFLAGS} -o $@ ${SSLOBJS} ${LDLIBS} ${SSLLIB} + ${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${SSLOBJS} ${LDLIBS} ${SSLLIB} ssl-auth.o: ssl-auth.c - ${CC} ${CFLAGS} ${SSLINC} -c $< + ${CC} ${CPPFLAGS} ${CFLAGS} ${SSLINC} -c $< ssl-criteria.o: ssl-criteria.c - ${CC} ${CFLAGS} ${SSLINC} -c $< + ${CC} ${CPPFLAGS} ${CFLAGS} ${SSLINC} -c $< install : all mkdir -p ${INSTBIN} debian/patches/22-manpage_width_error.diff0000644000000000000000000000077611360602273015722 0ustar Description: Avoid a page width error by rewriting text. Author: Mats Erik Andersson Forwarded: no Last-Update: 2010-04-12 --- netpipes-4.2/sockdown.1.debian +++ netpipes-4.2/sockdown.1 @@ -25,7 +25,7 @@ writeonly symbolic for same as above 1 convert to read\-only file descriptor readonly symbolic for same as above -2 complete shutdown. no reads or writes allowed in the future +2 complete shutdown. no more reads or writes are allowed totally symbolic for same as above .TE debian/patches/11-missing_include-1.diff0000644000000000000000000000054311355222403015177 0ustar Description: Missing prototype for strlen(). Author: Frank Lichtenheld Forwarded: no Last-Update: 2008-05-22 --- netpipes-4.2.orig/timelimit.c +++ netpipes-4.2/timelimit.c @@ -29,6 +29,7 @@ #include #include #include +#include #include extern int errno; #include "common.h" debian/patches/24-makefile_for_dh.diff0000644000000000000000000000123511364325224014773 0ustar Description: Let the makefile use DESTDIR for compatibility. Ease the use of automatic build using debhelper. Author: Mats Erik Andersson Forwarded: not-needed Last-Update: 2010-04-23 --- netpipes-4.2.debian/Makefile +++ netpipes-4.2/Makefile @@ -17,10 +17,10 @@ # You probably want to change this: #INSTROOT = ${HOME} -INSTROOT = /depot/collections0/netpipes4.1 +DESTDIR = /depot/collections0/netpipes4.1 #INSTROOT = /usr/local -INSTBIN = ${INSTROOT}/bin -INSTMAN = ${INSTROOT}/share/man +INSTBIN = ${DESTDIR}/usr/bin +INSTMAN = ${DESTDIR}/usr/share/man # For those who wish to use gcc instead of the vendor's compiler. #CC=gcc -Wall debian/patches/01-cleanup_manpage.diff0000644000000000000000000000051011355222307015000 0ustar Description: Misplaced new line separator in manpage. Author: Fabian Franz Forwarded: no Last-Update: 2003-07-28 --- netpipes-4.2.orig/ssl-auth.1 +++ netpipes-4.2/ssl-auth.1 @@ -5,7 +5,6 @@ .TH SSL-AUTH 1 "October 28, 1998" .SH NAME - ssl\-auth \- secure sockets for the peasants netpipes 4.2 debian/patches/32-newline_timelimit.diff0000644000000000000000000000224411551017230015404 0ustar Description: Insert some NL in printout. Improve error formatting. Author: Mats Erik Andersson Forwarded: no Last-Update: 2011-04-12 --- netpipes-4.2.debian/timelimit.c +++ netpipes-4.2/timelimit.c @@ -77,7 +77,9 @@ if (rval != 0 && errno == ESRCH) break; if (i==5 && verbose) { - fprintf(stderr, "%s: child %s refuses to die [%d]. I refuse to stop killing it.", progname, childprogname, rval); + fprintf(stderr, "%s: child %s refuses to die [%d]. " + "I refuse to stop killing it.\n", + progname, childprogname, rval); } i++; } @@ -157,7 +159,7 @@ if (childpid==0) { /* child */ execvp(argv[2], argv+2); - fprintf(stderr, "%s: Unable to exec %s (%s)", + fprintf(stderr, "%s: Unable to exec %s (%s).\n", progname, argv[2], strerror(errno)); exit (1); } @@ -170,7 +172,8 @@ if (now >= start_time + timelimit) { if (nokill) { if (verbose) { - fprintf(stderr, "%s: I've waited more than %s for %s. It must finish in the background.", + fprintf(stderr, "%s: I've waited more than %s for %s. " + "It must finish in the background.\n", progname, argv[1], argv[2]); } exit(127); debian/README.Debian0000644000000000000000000000106411364317606011237 0ustar April 23nd, 2010 In the process of adapting this software to support IPv6, is was necessary to do some restructuring of the code. The most important change is that all storing port numbers in variables is done in host byte order. The two functions get_port() and set_port() in netpipes-4.2/common.c are responsible to transform to, or from, network byte order. Sensible detection of UNIX socket paths. July 28th, 2003 I had to rename getpeername to getsockname (and remove the symlink getsockname) as this package did conflict with tcputils. debian/rules0000755000000000000000000000070612163100012010233 0ustar #!/usr/bin/make -f CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) CFLAGS = $(shell dpkg-buildflags --get CFLAGS) LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) export CPPFLAGS CFLAGS LDFLAGS ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CDEBUGFLAGS += -g -O0 -Wall else CDEBUGFLAGS += -g -O2 -Wall endif %: dh $@ override_dh_auto_build: $(MAKE) CDEBUGFLAGS="$(CDEBUGFLAGS)" override_dh_installchangelogs: dh_installchangelogs README debian/source/0000755000000000000000000000000011355222140010461 5ustar debian/source/format0000644000000000000000000000001411362026162011673 0ustar 3.0 (quilt)