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

--- Comment #1 from Kuba Ober <[email protected]> 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.
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to