Updated patches to work with the current trunk.
[rsync/rsync-patches.git] / xattrs.diff
index 4446c7c..6ec2f0c 100644 (file)
@@ -11,9 +11,10 @@ To use this patch, run these commands for a successful build:
     make
 
 diff --git a/compat.c b/compat.c
+index 1b66069..fb46fa5 100644
 --- a/compat.c
 +++ b/compat.c
-@@ -190,13 +190,6 @@ void setup_protocol(int f_out,int f_in)
+@@ -189,13 +189,6 @@ void setup_protocol(int f_out,int f_in)
        if (protocol_version < 30) {
                if (append_mode == 1)
                        append_mode = 2;
@@ -28,17 +29,18 @@ diff --git a/compat.c b/compat.c
  
        if (delete_mode && !(delete_before+delete_during+delete_after)) {
 diff --git a/xattrs.c b/xattrs.c
+index 2d0e050..b2017ed 100644
 --- a/xattrs.c
 +++ b/xattrs.c
-@@ -21,6 +21,7 @@
+@@ -22,6 +22,7 @@
  #include "rsync.h"
  #include "ifuncs.h"
+ #include "inums.h"
 +#include "io.h"
  #include "lib/sysxattrs.h"
  
  #ifdef SUPPORT_XATTRS
-@@ -33,6 +34,7 @@ extern int read_only;
+@@ -34,6 +35,7 @@ extern int read_only;
  extern int list_only;
  extern int preserve_xattrs;
  extern int checksum_seed;
@@ -46,7 +48,7 @@ diff --git a/xattrs.c b/xattrs.c
  
  #define RSYNC_XAL_INITIAL 5
  #define RSYNC_XAL_LIST_INITIAL 100
-@@ -246,7 +248,7 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+@@ -247,7 +249,7 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
                if (!(ptr = get_xattr_data(fname, name, &datum_len, 0)))
                        return -1;
  
@@ -55,7 +57,7 @@ diff --git a/xattrs.c b/xattrs.c
                        /* For large datums, we store a flag and a checksum. */
                        name_offset = 1 + MAX_DIGEST_LEN;
                        sum_init(checksum_seed);
-@@ -348,7 +350,7 @@ static int find_matching_xattr(item_list *xalp)
+@@ -349,7 +351,7 @@ static int find_matching_xattr(item_list *xalp)
                         || rxas1[j].datum_len != rxas2[j].datum_len
                         || strcmp(rxas1[j].name, rxas2[j].name))
                                break;
@@ -64,7 +66,7 @@ diff --git a/xattrs.c b/xattrs.c
                                if (memcmp(rxas1[j].datum + 1,
                                           rxas2[j].datum + 1,
                                           MAX_DIGEST_LEN) != 0)
-@@ -385,13 +387,22 @@ int send_xattr(stat_x *sxp, int f)
+@@ -386,13 +388,22 @@ int send_xattr(stat_x *sxp, int f)
  {
        int ndx = find_matching_xattr(sxp->xattr);
  
@@ -90,7 +92,7 @@ diff --git a/xattrs.c b/xattrs.c
                for (rxa = sxp->xattr->items; count--; rxa++) {
                        size_t name_len = rxa->name_len;
                        const char *name = rxa->name;
-@@ -410,8 +421,8 @@ int send_xattr(stat_x *sxp, int f)
+@@ -411,8 +422,8 @@ int send_xattr(stat_x *sxp, int f)
                                name_len += UPRE_LEN;
                        }
  #endif
@@ -101,7 +103,7 @@ diff --git a/xattrs.c b/xattrs.c
  #ifndef HAVE_LINUX_XATTRS
                        if (name_len > rxa->name_len) {
                                write_buf(f, USER_PREFIX, UPRE_LEN);
-@@ -419,7 +430,7 @@ int send_xattr(stat_x *sxp, int f)
+@@ -420,7 +431,7 @@ int send_xattr(stat_x *sxp, int f)
                        }
  #endif
                        write_buf(f, name, name_len);
@@ -110,7 +112,7 @@ diff --git a/xattrs.c b/xattrs.c
                                write_buf(f, rxa->datum + 1, MAX_DIGEST_LEN);
                        else
                                write_buf(f, rxa->datum, rxa->datum_len);
-@@ -469,7 +480,7 @@ int xattr_diff(struct file_struct *file, stat_x *sxp, int find_all)
+@@ -470,7 +481,7 @@ int xattr_diff(struct file_struct *file, stat_x *sxp, int find_all)
                cmp = rec_cnt ? strcmp(snd_rxa->name, rec_rxa->name) : -1;
                if (cmp > 0)
                        same = 0;
@@ -119,7 +121,7 @@ diff --git a/xattrs.c b/xattrs.c
                        same = cmp == 0 && snd_rxa->datum_len == rec_rxa->datum_len
                            && memcmp(snd_rxa->datum + 1, rec_rxa->datum + 1,
                                      MAX_DIGEST_LEN) == 0;
-@@ -514,6 +525,9 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
+@@ -515,6 +526,9 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
        int cnt, prior_req = 0;
        rsync_xa *rxa;
  
@@ -129,7 +131,7 @@ diff --git a/xattrs.c b/xattrs.c
        lst += F_XATTR(file);
        for (rxa = lst->items, cnt = lst->count; cnt--; rxa++) {
                if (rxa->datum_len <= MAX_FULL_DATUM)
-@@ -570,6 +584,9 @@ int recv_xattr_request(struct file_struct *file, int f_in)
+@@ -571,6 +585,9 @@ int recv_xattr_request(struct file_struct *file, int f_in)
        rsync_xa *rxa;
        int rel_pos, cnt, num, got_xattr_data = 0;
  
@@ -139,7 +141,7 @@ diff --git a/xattrs.c b/xattrs.c
        if (F_XATTR(file) < 0) {
                rprintf(FERROR, "recv_xattr_request: internal data error!\n");
                exit_cleanup(RERR_STREAMIO);
-@@ -632,7 +649,22 @@ void receive_xattr(struct file_struct *file, int f)
+@@ -633,7 +650,22 @@ void receive_xattr(struct file_struct *file, int f)
  #else
        int need_sort = 1;
  #endif
@@ -163,7 +165,7 @@ diff --git a/xattrs.c b/xattrs.c
  
        if (ndx < 0 || (size_t)ndx > rsync_xal_l.count) {
                rprintf(FERROR, "receive_xattr: xa index %d out of"
-@@ -645,7 +677,7 @@ void receive_xattr(struct file_struct *file, int f)
+@@ -646,7 +678,7 @@ void receive_xattr(struct file_struct *file, int f)
                return;
        }
        
@@ -172,7 +174,7 @@ diff --git a/xattrs.c b/xattrs.c
                (void)EXPAND_ITEM_LIST(&temp_xattr, rsync_xa, count);
                temp_xattr.count = 0;
        }
-@@ -653,9 +685,10 @@ void receive_xattr(struct file_struct *file, int f)
+@@ -654,9 +686,10 @@ void receive_xattr(struct file_struct *file, int f)
        for (num = 1; num <= count; num++) {
                char *ptr, *name;
                rsync_xa *rxa;