Bug 1660 - --exclude option causes rsync to fail
Summary: --exclude option causes rsync to fail
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.3
Hardware: x86 Linux
: P3 major (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2004-08-24 08:14 UTC by Justin Guenther
Modified: 2005-04-01 11:21 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Justin Guenther 2004-08-24 08:14:42 UTC
After upgrading to rsync 2.6.3pre1 yesterday, I was no longer able to sync
successfully through SSH.

bash$ ssh -x root@host rsync --server --sender --exclude /etc -av . /
rsync: Error parsing options: option may be supported on client but not on server?
rsync error: syntax or usage error (code 1) at main.c(1064)

If I remove the --exclude option this problem goes away. Both computers are
running rsync 2.6.3pre1.

This problem does not occur if I instead do `rsync -e "ssh -l root"' instead of
first SSH'ing to the remote computer and running rsync from there. If you need
any more information please let me know.
Comment 1 Wayne Davison 2004-08-25 08:32:22 UTC
This is because you're manually specifying the --server option.  The --exclude
option is specified to the client rsync, and it sends the excludes to the server
via the socket (when necessary), so the exclude option is not supposed to be
used when running the server. Are you trying to do something tricky here?
Comment 2 Craig Barratt 2004-08-25 14:03:23 UTC

This is the way BackupPC (using File::RsyncP) invokes the client side
of rsync.  This is perl code that emulates one side of the rsync
connection, and the real rsync is used as the server side with the
--server option.

I agree that using the --server option manually in this manner is subject
to change, so I can't reasonably expect backward compatibility for an
internal feature.

So it looks like I should update File::RsyncP to send the exclude arguments
through the socket instead of arglist.  Up until 2.6.2 the arglist method
worked fine.

Comment 3 Wayne Davison 2004-08-26 10:43:49 UTC
(In reply to comment #2)
> This is the way BackupPC (using File::RsyncP) invokes the client side
> of rsync.

OK.  My earlier choice to get rid of the server-side support for these options
was because the --include-from/--exclude-from options needed  little more
security and I didn't know that some non-standard setup was using them.  I've
changed the code to allow them again, and added the extra security check needed.
Comment 4 Craig Barratt 2004-08-26 20:34:49 UTC

That's really great.  It's definitely above and beyond the call of
duty to provide backward compatibility for undocumented/unsupported

I really appreciate your efforts.

I will still go ahead and provide correct support for excludes via
the socket interface, but decoupling this from the 2.6.3 release is
a huge help.