diff --git a/src/NzbDrone.Core/Download/RejectedImportService.cs b/src/NzbDrone.Core/Download/RejectedImportService.cs index 2cbb8f523..edcd3a616 100644 --- a/src/NzbDrone.Core/Download/RejectedImportService.cs +++ b/src/NzbDrone.Core/Download/RejectedImportService.cs @@ -22,7 +22,7 @@ public RejectedImportService(ICachedIndexerSettingsProvider cachedIndexerSetting public bool Process(TrackedDownload trackedDownload, ImportResult importResult) { - if (importResult.Result != ImportResultType.Rejected || importResult.ImportDecision.LocalEpisode != null) + if (importResult.Result != ImportResultType.Rejected || importResult.ImportDecision.LocalEpisode == null) { return false; } diff --git a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs index 093792cd0..e4901257e 100644 --- a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs @@ -260,6 +260,26 @@ private List ProcessFile(FileInfo fileInfo, ImportMode importMode, var extension = Path.GetExtension(fileInfo.Name); + if (FileExtensions.DangerousExtensions.Contains(extension)) + { + return new List + { + new ImportResult(new ImportDecision(new LocalEpisode { Path = fileInfo.FullName }, + new ImportRejection(ImportRejectionReason.DangerousFile, $"Caution: Found potentially dangerous file with extension: {extension}")), + $"Caution: Found potentially dangerous file with extension: {extension}") + }; + } + + if (FileExtensions.ExecutableExtensions.Contains(extension)) + { + return new List + { + new ImportResult(new ImportDecision(new LocalEpisode { Path = fileInfo.FullName }, + new ImportRejection(ImportRejectionReason.ExecutableFile, $"Caution: Found executable file with extension: '{extension}'")), + $"Caution: Found executable file with extension: '{extension}'") + }; + } + if (extension.IsNullOrWhiteSpace() || !MediaFileExtensions.Extensions.Contains(extension)) { _logger.Debug("[{0}] has an unsupported extension: '{1}'", fileInfo.FullName, extension);