mirror of
https://github.com/nmap/nmap.git
synced 2026-01-20 13:19:01 +00:00
Insert a path separator in returned paths in init_scandir when WIN32 is defined in nse_init.cc. The Windows code was inserting a separator to find files (e.g. globbing on "%s\*") but was not inserting the separator in returned paths. A symptom of this was scanning with --script=scripts and seeing error messages about not being able to access things like "C:\Nmap\scriptsanonFTP.nse" (should be "C:\Nmap\scripts\anonFTP.nse").
This commit is contained in:
@@ -632,7 +632,7 @@ int init_scandir(char* dirname, std::vector<std::string>& result, int files_or_d
|
||||
|
||||
// otherwise we add it to the results
|
||||
// we assume that dirname ends with a directory separator of some kind
|
||||
path = std::string(dirname) + std::string(entry.cFileName);
|
||||
path = std::string(dirname) + "\\" + std::string(entry.cFileName);
|
||||
result.push_back(path);
|
||||
morefiles = FindNextFile(dir, &entry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user