Fixed failing hunks.
authorWayne Davison <wayned@samba.org>
Thu, 7 Dec 2006 04:08:04 +0000 (04:08 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 7 Dec 2006 04:08:04 +0000 (04:08 +0000)
acls.diff
source-filter_dest-filter.diff

index 6d40ba3..cdfa331 100644 (file)
--- a/acls.diff
+++ b/acls.diff
@@ -811,7 +811,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +              if (type == SMB_ACL_TYPE_ACCESS)
 +                      F_ACL(file) = ndx;
 +              else
-+                      F_DEFACL(file) = ndx;
++                      F_DEF_ACL(file) = ndx;
 +              racl_list = &default_acl_list;
 +      } while (BUMP_TYPE(type) && S_ISDIR(file->mode));
 +}
@@ -845,7 +845,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +              if (type == SMB_ACL_TYPE_ACCESS)
 +                      F_ACL(file) = ndx;
 +              else
-+                      F_DEFACL(file) = ndx;
++                      F_DEF_ACL(file) = ndx;
 +              racl = sxp->def_acl;
 +              racl_list = &default_acl_list;
 +      } while (BUMP_TYPE(type) && S_ISDIR(sxp->st.st_mode));
@@ -965,7 +965,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +                      eq = sxp->acc_acl
 +                          && rsync_acl_equal_enough(sxp->acc_acl, &duo_item->racl, file->mode);
 +              } else {
-+                      ndx = F_DEFACL(file);
++                      ndx = F_DEF_ACL(file);
 +                      if (ndx < 0 || (size_t)ndx >= default_acl_list.count)
 +                              continue;
 +                      duo_item = default_acl_list.items;
@@ -1212,7 +1212,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        /* Check to see if this is a device file, or link */
        if ((am_root && preserve_devices && IS_DEVICE(file->mode))
         || (preserve_specials && IS_SPECIAL(file->mode))) {
-@@ -259,7 +280,7 @@ static int keep_backup(const char *fname
+@@ -260,7 +281,7 @@ static int keep_backup(const char *fname
                if (robust_move(fname, buf) != 0) {
                        rsyserr(FERROR, errno, "keep_backup failed: %s -> \"%s\"",
                                full_fname(fname), buf);
@@ -1346,7 +1346,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        if (always_checksum && S_ISREG(mode))
                extra_len += SUM_EXTRA_CNT * EXTRA_LEN;
  
-@@ -732,6 +741,11 @@ static struct file_struct *recv_file_ent
+@@ -733,6 +742,11 @@ static struct file_struct *recv_file_ent
                read_buf(f, bp, checksum_len);
        }
  
@@ -1358,7 +1358,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        return file;
  }
  
-@@ -992,6 +1006,9 @@ static struct file_struct *send_file_nam
+@@ -993,6 +1007,9 @@ static struct file_struct *send_file_nam
                                          unsigned short flags)
  {
        struct file_struct *file;
@@ -1368,7 +1368,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  
        file = make_file(fname, flist, stp, flags,
                         f == -2 ? SERVER_FILTERS : ALL_FILTERS);
-@@ -1001,11 +1018,24 @@ static struct file_struct *send_file_nam
+@@ -1002,11 +1019,24 @@ static struct file_struct *send_file_nam
        if (chmod_modes && !S_ISLNK(file->mode))
                file->mode = tweak_mode(file->mode, chmod_modes);
  
@@ -1411,7 +1411,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  extern char *backup_dir;
  extern char *backup_suffix;
  extern int backup_suffix_len;
-@@ -445,22 +447,27 @@ static void do_delete_pass(struct file_l
+@@ -446,22 +448,27 @@ static void do_delete_pass(struct file_l
                rprintf(FINFO, "                    \r");
  }
  
@@ -1444,7 +1444,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
             int32 iflags, uchar fnamecmp_type, const char *xname)
  {
        if (statret >= 0) { /* A from-dest-dir statret can == 1! */
-@@ -468,20 +475,24 @@ void itemize(struct file_struct *file, i
+@@ -469,20 +476,24 @@ void itemize(struct file_struct *file, i
                    : S_ISDIR(file->mode) ? !omit_dir_times
                    : !S_ISLNK(file->mode);
  
@@ -1474,7 +1474,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        } else
                iflags |= ITEM_IS_NEW;
  
-@@ -733,7 +744,7 @@ void check_for_finished_hlinks(int itemi
+@@ -736,7 +747,7 @@ void check_for_finished_hlinks(int itemi
   * handling the file, -1 if no dest-linking occurred, or a non-negative
   * value if we found an alternate basis file. */
  static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
@@ -1483,7 +1483,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                         int maybe_ATTRS_REPORT, enum logcode code)
  {
        int best_match = -1;
-@@ -742,7 +753,7 @@ static int try_dests_reg(struct file_str
+@@ -745,7 +756,7 @@ static int try_dests_reg(struct file_str
  
        do {
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1492,7 +1492,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        continue;
                switch (match_level) {
                case 0:
-@@ -750,16 +761,20 @@ static int try_dests_reg(struct file_str
+@@ -753,16 +764,20 @@ static int try_dests_reg(struct file_str
                        match_level = 1;
                        /* FALL THROUGH */
                case 1:
@@ -1516,7 +1516,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                continue;
                        best_match = j;
                        match_level = 3;
-@@ -774,7 +789,7 @@ static int try_dests_reg(struct file_str
+@@ -777,7 +792,7 @@ static int try_dests_reg(struct file_str
        if (j != best_match) {
                j = best_match;
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1525,7 +1525,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        return -1;
        }
  
-@@ -782,15 +797,20 @@ static int try_dests_reg(struct file_str
+@@ -785,15 +800,20 @@ static int try_dests_reg(struct file_str
  #ifdef SUPPORT_HARD_LINKS
                if (link_dest) {
                        int i = itemizing && (verbose > 1 || stdout_format_has_i > 1);
@@ -1549,7 +1549,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                if (verbose > 1 && maybe_ATTRS_REPORT) {
                        rprintf(FCLIENT, "%s is uptodate\n", fname);
                }
-@@ -806,8 +826,13 @@ static int try_dests_reg(struct file_str
+@@ -809,8 +829,13 @@ static int try_dests_reg(struct file_str
                        }
                        return -1;
                }
@@ -1565,7 +1565,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                set_file_attrs(fname, file, NULL, 0);
                if (maybe_ATTRS_REPORT
                 && ((!itemizing && verbose && match_level == 2)
-@@ -828,7 +853,7 @@ static int try_dests_reg(struct file_str
+@@ -833,7 +858,7 @@ static int try_dests_reg(struct file_str
   * handling the file, or -1 if no dest-linking occurred, or a non-negative
   * value if we found an alternate basis file. */
  static int try_dests_non(struct file_struct *file, char *fname, int ndx,
@@ -1574,7 +1574,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                         int maybe_ATTRS_REPORT, enum logcode code)
  {
        char lnk[MAXPATHLEN];
-@@ -860,24 +885,24 @@ static int try_dests_non(struct file_str
+@@ -866,24 +891,24 @@ static int try_dests_non(struct file_str
  
        do {
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1604,16 +1604,16 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                continue;
                        break;
  #endif
-@@ -891,7 +916,7 @@ static int try_dests_non(struct file_str
-                       break;
+@@ -898,7 +923,7 @@ static int try_dests_non(struct file_str
                case TYPE_SPECIAL:
                case TYPE_DEVICE:
--                      if (stp->st_rdev != MAKEDEV(F_DMAJOR(file), F_DMINOR(file)))
-+                      if (sxp->st.st_rdev != MAKEDEV(F_DMAJOR(file), F_DMINOR(file)))
+                       devp = F_RDEV_P(file);
+-                      if (stp->st_rdev != MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp)))
++                      if (sxp->st.st_rdev != MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp)))
                                continue;
                        break;
  #ifdef SUPPORT_LINKS
-@@ -908,7 +933,11 @@ static int try_dests_non(struct file_str
+@@ -915,7 +940,11 @@ static int try_dests_non(struct file_str
                        match_level = 2;
                        best_match = j;
                }
@@ -1626,7 +1626,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        match_level = 3;
                        best_match = j;
                        break;
-@@ -921,7 +950,7 @@ static int try_dests_non(struct file_str
+@@ -928,7 +957,7 @@ static int try_dests_non(struct file_str
        if (j != best_match) {
                j = best_match;
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1635,7 +1635,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        return -1;
        }
  
-@@ -952,7 +981,15 @@ static int try_dests_non(struct file_str
+@@ -959,7 +988,15 @@ static int try_dests_non(struct file_str
                            : ITEM_LOCAL_CHANGE
                             + (match_level == 3 ? ITEM_XNAME_FOLLOWS : 0);
                        char *lp = match_level == 3 ? "" : NULL;
@@ -1652,7 +1652,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                if (verbose > 1 && maybe_ATTRS_REPORT) {
                        rprintf(FCLIENT, "%s%s is uptodate\n",
-@@ -965,6 +1002,7 @@ static int try_dests_non(struct file_str
+@@ -972,6 +1009,7 @@ static int try_dests_non(struct file_str
  }
  
  static int phase = 0;
@@ -1660,7 +1660,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  
  /* Acts on the_file_list->file's ndx'th item, whose name is fname.  If a dir,
   * make sure it exists, and has the right permissions/timestamp info.  For
-@@ -986,7 +1024,8 @@ static void recv_generator(char *fname, 
+@@ -993,7 +1031,8 @@ static void recv_generator(char *fname, 
        static int need_fuzzy_dirlist = 0;
        struct file_struct *fuzzy_file = NULL;
        int fd = -1, f_copy = -1;
@@ -1670,7 +1670,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        struct file_struct *back_file = NULL;
        int statret, real_ret, stat_errno;
        char *fnamecmp, *partialptr, *backupptr = NULL;
-@@ -1042,6 +1081,9 @@ static void recv_generator(char *fname, 
+@@ -1049,6 +1088,9 @@ static void recv_generator(char *fname, 
                } else if (!dry_run)
                        return;
        }
@@ -1680,7 +1680,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        if (dry_run > 1) {
                statret = -1;
                stat_errno = ENOENT;
-@@ -1049,7 +1091,7 @@ static void recv_generator(char *fname, 
+@@ -1056,7 +1098,7 @@ static void recv_generator(char *fname, 
                const char *dn = file->dirname ? file->dirname : ".";
                if (parent_dirname != dn && strcmp(parent_dirname, dn) != 0) {
                        if (relative_paths && !implied_dirs
@@ -1689,7 +1689,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                         && create_directory_path(fname) < 0) {
                                rsyserr(FERROR, errno,
                                        "recv_generator: mkdir %s failed",
-@@ -1061,6 +1103,10 @@ static void recv_generator(char *fname, 
+@@ -1068,6 +1110,10 @@ static void recv_generator(char *fname, 
                        }
                        if (fuzzy_basis)
                                need_fuzzy_dirlist = 1;
@@ -1700,7 +1700,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                parent_dirname = dn;
  
-@@ -1070,7 +1116,7 @@ static void recv_generator(char *fname, 
+@@ -1077,7 +1123,7 @@ static void recv_generator(char *fname, 
                        need_fuzzy_dirlist = 0;
                }
  
@@ -1709,7 +1709,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                    keep_dirlinks && S_ISDIR(file->mode));
                stat_errno = errno;
        }
-@@ -1088,8 +1134,9 @@ static void recv_generator(char *fname, 
+@@ -1095,8 +1141,9 @@ static void recv_generator(char *fname, 
         * mode based on the local permissions and some heuristics. */
        if (!preserve_perms) {
                int exists = statret == 0
@@ -1721,7 +1721,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (S_ISDIR(file->mode)) {
-@@ -1098,8 +1145,8 @@ static void recv_generator(char *fname, 
+@@ -1105,8 +1152,8 @@ static void recv_generator(char *fname, 
                 * file of that name and it is *not* a directory, then
                 * we need to delete it.  If it doesn't exist, then
                 * (perhaps recursively) create it. */
@@ -1732,7 +1732,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                return;
                        statret = -1;
                }
-@@ -1108,14 +1155,14 @@ static void recv_generator(char *fname, 
+@@ -1115,14 +1162,14 @@ static void recv_generator(char *fname, 
                        dry_run++;
                }
                real_ret = statret;
@@ -1749,7 +1749,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                              itemizing, maybe_ATTRS_REPORT, code);
                        if (j == -2) {
                                itemizing = 0;
-@@ -1124,7 +1171,11 @@ static void recv_generator(char *fname, 
+@@ -1131,7 +1178,11 @@ static void recv_generator(char *fname, 
                                statret = 1;
                }
                if (itemizing && f_out != -1) {
@@ -1762,7 +1762,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                statret ? ITEM_LOCAL_CHANGE : 0, 0, NULL);
                }
                if (real_ret != 0 && do_mkdir(fname,file->mode) < 0 && errno != EEXIST) {
-@@ -1144,21 +1195,21 @@ static void recv_generator(char *fname, 
+@@ -1151,22 +1202,22 @@ static void recv_generator(char *fname, 
                                return;
                        }
                }
@@ -1781,16 +1781,17 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +              goto cleanup;
        }
  
+ #ifdef SUPPORT_HARD_LINKS
        if (preserve_hard_links && F_IS_HLINKED(file)
 -          && hard_link_check(file, ndx, fname, statret, &st,
 +          && hard_link_check(file, ndx, fname, statret, &sx,
                               itemizing, code, HL_CHECK_MASTER))
 -              return;
 +              goto cleanup;
+ #endif
  
        if (preserve_links && S_ISLNK(file->mode)) {
- #ifdef SUPPORT_LINKS
-@@ -1177,14 +1228,14 @@ static void recv_generator(char *fname, 
+@@ -1186,14 +1237,14 @@ static void recv_generator(char *fname, 
                        char lnk[MAXPATHLEN];
                        int len;
  
@@ -1805,10 +1806,10 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 -                              set_file_attrs(fname, file, &st, maybe_ATTRS_REPORT);
 +                                      itemize(file, ndx, 0, &sx, 0, 0, NULL);
 +                              set_file_attrs(fname, file, &sx, maybe_ATTRS_REPORT);
+ #ifdef SUPPORT_HARD_LINKS
                                if (preserve_hard_links && F_IS_HLINKED(file))
                                        hard_link_cluster(file, ndx, itemizing, code, -1);
-                               if (remove_source_files == 1)
-@@ -1193,10 +1244,10 @@ static void recv_generator(char *fname, 
+@@ -1204,10 +1255,10 @@ static void recv_generator(char *fname, 
                        }
                        /* Not the right symlink (or not a symlink), so
                         * delete it. */
@@ -1821,16 +1822,16 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                              itemizing, maybe_ATTRS_REPORT, code);
                        if (j == -2) {
  #ifndef CAN_HARDLINK_SYMLINK
-@@ -1212,7 +1263,7 @@ static void recv_generator(char *fname, 
-                               statret = 1;
+@@ -1224,7 +1275,7 @@ static void recv_generator(char *fname, 
                }
+ #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && F_IS_HLINKED(file)
 -                  && hard_link_check(file, ndx, fname, -1, &st,
 +                  && hard_link_check(file, ndx, fname, -1, &sx,
                                       itemizing, code, HL_SKIP))
                        return;
-               if (do_symlink(sl, fname) != 0) {
-@@ -1221,7 +1272,7 @@ static void recv_generator(char *fname, 
+ #endif
+@@ -1234,7 +1285,7 @@ static void recv_generator(char *fname, 
                } else {
                        set_file_attrs(fname, file, NULL, 0);
                        if (itemizing) {
@@ -1839,7 +1840,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                        ITEM_LOCAL_CHANGE, 0, NULL);
                        }
                        if (code != FNONE && verbose)
-@@ -1244,31 +1295,36 @@ static void recv_generator(char *fname, 
+@@ -1260,33 +1311,38 @@ static void recv_generator(char *fname, 
                if (statret == 0) {
                        char *t;
                        if (IS_DEVICE(file->mode)) {
@@ -1870,8 +1871,10 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +                                      itemize(file, ndx, 0, &sx, 0, 0, NULL);
 +                              }
 +                              set_file_attrs(fname, file, &sx, maybe_ATTRS_REPORT);
+ #ifdef SUPPORT_HARD_LINKS
                                if (preserve_hard_links && F_IS_HLINKED(file))
                                        hard_link_cluster(file, ndx, itemizing, code, -1);
+ #endif
                                if (remove_source_files == 1)
                                        goto return_with_success;
 -                              return;
@@ -1886,16 +1889,16 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                              itemizing, maybe_ATTRS_REPORT, code);
                        if (j == -2) {
  #ifndef CAN_HARDLINK_SPECIAL
-@@ -1284,7 +1340,7 @@ static void recv_generator(char *fname, 
-                               statret = 1;
+@@ -1303,7 +1359,7 @@ static void recv_generator(char *fname, 
                }
+ #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && F_IS_HLINKED(file)
 -                  && hard_link_check(file, ndx, fname, -1, &st,
 +                  && hard_link_check(file, ndx, fname, -1, &sx,
                                       itemizing, code, HL_SKIP))
                        return;
-               if (verbose > 2) {
-@@ -1297,7 +1353,11 @@ static void recv_generator(char *fname, 
+ #endif
+@@ -1318,7 +1374,11 @@ static void recv_generator(char *fname, 
                } else {
                        set_file_attrs(fname, file, NULL, 0);
                        if (itemizing) {
@@ -1908,7 +1911,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                        ITEM_LOCAL_CHANGE, 0, NULL);
                        }
                        if (code != FNONE && verbose)
-@@ -1307,7 +1367,7 @@ static void recv_generator(char *fname, 
+@@ -1330,7 +1390,7 @@ static void recv_generator(char *fname, 
                        if (remove_source_files == 1)
                                goto return_with_success;
                }
@@ -1917,7 +1920,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (!S_ISREG(file->mode)) {
-@@ -1341,7 +1401,7 @@ static void recv_generator(char *fname, 
+@@ -1364,7 +1424,7 @@ static void recv_generator(char *fname, 
        }
  
        if (update_only && statret == 0
@@ -1926,7 +1929,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                if (verbose > 1)
                        rprintf(FINFO, "%s is newer\n", fname);
                return;
-@@ -1350,20 +1410,20 @@ static void recv_generator(char *fname, 
+@@ -1373,20 +1433,20 @@ static void recv_generator(char *fname, 
        fnamecmp = fname;
        fnamecmp_type = FNAMECMP_FNAME;
  
@@ -1951,7 +1954,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                if (j >= 0) {
                        fnamecmp = fnamecmpbuf;
-@@ -1373,7 +1433,7 @@ static void recv_generator(char *fname, 
+@@ -1396,7 +1456,7 @@ static void recv_generator(char *fname, 
        }
  
        real_ret = statret;
@@ -1960,7 +1963,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  
        if (partial_dir && (partialptr = partial_dir_fname(fname)) != NULL
            && link_stat(partialptr, &partial_st, 0) == 0
-@@ -1392,7 +1452,7 @@ static void recv_generator(char *fname, 
+@@ -1415,7 +1475,7 @@ static void recv_generator(char *fname, 
                                rprintf(FINFO, "fuzzy basis selected for %s: %s\n",
                                        fname, fnamecmpbuf);
                        }
@@ -1969,16 +1972,16 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        statret = 0;
                        fnamecmp = fnamecmpbuf;
                        fnamecmp_type = FNAMECMP_FUZZY;
-@@ -1401,7 +1461,7 @@ static void recv_generator(char *fname, 
+@@ -1425,7 +1485,7 @@ static void recv_generator(char *fname, 
        if (statret != 0) {
+ #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && F_IS_HLINKED(file)
 -                  && hard_link_check(file, ndx, fname, statret, &st,
 +                  && hard_link_check(file, ndx, fname, statret, &sx,
                                       itemizing, code, HL_SKIP))
                        return;
-               if (stat_errno == ENOENT)
-@@ -1411,36 +1471,49 @@ static void recv_generator(char *fname, 
+ #endif
+@@ -1436,38 +1496,51 @@ static void recv_generator(char *fname, 
                return;
        }
  
@@ -2016,8 +2019,10 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
 -              set_file_attrs(fname, file, &st, maybe_ATTRS_REPORT);
 +              set_file_attrs(fname, file, &sx, maybe_ATTRS_REPORT);
+ #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && F_IS_HLINKED(file))
                        hard_link_cluster(file, ndx, itemizing, code, -1);
+ #endif
                if (remove_source_files != 1)
 -                      return;
 +                      goto cleanup;
@@ -2035,15 +2040,16 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                fnamecmp = partialptr;
                fnamecmp_type = FNAMECMP_PARTIAL_DIR;
                statret = 0;
-@@ -1464,17 +1537,21 @@ static void recv_generator(char *fname, 
-         pretend_missing:
+@@ -1492,18 +1565,22 @@ static void recv_generator(char *fname, 
                /* pretend the file didn't exist */
+ #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && F_IS_HLINKED(file)
 -                  && hard_link_check(file, ndx, fname, statret, &st,
 +                  && hard_link_check(file, ndx, fname, statret, &sx,
                                       itemizing, code, HL_SKIP))
 -                      return;
 +                      goto cleanup;
+ #endif
                statret = real_ret = -1;
 +#ifdef SUPPORT_ACLS
 +              if (preserve_acls && ACL_READY(sx))
@@ -2060,7 +2066,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                if (!(back_file = make_file(fname, NULL, NULL, 0, NO_FILTERS))) {
                        close(fd);
-@@ -1485,7 +1562,7 @@ static void recv_generator(char *fname, 
+@@ -1514,7 +1591,7 @@ static void recv_generator(char *fname, 
                                full_fname(backupptr));
                        unmake_file(back_file);
                        close(fd);
@@ -2069,7 +2075,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                if ((f_copy = do_open(backupptr,
                    O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600)) < 0) {
-@@ -1493,14 +1570,14 @@ static void recv_generator(char *fname, 
+@@ -1522,14 +1599,14 @@ static void recv_generator(char *fname, 
                                full_fname(backupptr));
                        unmake_file(back_file);
                        close(fd);
@@ -2086,7 +2092,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (verbose > 2)
-@@ -1518,24 +1595,32 @@ static void recv_generator(char *fname, 
+@@ -1547,8 +1624,16 @@ static void recv_generator(char *fname, 
                        iflags |= ITEM_BASIS_TYPE_FOLLOWS;
                if (fnamecmp_type == FNAMECMP_FUZZY)
                        iflags |= ITEM_XNAME_FOLLOWS;
@@ -2104,8 +2110,10 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (!do_xfers) {
+@@ -1556,17 +1641,17 @@ static void recv_generator(char *fname, 
                if (preserve_hard_links && F_IS_HLINKED(file))
                        hard_link_cluster(file, ndx, itemizing, code, -1);
+ #endif
 -              return;
 +              goto cleanup;
        }
@@ -2124,7 +2132,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  
        if (f_copy >= 0) {
                close(f_copy);
-@@ -1548,6 +1633,13 @@ static void recv_generator(char *fname, 
+@@ -1579,6 +1664,13 @@ static void recv_generator(char *fname, 
        }
  
        close(fd);
@@ -2138,7 +2146,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  }
  
  void generate_files(int f_out, struct file_list *flist, char *local_name)
-@@ -1609,6 +1701,8 @@ void generate_files(int f_out, struct fi
+@@ -1640,6 +1732,8 @@ void generate_files(int f_out, struct fi
         * notice that and let us know via the redo pipe (or its closing). */
        ignore_timeout = 1;
  
@@ -2157,22 +2165,22 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  extern int make_backups;
  extern int remove_source_files;
  extern int stdout_format_has_i;
-@@ -154,15 +155,19 @@ void init_hard_links(void)
+@@ -150,15 +151,19 @@ void init_hard_links(void)
+ }
  
- #ifdef SUPPORT_HARD_LINKS
  static int maybe_hard_link(struct file_struct *file, int ndx,
--                         char *fname, int statret, STRUCT_STAT *st,
-+                         char *fname, int statret, statx *sxp,
-                          char *toname, STRUCT_STAT *to_st,
+-                         const char *fname, int statret, STRUCT_STAT *stp,
++                         const char *fname, int statret, statx *sxp,
+                          const char *toname, STRUCT_STAT *to_stp,
                           int itemizing, enum logcode code)
  {
        if (statret == 0) {
--              if (st->st_dev == to_st->st_dev
--               && st->st_ino == to_st->st_ino) {
-+              if (sxp->st.st_dev == to_st->st_dev
-+               && sxp->st.st_ino == to_st->st_ino) {
+-              if (stp->st_dev == to_stp->st_dev
+-               && stp->st_ino == to_stp->st_ino) {
++              if (sxp->st.st_dev == to_stp->st_dev
++               && sxp->st.st_ino == to_stp->st_ino) {
                        if (itemizing) {
--                              itemize(file, ndx, statret, st,
+-                              itemize(file, ndx, statret, stp,
 +#ifdef SUPPORT_ACLS
 +                              if (preserve_acls && !ACL_READY(*sxp))
 +                                      get_acl(fname, sxp);
@@ -2181,36 +2189,35 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                        ITEM_LOCAL_CHANGE | ITEM_XNAME_FOLLOWS,
                                        0, "");
                        }
-@@ -177,13 +182,13 @@ static int maybe_hard_link(struct file_s
+@@ -173,12 +178,12 @@ static int maybe_hard_link(struct file_s
                        return -1;
                }
        }
--      return hard_link_one(file, ndx, fname, statret, st, toname,
+-      return hard_link_one(file, ndx, fname, statret, stp, toname,
 +      return hard_link_one(file, ndx, fname, statret, sxp, toname,
                             0, itemizing, code);
  }
- #endif
  
- int hard_link_check(struct file_struct *file, int ndx, char *fname,
--                  int statret, STRUCT_STAT *st, int itemizing,
+ int hard_link_check(struct file_struct *file, int ndx, const char *fname,
+-                  int statret, STRUCT_STAT *stp, int itemizing,
 +                  int statret, statx *sxp, int itemizing,
                    enum logcode code, int skip)
  {
- #ifdef SUPPORT_HARD_LINKS
-@@ -227,7 +232,7 @@ int hard_link_check(struct file_struct *
+       int head;
+@@ -221,7 +226,7 @@ int hard_link_check(struct file_struct *
                                                 || st2.st_ino != st3.st_ino)
                                                        continue;
                                                statret = 1;
--                                              st = &st3;
+-                                              stp = &st3;
 +                                              sxp->st = st3;
                                                if (verbose < 2 || !stdout_format_has_i) {
                                                        itemizing = 0;
                                                        code = FNONE;
-@@ -237,12 +242,16 @@ int hard_link_check(struct file_struct *
+@@ -231,12 +236,16 @@ int hard_link_check(struct file_struct *
                                        if (!unchanged_file(cmpbuf, file, &st3))
                                                continue;
                                        statret = 1;
--                                      st = &st3;
+-                                      stp = &st3;
 -                                      if (unchanged_attrs(file, &st3))
 +                                      sxp->st = st3;
 +#ifdef SUPPORT_ACLS
@@ -2221,25 +2228,25 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                                break;
                                } while (basis_dir[++j] != NULL);
                        }
--                      maybe_hard_link(file, ndx, fname, statret, st,
+-                      maybe_hard_link(file, ndx, fname, statret, stp,
 +                      maybe_hard_link(file, ndx, fname, statret, sxp,
                                        toname, &st2, itemizing, code);
                        if (remove_source_files == 1 && do_xfers)
                                send_msg_int(MSG_SUCCESS, ndx);
-@@ -257,7 +266,7 @@ int hard_link_check(struct file_struct *
+@@ -249,7 +258,7 @@ int hard_link_check(struct file_struct *
+ }
  
- #ifdef SUPPORT_HARD_LINKS
- int hard_link_one(struct file_struct *file, int ndx, char *fname,
--                int statret, STRUCT_STAT *st, char *toname, int terse,
-+                int statret, statx *sxp, char *toname, int terse,
+ int hard_link_one(struct file_struct *file, int ndx, const char *fname,
+-                int statret, STRUCT_STAT *stp, const char *toname, int terse,
++                int statret, statx *sxp, const char *toname, int terse,
                  int itemizing, enum logcode code)
  {
        if (do_link(toname, fname)) {
-@@ -273,7 +282,11 @@ int hard_link_one(struct file_struct *fi
+@@ -265,7 +274,11 @@ int hard_link_one(struct file_struct *fi
        }
  
        if (itemizing) {
--              itemize(file, ndx, statret, st,
+-              itemize(file, ndx, statret, stp,
 +#ifdef SUPPORT_ACLS
 +              if (preserve_acls && statret == 0 && !ACL_READY(*sxp))
 +                      get_acl(fname, sxp);
@@ -2248,15 +2255,15 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        ITEM_LOCAL_CHANGE | ITEM_XNAME_FOLLOWS, 0,
                        terse ? "" : toname);
        }
-@@ -290,14 +303,15 @@ void hard_link_cluster(struct file_struc
- #ifdef SUPPORT_HARD_LINKS
+@@ -279,14 +292,15 @@ void hard_link_cluster(struct file_struc
+ {
        char hlink1[MAXPATHLEN];
        char *hlink2;
 -      STRUCT_STAT st1, st2;
 +      statx sx;
 +      STRUCT_STAT st;
        int statret, ndx = master;
-       struct hlist *hl = F_HLIST(file);
+       struct hlist *hl = F_HL_LIST(file);
  
        hl->hlindex = FINISHED_LINK;
        if (dry_run)
@@ -2266,7 +2273,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                return;
        if (!(file->flags & FLAG_HLINK_FIRST)) {
                while (!(file->flags & FLAG_HLINK_LAST)) {
-@@ -313,9 +327,13 @@ void hard_link_cluster(struct file_struc
+@@ -302,9 +316,13 @@ void hard_link_cluster(struct file_struc
                if (hl->hlindex != SKIPPED_LINK)
                        continue;
                hlink2 = f_name(file, NULL);
@@ -5727,7 +5734,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +#ifdef SUPPORT_ACLS
 +      const char *parent_dirname = "";
 +#endif
-       int i, recv_ok;
+       int ndx, recv_ok;
  
        if (verbose > 2)
 @@ -550,7 +555,16 @@ int recv_files(int f_in, struct file_lis
@@ -5954,20 +5961,20 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  #define GID_NONE ((gid_t)-1)
  
  #define HL_CHECK_MASTER       0
-@@ -551,10 +559,12 @@ extern int preserve_gid;
+@@ -553,10 +561,12 @@ extern int preserve_gid;
  /* When the associated option is on, all entries will have these present: */
  #define F_UID(f) REQ_EXTRA(f, preserve_uid)->uid
  #define F_GID(f) REQ_EXTRA(f, preserve_gid)->gid
 +#define F_ACL(f) REQ_EXTRA(f, preserve_acls)->unum
  
- /* These are per-entry optional and mutally exclusive: */
- #define F_IDEV(f)  OPT_EXTRA(f, LEN64_BUMP(f))->idev
- #define F_HLIST(f) OPT_EXTRA(f, LEN64_BUMP(f))->hlist
-+#define F_DEFACL(f) OPT_EXTRA(f, LEN64_BUMP(f))->unum
+ /* These items are per-entry optional and mutally exclusive: */
+ #define F_HL_IDEV(f) OPT_EXTRA(f, LEN64_BUMP(f))->idev
+ #define F_HL_LIST(f) OPT_EXTRA(f, LEN64_BUMP(f))->hlist
++#define F_DEF_ACL(f) OPT_EXTRA(f, LEN64_BUMP(f))->unum
  
- /* These are per-entry optional, but always both or neither:
-  * (Note: a device doesn't need to use LEN64_BUMP(f).) */
-@@ -689,6 +699,17 @@ struct stats {
+ /* This optional item might follow an F_HL_*() item.
+  * (Note: a device doesn't need to check LEN64_BUMP(f).) */
+@@ -694,6 +704,17 @@ struct stats {
  
  struct chmod_mode_struct;
  
@@ -5985,7 +5992,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  #include "byteorder.h"
  #include "lib/mdfour.h"
  #include "lib/wildmatch.h"
-@@ -707,6 +728,16 @@ struct chmod_mode_struct;
+@@ -712,6 +733,16 @@ struct chmod_mode_struct;
  #define NORETURN __attribute__((__noreturn__))
  #endif
  
index f50e861..4495b6a 100644 (file)
@@ -40,7 +40,7 @@ To use this patch, run these commands for a successful build:
  extern int size_only;
  extern OFF_T max_size;
  extern OFF_T min_size;
-@@ -507,7 +508,7 @@ void itemize(struct file_struct *file, i
+@@ -508,7 +509,7 @@ void itemize(struct file_struct *file, i
  /* Perform our quick-check heuristic for determining if a file is unchanged. */
  int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
  {
@@ -51,7 +51,7 @@ To use this patch, run these commands for a successful build:
        /* if always checksum is set then we use the checksum instead
 --- old/main.c
 +++ new/main.c
-@@ -122,7 +122,7 @@ pid_t wait_process(pid_t pid, int *statu
+@@ -126,7 +126,7 @@ pid_t wait_process(pid_t pid, int *statu
  }
  
  /* Wait for a process to exit, calling io_flush while waiting. */
@@ -249,12 +249,12 @@ To use this patch, run these commands for a successful build:
 @@ -348,6 +349,8 @@ int recv_files(int f_in, struct file_lis
        enum logcode log_code = log_before_transfer ? FLOG : FINFO;
        int max_phase = protocol_version >= 29 ? 2 : 1;
-       int i, recv_ok;
+       int ndx, recv_ok;
 +      pid_t pid = 0;
 +      char *filter_argv[MAX_FILTER_ARGS + 1];
  
        if (verbose > 2)
-               rprintf(FINFO,"recv_files(%d) starting\n",flist->count);
+               rprintf(FINFO, "recv_files(%d) starting\n", flist->count);
 @@ -362,6 +365,23 @@ int recv_files(int f_in, struct file_lis
  
        updating_basis = inplace;