The patches for 3.0.9.
[rsync.git/patches.git] / checksum-xattr.diff
index 53d1319d2c0c3c1d544b832c34056a2f451d4927..e6e3d353768662d8b9c71df6fc5b9fac5fe2aabb 100644 (file)
@@ -8,10 +8,11 @@ To use this patch, run these commands for a successful build:
     ./configure                               (optional if already run)
     make
 
+based-on: 40afd365cc8ca968fd16e161d24df5b8a8a520cc
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -1250,7 +1250,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1298,7 +1298,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                memcpy(bp + basename_len, linkname, linkname_len);
  #endif
  
@@ -24,7 +25,7 @@ diff --git a/flist.c b/flist.c
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
-@@ -721,7 +721,8 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
+@@ -758,7 +758,8 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
           of the file time to determine whether to sync */
        if (always_checksum > 0 && S_ISREG(st->st_mode)) {
                char sum[MAX_DIGEST_LEN];
@@ -38,9 +39,10 @@ diff --git a/support/xsums b/support/xsums
 new file mode 100644
 --- /dev/null
 +++ b/support/xsums
-@@ -0,0 +1,118 @@
-+#!/usr/bin/perl -w
+@@ -0,0 +1,119 @@
++#!/usr/bin/perl
 +use strict;
++use warnings;
 +
 +use Getopt::Long;
 +use Cwd qw(abs_path cwd);
@@ -160,16 +162,16 @@ new file mode 100644
 diff --git a/xattrs.c b/xattrs.c
 --- a/xattrs.c
 +++ b/xattrs.c
-@@ -33,6 +33,8 @@ extern int read_only;
- extern int list_only;
- extern int preserve_xattrs;
+@@ -36,6 +36,8 @@ extern int preserve_links;
+ extern int preserve_devices;
+ extern int preserve_specials;
  extern int checksum_seed;
 +extern int checksum_len;
 +extern int protocol_version;
  
  #define RSYNC_XAL_INITIAL 5
  #define RSYNC_XAL_LIST_INITIAL 100
-@@ -68,6 +70,10 @@ extern int checksum_seed;
+@@ -71,6 +73,10 @@ extern int checksum_seed;
  #define XACC_ACL_ATTR RSYNC_PREFIX "%" XACC_ACL_SUFFIX
  #define XDEF_ACL_SUFFIX "dacl"
  #define XDEF_ACL_ATTR RSYNC_PREFIX "%" XDEF_ACL_SUFFIX
@@ -180,7 +182,7 @@ diff --git a/xattrs.c b/xattrs.c
  
  typedef struct {
        char *datum, *name;
-@@ -238,7 +244,9 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+@@ -246,7 +252,9 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
                         || (am_root < 0
                          && (strcmp(name+RPRE_LEN+1, XSTAT_SUFFIX) == 0
                           || strcmp(name+RPRE_LEN+1, XACC_ACL_SUFFIX) == 0
@@ -191,7 +193,7 @@ diff --git a/xattrs.c b/xattrs.c
                                continue;
                }
  
-@@ -891,6 +899,39 @@ int del_def_xattr_acl(const char *fname)
+@@ -956,6 +964,39 @@ int del_def_xattr_acl(const char *fname)
  }
  #endif
  
@@ -202,7 +204,7 @@ diff --git a/xattrs.c b/xattrs.c
 +      char buf[256];
 +      uint32 file_length, mtime;
 +      int len;
-+      
++
 +      len = sys_lgetxattr(fname, mdattr, buf, sizeof buf);
 +      if (len < 0) {
 +              if (errno == ENOTSUP || errno == ENOATTR)