From 85d81f76ce4c28a0a97be752f5fe8cb37f4d1478 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 1 Oct 2010 18:12:22 +0000 Subject: [PATCH] Add another parameter to nsp_settrace that allows setting the FILE stream to write to. It defaults to stdout like before if NULL is provided. Ncat uses this to write to stderr instead. --- CHANGELOG | 3 +++ nmap_dns.cc | 6 +++--- nse_nsock.cc | 2 +- service_scan.cc | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a1301f4d5..cf60a3402 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o Ncat now logs Nsock debug output to stderr instead of stdout, like + its other debug messages. [David] + o Updated to the latest config.guess and config.sub. Thanks to Ty Miller for a reminder. [David] diff --git a/nmap_dns.cc b/nmap_dns.cc index bdb188132..f4655df54 100644 --- a/nmap_dns.cc +++ b/nmap_dns.cc @@ -1190,7 +1190,7 @@ static void nmap_mass_rdns_core(Target **targets, int num_targets) { fatal("Unable to create nsock pool in %s()", __func__); if ((lasttrace = o.packetTrace())) - nsp_settrace(dnspool, NSOCK_TRACE_LEVEL, o.getStartTime()); + nsp_settrace(dnspool, NULL, NSOCK_TRACE_LEVEL, o.getStartTime()); connect_dns_servers(); @@ -1212,8 +1212,8 @@ static void nmap_mass_rdns_core(Target **targets, int num_targets) { if (o.packetTrace() != lasttrace) { lasttrace = !lasttrace; if (lasttrace) - nsp_settrace(dnspool, NSOCK_TRACE_LEVEL, o.getStartTime()); - else nsp_settrace(dnspool, 0, o.getStartTime()); + nsp_settrace(dnspool, NULL, NSOCK_TRACE_LEVEL, o.getStartTime()); + else nsp_settrace(dnspool, NULL, 0, o.getStartTime()); } nsock_loop(dnspool, timeout); } diff --git a/nse_nsock.cc b/nse_nsock.cc index 2526e7dbc..0157cfe11 100644 --- a/nse_nsock.cc +++ b/nse_nsock.cc @@ -1062,7 +1062,7 @@ LUALIB_API int luaopen_nsock (lua_State *L) nsock_pool nsp = new_pool(L); if (o.scriptTrace()) - nsp_settrace(nsp, NSOCK_TRACE_LEVEL, o.getStartTime()); + nsp_settrace(nsp, NULL, NSOCK_TRACE_LEVEL, o.getStartTime()); #if HAVE_OPENSSL /* Value speed over security in SSL connections. */ nsp_ssl_init_max_speed(nsp); diff --git a/service_scan.cc b/service_scan.cc index dc67f0d50..4b30895d4 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -2481,7 +2481,7 @@ int service_scan(vector &Targets) { } if (o.versionTrace()) { - nsp_settrace(nsp, NSOCK_TRACE_LEVEL, o.getStartTime()); + nsp_settrace(nsp, NULL, NSOCK_TRACE_LEVEL, o.getStartTime()); } #if HAVE_OPENSSL