summaryrefslogtreecommitdiff
path: root/lib/Memoize
diff options
context:
space:
mode:
authorSolar Designer <solar@openwall.com>2004-01-26 04:22:18 +0300
committerDave Mitchell <davem@fdisolutions.com>2004-02-01 17:40:02 +0000
commit2359510ddb135dcc6e80153f51cff0a97b20b597 (patch)
treeb074c5df813a1e3e529f0330620b456ecc4988e6 /lib/Memoize
parenta95a5f75a0e72874474834cd9e274afa0f23b6d8 (diff)
downloadperl-2359510ddb135dcc6e80153f51cff0a97b20b597.tar.gz
Re: [perl #15063] /tmp issues
Message-ID: <20040125222218.GA13499@openwall.com> Remove insecure usage of /tmp from code and documentation p4raw-id: //depot/perl@22258
Diffstat (limited to 'lib/Memoize')
-rwxr-xr-xlib/Memoize/t/tie.t9
-rwxr-xr-xlib/Memoize/t/tie_gdbm.t8
-rw-r--r--lib/Memoize/t/tie_ndbm.t9
-rw-r--r--lib/Memoize/t/tie_sdbm.t9
-rw-r--r--lib/Memoize/t/tie_storable.t9
5 files changed, 5 insertions, 39 deletions
diff --git a/lib/Memoize/t/tie.t b/lib/Memoize/t/tie.t
index e058674761..02c20d6fc7 100755
--- a/lib/Memoize/t/tie.t
+++ b/lib/Memoize/t/tie.t
@@ -29,14 +29,7 @@ sub n {
$_[0]+1;
}
-if (eval {require File::Spec::Functions}) {
- File::Spec::Functions->import('tmpdir', 'catfile');
- $tmpdir = tmpdir();
-} else {
- *catfile = sub { join '/', @_ };
- $tmpdir = $ENV{TMP} || $ENV{TMPDIR} || '/tmp';
-}
-$file = catfile($tmpdir, "md$$");
+$file = "md$$";
@files = ($file, "$file.db", "$file.dir", "$file.pag");
1 while unlink @files;
diff --git a/lib/Memoize/t/tie_gdbm.t b/lib/Memoize/t/tie_gdbm.t
index e9f20a071e..002ab9de00 100755
--- a/lib/Memoize/t/tie_gdbm.t
+++ b/lib/Memoize/t/tie_gdbm.t
@@ -26,13 +26,7 @@ if ($@) {
print "1..4\n";
-if (eval {require File::Spec::Functions}) {
- File::Spec::Functions->import();
-} else {
- *catfile = sub { join '/', @_ };
-}
-$tmpdir = $ENV{TMP} || $ENV{TMPDIR} || '/tmp';
-$file = catfile($tmpdir, "md$$");
+$file = "md$$";
1 while unlink $file, "$file.dir", "$file.pag";
tryout('GDBM_File', $file, 1); # Test 1..4
1 while unlink $file, "$file.dir", "$file.pag";
diff --git a/lib/Memoize/t/tie_ndbm.t b/lib/Memoize/t/tie_ndbm.t
index 0551446940..e22f06f4f2 100644
--- a/lib/Memoize/t/tie_ndbm.t
+++ b/lib/Memoize/t/tie_ndbm.t
@@ -28,14 +28,7 @@ if ($@) {
print "1..4\n";
-
-if (eval {require File::Spec::Functions}) {
- File::Spec::Functions->import();
-} else {
- *catfile = sub { join '/', @_ };
-}
-$tmpdir = $ENV{TMP} || $ENV{TMPDIR} || '/tmp';
-$file = catfile($tmpdir, "md$$");
+$file = "md$$";
1 while unlink $file, "$file.dir", "$file.pag";
tryout('Memoize::NDBM_File', $file, 1); # Test 1..4
1 while unlink $file, "$file.dir", "$file.pag";
diff --git a/lib/Memoize/t/tie_sdbm.t b/lib/Memoize/t/tie_sdbm.t
index 48895355c6..588efd9561 100644
--- a/lib/Memoize/t/tie_sdbm.t
+++ b/lib/Memoize/t/tie_sdbm.t
@@ -28,14 +28,7 @@ if ($@) {
print "1..4\n";
-if (eval {require File::Spec::Functions}) {
- File::Spec::Functions->import('tmpdir', 'catfile');
- $tmpdir = tmpdir();
-} else {
- *catfile = sub { join '/', @_ };
- $tmpdir = $ENV{TMP} || $ENV{TMPDIR} || '/tmp';
-}
-$file = catfile($tmpdir, "md$$");
+$file = "md$$";
1 while unlink $file, "$file.dir", "$file.pag";
if ( $^O eq 'VMS' ) {
1 while unlink "$file.sdbm_dir";
diff --git a/lib/Memoize/t/tie_storable.t b/lib/Memoize/t/tie_storable.t
index 042175552b..de3b8dc26b 100644
--- a/lib/Memoize/t/tie_storable.t
+++ b/lib/Memoize/t/tie_storable.t
@@ -33,14 +33,7 @@ if ($@) {
print "1..4\n";
-
-if (eval {require File::Spec::Functions}) {
- File::Spec::Functions->import();
-} else {
- *catfile = sub { join '/', @_ };
-}
-$tmpdir = $ENV{TMP} || $ENV{TMPDIR} || '/tmp';
-$file = catfile($tmpdir, "storable$$");
+$file = "storable$$";
1 while unlink $file;
tryout('Memoize::Storable', $file, 1); # Test 1..4
1 while unlink $file;