FS#39052 - gnu-netcat listen mode broken

Attached to Project: Arch Linux
Opened by Dima Q (dimaqq) - Wednesday, 26 February 2014, 09:58 GMT
Last edited by Jan de Groot (JGC) - Wednesday, 26 February 2014, 11:01 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
netcat listen mode doesn't work. port is not accepted (-l),

Additional info:
* extra/gnu-netcat 0.7.1-4

Steps to reproduce:
$ pacman -S netcat
$ netcat -vl 1234
Warning: Inverse name lookup failed for `0.0.4.210'
# here 1234 is somehow interpreted as host address rather than port number
$ strace -ebind nc -l 1234
bind(4, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
# port number is not set at all (0) when listening

netcat client mode works fine.
For a quick work-around, switch to openbsd-netcat
This task depends upon

Closed by  Jan de Groot (JGC)
Wednesday, 26 February 2014, 11:01 GMT
Reason for closing:  Not a bug
Comment by Jan de Groot (JGC) - Wednesday, 26 February 2014, 10:20 GMT
GNU netcat and BSD netcat are incompatible when it comes to the commandline. For BSD netcat:
# nc -l 1234
For GNU netcat:
# nc -l -p 1234

BSD netcat forbids use of -p when using -l.
Comment by Dima Q (dimaqq) - Wednesday, 26 February 2014, 10:40 GMT
Woe to me, I swear `nc -vlp 1234` didn't work either an hour ago, but lo and behold it does now.

Let's say that PEBCAK...

Loading...