When deleting extraneous xattrs, never delete items from the system
authorWayne Davison <wayned@samba.org>
Sat, 10 Mar 2007 01:20:26 +0000 (01:20 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 10 Mar 2007 01:20:26 +0000 (01:20 +0000)
namespace.  Furthermore, for a non-root user, ignore any non-user
namespace items.

xattrs.diff

index e8a53f7..d2b4533 100644 (file)
@@ -564,7 +564,7 @@ TODO:
  transfer.  The resulting value is treated as though it was the permissions
 --- old/xattr.c
 +++ new/xattr.c
-@@ -0,0 +1,451 @@
+@@ -0,0 +1,459 @@
 +/*
 + * Extended Attribute support for rsync.
 + * Written by Jay Fenlason, vaguely based on the ACLs patch.
@@ -979,6 +979,14 @@ TODO:
 +              name_len = strlen(name) + 1;
 +              list_len -= name_len;
 +
++#ifdef HAVE_LINUX_XATTRS
++              /* We always ignore the system namespace, and non-root
++               * ignores everything but the user namespace. */
++              if (am_root ? HAS_PREFIX(name, SYSTEM_PREFIX)
++                          : !HAS_PREFIX(name, USER_PREFIX))
++                      continue;
++#endif
++
 +              for (i = 0; i < xalp->count; i++) {
 +                      if (strcmp(name, rxas[i].name) == 0)
 +                              break;