rsync -a should imply -X

Bug #1785302 reported by Steve Langasek on 2018-08-03
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rsync (Ubuntu)

Bug Description

As discussed at ff, as of Ubuntu 18.04 an Ubuntu root filesystem uses xattrs for storing filesystem capabilities. We should therefore have defaults for our rsync that preserve these attributes without needing to pass additional commandline options.

Currently the rsync -a ("archive") option is documented as preserving symlinks (-l), permissions (-p), modification times (-t), groups (-g), owners (-u), and special files (-D); but not hardlinks (-H), acls (-A), or xattrs (-X). I haven't looked into the reasoning, but I expect it's because the first set of options can be assumed supported on a target POSIX-ish filesystem, and the latter are not guaranteed to be supported on all POSIX-ish filesystems (although POSIX does require hardlink support). On Ubuntu, and on modern Linux generally, it should be safe to assume that any POSIX filesystem currently in use that supports Unix permissions and special files also supports acls and xattrs. (Linux filesystems known to support them: ext4, xfs, jfs, zfs, btrfs.)

Without having looked closely at the implementation, I think a sensible approach on Ubuntu would be:

 - rsync when sending should interpret '-a' to include '-A' and '-X' and send acls and xattrs as part of the stream.
   - if sending to a remote server that doesn't negotiate a protocol high enough to handle acls and xattrs, do not consider this an error.
 - rsync when receiving xattrs and acls appears to already ignore failures to set them, so no changes would be required for compatibility.

tags: added: id-5b64a4089f439b7cfebbbb22
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers