Skip to content

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

@uroehm

Description

@uroehm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions