]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/LunCmd/Iet.pm
iSCSI ipv6 support
[pve-storage.git] / PVE / Storage / LunCmd / Iet.pm
index 98c062bd2d45f92621c1f4f275dfea5f447c3cc8..4a8ebd5a1af49927054aa1b7356e33081ebe83bc 100644 (file)
@@ -57,12 +57,12 @@ my $execute_command = sub {
     $err .= "$line";
     };
 
-    $target = 'root@' . $scfg->{portal};
-
     if ($exec eq 'scp') {
-        $cmd = [@scp_cmd, '-i', "$id_rsa_path/$scfg->{portal}_id_rsa", $method, "$target:$params[0]"];
+        $target = 'root@[' . $scfg->{portal} . ']';
+        $cmd = [@scp_cmd, '-i', "$id_rsa_path/$scfg->{portal}_id_rsa", '--', $method, "$target:$params[0]"];
     } else {
-        $cmd = [@ssh_cmd, '-i', "$id_rsa_path/$scfg->{portal}_id_rsa", $target, $method, @params];
+        $target = 'root@' . $scfg->{portal};
+        $cmd = [@ssh_cmd, '-i', "$id_rsa_path/$scfg->{portal}_id_rsa", $target, '--', $method, @params];
     }
 
     eval {