1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-02 12:59:02 +00:00

Remove the current directory from nmap_fetchfile.

This commit is contained in:
david
2011-03-26 06:48:27 +00:00
parent 85762f952f
commit c8f79b8afe

14
nmap.cc
View File

@@ -2730,11 +2730,10 @@ int nmap_fetchfile(char *filename_returned, int bufferlen, const char *file) {
then the directory the nmap binary is in
then the directory the nmap binary is in plus "../share/nmap"
then we try NMAPDATADIR/file <--NMAPDATADIR
finally we try ./file
-- or on Windows --
--datadir -> $NMAPDIR -> nmap.exe directory -> NMAPDATADIR -> .
--datadir -> $NMAPDIR -> nmap.exe directory -> NMAPDATADIR
*/
/* Check the map of requested data file names. */
@@ -2828,17 +2827,6 @@ int nmap_fetchfile(char *filename_returned, int bufferlen, const char *file) {
}
}
if (!foundsomething) {
res = Snprintf(filename_returned, bufferlen, "./%s", file);
if (res > 0 && res < bufferlen) {
foundsomething = fileexistsandisreadable(filename_returned);
}
}
if (!foundsomething) {
filename_returned[0] = '\0';
}
if (foundsomething && o.debugging > 1)
log_write(LOG_PLAIN, "Fetchfile found %s\n", filename_returned);