[Bug 9594] Error transferring user and non-user xattr using --fake-super under Linux

samba-bugs at samba.org samba-bugs at samba.org
Tue Apr 29 19:20:40 MDT 2014


https://bugzilla.samba.org/show_bug.cgi?id=9594

--- Comment #1 from Kuba Ober <kuba at mareimbrium.org> 2014-04-30 01:20:39 UTC ---
I can reproduce under 3.1.1pre1. The cause of the problem is as follows:

Note that the rsync_xa list items contain the xattr name and value *but also*
an attribute *index* (num!). 

1. The sender is sorting the rsync_xa list alphabetically on the xattr name in
rsync_xal_get. The attribute indices (num members) are set *after this sort*.

2. The receiver then proceeds to append RSYNC_PREFIX ("user.rsync.") to the
xattr name in receive_xattr, and resorts the list. Now the attribute indices do
not match the list order.

3. The receiver then proceeds to iterate through this list in
recv_xattr_request with the assumption that the 
num indices are ascending within the list. The lexicographic sort performed in
step 2 above breaks this assumption.

Since I don't understand why the list needs to be lexicographically sorted at
all, I don't know which of the two fixes below would be desirable: 

Fix 1: Don't sort the list in receive_xattr iff HAVE_LINUX_XATTR is defined.
Fix 2: Don't assume that the list indices are sorted in recv_xattr_request. The
change would be from

while (cnt && rxa->num < num) {

to

while (cnt && rxa->num != num) {

Cheers, Kuba

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the rsync mailing list