By default certain file suffixes should not be compressed while rsyncing from remote host. This worked fine for 3.0.6 but doesn't for 3.1.3. In my tests I named an ascii text file as z.gz and rsynced it: [simix@alpha Z]$ rsync-3.0.6/rsync --rsync-path=${PWD}/rsync-3.0.6/rsync -azv alpha:Z/z.gz Z ; rm -vf Z simix@alpha's password: receiving incremental file list z.gz sent 30 bytes received 629254 bytes 83904.53 bytes/sec total size is 628952 speedup is 1.00 removed ‘Z’ [simix@alpha Z]$ rsync-3.1.3/rsync --rsync-path=${PWD}/rsync-3.1.3/rsync -azv alpha:Z/z.gz Z ; rm -vf Z simix@alpha's password: receiving incremental file list z.gz sent 43 bytes received 63,873 bytes 18,261.71 bytes/sec total size is 628,952 speedup is 9.84 removed ‘Z’ As you can see the file was compressed on the fly with 3.1.3, which is wrong. I'm wondering if the following change is the culprit here: --- rsync-3.0.6/token.c 2009-01-17 22:41:35.000000000 +0100 +++ rsync-3.1.3/token.c 2018-01-15 04:55:07.000000000 +0100 @@ -45,12 +46,12 @@ static void add_suffix(struct suffix_tre if (ltr == '[') { const char *after = strchr(str, ']'); - /* Just skip bogus character classes. */ - if (!after++) + /* Treat "[foo" and "[]" as having a literal '['. */ + if (after && after++ != str+1) { + while ((ltr = *str++) != ']') + add_suffix(prior, ltr, after); return; - while ((ltr = *str++) != ']') - add_suffix(prior, ltr, after); - return; + } } for (node = *prior; node; prior = &node->sibling, node = node->sibling) { Kind regards, Simon
Did some more tests and found the bug was introduced between 3.0.9 and 3.1.0. It seems like handling of default values is not working as expected.
The code actually grabs the default skip-compress list from the daemon's "dont compress" list, and in recent rsync versions the daemon vars were not initialized in a non-daemon run. I've committed a fix.