Nmap Development mailing list archives

SIGINT patch


From: "Gisle Vanem" <giva () bgnett no>
Date: Fri, 27 Aug 2004 14:50:55 +0200

A cosmetic issue with nmap since the SIGINT hander was adde on 
Win32 too. I pressed ^C some seconds into the scan:
nmap -P0 -p501-1500 -sT -d1 host

Starting nmap 3.59ALPHA5 ( http://www.insecure.org/nmap ) at 2004-08-27 14:06 GMT
Initiating Connect() Scan against x.x.x.x [1000 ports] at 14:06
caught SIGINT signal, cleaning up
Strange read error from 219.232.79.248 (10093): No such file or directory
select failed in do_one_select_round()

--------

10093 is WSANOTINITIALISED since WSACleanup() was called in
the atexit-function winip_cleanup(). signal-handlers are called in a 
separate thread on Windows. 

nmap could be smart and sense this by testing socket_errno() == 
WSANOTINITIALISED. Or set a global flag in sigdie() which the
reporters could test. Or just don't call WSACleanup(). Winsock 
(on Win-NT+ at least) is cleaned up when a process quits. Maybe
there could be leaks on Win-9x.

Attached is my proposed patch.

--gv

Attachment: diffs-2.txt
Description:

---------------------------------------------------------------------
For help using this (nmap-dev) mailing list, send a blank email to 
nmap-dev-help () insecure org . List archive: http://seclists.org

Current thread: