Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Using "-i" option will wait in an unexpected way (even when data is transmitted)
Version-Release number of selected component (if applicable):
nmap-ncat-6.40-4.el7.x86_64
How reproducible:
always
Steps to Reproduce:
Objective:
- using nc to connect to a remote system
- send a string to the remote system
- get a string back from the remote system and exit
- set a max timeout for the entire operation so that if the remote system answers back in say 0.1 sec, nc will exit after 0.1 sec, in any other case (remote system not online, remote system connects but doesn't answer back, whatever) the nc command will exit in a fixed amount of time.
With RHEL5/6 nc, we had
"-w" (for connect and idle timeout)
With RHEL7 (switch to nmap-ncat) we have
-w (for connect timeout)
-i (for idle timeout)
but "-i" doesn't work as I would expect.
Actual results:
Connecting from RHEL7 (will wait 3 secs)
$ time echo quit | nc -w 3 -i 3 ip.local.lan 21
220 (vsFTPd 2.0.5)
221 Goodbye.
Ncat: Idle timeout expired (3000 ms).
real 0m3.054s
user 0m0.005s
sys 0m0.009s
$
Expected results:
Connecting from RHEL5/RHEL6 (exits as soon as possible)
$ time echo quit | nc -w 3 ip.local.lan 21
220 (vsFTPd 2.0.5)
221 Goodbye.
real 0m0.008s
user 0m0.000s
sys 0m0.001s
$
Additional info:
If you omit "-i" it will exit immediately, but then when the server has problems and doesn't answer back the connection will be stuck and won't terminate in a fixed amount of time.