Using long file names in an Exclude file is causing Rsync to loop.

Wayne Davison wayned at
Thu Oct 12 22:51:12 GMT 2006

On Thu, Oct 12, 2006 at 02:14:20PM -0400, Ben Anderson wrote:

> I'm wondering if my exclude rule (excluding a file name which is
> longer than MAXPATHLEN) is not being "consumed" properly

Yes, you've nailed down the problem nicely.  It looks like we can just
move the line that bumps the pattern pointer up to a spot right above
the length check, and the loop will be fixed.  It also looks like we
need to have the rprintf() truncate the name (since cp doesn't come
back '\0' terminated):

        while (1) {
                /* Remember that the returned string is NOT '\0' terminated! */
                cp = parse_rule_tok(pattern, mflags, xflags,
                                    &pat_len, &new_mflags);
                if (!cp)
                pattern = cp + pat_len;
                if (pat_len >= MAXPATHLEN) {
                        rprintf(FERROR, "discarding over-long filter: %.*s\n",
                                pat_len, cp);


More information about the rsync mailing list