1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 07:11:37 +00:00

Fix the message printed when a host is skipped, for example on Windows when

attempting to scan localhost. It used to look like
  All 0 scanned ports on 127.0.0.1 are 
("Are what?") Now it looks like
  0 ports scanned on 127.0.0.1
This commit is contained in:
david
2007-12-14 09:53:42 +00:00
parent c517a80acd
commit b131ed23fa
2 changed files with 27 additions and 16 deletions

View File

@@ -1,5 +1,12 @@
# Nmap Changelog ($Id$); -*-text-*- # Nmap Changelog ($Id$); -*-text-*-
o Fixed an output problem that showed itself on Windows when attempting
to scan localhost, which is skipped. The problem looked like
All 0 scanned ports on 127.0.0.1 are
("Are what?") Now it looks like
0 ports scanned on 127.0.0.1
Rob Nicholls reported the problem.
o Fixed a bug that prevented the --resume option from working on o Fixed a bug that prevented the --resume option from working on
Windows. A symptom of the bug was an error message that looks like Windows. A symptom of the bug was an error message that looks like
..\utils.cc(996): CreateFileMapping(), file 'testresume', length 103, ..\utils.cc(996): CreateFileMapping(), file 'testresume', length 103,

View File

@@ -466,25 +466,29 @@ void printportoutput(Target *currenths, PortList *plist) {
} }
if (numignoredports == plist->numports) { if (numignoredports == plist->numports) {
log_write(LOG_PLAIN, if (numignoredports == 0) {
"%s %d scanned %s on %s %s ", log_write(LOG_PLAIN, "0 ports scanned on %s\n", currenths->NameIP(hostname, sizeof(hostname)));
(numignoredports == 1)? "The" : "All", numignoredports,
(numignoredports == 1)? "port" : "ports",
currenths->NameIP(hostname, sizeof(hostname)),
(numignoredports == 1)? "is" : "are");
if (plist->numIgnoredStates() == 1) {
log_write(LOG_PLAIN, statenum2str(plist->nextIgnoredState(PORT_UNKNOWN)));
} else { } else {
prevstate = PORT_UNKNOWN; log_write(LOG_PLAIN,
while ((istate = plist->nextIgnoredState(prevstate)) != PORT_UNKNOWN) { "%s %d scanned %s on %s %s ",
if (prevstate != PORT_UNKNOWN) log_write(LOG_PLAIN, " or "); (numignoredports == 1)? "The" : "All", numignoredports,
log_write(LOG_PLAIN, "%s (%d)", statenum2str(istate), plist->getStateCounts(istate)); (numignoredports == 1)? "port" : "ports",
prevstate = istate; currenths->NameIP(hostname, sizeof(hostname)),
(numignoredports == 1)? "is" : "are");
if (plist->numIgnoredStates() == 1) {
log_write(LOG_PLAIN, statenum2str(plist->nextIgnoredState(PORT_UNKNOWN)));
} else {
prevstate = PORT_UNKNOWN;
while ((istate = plist->nextIgnoredState(prevstate)) != PORT_UNKNOWN) {
if (prevstate != PORT_UNKNOWN) log_write(LOG_PLAIN, " or ");
log_write(LOG_PLAIN, "%s (%d)", statenum2str(istate), plist->getStateCounts(istate));
prevstate = istate;
}
} }
if(o.reason)
print_state_summary(plist, STATE_REASON_EMPTY);
log_write(LOG_PLAIN, "\n");
} }
if(o.reason)
print_state_summary(plist, STATE_REASON_EMPTY);
log_write(LOG_PLAIN, "\n");
log_write(LOG_MACHINE,"Host: %s (%s)\tStatus: Up", log_write(LOG_MACHINE,"Host: %s (%s)\tStatus: Up",
currenths->targetipstr(), currenths->HostName()); currenths->targetipstr(), currenths->HostName());