[pve-devel] [PATCH 4/4] pvecm create: put brackets around hostnames for rsync

Wolfgang Bumiller w.bumiller at proxmox.com
Thu May 21 13:07:44 CEST 2015


ssh and friends differ with respect to ipv6notations
 * ssh: 'user at host'
 * ssh-copy-id: 'user at host' as it uses ssh
 * scp: 'user@[host]:file'
 * rsync --rsh=ssh: '[user at host]'

rsync accepts brackets for all of ipv4, ipv6 or named hosts, so simply
defaulting to always using them works
---
 data/PVE/pvecm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/PVE/pvecm b/data/PVE/pvecm
index 9dba9fa..df2c9cb 100755
--- a/data/PVE/pvecm
+++ b/data/PVE/pvecm
@@ -411,7 +411,7 @@ __PACKAGE__->register_method ({
 	eval {
 	    print "copy corosync auth key\n";
 	    $cmd = ['rsync', '--rsh=ssh -l root -o BatchMode=yes', '-lpgoq', 
-		    "$host:$authfile $clusterconf", $tmpdir];
+		    "[$host]:$authfile $clusterconf", $tmpdir];
 
 	    system(@$cmd) == 0 || die "can't rsync data from host '$host'\n";
 
-- 
2.1.4





More information about the pve-devel mailing list