ncat datagram connect only if not in recvonly mode #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am trying to use ncat to listen on a unix domain datagram socket in
receive only mode. I am using this as a simple syslog receiving server for
testing.
When I use the following command:
ncat --recv-only -luU /tmp/test.socket
and then try to log a message using logger with the following command:
logger -d -u /tmp/test.socket "this is a test"
I get the following error on the ncat side:
connect: Invalid argument
From looking at the ncat_listen.c code it looks like ncat tries to connect
a sending socket even when in recv-only mode. I added a check to connect
only when not in recv-only mode and then ncat worked as expected.
I've also sent this out a few days back to the dev mailing list: https://seclists.org/nmap-dev/2014/q4/343 .
Hope this fix is something you can merge in.
Thanks,
Guy