From 9a6980807657b74b160234cbb527bd0142eaa26f Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Thu, 20 Apr 2006 15:28:48 +0000 Subject: Untaint current dir when temporarily chdir'ing to cache --- urpm/download.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'urpm') diff --git a/urpm/download.pm b/urpm/download.pm index 354ab897..81a45f93 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -207,7 +207,7 @@ sub sync_wget { my $options = shift; $options = { dir => $options } if !ref $options; #- force download to be done in cachedir to avoid polluting cwd. - my $cwd = getcwd(); + (my $cwd) = getcwd() =~ /(.*)/; chdir $options->{dir}; my ($buf, $total, $file) = ('', undef, undef); my $wget_command = join(" ", map { "'$_'" } @@ -275,7 +275,7 @@ sub sync_curl { } #- force download to be done in cachedir to avoid polluting cwd, #- however for curl, this is mandatory. - my $cwd = getcwd(); + (my $cwd) = getcwd() =~ /(.*)/; chdir($options->{dir}); my (@ftp_files, @other_files); foreach (@_) { @@ -424,7 +424,7 @@ sub sync_rsync { my $options = shift; $options = { dir => $options } if !ref $options; #- force download to be done in cachedir to avoid polluting cwd. - my $cwd = getcwd(); + (my $cwd) = getcwd() =~ /(.*)/; chdir($options->{dir}); my $limit_rate = _calc_limit_rate $options->{limit_rate}; foreach (@_) { -- cgit v1.2.1