From 6b5edab09da2b97bf6e574332818fa79ab41d18c Mon Sep 17 00:00:00 2001 From: Marius van Witzenburg Date: Wed, 5 Jul 2017 12:15:08 +0200 Subject: [PATCH] Escape dataset verify command --- zfs_autobackup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zfs_autobackup b/zfs_autobackup index dd4ac48..3449838 100755 --- a/zfs_autobackup +++ b/zfs_autobackup @@ -288,7 +288,9 @@ def zfs_transfer(ssh_source, source_filesystem, first_snapshot, second_snapshot, raise(subprocess.CalledProcessError(target_proc.returncode, target_cmd)) debug("Verifying if snapshot exists on target") - run(ssh_to=ssh_target, cmd=["zfs", "list", target_filesystem+"@"+second_snapshot ]) + run(ssh_to=ssh_target, input=target_filesystem+"@"+second_snapshot + "\0", cmd= + [ "xargs", "-0", "-n", "1", "zfs", "list" ] + )