clang 3.4.1 on FreeBSD gave this warning:
nmap.cc:3064:48: warning: use of logical '||' with constant operand
[-Wconstant-logical-operand]
return file_is_readable(filename_returned) || 1;
nmap.cc:3064:48: note: use '|' for a bitwise operation
Changed to match the intent: return 1 if file_is_readable returns 0, otherwise
return that non-0 value.
In addition to silencing an unnecessary fatal error when nmap-os-db is
not found but user has requested -6, this should make start times a bit
more efficient, since only 1 or the other database is loaded. Patch by
Alexandru Geana
Fixes#97
The message stating that an unknown -P* option was used contained
references to old, deprecated forms:
-PT (now -PA)
-PB (now -PE -PA)
-PI (now -PE)
Additionally, -PR was missing.
Changes:
* Fix a collision of the name PS_NONE with a different constant in shlobj.h
* Update solution and project files for VS2013
* Update the NSIS installer to reference the VC 2013 redistributable
This was a case where order of arguments affected the outcome: if -PE
came before -Pn, then -Pn took precedence. Otherwise, -PE took
precedence (except that o.pingtype would also contain PINGTYPE_NONE...
not sure how that affected things). This cleans things up by letting
PINGTYPE_NONE be OR'd into o.opingtype, then checking for it after all
options have been processed and clearing out the other types if it is
found.
For example, "-oX -sV logfile.xml" would have meant write to a file named '-sV' previously
Now, it generates the error message "Output filename begins with '-'. Try '-oX ./-sV' if you really want it to be named as such. QUITTING."
proposal. This only affects Nmap's root directory. We might also need to
modify the code which autogenerates Nmap's source code files such as IPv6
fingerprinting code.
I often need something like this when creating and testing new service
probes. It's handier than modifying script.db every time to remove
the "version" category.