Discard names of trash files immediately after unlink
authorJacob Bachmeyer <jcb@gnu.org>
Sat, 15 Oct 2022 03:43:44 +0000 (22:43 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Sat, 15 Oct 2022 03:43:44 +0000 (22:43 -0500)
gatekeeper.pl

index 4fe6fb74dc6faa18c8d08f1fec8558f16e212045..ed9fd7e5d1a1ea83a042ee5e3acbe7c02b48f777 100755 (executable)
@@ -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;