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.
3. What is the nature and description of the request?
- Customer is using ncat to transfer files between two hosts by using rsync
- when copy operation is finished server closed socket for writing by calling shutdown(sd, SHUT_WR).
- client sees this and continues, because it can still send data (if you do not use --recv-only option)
- client socket keeps open (CLOSE_WAIT) even server has send shutdown
- when server socket is closed, ncat can't distinguish whether it's closed or half closed, until it tries to send something.
4. Why does the customer need this? (List the business requirements here)
- cp files/data between two sockets and terminate also client when server is done
5. How would the customer like to achieve this? (List the functional requirements here)
a) change the default behavior, so that client also performs shutdown after receiving server shutdown
b) Allowing the -k option to bring back the (current) keep alive behavior in client mode
6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
Example:
a)
root@server# useradd user1
root@server# su - user1
user1@server# ncat -4 --allow <client IP> -l -e /bin/bash
root@client# ncat <server IP>
exit
root@client# lsof -p <ncat pid> | grep CLOSE_WAIT
root@client#
b)
root@server# useradd user1
root@server# su - user1
root@server# ncat -4 --allow <client IP> -k -l -e /bin/bash
root@client# ncat <server IP>
exit
root@client# lsof -p <ncat pid> | grep CLOSE_WAIT
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ncat <pid> root 3u IPv4 468854 0t0 TCP <client>:50546-><server>:31337 (CLOSE_WAIT)
7. Is there already an existing RFE upstream or in Red Hat Bugzilla?
- found RHBZ#1078244 -> it is confirmed that the actual behavior is not a bug and BZ is closed with WONTFIX
- found upstream mailing list [https://seclists.org/nmap-dev/2017/q2/134] where upstream maintainer suggest to change default behavior and implement parameter -k
- found [https://github.com/nmap/nmap/issues/1779] where an extra argument --exit-on-close is requested to change the current behavior
8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?
- no, asap
9. Is the sales team involved in this request and do they have any additional input?
- no
10. List any affected packages or components.
- nmap-ncat
11. Would the customer be able to assist in testing this functionality if implemented?
- yes
a) testcase to verify the default behavior on exit is changed
1. setup ncat listener:
terminalA # ncat -4 -l -e /bin/bash
2. open a new terminal and connect:
terminalB # nc localhost
3. type "exit" on the client side (terminalB)
terminalB # exit
4. on terminalA listener exists, on terminalB client exits
5. verify that there is no connection on CLOSE_WAIT on terminalA
terminalA # lsof | grep "^nc" | grep CLOSE_WAIT
terminalA #
b) testcase to verify "--no-terminate" behaves like Ncat's previous behavior
1. setup ncat listener:
terminalA # ncat --no-terminate -4 -l -e /bin/bash
2. open a new terminal and connect:
terminalB # nc localhost
3. type "exit" on the client side (terminalB)
terminalB # exit
4. on terminalA listener exists, on terminalB client does _not_ return to prompt
5. verify that there is a nc connection with status CLOSE_WAIT on terminalA
terminalA # lsof | grep "^nc" | grep CLOSE_WAIT
nc 319261 user 3u IPv4 5147699 0t0 TCP host:47682->host:31337 (CLOSE_WAIT)
I tried to get this into Fedora and received very negative feedback that this change would break so many existing scripts that cannot be easily fixed to accommodate the proposed change.
Therefore closing this as WONTFIX as don't want to disrupt behavior seen for ages which would definitely lead to an extreme amount of customer cases.