Bug 2125311

Summary: rsync-daemon fail on 3.1.3
Product: Red Hat Enterprise Linux 8 Reporter: cstackpole
Component: rsyncAssignee: Michal Ruprich <mruprich>
Status: CLOSED ERRATA QA Contact: Ondrej Mejzlik <omejzlik>
Severity: medium Docs Contact:
Priority: urgent    
Version: 8.6CC: bugproxy, fkrska, mruprich, neil, omejzlik, pasik
Target Milestone: rcKeywords: Reproducer, Triaged, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: rsync-3.1.3-19.el8_7.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2139118 2139119 (view as bug list) Environment:
Last Closed: 2023-01-26 09:20:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2139118, 2139119    

Description cstackpole 2022-09-08 15:10:44 UTC
Description of problem:
rsync-daemon-3.1.3-14.el8_6.3.noarch.rpm has an issue with the --delete option and the --filter option when used at the same time. This doesn't seem to be an issue with the client, just the rsync daemon on the server side.

Version-Release number of selected component (if applicable):

Red Hat Enterprise Linux release 8.6 (Ootpa)
rsync-daemon-3.1.3-14.el8_6.3.noarch.rpm


How reproducible: Every time we've tested on every host we've tested.


Steps to Reproduce:
1. Install rsync-daemon-3.1.3-14.el8_6.3 on server (192.168.1.1)
2. From a client, run this: /usr/bin/rsync -a --delete --filter '-x system.*' / 192.168.1.1::some/test/dir/

Actual results:

ERROR: rejecting excluded file-list name: etc/X11/mwm/system.mwmrc
rsync error: protocol incompatibility (code 2) at flist.c(912) [receiver=3.1.3]
rsync error: protocol incompatibility (code 2) at io.c(1649) [generator=3.1.3]

Removing either --delete or --filter and rsync runs. (You can add other flags too, I just simplified it as much as possible for bug report.) And it doesn't matter the file. Remove system.mwmrc and it will fail on the very next matching file.

Expected results:

It should work without error.

Additional info:

On the server run this: dnf downgrade rsync-daemon-3.1.3-14.el8_6.2

And watch it work. Upgrade to rsync-daemon-3.1.3-14.el8_6.3 and watch it fail. Client version doesn't seem to matter.

This seems relevant to me:
https://download.samba.org/pub/rsync/NEWS#3.1.3

2021-09-27 - Tomas Korbar <tkorbar> - 3.1.3-13
- Resolves: #1907443 - Read-only files that have changed xattrs fail to allow xattr changes

This is a big deal for us, but with a downgrade to an older version as a workaround we will be fine for a while so I marked as medium severity. Feel free to adjust. :-)

Thanks!

Comment 1 cstackpole 2022-09-08 15:14:23 UTC
Seems this might be the upstream for the breaking patch (simply trying to add relevant information):
https://github.com/WayneD/rsync/issues/208

Comment 2 Michal Ruprich 2022-09-08 16:49:22 UTC
Hi,

thanks for the bug report. This is most probably a result of a fix for a recent CVE. Can you please try to run you command with --old-args option? It should be a workaround for these issues.

Thanks and regards,
Michal

Comment 3 cstackpole 2022-09-08 17:06:03 UTC
Greetings,
Adding `--old-args` after the `-a` flag did not make a difference.
Thanks!

Comment 4 Michal Ruprich 2022-09-08 20:02:04 UTC
Thanks,

can you please try this test package please:

https://people.redhat.com/mruprich/rsync-3.1.3-14.el8_6.4.x86_64.rpm
https://people.redhat.com/mruprich/rsync-daemon-3.1.3-14.el8_6.4.noarch.rpm

These contain some possible fixes from the Upstream.

Thanks,
Michal

Comment 5 cstackpole 2022-09-08 20:33:53 UTC
Sorry. No go. Same error. I updated both server and client.
Thanks!

Comment 6 Michal Ruprich 2022-10-21 12:37:43 UTC
Hi,
sorry for longer absence here, can you please try this update? This helped me in RHEL7 with the same issue:

https://people.redhat.com/mruprich/rsync-daemon-3.1.3-14.el8_6.5.noarch.rpm
https://people.redhat.com/mruprich/rsync-3.1.3-14.el8_6.5.x86_64.rpm

Thanks,
Michal

Comment 7 cstackpole 2022-10-21 13:40:07 UTC
Thank you for the update. Unfortunately, exact same error. I updated both server and client.

Comment 8 cstackpole 2022-10-21 13:40:59 UTC
I meant to post this as verification.
$ rpm -q rsync
rsync-3.1.3-14.el8_6.5.x86_64

Comment 9 Michal Ruprich 2022-10-24 12:02:41 UTC
Thanks, I was finally able to reproduce this and it works fine on 3.2.7 version that is currently being released in Fedora. So there is a fix I just need to find it. Thanks for testing, I am going to come up with fix soon.

Comment 12 Michal Ruprich 2022-11-01 09:28:22 UTC
Hi,

I am sorry to bother you with testing, I just want to make sure this works. I was finally able to find what was wrong with the filtering and that it only occurred in the 3.1.3 version of rsync. The -x filter was not properly added as seen with --debug=all4:

...
[client] add_rule(- user.*)
...

This is wrong and should be like this:
...
[client] add_rule(-x user.*)
...

I found a path upstream that fixes this(at least for my reproducer with -x user.* but it should work for your usecase as well).

So hopefully for the last time, I would like to ask you to test this package:
https://people.redhat.com/mruprich/rsync-3.1.3-14.el8_6.6.x86_64.rpm
https://people.redhat.com/mruprich/rsync-daemon-3.1.3-14.el8_6.6.noarch.rpm

Thank you,
Michal

Comment 15 cstackpole 2022-11-01 13:59:00 UTC
Huzzah! It works! Thank you so much for all your time and effort getting this fixed. It helps me out quite a bit. I really appreciate your help Michal!

I will keep an eye out for the 3.1.3-14.el8_6.6 release.
Thanks!

Comment 22 cstackpole 2022-12-23 19:22:51 UTC
Greetings,
We got bit by this again... worse, the migration had already occurred to 8.7 so it made it even more challenging to revert back. Fortunately, I knew where to get the 3.1.3-14.el8_6.2 rpms. Just to see if things were moving along but hadn't landed in RH yet, I pulled rsync-3.1.3-19.el8.1.x86_64 from CentOS 8 Stream. Still same error as before. Which is a shame because I see that it updated earlier this month:
http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/

Any update on when we can get this fix pushed through please? 
Thank you!

Comment 23 cstackpole 2022-12-23 19:31:16 UTC
DAH! I forgot to update the client when I was testing the stream version... I take that back...

rsync-3.1.3-19.el8.1.x86_64 DOES work! Huzzah!

Any idea when that might land in RHEL 8.7?

Thank you so much!

Comment 24 cstackpole 2023-01-05 17:36:15 UTC
Greetings @mruprich ,
It's been a month since you pushed this patch release in Stream:
https://gitlab.com/redhat/centos-stream/rpms/rsync/-/commit/e5461b77ec2fdf84da618afdb9d75ab13af4fa24

Any update on when I can get this on my RHEL 8.7 systems?

Thank you!

Comment 25 Michal Ruprich 2023-01-09 08:50:38 UTC
It should be out within a week or so.

Comment 26 Michal Ruprich 2023-01-26 09:12:52 UTC
*** Bug 2153814 has been marked as a duplicate of this bug. ***

Comment 27 Michal Ruprich 2023-01-26 09:20:15 UTC
This bug should now be fixed by rsync-3.1.3-19.el8_7.1 and rsync-3.1.3-14.el8_6.4. Both of these erratas are shipped. I am closing this issue, feel free to reopen should the problem re-appear.

Comment 28 cstackpole 2023-01-26 14:37:51 UTC
Thanks @mruprich ! We've been testing rsync-3.1.3-19.el8_7.1 this week and things are looking good. Haven't found an issue yet. Thanks for all your help on this! It's much appreciated!

Comment 29 Michal Ruprich 2023-01-26 14:40:44 UTC
Thank you for the patience, this was a weird one to solve. Hopefully this was the last time we saw this error.

Regards,
Michal