From: Jacob Bachmeyer Date: Sat, 15 Oct 2022 03:43:44 +0000 (-0500) Subject: Discard names of trash files immediately after unlink X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6e36fdf6cc1e0aaa7ddce22ccf9e81a034f79e02;p=gatekeeper.git Discard names of trash files immediately after unlink --- diff --git a/gatekeeper.pl b/gatekeeper.pl index 4fe6fb7..ed9fd7e 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -918,6 +918,8 @@ sub scan_incoming { # dispose of any garbage files ftp_syslog('info', "Trashcanned files removed") if unlink @trash; + @trash = (); # and empty the array to be safe, since it contained + # potentially arbitrary _untainted_ filenames # No possible files found, so return before we call lsof return () unless %possible;