Make current loglevel and current log callback global
to the library. Attaching them to the nsock pool doesn't
bring any benefit and prevents from logging activity in
code sections that don't have access to a pool (such as
proxy chain specification parsing).
Updated external calls and nsock tests accordingly.
I had intended the unlink to appy only to unix domain sockets, but it
was being called for every kind of local address.
http://seclists.org/nmap-dev/2013/q3/647
To avoid new GCC warnings about tempnam:
ncat_connect.c:789: warning: the use of `tempnam' is dangerous, better use `mkstemp'
Doing things this way has the same race condition as tempnam did,
because we are unlinking the file before binding it. (The race window is
smaller now.) The file must not exist before binding the Unix socket, or
else you get an "address already in use" error. Unlinking before binding
is the same thing that netcat-openbsd does. See this earlier thread:
http://seclists.org/nmap-dev/2012/q4/336.
for file in `grep "* including the terms and conditions of this license text as well. \*" * -r --files-with-match `; do sed "s/\* including the terms and conditions of this license text as well. \*/* including the terms and conditions of this license text as well. */g" -i $file; done
Apparently SCTP can't have the same kind of half-open sockets that TCP
has. When one direction is closed, we can't do anything further with the
socket.
http://seclists.org/nmap-dev/2013/q1/227
This eliminates the ambiguity that could exist when, say, both o.udp and
o.sctp were both set. The code would use whichever it happened to test
first. This also makes TCP mode explicit with IPPROTO_TCP.
ncat_assert is safe because it cannot be disabled. <assert.h> assert is
also safe because we make sure that NDEBUG remains defined. Doing this
helps avoid potential bad effects of something changing in the future.
Reworked the logging infrastructure to make it more flexible
and consistent.
Updated nmap, nping and ncat accordingly. Nsock log level can
now be adjusted at runtime by pressing d/D in nmap.
compatibility between systems and use cases. [Henri Doreau]
There were known issues with the following cases:
* epoll and regular files
* kqueue and regular files
* WSAPoll and stdin
The --nsock-engine=<ENGINE> can still be used to bypass this
default choice.
See: http://seclists.org/nmap-dev/2012/q4/173
This code was not always properly cleaning up automatically generated
sockets; for example in the case of "Connection refused". It would
delete sockets even if you gave one manually with --source; it's not
clear that's the right behavior.
is a regular file.
Under linux, that provides epoll(7), this allows proper behavior when
redirecting a regular file to stdin (e.g.: 'ncat localhost < file.txt').
Bug was reported by Michal Hlavinka. See
http://seclists.org/nmap-dev/2012/q3/490 for more details.
If you have trouble updating after this revision you need to follow
these instructions. You have probably just seen an error like this:
svn: URL 'svn://svn.insecure.org/nping' of existing directory 'nping'
does not match expected URL 'svn://svn.insecure.org/nmap/nping'
This is caused by the replacement of SVN externals.
Here's what you need to do. First, save any local changes you might have
in the nping, nsock, nbase, ncat, and zenmap directories. (For example
by running "cd nping; svn diff > ../nping.diff".) If you don't have any
local changes you can skip this step.
Then run these commands:
rm -rf nping/ nsock/ nbase/ ncat/ zenmap/
svn update
svn cleanup
If all else fails, you can just delete your whole working directory and
check out anew:
svn co --username guest --password "" svn://svn.insecure.org/nmap
There may be further discussion in the mailing list thread at
http://seclists.org/nmap-dev/2011/q4/303.