summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoeyh <joeyh>2007-06-25 20:10:35 +0000
committerjoeyh <joeyh>2007-06-25 20:10:35 +0000
commit1d7165266b9f24feeabf1480dc68e7ea6114a718 (patch)
treec0038dba5df2096adaf6b58a34cda4492690e353
parent058c192993796e007353506873611d110bf613d0 (diff)
downloadmoreutils-1d7165266b9f24feeabf1480dc68e7ea6114a718.tar.gz
* vidir, zrun: Don't put temp files in the current directory. Closes: #429367
-rw-r--r--debian/changelog6
-rwxr-xr-xvidir3
-rwxr-xr-xzrun4
3 files changed, 11 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index c856224..ced9aa0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+moreutils (0.22) unstable; urgency=low
+
+ * vidir, zrun: Don't put temp files in the current directory. Closes: #429367
+
+ -- Joey Hess <joeyh@debian.org> Mon, 25 Jun 2007 16:08:14 -0400
+
moreutils (0.21) unstable; urgency=low
* Patch from Sergej Pupykin fixing ifdata -pN.
diff --git a/vidir b/vidir
index d482746..6df58bd 100755
--- a/vidir
+++ b/vidir
@@ -60,6 +60,7 @@ Licensed under the GNU GPL.
=cut
+use File::Spec;
use File::Temp;
use Getopt::Long;
@@ -90,7 +91,7 @@ foreach my $item (@ARGV) {
}
}
-my $tmp=File::Temp->new(template => "dirXXXXX");
+my $tmp=File::Temp->new(TEMPLATE => "dirXXXXX", DIR => File::Spec->tmpdir);
open (OUT, ">".$tmp->filename) || die "$0: cannot write ".$tmp->filename.": $!\n";
my %item;
diff --git a/zrun b/zrun
index 7d313e2..7776db2 100755
--- a/zrun
+++ b/zrun
@@ -32,6 +32,7 @@ Copyright 2006 by Chung-chieh Shan <ccshan@post.harvard.edu>
use warnings;
use strict;
use IO::Handle;
+use File::Spec;
use File::Temp qw{tempfile};
my $program = shift;
@@ -47,7 +48,8 @@ foreach my $argument (@ARGV) {
my $suffix = "-$2";
my @preprocess = $3 eq "bz2" ? qw(bzip2 -d -c) : qw(gzip -d -c);
- my ($fh, $tmpname) = tempfile(SUFFIX => $suffix, UNLINK => 1)
+ my ($fh, $tmpname) = tempfile(SUFFIX => $suffix,
+ DIR => File::Spec->tmpdir, UNLINK => 1)
or die "zrun: cannot create temporary file: $!\n";
if (my $child = fork) {