From 1d7165266b9f24feeabf1480dc68e7ea6114a718 Mon Sep 17 00:00:00 2001 From: joeyh Date: Mon, 25 Jun 2007 20:10:35 +0000 Subject: [PATCH] * vidir, zrun: Don't put temp files in the current directory. Closes: #429367 --- debian/changelog | 6 ++++++ vidir | 3 ++- zrun | 4 +++- 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 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 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) { -- 2.39.5