[Rt-commit] rt branch, 4.4/emailparser-tmpfile-path, created. rt-4.2.3-202-gc4ed888

Alex Vandiver alexmv at bestpractical.com
Wed Apr 30 11:37:59 EDT 2014


The branch, 4.4/emailparser-tmpfile-path has been created
        at  c4ed8889c9a1c087a5f80435573ba327f3c51b02 (commit)

- Log -----------------------------------------------------------------
commit c4ed8889c9a1c087a5f80435573ba327f3c51b02
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Apr 30 11:36:52 2014 -0400

    Default to placing tmpfiles generated during email parsing under /tmp
    
    This allows the system tmp-cleaner to purge any dangling files, and
    eases configuration of RT under SELinux.
    
    Fixes I#25890.

diff --git a/lib/RT/EmailParser.pm b/lib/RT/EmailParser.pm
index 283cc45..156e160 100644
--- a/lib/RT/EmailParser.pm
+++ b/lib/RT/EmailParser.pm
@@ -473,10 +473,10 @@ sub _SetupMIMEParser {
     # of File::Spec->tmpdir (e.g., /tmp) beacuse it isn't always
     # writable.
     my $tmpdir;
-    if ( -w $RT::VarPath ) {
-        $tmpdir = File::Temp::tempdir( DIR => $RT::VarPath, CLEANUP => 1 );
-    } elsif (-w File::Spec->tmpdir) {
+    if (-w File::Spec->tmpdir) {
         $tmpdir = File::Temp::tempdir( TMPDIR => 1, CLEANUP => 1 );
+    } elsif ( -w $RT::VarPath ) {
+        $tmpdir = File::Temp::tempdir( DIR => $RT::VarPath, CLEANUP => 1 );
     } else {
         $RT::Logger->crit("Neither the RT var directory ($RT::VarPath) nor the system tmpdir (@{[File::Spec->tmpdir]}) are writable; falling back to in-memory parsing!");
     }

-----------------------------------------------------------------------


More information about the rt-commit mailing list