[Rt-commit] r15898 - in rt/3.8/trunk: .

alexmv at bestpractical.com alexmv at bestpractical.com
Wed Sep 10 16:02:56 EDT 2008


Author: alexmv
Date: Wed Sep 10 16:02:12 2008
New Revision: 15898

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm

Log:
 r37144 at kohr-ah:  chmrr | 2008-09-10 16:01:05 -0400
  UNLINK => 1 isn't assumed if you get both the filename and filehandle


Modified: rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm	(original)
+++ rt/3.8/trunk/lib/RT/Crypt/GnuPG.pm	Wed Sep 10 16:02:12 2008
@@ -520,11 +520,11 @@
             map Email::Address->parse( $entity->head->get( $_ ) ),
             qw(To Cc Bcc);
 
-        my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+        my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
         binmode $tmp_fh, ':raw';
 
-    my ($handles, $handle_list) = _make_gpg_handles(stdout => $tmp_fh);
-    my %handle = %$handle_list;
+        my ($handles, $handle_list) = _make_gpg_handles(stdout => $tmp_fh);
+        my %handle = %$handle_list;
         $handles->options( 'stdout'  )->{'direct'} = 1;
         $gnupg->passphrase( $args{'Passphrase'} ) if $args{'Sign'};
 
@@ -641,7 +641,7 @@
 
     my %res;
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $tmp_fh, ':raw';
 
     my ($handles, $handle_list) = _make_gpg_handles(stdout => $tmp_fh);
@@ -729,7 +729,7 @@
 
     my %res;
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $tmp_fh, ':raw';
 
     my ($handles, $handle_list) = _make_gpg_handles(stdout => $tmp_fh);
@@ -829,7 +829,7 @@
 
     my %res;
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $tmp_fh, ':raw';
 
     my ($handles, $handle_list) = _make_gpg_handles(stdout => $tmp_fh);
@@ -1060,7 +1060,7 @@
         meta_interactive => 0,
     );
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $tmp_fh, ':raw';
     $args{'Data'}->bodyhandle->print( $tmp_fh );
     $tmp_fh->flush;
@@ -1105,7 +1105,7 @@
         meta_interactive => 0,
     );
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $tmp_fh, ':raw:eol(CRLF?)';
     $args{'Data'}->print( $tmp_fh );
     $tmp_fh->flush;
@@ -1170,7 +1170,7 @@
     $args{'Passphrase'} = GetPassphrase()
         unless defined $args{'Passphrase'};
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $tmp_fh, ':raw';
 
     my ($handles, $handle_list) = _make_gpg_handles(stdout => $tmp_fh);
@@ -1247,7 +1247,7 @@
     $args{'Passphrase'} = GetPassphrase()
         unless defined $args{'Passphrase'};
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $tmp_fh, ':raw';
 
     my $io = $args{'Data'}->open('r');
@@ -1256,7 +1256,7 @@
     }
 
     my ($had_literal, $in_block) = ('', 0);
-    my ($block_fh, $block_fn) = File::Temp::tempfile();
+    my ($block_fh, $block_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $block_fh, ':raw';
 
     my %res;
@@ -1279,7 +1279,7 @@
             }
             print $tmp_fh "-----END OF PART-----\n" if $had_literal;
 
-            ($block_fh, $block_fn) = File::Temp::tempfile();
+            ($block_fh, $block_fn) = File::Temp::tempfile( UNLINK => 1 );
             binmode $block_fh, ':raw';
             $in_block = 0;
         }
@@ -1309,7 +1309,7 @@
     );
     my $gnupg = $args{'GnuPG'};
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $tmp_fh, ':raw';
 
     my ($handles, $handle_list) = _make_gpg_handles(
@@ -1378,7 +1378,7 @@
     $args{'Passphrase'} = GetPassphrase()
         unless defined $args{'Passphrase'};
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $tmp_fh, ':raw';
     $args{'Data'}->bodyhandle->print( $tmp_fh );
     seek $tmp_fh, 0, 0;
@@ -1423,7 +1423,7 @@
     $args{'Passphrase'} = GetPassphrase()
         unless defined $args{'Passphrase'};
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( UNLINK => 1 );
     binmode $tmp_fh, ':raw';
 
     my ($handles, $handle_list) = _make_gpg_handles(


More information about the Rt-commit mailing list