Paul Slootman
2005-Apr-26 08:25 UTC
Bug#306368: filter rules are too modern for remote rsync (which is 2.5.6)
I received the following bug report for the Debian rsync package today. I wouldn't have expected 2.6.4 to refuse to talk to even a 2.6.2 in this way... Perhaps Wayne could comment? Paul Slootman On Tue 26 Apr 2005, Alexey Feldgendler wrote:> > Rsync fails to push filters to the the remote host if the remote rsync > is older than the Debian's. I've tried to connect to a remote host > with the following rsync: > > rsync version 2.5.6 protocol version 26 > Copyright (C) 1996-2002 by Andrew Tridgell and others > <http://rsync.samba.org/> > Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, > IPv6, 64-bit system inums, 64-bit internal inums > > (that was a Fedora Core 1 box) > > Here is the command I've tried to execute on my Debian system: > > rsync -Cavvv ~/ports-utils bfc1: > (bfc1 is the remote Fedora Core 1 host with rsync 2.5.6) > > Here is the output from rsync on Debian: > > opening connection using /home/feldgendler/bin/ssh bfc1 rsync --server -vvvlogDtprC . > [sender] add_rule(-C ) > [sender] add_rule(- RCS) [cvsignore] > [sender] add_rule(- SCCS) [cvsignore] > [sender] add_rule(- CVS) [cvsignore] > [sender] add_rule(- CVS.adm) [cvsignore] > [sender] add_rule(- RCSLOG) [cvsignore] > [sender] add_rule(- cvslog.*) [cvsignore] > [sender] add_rule(- tags) [cvsignore] > [sender] add_rule(- TAGS) [cvsignore] > [sender] add_rule(- .make.state) [cvsignore] > [sender] add_rule(- .nse_depinfo) [cvsignore] > [sender] add_rule(- *~) [cvsignore] > [sender] add_rule(- #*) [cvsignore] > [sender] add_rule(- .#*) [cvsignore] > [sender] add_rule(- ,*) [cvsignore] > [sender] add_rule(- _$*) [cvsignore] > [sender] add_rule(- *$) [cvsignore] > [sender] add_rule(- *.old) [cvsignore] > [sender] add_rule(- *.bak) [cvsignore] > [sender] add_rule(- *.BAK) [cvsignore] > [sender] add_rule(- *.orig) [cvsignore] > [sender] add_rule(- *.rej) [cvsignore] > [sender] add_rule(- .del-*) [cvsignore] > [sender] add_rule(- *.a) [cvsignore] > [sender] add_rule(- *.olb) [cvsignore] > [sender] add_rule(- *.o) [cvsignore] > [sender] add_rule(- *.obj) [cvsignore] > [sender] add_rule(- *.so) [cvsignore] > [sender] add_rule(- *.exe) [cvsignore] > [sender] add_rule(- *.Z) [cvsignore] > [sender] add_rule(- *.elc) [cvsignore] > [sender] add_rule(- *.ln) [cvsignore] > [sender] add_rule(- core) [cvsignore] > [sender] add_rule(- .svn/) [cvsignore] > [sender] parse_filter_file(/home/feldgendler/.cvsignore,8380,0) > [sender] add_rule(- semantic.cache) [cvsignore] > filter rules are too modern for remote rsync. > rsync error: syntax or usage error (code 1) at exclude.c(1119) > _exit_cleanup(code=1, file=exclude.c, line=1119): about to call exit(1) > > Even adding --protocol=26 to the above command did not help. > > I've also tried the same with another remote Fedora Core 1 host which > had: > > rsync version 2.6.2 protocol version 28 > Copyright (C) 1996-2004 by Andrew Tridgell and others > <http://rsync.samba.org/> > Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, > IPv6, 64-bit system inums, 64-bit internal inums > > ....and got a similar error message. > > Only installing rsync 2.6.4 (I actually copied the binary from Debian > to Fedora Core 1) resolved the problem. > > So, rsync 2.6.4 only works with rsync 2.6.4, and this renders the > package almost unusable because most remote osts run different (older) > versions of rsync. > > Alexey.
Wayne Davison
2005-Apr-26 15:31 UTC
Bug#306368: filter rules are too modern for remote rsync (which is 2.5.6)
On Tue, Apr 26, 2005 at 10:25:14AM +0200, Paul Slootman wrote:> I wouldn't have expected 2.6.4 to refuse to talk to even a 2.6.2 in > this way...It shouldn't, and (interestingly) it wouldn't have if --delete had been specified (apparently I did all my backward-compatibility testing using --delete). So, it turns out to be a bug in the filter-compatibility code when we're a client sender and we're not actually sending the filter list to the receiver (which we don't in older protocols when we're the sender and --delete wasn't specified), but instead just verifying that it doesn't contain any directives that were too new to work with the remote rsync. Attached is the fix. ..wayne.. -------------- next part -------------- --- exclude.c 7 Apr 2005 18:06:06 -0000 1.115 +++ exclude.c 26 Apr 2005 15:18:45 -0000 @@ -1108,7 +1108,7 @@ static void send_rules(int f_out, struct && !(ent->match_flags & MATCHFLG_MERGE_FILE)) { int f = am_sender || protocol_version < 29 ? f_out : -1; send_rules(f, &cvs_filter_list); - if (f >= 0) + if (f >= 0 || f_out < 0) continue; } p = get_rule_prefix(ent->match_flags, ent->pattern, 1, &plen);