- rxas->name = ptr + datum_len;
- rxas->datum = ptr;
-@@ -263,7 +279,10 @@ void send_xattr(statx *sxp, int f)
- #else
- /* We strip the rsync prefix from disguised namespaces
- * and put everything else in the user namespace. */
-- if (HAS_PREFIX(rxa->name, RSYNC_PREFIX)) {
-+ if (HAS_PREFIX(rxa->name, RSYNC_PREFIX)
-+ && (am_root < 0 || rxa->name_len != XSTAT_LEN + 1
-+ || rxa->name[CENT_POS] != '%'
-+ || strcmp(rxa->name, XSTAT_ATTR) != 0)) {
- write_int(f, rxa->name_len - RPRE_LEN);
- write_int(f, rxa->datum_len);
- write_buf(f, rxa->name + RPRE_LEN, rxa->name_len - RPRE_LEN);
-@@ -298,10 +317,8 @@ void receive_xattr(struct file_struct *f
- size_t name_len = read_int(f);
- size_t datum_len = read_int(f);
- size_t extra_len = am_root < 0 ? RPRE_LEN : 0;
--#ifndef HAVE_LINUX_XATTRS
- if (datum_len + extra_len < datum_len)
- out_of_memory("receive_xattr"); /* overflow */
+ rxas->name = ptr + name_offset;
+ memcpy(rxas->name, name, name_len);
+@@ -576,13 +593,9 @@ void receive_xattr(struct file_struct *f
+ size_t name_len = read_abbrevint(f);
+ size_t datum_len = read_abbrevint(f);
+ size_t dget_len = datum_len > MAX_FULL_DATUM ? 1 + MAX_DIGEST_LEN : datum_len;
+-#ifdef HAVE_LINUX_XATTRS
+- size_t extra_len = 0;
+-#else
+- size_t extra_len = am_root ? RPRE_LEN : 0;
++ size_t extra_len = MIGHT_NEED_RPRE ? RPRE_LEN : 0;
+ if (dget_len + extra_len < dget_len)
+ out_of_memory("receive_xattr"); /* overflow */