From owner-freebsd-bugs@FreeBSD.ORG Sat Jul 20 17:10:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7186DF54 for ; Sat, 20 Jul 2013 17:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 52F06BAB for ; Sat, 20 Jul 2013 17:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r6KHA1j0086689 for ; Sat, 20 Jul 2013 17:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r6KHA00N086688; Sat, 20 Jul 2013 17:10:00 GMT (envelope-from gnats) Date: Sat, 20 Jul 2013 17:10:00 GMT Message-Id: <201307201710.r6KHA00N086688@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Mark Linimon Subject: Re: bin/176713: [patch] nc(1) closes network socket too soon X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Mark Linimon List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 17:10:02 -0000 The following reply was made to PR bin/176713; it has been noted by GNATS. From: Mark Linimon To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/176713: [patch] nc(1) closes network socket too soon Date: Sat, 20 Jul 2013 12:08:18 -0500 ----- Forwarded message from Fernando Apesteguía ----- Date: Sat, 20 Jul 2013 17:58:52 +0200 From: Fernando Apesteguía To: "Ronald F. Guilmette" Cc: FreeBSD Hackers Subject: Re: bin/176713: [patch] nc(1) closes network socket too soon On Sat, Jul 20, 2013 at 4:31 PM, Ronald F. Guilmette wrote: > Could someone please take a look at this bug report (bin/176713) and > also at the simple patch that I provided to fix the problem? > > This is quite a serious problem, and my PR has been pending with no > action since Wed, 6 Mar 2013. > > > Regards, > rfg > > > P.S. Please note that in reality, I do not believe that it is necessary > to add a new -q option in order to preserve backwards compatability, > however > I proposed one because in my experience there is always going to be some > purist who will claim that *any* change in semantics, however small or > helpful, in *any* software ``may'' break something. In reality, the > problem in this can most easily be solved simply by removing the one > statement: > > shutdown(nfd, SHUT_WR); > > entirely from the source, rather than making it conditional on -q, as I > suggested in my PR, bin/176713. > It seems to work for me: Old version: $ echo 193.0.6.139 | nc whois.ripe.net 43 % This is the RIPE Database query service. % The objects are in RPSL format. % % The RIPE Database is subject to Terms and Conditions. % See http://www.ripe.net/db/support/db-terms-conditions.pdf with the patched version: echo 193.0.6.139 | ./nc -q whois.ripe.net 43 % This is the RIPE Database query service. % The objects are in RPSL format. % % The RIPE Database is subject to Terms and Conditions. % See http://www.ripe.net/db/support/db-terms-conditions.pdf % Note: this output has been filtered. % To receive output for a database update, use the "-B" flag. % Information related to '193.0.0.0 - 193.0.7.255' % Abuse contact for '193.0.0.0 - 193.0.7.255' is 'abuse@ripe.net' inetnum: 193.0.0.0 - 193.0.7.255 netname: RIPE-NCC descr: RIPE Network Coordination Centre org: ORG-RIEN1-RIPE descr: Amsterdam, Netherlands remarks: Used for RIPE NCC infrastructure. country: NL admin-c: JDR-RIPE admin-c: BRD-RIPE tech-c: OPS4-RIPE status: ASSIGNED PI source: RIPE # Filtered mnt-by: RIPE-NCC-MNT mnt-lower: RIPE-NCC-MNT organisation: ORG-RIEN1-RIPE org-name: Reseaux IP Europeens Network Coordination Centre (RIPE NCC) org-type: RIR descr: RIPE NCC Operations address: Reseaux IP Europeens Network Coordination Centre (RIPE NCC) P.O. Box 10096 1016 EB Amsterdam Netherlands phone: +31205354444 fax-no: +31205354445 admin-c: AP110-RIPE admin-c: MENN1-RIPE abuse-c: ops4-ripe mnt-ref: RIPE-NCC-MNT mnt-ref: RIPE-NCC-HM-MNT mnt-by: RIPE-NCC-HM-MNT source: RIPE # Filtered role: RIPE NCC Operations address: Singel 258 address: 1016 AB Amsterdam address: The Netherlands phone: +31 20 535 4444 fax-no: +31 20 535 4445 abuse-mailbox: abuse@ripe.net admin-c: JDR-RIPE admin-c: BRD-RIPE tech-c: GL7321-RIPE tech-c: JA47 tech-c: MENN1-RIPE tech-c: EMIL-RIPE tech-c: RCO-RIPE tech-c: APZ-RIPE tech-c: CNAG-RIPE tech-c: RPM-RIPE tech-c: SO2011-RIPE tech-c: RH5357-RIPE tech-c: DCW-RIPE tech-c: FMUL-RIPE nic-hdl: OPS4-RIPE mnt-by: RIPE-NCC-MNT source: RIPE # Filtered person: Brian Riddle address: IT Manager address: RIPE NCC - Operations address: Singel 258 address: 1016AB Amsterdam address: The Netherlands phone: +31 20 535 4444 fax-no: +31 20 535 4445 nic-hdl: BRD-RIPE source: RIPE # Filtered mnt-by: RIPE-NCC-MNT person: Jochem de Ruig address: RIPE NCC address: Singel 258 address: 1016AB Amsterdam address: The Netherlands phone: +31 20 535 4444 fax-no: +31 20 535 4445 nic-hdl: JDR-RIPE source: RIPE # Filtered mnt-by: RIPE-NCC-MNT % Information related to '193.0.0.0/21AS3333' route: 193.0.0.0/21 descr: RIPE-NCC origin: AS3333 mnt-by: RIPE-NCC-MNT source: RIPE # Filtered % This query was served by the RIPE Database Query Service version 1.66.3 (WHOIS2) Tested on: FreeBSD hammer 9.1-RELEASE-p3 FreeBSD 9.1-RELEASE-p3 #0: Mon Apr 29 18:27:25 UTC 2013 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 > > P.P.S. I have just realized that yet one more critical enhancement for > nc is called for, and I will be filing a separate and additional PR for > that soon. I hope that someone will be able to take a look at that as > soon as it is filed. > Just out of curiosity. What is it about? ----- End forwarded message -----