[3/5] ids-functions.pl: Remove temporary file, if the download failed.

Message ID 20220323040452.2609-3-stefan.schantl@ipfire.org
State Superseded
Headers
Series [1/5] ids-functions.pl: Drop downloader code for sourcefire based ruleset. |

Commit Message

Stefan Schantl March 23, 2022, 4:04 a.m. UTC
  Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 config/cfgroot/ids-functions.pl | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl
index c8bc52b1b..dfbeb1a7d 100644
--- a/config/cfgroot/ids-functions.pl
+++ b/config/cfgroot/ids-functions.pl
@@ -393,6 +393,9 @@  sub downloadruleset ($) {
 				return 1;
 			}
 
+			# Remove temporary file, if one exists.
+			unlink("$tmpfile") if (-e "$tmpfile");
+
 			# Increase download attempt counter.
 			$dl_attempt++;
 		}