Bug 7109 - Need to define NO_SYMLINK_XATTRS on Linux
Need to define NO_SYMLINK_XATTRS on Linux
Status: RESOLVED FIXED
Product: rsync
Classification: Unclassified
Component: core
3.1.0
All Linux
: P3 major
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-07 19:00 UTC by Matt McCutchen
Modified: 2011-06-18 20:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt McCutchen 2010-02-07 19:00:43 UTC
NO_SYMLINK_XATTRS needs to be defined on Linux.  See:

http://git.savannah.gnu.org/cgit/attr.git/tree/man/man5/attr.5?id=1cc88bd4c17ef99ace22c8be362d513f155b1387#n116

It would be nice to have a portable configure test rather than hard-coding the value for each OS.  Unfortunately, the test may need to use the abstraction layer in lib/sysxattrs.c, which would not be available at configure time without special tricks.
Comment 1 Matt McCutchen 2010-02-07 19:01:10 UTC
Fixing typo in summary.
Comment 2 Wayne Davison 2010-12-19 11:05:42 UTC
Yeah, it would be nice to figure this out instead of hard-wiring it, but we'll just hard-wire it for now.

Eventually rsync may need to behave differently depending on the filesystem, but we won't worry about that yet.
Comment 3 Wayne Davison 2011-06-04 23:57:49 UTC
Since the read function doesn't generate an error, it shouod be fine to just let any attempt to set user xattrs on a symlink generate an error.  Is there anything I'm missing?
Comment 4 Matt McCutchen 2011-06-05 00:48:12 UTC
(In reply to comment #3)
> Since the read function doesn't generate an error, it shouod be fine to just
> let any attempt to set user xattrs on a symlink generate an error.  Is there
> anything I'm missing?

Yes: bug 7110.  NO_SYMLINK_XATTRS is needed to trigger the code path that converts the symlink to a regular file to be able to set the fake-super xattr.  Without it, rsync will try to set the xattr on the symlink, generating an EPERM which is swallowed by a test you apparently wrote to allow fake-super to work on a best-effort basis before the introduction of the NO_SYMLINK_XATTRS switch.

So, you can either detect the EPERM and convert the symlink to a regular file then, or have a separate NO_SYMLINK_USER_XATTRS switch.  But either way, the EPERM test should go now that it is masking a failure that rsync is supposed to be able to avoid.
Comment 5 Wayne Davison 2011-06-18 18:28:22 UTC
Will be fixed in 3.1.0.
Comment 6 Matt McCutchen 2011-06-18 18:55:21 UTC
do_readlink needs to use the same condition as do_symlink.
Comment 7 Wayne Davison 2011-06-18 20:44:01 UTC
Thanks -- I missed the other 2 #if changes.  Fixed now.