You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by qu...@apache.org on 2004/07/07 21:28:15 UTC

svn commit: rev 22681 - spamassassin/trunk/lib/Mail/SpamAssassin

Author: quinlan
Date: Wed Jul  7 12:28:14 2004
New Revision: 22681

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
Log:
bug 3359: M::SA::Util::secure_tmpfile() only allows 1 file to be used at
a time (simple fix from Rudolph Pereira)


Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm	(original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm	Wed Jul  7 12:28:14 2004
@@ -699,7 +699,7 @@
     die "Cannot find a temporary directory! set TMP or TMPDIR in env";
   }
 
-  my $reportfile;
+  my ($reportfile,$tmpfile);
   my $umask = umask 077;
   do {
     # we do not rely on the obscurity of this name for security...
@@ -722,10 +722,10 @@
                   );
     # ...rather, we require O_EXCL|O_CREAT to guarantee us proper
     # ownership of our file; read the open(2) man page.
-  } while (! sysopen (TMPFILE, $reportfile, O_RDWR|O_CREAT|O_EXCL, 0600));
+  } while (! sysopen ($tmpfile, $reportfile, O_RDWR|O_CREAT|O_EXCL, 0600));
   umask $umask;
 
-  return ($reportfile, \*TMPFILE);
+  return ($reportfile, $tmpfile);
 }
 
 ###########################################################################