[Bug 14323] New: Defaults for --skip-compress are not working, everything is being compressed

samba-bugs at samba.org samba-bugs at samba.org
Fri Mar 20 13:29:34 UTC 2020


https://bugzilla.samba.org/show_bug.cgi?id=14323

            Bug ID: 14323
           Summary: Defaults for --skip-compress are not working,
                    everything is being compressed
           Product: rsync
           Version: 3.1.3
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: core
          Assignee: wayne at opencoder.net
          Reporter: simon.matter at invoca.ch
        QA Contact: rsync-qa at samba.org

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 at 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 at 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 at 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 at 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

-- 
You are receiving this mail because:
You are the QA Contact for the bug.



More information about the rsync mailing list