1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00

Remove nmap-update

This feature was never publicly released, and has not been distributed
in our binary builds for a couple versions now. It needed to be removed
in order to reduce the number of places Nmap looks for data files. See #2051
This commit is contained in:
dmiller
2020-08-27 19:13:31 +00:00
parent 2520edd8fe
commit 210adf941e
32 changed files with 18 additions and 8411 deletions

13
nmap.cc
View File

@@ -2556,9 +2556,7 @@ static int nmap_fetchfile_sub(char *filename_returned, int bufferlen, const char
individual data files. If any of these were used those locations are checked
first, and no other locations are checked.
After that, the following directories are searched in order. First an
NMAP_UPDATE_CHANNEL subdirectory is checked in all of them, then they are all
tried again directly.
After that, the following directories are searched in order:
* --datadir
* $NMAPDIR
* [Non-Windows only] ~/.nmap
@@ -2568,7 +2566,6 @@ static int nmap_fetchfile_sub(char *filename_returned, int bufferlen, const char
"/../share/nmap"
* NMAPDATADIR */
int nmap_fetchfile(char *filename_returned, int bufferlen, const char *file) {
const char *UPDATES_PREFIX = "updates/" NMAP_UPDATE_CHANNEL "/";
std::map<std::string, std::string>::iterator iter;
char buf[BUFSIZ];
int res;
@@ -2585,13 +2582,7 @@ int nmap_fetchfile(char *filename_returned, int bufferlen, const char *file) {
return res != 0 ? res : 1;
}
/* Try updates directory first. */
Strncpy(buf, UPDATES_PREFIX, sizeof(buf));
Strncpy(buf + strlen(UPDATES_PREFIX), file, sizeof(buf) - strlen(UPDATES_PREFIX));
res = nmap_fetchfile_sub(filename_returned, bufferlen, buf);
if (!res)
res = nmap_fetchfile_sub(filename_returned, bufferlen, file);
res = nmap_fetchfile_sub(filename_returned, bufferlen, file);
return res;
}