From 2983408212358ac4f9148a9e64791ba55fb4c952 Mon Sep 17 00:00:00 2001 From: rolfm Date: Sat, 5 Jun 2010 10:19:09 -0700 Subject: [PATCH] Fixed SFTP mover bug that would leave escaped tmp files on the destination server. --- lib/Bric/Changes.pod | 5 +++++ lib/Bric/Util/Trans/SFTP.pm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Bric/Changes.pod b/lib/Bric/Changes.pod index f7ea5a30f..95de07c8c 100644 --- a/lib/Bric/Changes.pod +++ b/lib/Bric/Changes.pod @@ -41,6 +41,11 @@ C or C F directives were anything other than 80 and 443, respectively. Thanks to Héctor Daniel Cortés González for the report. [David] +=item * + +Fixed a bug where the SFTP mover would not properly finish moving the file, +leavingescaped tmp files on the destination server. [Matt Rolf] + =back =head1 Version 2.0.0 (2010-04-12) diff --git a/lib/Bric/Util/Trans/SFTP.pm b/lib/Bric/Util/Trans/SFTP.pm index 50ba43784..23c5e6e2f 100644 --- a/lib/Bric/Util/Trans/SFTP.pm +++ b/lib/Bric/Util/Trans/SFTP.pm @@ -213,7 +213,7 @@ sub put_res { $sftp->unlink($tmp_dest) if FTP_UNLINK_BEFORE_MOVE; my $f = $ssh2->scp_put($src, $tmp_dest_esc); $sftp->unlink($dest_file) if FTP_UNLINK_BEFORE_MOVE; - $sftp->rename($tmp_dest, $dest_file); + $sftp->rename($tmp_dest_esc, $dest_file); }; unless (defined $status) { my $msg = "Unable to put file '$dest_file' on remote host"