nc -d -l does not return data (only empty strings)

Bug #1656785 reported by Stefan Bader on 2017-01-16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
netcat-openbsd (Debian)
Won't Fix
netcat-openbsd (Ubuntu)

Bug Description

The Zesty (17.04) version of nc (1.130-1ubuntu1) no longer returns the received data when using the '-d' (do not listen on stdin) flag together with the '-l' (listen on socket) flag. This used to work in previous releases (1.105-7ubuntu1 Trusty-Yakkety). In fact, in the previous version, the '-d' flag seems to be required to make the data transfer more reliable in scripts.

Testcase: Attached script passes on older versions, fails with the current version of nc.

Stefan Bader (smb) wrote :
Changed in netcat-openbsd (Debian):
status: Unknown → New
Stefan Bader (smb) wrote :

Added to the Debian bug report. Basically the output problem is related to a Debian add-on patch to introduce the -q# option (delayed exit) which has been incorrectly adapted to the new code.
However while testing a possible solution I found that upstream changed the default behaviour of nc to not shutdown the net socket when the local input stream closes. Now this requires using -N to get this back.

Stefan Bader (smb) wrote :
tags: added: patch
Changed in netcat-openbsd (Debian):
status: New → Fix Released
Changed in netcat-openbsd (Debian):
status: Fix Released → New
Changed in netcat-openbsd (Debian):
status: New → Won't Fix
Aron Xu (happyaron) wrote :

-q handling is updated in 1.130-3.

Changed in netcat-openbsd (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.