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: wa...@opencoder.net
          Reporter: simon.mat...@invoca.ch
        QA Contact: rsync...@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@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

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

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
  • [Bug 14323] New: Defa... just subscribed for rsync-qa from bugzilla via rsync

Reply via email to