You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Duncan Findlay <du...@debian.org> on 2005/06/08 06:01:44 UTC

Re: svn commit: r189514 - in /spamassassin/trunk: MANIFEST t/SATest.pm t/data/spamc_test.cf t/spamc_cf.t t/spamd_plugin.t t/spamd_unix.t

On Wed, Jun 08, 2005 at 03:39:33AM -0000, jm@apache.org wrote:
> +sub mk_safe_tmpdir {
> +  return $safe_tmpdir if defined($safe_tmpdir);
> +
> +  my $dir = $ENV{TMPDIR} || '/tmp';
> +
> +  # be a little paranoid, since we're using a public tmp dir and
> +  # are exposed to race conditions
> +  my $retries = 10;

I think we should just use File::Temp, it's included with perl, AFAIK,
and should do the right thing in more situations. This looks a little
specific to unix-like environments.

-- 
Duncan Findlay

Re: svn commit: r189514 - in /spamassassin/trunk: MANIFEST t/SATest.pm t/data/spamc_test.cf t/spamc_cf.t t/spamd_plugin.t t/spamd_unix.t

Posted by "Malte S. Stretz" <ms...@gmx.net>.
On Wednesday 08 June 2005 06:01 CET Duncan Findlay wrote:
> On Wed, Jun 08, 2005 at 03:39:33AM -0000, jm@apache.org wrote:
> > +sub mk_safe_tmpdir {
> > +  return $safe_tmpdir if defined($safe_tmpdir);
> > +
> > +  my $dir = $ENV{TMPDIR} || '/tmp';
> > +
> > +  # be a little paranoid, since we're using a public tmp dir and
> > +  # are exposed to race conditions
> > +  my $retries = 10;
>
> I think we should just use File::Temp, it's included with perl, AFAIK,
> and should do the right thing in more situations. This looks a little
> specific to unix-like environments.

... or at least File::Spec->tmpdir()

Cheers,
Malte

-- 
[SGT] Simon G. Tatham: "How to Report Bugs Effectively"
      <http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>
[ESR] Eric S. Raymond: "How To Ask Questions The Smart Way"
      <http://www.catb.org/~esr/faqs/smart-questions.html>