From nobody@FreeBSD.org  Mon Dec 30 22:47:12 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id AD248D63
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 30 Dec 2013 22:47:12 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 99192182D
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 30 Dec 2013 22:47:12 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBUMlAhU069727
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 30 Dec 2013 22:47:10 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBUMlAIx069715;
	Mon, 30 Dec 2013 22:47:10 GMT
	(envelope-from nobody)
Message-Id: <201312302247.rBUMlAIx069715@oldred.freebsd.org>
Date: Mon, 30 Dec 2013 22:47:10 GMT
From: Robert <rol@robert-eckardt.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: nc does not exit after transfer
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         185353
>Category:       docs
>Synopsis:       nc(1) does not exit after transfer (should be documented)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    allanjude
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 30 22:50:01 UTC 2013
>Closed-Date:    Tue May 20 06:31:36 UTC 2014
>Last-Modified:  Tue May 20 06:31:36 UTC 2014
>Originator:     Robert
>Release:        10.0-RC3
>Organization:
>Environment:
Live-CD from memstick
>Description:
nc is supposed to close connection after file transfer as described in man page.

machineA or TerminalB $ nc -l 12345 > foo.txt
machineC or TerminalD $ nc machineA 12345 < bar.txt

The connection in the example above hangs until nc is interrupted on one side.
Adding -d (don't read from stdin) on the listening side is ignored.
Redirecting input from /dev/null (nc -l 12345 > foo.txt < /dev/null) on the listening side aborts before the whole file (200k in my case) was transfered.
This happens also from 10.0-RC3 -> 9.1-R, but not the other way round.

>How-To-Repeat:
see description
>Fix:


>Release-Note:
>Audit-Trail:

From: Peter Wemm <peter@wemm.org>
To: Robert <rol@robert-eckardt.de>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: amd64/185353: nc does not exit after transfer
Date: Mon, 30 Dec 2013 16:40:42 -0800

      -N      shutdown(2) the network socket after EOF on the input.  Some
              servers require this to finish their work.
 
 Try:  "nc -N machineA 12345 < bar.txt" from your example
 
 -- 
 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV
 Yes, I know, gmail sucks now. If you see this then I forgot. Habits
 are hard to break.

From: "Robert Eckardt" <rol@robert-eckardt.de>
To: Peter Wemm <peter@wemm.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: amd64/185353: nc does not exit after transfer
Date: Wed, 1 Jan 2014 16:10:24 +0100

 On Mon, 30 Dec 2013 16:40:42 -0800, Peter Wemm wrote
 > -N      shutdown(2) the network socket after EOF on the input.  
 > Some             servers require this to finish their work.
 > 
 > Try:  "nc -N machineA 12345 < bar.txt" from your example
 
 Hi,
 
 you're right. It works.
 Then it should be documented in the example in the man page as nc 
 now belongs to "some servers" that require this to finish their work.
 
 Regards,
 Robert
 
 > -- 
 > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; 
 > KI6FJV Yes, I know, gmail sucks now. If you see this then I forgot. Habits
 > are hard to break.
 
Responsible-Changed-From-To: freebsd-amd64->freebsd-docs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Jan 6 00:07:44 UTC 2014 
Responsible-Changed-Why:  
reclassify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185353 

From: Allan Jude <freebsd@allanjude.com>
To: bug-followup@FreeBSD.org, rol@robert-eckardt.de
Cc:  
Subject: Re: docs/185353: nc(1) does not exit after transfer (should be documented)
Date: Mon, 10 Feb 2014 11:28:30 -0500

 This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
 --XT7BEsPaqPf8iu4tkvRjj0IVfVVkg2Kte
 Content-Type: multipart/mixed;
  boundary="------------010906050000010700040805"
 
 This is a multi-part message in MIME format.
 --------------010906050000010700040805
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 I have sent in a patch upstream to resolve this issue. Once it is
 committed we can import the updated version of netcat and gain the
 documentation fix.
 
 It is a 1 line diff to the man page, so I've attached a diff against our
 tree as well, for reference.
 
 --=20
 Allan Jude
 
 --------------010906050000010700040805
 Content-Type: text/plain; charset=windows-1252;
  name="contrib_netcat.nc.1.diff"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
  filename="contrib_netcat.nc.1.diff"
 
 Index: contrib/netcat/nc.1
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 --- contrib/netcat/nc.1	(revision 261716)
 +++ contrib/netcat/nc.1	(working copy)
 @@ -365,7 +365,7 @@
  .Nm
  process, feeding it the file which is to be transferred:
  .Pp
 -.Dl $ nc host.example.com 1234 \*(Lt filename.in
 +.Dl $ nc -N host.example.com 1234 \*(Lt filename.in
  .Pp
  After the file has been transferred, the connection will close automatic=
 ally.
  .Sh TALKING TO SERVERS
 
 --------------010906050000010700040805--
 
 --XT7BEsPaqPf8iu4tkvRjj0IVfVVkg2Kte
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.16 (MingW32)
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
 
 iQIcBAEBAgAGBQJS+P4uAAoJEJrBFpNRJZKfxmIP/3OozGxuoBulAb7w4lkyyUy9
 w+mjCk3prdvZ5ofAdx/UYVuHiw8NMj9MAY2FlAY4OXn+rZO/E0UQTcBy8j5oCSjP
 Ccc0sdt9jfp4itLOyzC8Kc0uU/eKM1FOFJSh5gv8uTAu8aZJ7Ep93R79k90BIHAQ
 j9XbBByEsapARfMWUb1GLtpAkbTPtkUHhsxzzWpm7B8Asu2E3Y7+bGz6cYDavRHO
 iB84kwhnEdAyJfImDbHYjq4+uL1vCwPo+yNFSf2x9oROFGiGOqxdjxQYkmis0yBE
 UR3CnBLSz6CfInMaCUKS1dW6LkioOU0TMVJSUnZxXBiYu3AvNYWmk6UReN88PSCa
 8zlyGJ6mOELI4HnjcSMcJMzg8cjK+QUU6k/hVbphB7Lk3YkrHU4akW99ma2xVPjd
 6q3xjxIDBX/Hmfh8dRzR4otX/3jWZv6DewfyHz26oPeuCje5eHgLVci0EkXrL/A6
 NOK98HVLwVbXL9XDT2tbbfHJ+a4vQYLIN11BZRvnm6vn8anfWhNnmvCCjNKWwlS5
 UlCjHs0h6/aOc5Zd8U3h9RJjciCc2zIpHfq7dT8x0efmGyQbcEMCSJ7sIlC+0E8I
 Yw75rTZWo0zOmpn/yEICcZw2NR3g3Gi9q/S7QGg3S6mOXno8e/paoiyennmhNHsq
 OaVJB1WZUnrMD4wjfcVj
 =Ecvw
 -----END PGP SIGNATURE-----
 
 --XT7BEsPaqPf8iu4tkvRjj0IVfVVkg2Kte--

From: Allan Jude <freebsd@allanjude.com>
To: bug-followup@FreeBSD.org, rol@robert-eckardt.de, delphij@freebsd.org
Cc:  
Subject: Re: docs/185353: nc(1) does not exit after transfer (should be documented)
Date: Mon, 10 Feb 2014 15:04:09 -0500

 The fix has been committed to OpenBSD.
 
 http://marc.info/?l=openbsd-cvs&m=139206012706972&w=2
 
 There have been a few other updates to netcat in the mean time, although
 they are to do with FD passing, which I suspect is an OpenBSD only feature.
 
 Hopefully Xin Li or someone else can MFV and pull in the fix for the man
 page.
 
 -- 
 Allan Jude
State-Changed-From-To: open->closed 
State-Changed-By: allanjude 
State-Changed-When: Tue May 20 06:30:28 UTC 2014 
State-Changed-Why:  
Updated man page (by Allan Jude) merged from vendor (OpenBSD 5.5) to  
head in r264361 by Xin Li 


Responsible-Changed-From-To: freebsd-docs->allanjude 
Responsible-Changed-By: allanjude 
Responsible-Changed-When: Tue May 20 06:30:28 UTC 2014 
Responsible-Changed-Why:  
Updated man page (by Allan Jude) merged from vendor (OpenBSD 5.5) to 
head in r264361 by Xin Li 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185353 
>Unformatted:
