Bug 1321136

Summary: nc is not backwards compatible, breaking existing software
Product: Red Hat Enterprise Linux 7 Reporter: Quanah Gibson-Mount <quanah>
Component: nmapAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 7.0CC: redhat-bugzilla, robert.scheck, srandhaw
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-25 13:09:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Quanah Gibson-Mount 2016-03-24 18:32:29 UTC
Description of problem:

Prior to the RHEL 7.2 release, netcat/nc was broken due to bug#1192143.

Now that is fixed, netcat/nc is now broken in that it is no longer BACKWARDS COMPATIBLE with every previous release of nc.


Version-Release number of selected component (if applicable):

nmap-ncat-6.40-7.el7.x86_64


How reproducible:

100%

Steps to Reproduce:
1. Use the -w # option with nc

Actual results:

It throws an error and exits.


Expected results:

Maybe it gives a warning and continues.  But even the warning is unnecessary.


Additional info:

RHEL6 behavior:

echo REWRITE opendkim | /usr/bin/nc -w 120 localhost 7171
SUCCESS REWRITES COMPLETE
echo $?
0

RHEL7 behavior:

echo REWRITE opendkim | /usr/bin/nc -w 120 localhost 7171
Ncat: Since April 2010, the default unit for -w is seconds, so your time of "120" is 2.0 minutes. Use "120ms" for 120 milliseconds. QUITTING.
echo $?
2

Comment 2 Quanah Gibson-Mount 2016-03-28 15:33:42 UTC
Also note, it is impossible to use "s" with the version of nc in RHEL6:

[quanah@ldap01 ~]$ which nc
/usr/bin/nc
[quanah@ldap01 ~]$ nc -w 120s ldap01.zimbra.com 389
nc: timeout cannot be negative
[quanah@ldap01 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.6 (Santiago)


which means now that there's no way to be compatible when using nc for software on both RHEL6 and RHEL7.

Comment 3 Quanah Gibson-Mount 2016-03-28 15:34:14 UTC
Broken in 7.0 through 7.2

Comment 4 Robert Scheck 2016-05-01 00:10:25 UTC
Cross-filed case 01626771 on the Red Hat customer portal.

Comment 6 Michal Hlavinka 2016-10-25 13:09:46 UTC
nmap's ncat is not a drop in replacement for nc and it does not want to be that, so it is expected not to be compatible with nc. If you really need backward compatibility, let me point you to bug #1383127 = request to bring back original nc. (note: that bug is not publicly visible, but you can ask in your support ticket to be added to cc-list if you want).

Comment 7 Robert Scheck 2016-10-25 14:24:12 UTC
I am sorry, I disagree with this. You, Red Hat, can not simply switch from
a well known working software such as BSD's nc to the broken "nmap-netcat"
being a somewhat incompatible replacement. This especially applies, when the
original /usr/bin/nc is not made a symlink for alternatives usage, but a
fixed symlink to ncat. A symlink to alternatives would at least allow EPEL
package maintainers to ship the original BSD nc additionally without causing
a file conflict.

I am updating our ticket on the Red Hat customer portal accordingly: Either
this issue gets fixed, or the nc symlink shall point to alternatives(1).

Comment 8 Robert Scheck 2016-10-25 14:28:41 UTC
Note: Original BSD nc is likely the best, but also the hardest option to get - 
given this switch could maybe break other stuff in RHEL, right?

Comment 9 Michal Hlavinka 2016-10-25 14:40:45 UTC
I'm not exactly the best person to answer what is or is not likely. My own opinion is that returning to orignial nc would be best option. nmap-ncat is not primary interest of nmap's upstream, BSD nc is still quite a standard or it was for a long time and I think it would still be better. If there is sufficient demand from customers for bug #1383127 (bring back original nc), it should be possible to get it approved by management and bring it back.

There is no problem with using alternatives, if there is requested (bug rfe) for it, but it should probably by option b, not a.

Comment 10 Robert Scheck 2021-03-18 12:17:11 UTC
Given Red Hat is obviously not interested in shipping the OpenBSD nc (or netcat) utility in RHEL, bug #1939769 finally brings this package now back using the EPEL repository.