Matt's --copy-devices patch.
[rsync/rsync-patches.git] / checksum-xattr.diff
index 24c4de4..b8c6b81 100644 (file)
@@ -155,48 +155,25 @@ To use this patch, run these commands for a successful build:
 +}
 --- old/xattrs.c
 +++ new/xattrs.c
-@@ -31,6 +31,8 @@ extern int am_generator;
- extern int read_only;
+@@ -32,6 +32,8 @@ extern int read_only;
  extern int list_only;
+ extern int preserve_xattrs;
  extern int checksum_seed;
 +extern int checksum_len;
 +extern int protocol_version;
  
  #define RSYNC_XAL_INITIAL 5
  #define RSYNC_XAL_LIST_INITIAL 100
-@@ -62,7 +64,8 @@ extern int checksum_seed;
+@@ -63,6 +65,8 @@ extern int checksum_seed;
  #define RPRE_LEN ((int)sizeof RSYNC_PREFIX - 1)
  
  #define XSTAT_ATTR RSYNC_PREFIX "%stat"
--#define XSTAT_LEN ((int)sizeof XSTAT_ATTR - 1)
 +#define MD4_ATTR RSYNC_PREFIX "%md4"
 +#define MD5_ATTR RSYNC_PREFIX "%md5"
  
  typedef struct {
        char *datum, *name;
-@@ -223,8 +226,8 @@ static int rsync_xal_get(const char *fna
-                       continue;
- #endif
--              if (am_root < 0 && name_len == XSTAT_LEN + 1
--               && name[RPRE_LEN] == '%' && strcmp(name, XSTAT_ATTR) == 0)
-+              if (name_len > RPRE_LEN && name[RPRE_LEN] == '%'
-+               && HAS_PREFIX(name, RSYNC_PREFIX))
-                       continue;
-               datum_len = name_len; /* Pass extra size to get_xattr_data() */
-@@ -636,8 +639,8 @@ void receive_xattr(struct file_struct *f
-                       continue;
-               }
- #endif
--              if (am_root < 0 && name_len == XSTAT_LEN + 1
--               && name[RPRE_LEN] == '%' && strcmp(name, XSTAT_ATTR) == 0) {
-+              if (name_len > RPRE_LEN && name[RPRE_LEN] == '%'
-+               && HAS_PREFIX(name, RSYNC_PREFIX)) {
-                       free(ptr);
-                       continue;
-               }
-@@ -795,6 +798,39 @@ int set_xattr(const char *fname, const s
+@@ -797,6 +801,39 @@ int set_xattr(const char *fname, const s
        return rsync_xal_set(fname, lst + ndx, fnamecmp, sxp);
  }