From d79fb8d93c7498876515a534e4d90278bfdf5ece Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Fri, 8 Mar 2013 16:07:55 +0100 Subject: [PATCH] nmap updated to 6.25 --- .gitignore | 1 + nmap-6.01-shutdown.patch | 43 ---------- nmap-6.01-shutdown_test.patch | 145 ---------------------------------- nmap.spec | 22 +++--- sources | 2 +- 5 files changed, 13 insertions(+), 200 deletions(-) delete mode 100644 nmap-6.01-shutdown.patch delete mode 100644 nmap-6.01-shutdown_test.patch diff --git a/.gitignore b/.gitignore index 19588de..539fd14 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ nmap-5.21.tar.bz2 /nmap-5.61TEST5.tar.bz2 /nmap-6.00.tar.bz2 /nmap-6.01.tar.bz2 +/nmap-6.25.tar.bz2 diff --git a/nmap-6.01-shutdown.patch b/nmap-6.01-shutdown.patch deleted file mode 100644 index a508248..0000000 --- a/nmap-6.01-shutdown.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff -up nmap-6.01/ncat/ncat_core.c.shutdown nmap-6.01/ncat/ncat_core.c -diff -up nmap-6.01/ncat/ncat_core.h.shutdown nmap-6.01/ncat/ncat_core.h -diff -up nmap-6.01/ncat/ncat_listen.c.shutdown nmap-6.01/ncat/ncat_listen.c ---- nmap-6.01/ncat/ncat_listen.c.shutdown 2012-03-01 07:53:35.000000000 +0100 -+++ nmap-6.01/ncat/ncat_listen.c 2012-11-22 18:14:05.991381724 +0100 -@@ -317,10 +317,13 @@ static int ncat_listen_stream(int proto) - }else { - /* Read from stdin and write to all clients. */ - rc = read_stdin(); -- if (rc == 0 && o.sendonly) -- /* There will be nothing more to send. If we're not -- receiving anything, we can quit here. */ -- return 0; -+ if (rc == 0) { -+ if (o.sendonly) -+ /* There will be nothing more to send. If we're not -+ receiving anything, we can quit here. */ -+ return 0; -+ shutdown_sockets(SHUT_WR); -+ } - if (rc < 0) - return 1; - } -@@ -495,6 +498,19 @@ int read_stdin(void) - return nbytes; - } - -+void shutdown_sockets(int how) -+{ -+ struct fdinfo *fdn; -+ int i; -+ for (i = 0; i <= broadcast_fdlist.fdmax; i++) { -+ if (!FD_ISSET(i, &master_broadcastfds)) -+ continue; -+ -+ fdn = get_fdinfo(&broadcast_fdlist, i); -+ shutdown(fdn->fd, how); -+ } -+} -+ - /* Read from a client socket and write to stdout. Return the number of bytes - read from the socket, or -1 on error. */ - int read_socket(int recv_fd) diff --git a/nmap-6.01-shutdown_test.patch b/nmap-6.01-shutdown_test.patch deleted file mode 100644 index e0b4f00..0000000 --- a/nmap-6.01-shutdown_test.patch +++ /dev/null @@ -1,145 +0,0 @@ -diff -up nmap-6.01/ncat/test/ncat-test.pl.shutdown_test nmap-6.01/ncat/test/ncat-test.pl ---- nmap-6.01/ncat/test/ncat-test.pl.shutdown_test 2011-12-19 20:12:48.000000000 +0100 -+++ nmap-6.01/ncat/test/ncat-test.pl 2012-11-27 14:18:16.000000000 +0100 -@@ -21,6 +21,8 @@ my $HOST = "localhost"; - my $IPV6_ADDR = "::1"; - my $PORT = 40000; - my $PROXY_PORT = 40001; -+my $UNIXSOCK = "ncat.unixsock"; -+my $UNIXSOCK_TMP = "ncat.unixsock_tmp"; - - my $BUFSIZ = 1024; - -@@ -531,6 +533,22 @@ sub { - }; - kill_children; - -+# Test UNIX domain sockets listening -+($s_pid, $s_out, $s_in) = ncat("-l", "-U", $UNIXSOCK); -+test "Server UNIX socket listen on $UNIXSOCK (STREAM)", -+sub { -+ my $resp; -+ -+ unlink($UNIXSOCK); -+ my ($c_pid, $c_out, $c_in) = ncat("-U", $UNIXSOCK); -+ syswrite($c_in, "abc\n"); -+ $resp = timeout_read($s_out); -+ $resp eq "abc\n" or die "Server got \"$resp\", not \"abc\\n\" from client"; -+}; -+kill_children; -+unlink($UNIXSOCK); -+ -+ - server_client_test "Connect success exit code", - [], ["--send-only"], sub { - my ($pid, $code); -@@ -655,16 +673,37 @@ sub { - }; - kill_children; - -+server_client_test_all "Messages are logged to output file", -+["--output", "server.log"], ["--output", "client.log"], sub { -+ -+ syswrite($c_in, "abc\n"); -+ sleep 1; -+ syswrite($s_in, "def\n"); -+ sleep 1; -+ close($c_in); -+ open(FH, "server.log"); -+ my $contents = join("", ); -+ close(FH); -+ $contents eq "abc\ndef\n" or die "Server logged " . d($contents); -+ open(FH, "client.log"); -+ $contents = join("", ); -+ close(FH); -+ $contents eq "abc\ndef\n" or die "Client logged " . d($contents); -+}; -+unlink "server.log"; -+unlink "client.log"; -+kill_children; -+ - server_client_test_tcp_sctp_ssl "Debug messages go to stderr", - ["-vvv"], ["-vvv"], sub { - my $resp; - - syswrite($c_in, "abc\n"); -- close($c_in); - $resp = timeout_read($s_out) or die "Read timeout"; - $resp eq "abc\n" or die "Server got \"$resp\", not \"abc\\n\""; - syswrite($s_in, "abc\n"); - close($s_in); -+ close($c_in); - $resp = timeout_read($c_out) or die "Read timeout"; - $resp eq "abc\n" or die "Server got \"$resp\", not \"abc\\n\""; - }; -@@ -690,6 +729,36 @@ server_client_test_tcp_sctp_ssl "Server - }; - kill_children; - -+server_client_test "Client shutdown()s connection when reading EOF", -+[], [], sub { -+ my $resp; -+ -+ syswrite($c_in, "abc\n"); -+ $resp = timeout_read($s_out) or die "Read timeout"; -+ $resp eq "abc\n" or die "Server got \"$resp\", not \"abc\\n\""; -+ -+ close($c_in); -+ -+ $resp = timeout_read($s_out); -+ !defined($resp) or die "Server didn't get EOF (got \"$resp\")"; -+}; -+kill_children; -+ -+server_client_test "Server shutdown()s connection when reading EOF", -+[], [], sub { -+ my $resp; -+ -+ syswrite($s_in, "abc\n"); -+ $resp = timeout_read($c_out) or die "Read timeout"; -+ $resp eq "abc\n" or die "Client got \"$resp\", not \"abc\\n\""; -+ -+ close($s_in); -+ -+ $resp = timeout_read($c_out); -+ !defined($resp) or die "Client didn't get EOF (got \"$resp\")"; -+}; -+kill_children; -+ - # Tests to check that server defaults to non-persistent without --keep-open. - - # Server immediately quits after the first connection closed without --keep-open -@@ -1195,6 +1264,33 @@ sub { - }; - kill_children; - -+# Test connecting to UNIX datagram socket with -s -+test "Connect to UNIX datagram socket with -s", -+sub { -+ my ($pid, $code); -+ local $SIG{CHLD} = sub { }; -+ local *SOCK; -+ my $buff; -+ -+ unlink($UNIXSOCK); -+ unlink($UNIXSOCK_TMP); -+ -+ socket(SOCK, AF_UNIX, SOCK_DGRAM, 0) or die; -+ bind(SOCK, sockaddr_un($UNIXSOCK)) or die; -+ -+ my ($c_pid, $c_out, $c_in) = ncat("-U", "--udp", "-s", $UNIXSOCK_TMP, $UNIXSOCK); -+ syswrite($c_in, "abc\n"); -+ close($c_in); -+ -+ my $peeraddr = recv(SOCK, $buff, 4, 0) or die; -+ my ($path) = sockaddr_un($peeraddr); -+ $path eq $UNIXSOCK_TMP or die "Client connected to prosy with source socket path $path, not $UNIXSOCK_TMP"; -+}; -+kill_children; -+unlink($UNIXSOCK); -+unlink($UNIXSOCK_TMP); -+ -+ - # HTTP proxy tests. - - sub http_request { diff --git a/nmap.spec b/nmap.spec index 76c5f9d..9d9ded5 100644 --- a/nmap.spec +++ b/nmap.spec @@ -2,9 +2,9 @@ Summary: Network exploration tool and security scanner Name: nmap Epoch: 2 -Version: 6.01 +Version: 6.25 #global prerelease TEST5 -Release: 11%{?dist} +Release: 1%{?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) @@ -34,16 +34,14 @@ Patch4: zenmap-621887-workaround.patch # upstream provided patch for rhbz#845005, not yet in upstream repository Patch5: ncat_reg_stdin.diff -# shutdown socket on EOF, sent upstream -Patch6: nmap-6.01-r29743.patch -Patch7: nmap-6.01-shutdown.patch -Patch8: nmap-6.01-shutdown_test.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 BuildRequires: desktop-file-utils, dos2unix +# exception granted in FPC ticket 255 +Provides: bundled(lua) = 5.2 + %define pixmap_srcdir zenmap/share/pixmaps %description @@ -90,12 +88,11 @@ uses. %patch2 -p1 -b .noms %patch4 -p1 -b .bz637403 %patch5 -p1 -b .ncat_reg_stdin -%patch6 -p1 -b .r29743 -%patch7 -p1 -b .shutdown -%patch8 -p1 -b .shutdown_test #be sure we're not using tarballed copies of some libraries -rm -rf liblua libpcap libpcre macosx mswin32 +#rm -rf liblua libpcap libpcre macosx mswin32 +rm -rf libpcap libpcre macosx mswin32 + #fix locale dir mv zenmap/share/zenmap/locale zenmap/share @@ -220,6 +217,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/xnmap.1.gz %changelog +* Fri Mar 08 2013 Michal Hlavinka - 2:6.25-1 +- nmap updated to 6.25 + * Thu Feb 14 2013 Fedora Release Engineering - 2:6.01-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild diff --git a/sources b/sources index 431f2de..9a2fc2d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a1a71940f238abb835dbf3ee7412bcea nmap-6.01.tar.bz2 +fcc80f94ff3adcb11eedf91092ea6f5e nmap-6.25.tar.bz2