Make sure that any weird mode bits (if they exist up beyond the
[rsync/rsync-patches.git] / xattrs.diff
index 6ce2f24..9334471 100644 (file)
@@ -288,7 +288,7 @@ TODO:
  }
 --- old/lib/sysxattr.c
 +++ new/lib/sysxattr.c
-@@ -0,0 +1,136 @@
+@@ -0,0 +1,135 @@
 +/*
 + * Extended attribute support for rsync.
 + *
@@ -403,7 +403,7 @@ TODO:
 +       * terminator.  We need to change this into a series of null-terminted
 +       * strings.  Since the size is the same, we can simply transform the
 +       * output in place. */
-+      for (off = 0; off < len; ) {
++      for (off = 0; off < len; off += keylen + 1) {
 +              keylen = ((unsigned char*)list)[off];
 +              if (off + keylen >= len) {
 +                      /* Should be impossible, but kernel bugs happen! */
@@ -411,8 +411,7 @@ TODO:
 +                      return -1;
 +              }
 +              memmove(list+off, list+off+1, keylen);
-+              off += keylen;
-+              list[off++] = '\0';
++              list[off+keylen] = '\0';
 +      }
 +
 +      return len;