Nmap Development mailing list archives

[PATCH] Ncat as a client should quit event loop on EOF only if recvonly


From: Tomas Hozza <thozza () redhat com>
Date: Thu, 7 Feb 2013 03:52:32 -0500 (EST)

Hello.

Ncat acting as a client should call nsock_loop_quit()
on reading EOF from socket only if o.recvonly is set.
If not, Ncat should call shutdown(<sock_fd>, SHUT_RD).

The current code can result in situation when client
receives EOF from the server and quits the event loop.
This would prevent client from sending any more data
to the server.

This can be reproduced using TCP:

1. run server: # ncat -l 6666
2. run client: # ncat -4 localhost 6666
3. send EOF from server to client
4. client will exit the event loop and terminate the connection

- client should NOT quit the event loop if --recv-only
is not used.

I'm attaching proposed patch.

Regards,

Tomas Hozza

Attachment: 0001-Ncat-client-quit-event-loop-on-EOF-only-if-recvonly.patch
Description:

_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: