Bug 5356 - SELinux extended attributes incompatibility: Linux kernel 2.6.9 and 2.6.18
Summary: SELinux extended attributes incompatibility: Linux kernel 2.6.9 and 2.6.18
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.0
Hardware: x64 Linux
: P3 major (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
: 6312 (view as bug list)
Depends on:
Reported: 2008-03-27 11:49 UTC by Gino Sammet
Modified: 2009-11-21 00:50 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Gino Sammet 2008-03-27 11:49:11 UTC
"rsync --xattrs" cannot transfer SELinux extended file attributes when rsyncing files between x64 (Intel Xeon) systems running different versions of the Linux kernel -- e.g. source system running kernel 2.6.9, destination system running 2.6.18

Reproduce by:

# rsync --xattrs -zva -e ssh /root/mydir/ remote:/root/mydir
receiving incremental file list
created directory /root/mydir
rsync: rsync_xal_set: lsetxattr(".","security.selinux") failed: Invalid argument (22)


It's possible that the "lsetxattr" failure is caused by a fundamental change in the file system data structures implementing extended SELinux file attributes between Linux kernels 2.6.9 and 2.6.18

On the other hand, it might also be possible that the SELinux structures are actually compatible, and that the above error is just caused by some unsanitized parameter used in some function call...
Comment 1 Wayne Davison 2008-04-01 21:26:24 UTC
Rsync doesn't currently support the weeding out of unwanted xattr names except in very limited circumstances:  if it is running as a non-root user (or with --no-super), then all non user.* names are skipped.  If you're backing up data, you can use --fake-super, which stores all non user.* attributes as specially encoded user.* attributes (using user.rsync.* names).  If you're not backing up data, rsync currently only allows you to transfer non-user xattr data between compatible systems.

No conversion of the xattr values is supported (nor likely ever to be supported).  I'm not sure how compatible se-linux xattr items are across systems, but if they are not portible, there is little that rsync can do about it.  (It can be used to backup the attributes, but not help you make them work on another system.)

See bug 4573 for the enhancement request to allow xattr names to be filtered.
Comment 2 Matt McCutchen 2009-11-21 00:50:22 UTC
*** Bug 6312 has been marked as a duplicate of this bug. ***