Ticket #117 (new defect)

Opened 2 years ago

Last modified 11 months ago

main loop doesn't check for created tmpdir

Reported by: mnagel Assigned to: decoder
Priority: major Milestone: Development Release Version 3.5
Component: Image Analysis Version: 3.5.1
Keywords: Cc:

Description

In the main processing loop, the safe tmpdir creation fails when multiple parts are present because no check is performed to see if the directory was already created. The code in question should be patched as follows:

--- FuzzyOcr.pm 2007-01-07 04:05:08.000000000 -0800
+++ /etc/mail/spamassassin/FuzzyOcr.pm  2007-02-21 16:05:05.000000000 -0800
@@ -263,12 +263,14 @@
         }
 
         #Found Image!! Get a temporary dir to save image
-        $imgdir = Mail::SpamAssassin::Util::secure_tmpdir();
-        unless ($imgdir) {
-            errorlog("Scan canceled, cannot create Image TMPDIR.");
-            return 0;
-        }
-        set_tmpdir($imgdir);
+        unless ($imgdir = get_tmpdir()) {
+           $imgdir = Mail::SpamAssassin::Util::secure_tmpdir();
+           unless ($imgdir) {
+               errorlog("Scan canceled, cannot create Image TMPDIR.");
+               return 0;
+           }
+           set_tmpdir($imgdir);
+       }
 
         #Generete unique filename to store image
         my $imgfilename = Mail::SpamAssassin::Util::untaint_file_path(

Attachments

Change History

03.08.2007 10:24:28 changed by anonymous

03.08.2007 12:23:46 changed by anonymous

15.08.2007 02:26:29 changed by anonymous

17.08.2007 18:42:59 changed by anonymous

08.10.2007 16:45:14 changed by anonymous


Add/Change #117 (main loop doesn't check for created tmpdir)