Change: Log when rejecting a TAR archive for extraction

Based on report in <https://www.tt-forums.net/viewtopic.php?f=31&t=87374>
This commit is contained in:
Niels Martin Hansen 2020-07-28 18:22:11 +02:00 committed by Charles Pigott
parent 096cbf2dbb
commit cf943d3a74
1 changed files with 4 additions and 1 deletions

View File

@ -929,7 +929,10 @@ bool ExtractTar(const char *tar_filename, Subdirectory subdir)
const char *dirname = (*it).second.dirname;
/* The file doesn't have a sub directory! */
if (dirname == nullptr) return false;
if (dirname == nullptr) {
DEBUG(misc, 1, "Extracting %s failed; archive rejected, the contents must be in a sub directory", tar_filename);
return false;
}
char filename[MAX_PATH];
strecpy(filename, tar_filename, lastof(filename));