Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect syncing of file flags during remote rsync by fileflags.diff #7

Open
uroehm opened this issue Feb 12, 2023 · 0 comments
Open

Comments

@uroehm
Copy link

uroehm commented Feb 12, 2023

The --fileflags patch seems to mix-up the copied BSD flags at least during a remote rsync.

In flist.c: While the sender serialises the file's metadata in the order of mode, file flags and then (optionally) atime, the patch reads this serialisation on the receiver side in the wrong order of mode, atime and then flags. This means that in case one uses the corresponding sync option to send atimes for files, the patch interprets the atime value as the BSD flags.

Solution:
In flist.c:recv_file_entry(), move the fileflag receiving code

#ifdef SUPPORT_FILEFLAGS
	if (preserve_fileflags && !(xflags & XMIT_SAME_FLAGS))
		fileflags = (uint32)read_int(f);
#endif

about 15 lines up just after this condition:

	if (!(xflags & XMIT_SAME_MODE))
		mode = from_wire_mode(read_int(f));

Environment: rsync-3.2.7.tar.gz + fileflags patch (rsync-patches-3.2.7.tar.gz, Jan 2023), macOS 12.6, arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant