From af0dc84775e23457bb5edfe79270782f65d336b2 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 8 Aug 2013 17:09:11 +0200 Subject: [PATCH] do not print debug messages during normal use (#994376) --- nmap-6.40-logdebug.patch | 33 +++++++++++++++++++++++++++++++++ nmap.spec | 9 ++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 nmap-6.40-logdebug.patch diff --git a/nmap-6.40-logdebug.patch b/nmap-6.40-logdebug.patch new file mode 100644 index 0000000..b0b99c2 --- /dev/null +++ b/nmap-6.40-logdebug.patch @@ -0,0 +1,33 @@ +diff -up nmap-6.40/ncat/ncat_connect.c.logdebug nmap-6.40/ncat/ncat_connect.c +--- nmap-6.40/ncat/ncat_connect.c.logdebug 2013-08-08 16:49:23.541312607 +0200 ++++ nmap-6.40/ncat/ncat_connect.c 2013-08-08 16:50:07.311943322 +0200 +@@ -420,7 +420,8 @@ static int do_proxy_http(void) + goto bail; + } + code = http_parse_status_line_code(status_line); +- logdebug("Proxy returned status code %d.\n", code); ++ if (o.debug) ++ logdebug("Proxy returned status code %d.\n", code); + free(status_line); + status_line = NULL; + if (http_read_header(&sockbuf, &header) != 0) { +@@ -461,7 +462,8 @@ static int do_proxy_http(void) + http_challenge_free(&challenge); + goto bail; + } +- logdebug("Reconnection header:\n%s", request); ++ if (o.debug) ++ logdebug("Reconnection header:\n%s", request); + if (send(sd, request, n, 0) < 0) { + loguser("Error sending proxy request: %s.\n", socket_strerror(socket_errno())); + free(request); +@@ -478,7 +480,8 @@ static int do_proxy_http(void) + goto bail; + } + code = http_parse_status_line_code(status_line); +- logdebug("Proxy returned status code %d.\n", code); ++ if (o.debug) ++ logdebug("Proxy returned status code %d.\n", code); + free(status_line); + status_line = NULL; + if (http_read_header(&sockbuf, &header) != 0) { diff --git a/nmap.spec b/nmap.spec index 2b57fe2..83f9dc2 100644 --- a/nmap.spec +++ b/nmap.spec @@ -4,7 +4,7 @@ Name: nmap Epoch: 2 Version: 6.40 #global prerelease TEST5 -Release: 1%{?dist} +Release: 2%{?dist} # nmap is GPLv2 # zenmap is GPLv2 and LGPLv2+ (zenmap/higwidgets) and GPLv2+ (zenmap/radialnet) # libdnet-stripped is BSD (advertising clause rescinded by the Univ. of California in 1999) with some parts as Public Domain (crc32) @@ -35,6 +35,9 @@ Patch4: zenmap-621887-workaround.patch Patch5: ncat_reg_stdin.diff Patch6: nmap-6.25-displayerror.patch +#rhbz#994376 +Patch7: nmap-6.40-logdebug.patch + URL: http://nmap.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel, gtk2-devel, lua-devel, libpcap-devel, pcre-devel @@ -88,6 +91,7 @@ uses. %patch4 -p1 -b .bz637403 %patch5 -p1 -b .ncat_reg_stdin %patch6 -p1 -b .displayerror +%patch7 -p1 -b .logdebug # for aarch64 support, not needed with autotools 2.69+ for f in acinclude.m4 configure.ac nping/configure.ac @@ -222,6 +226,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/xnmap.1.gz %changelog +* Thu Aug 08 2013 Michal Hlavinka - 2:6.40-2 +- do not print debug messages during normal use (#994376) + * Tue Jul 30 2013 Michal Hlavinka - 2:6.40-1 - nmap updated to 6.40