X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=PVE%2FAPI2%2FStorage%2FStatus.pm;h=ce7e040b27fe62fefa94857ac91da76e8977867c;hb=243f413ad28c6a8e70eeff52d835482d4fc18bd4;hp=9a5a95239e6fe495501eaed874eee94367d49cb3;hpb=4af77132683a2e1fa462f3740837b15a72a37ffe;p=pve-storage.git diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm index 9a5a952..ce7e040 100644 --- a/PVE/API2/Storage/Status.pm +++ b/PVE/API2/Storage/Status.pm @@ -369,7 +369,7 @@ __PACKAGE__->register_method ({ type => 'string', }, tmpfilename => { - description => "The source file name. This parameter is usually set by the REST handler. You can only overwrite it when connecting to the trustet port on localhost.", + description => "The source file name. This parameter is usually set by the REST handler. You can only overwrite it when connecting to the trusted port on localhost.", type => 'string', optional => 1, }, @@ -427,7 +427,10 @@ __PACKAGE__->register_method ({ my $dest = "$path/$filename"; my $dirname = dirname($dest); - # we simply overwrite when destination when file already exists + # best effort to match apl_download behaviour + chmod 0644, $tmpfilename; + + # we simply overwrite the destination file if it already exists my $cmd; if ($node ne 'localhost' && $node ne PVE::INotify::nodename()) { @@ -447,7 +450,7 @@ __PACKAGE__->register_method ({ PVE::Tools::run_command([@remcmd, '/bin/mkdir', '-p', '--', PVE::Tools::shell_quote($dirname)], errmsg => "mkdir failed"); - $cmd = ['/usr/bin/scp', @ssh_options, '--', $tmpfilename, "[$remip]:" . PVE::Tools::shell_quote($dest)]; + $cmd = ['/usr/bin/scp', @ssh_options, '-p', '--', $tmpfilename, "[$remip]:" . PVE::Tools::shell_quote($dest)]; } else { PVE::Storage::activate_storage($cfg, $param->{storage}); File::Path::make_path($dirname);