diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-06-09 22:56:33 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-06-09 23:02:58 +0000 |
commit | f2392b7ebb07e23efc5c7f0fe551a87b1ce8ba62 (patch) | |
tree | a3e1d634ec96f23669ecd854afa9f4d61f11da0a /morphlib/exts/nfsboot.write | |
parent | 875499bd04626c9eae15185341704e36aae18c43 (diff) | |
download | morph-f2392b7ebb07e23efc5c7f0fe551a87b1ce8ba62.tar.gz |
Write extensions: pass -s to rsync
-s, or --protect-args prevents the file path components of destination
or source paths being interpreted by the remote shell.
This is for wildcards or other shell features, but it breaks when paths
have whitespace.
We tend to always use absolute paths, so all uses of rsync now pass -s.
kvm.write needs it, since the disk can be written to a path with spaces.
Nfsboot and ssh-rsync need it because version labels are used, which may
have spaces, and temporary directories are used, which could have spaces
in weird TMPDIR configurations.
Diffstat (limited to 'morphlib/exts/nfsboot.write')
-rwxr-xr-x | morphlib/exts/nfsboot.write | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/morphlib/exts/nfsboot.write b/morphlib/exts/nfsboot.write index f43d3c98..34a72972 100755 --- a/morphlib/exts/nfsboot.write +++ b/morphlib/exts/nfsboot.write @@ -118,7 +118,7 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): rsync_dest = 'root@%s:%s' % (location, kernel_dest) self.status(msg='Copying kernel') cliapp.runcmd( - ['rsync', kernel_src, rsync_dest]) + ['rsync', '-s', kernel_src, rsync_dest]) # Link the kernel to the right place self.status(msg='Creating links to kernel in tftp directory') @@ -153,7 +153,7 @@ class NFSBootWriteExtension(morphlib.writeexts.WriteExtension): self.status(msg='Creating \'orig\' rootfs') cliapp.runcmd( - ['rsync', '-aXSPH', '--delete', rootfs_src, + ['rsync', '-asXSPH', '--delete', rootfs_src, 'root@%s:%s' % (location, orig_path)]) self.status(msg='Creating \'run\' rootfs') |