#859099 rsnapshot: fails to handle quoting in +rsync_long_args

#859099#5
Date:
2017-03-30 10:08:29 UTC
From:
To:
The fix for #662636 breaks my rsnapshot config. Here's a minimal example
of the config:

=================================
config_version  1.2
cmd_rsync       /usr/bin/rsync
sync_first      1
snapshot_root   /tmp/rsnap/backup/
retain          daily   7
verbose         3
backup  /tmp/rsnap/src/         localhost/ +rsync_long_args=--filter="protect /tmp/rsnap/src/a/",exclude=/tmp/rsnap/src/a/
backup  /tmp/rsnap/src/a/       localhost/ include="/tmp/rsnap/src/a/b/",exclude="/tmp/rsnap/src/a/*"
=================================

The intention of the config is to backup /tmp/rsnap/src/a/b/, but nothing else
in /tmp/rsnap/src/a/.

Since i upgraded to jessie, i now get the following error when running rsnapshot:

=================================
$ rsnapshot -c rsnapshot.conf sync
mkdir -m 0755 -p /tmp/rsnap/backup/.sync/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --exclude=/tmp/rsnap/src/a/ --filter="protect /tmp/rsnap/src/a/" \
    /tmp/rsnap/src /tmp/rsnap/backup/.sync/localhost/
Unknown filter rule: `"protect /tmp/rsnap/src/a/"'
rsync error: syntax or usage error (code 1) at exclude.c(904) [client=3.1.1]
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot -c rsnapshot.conf sync
----------------------------------------------------------------------------
ERROR: /usr/bin/rsync returned 1 while processing /tmp/rsnap/src/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --include="/tmp/rsnap/src/a/b/" --exclude="/tmp/rsnap/src/a/*" \
    /tmp/rsnap/src/a /tmp/rsnap/backup/.sync/localhost/
touch /tmp/rsnap/backup/.sync/
=================================

As you can see, rsync is unable to parse the filter `protect` rule any more. If
i remove debian/patches/10_space_destdir.diff, then it works as expected (and
has been working for some years with squeeze):

=================================
$ rsnapshot -c rsnapshot.conf sync
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --exclude=/tmp/rsnap/src/a/ --filter="protect /tmp/rsnap/src/a/" \
    /tmp/rsnap/src /tmp/rsnap/backup/.sync/localhost/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --include="/tmp/rsnap/src/a/b/" --exclude="/tmp/rsnap/src/a/*" \
    /tmp/rsnap/src/a /tmp/rsnap/backup/.sync/localhost/
touch /tmp/rsnap/backup/.sync/
=================================

#859099#10
Date:
2017-03-30 10:41:14 UTC
From:
To:
Hey,
Sorry, i just realised that this bug is a duplicate of
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=793687

The only new information i've provided in this bug is that the
breakage is due to a specific debian patch, and a minimal reproducible
example.

Steve

#859099#15
Date:
2021-06-04 00:22:27 UTC
From:
To:
Cannot reproduce. This appears to have been fixed in upstream master and
in last tagged release (1.4.3, Nov 17 2019).

Thanks,

Sam.

#859099#22
Date:
2022-06-18 11:31:39 UTC
From:
To:
Stephen,

The 10_space_destdir patch was removed in version 1.4.0-1.

Closing as fixed.

Thanks

Mark