Fixed a failing hunk.
authorWayne Davison <wayned@samba.org>
Sat, 3 Feb 2007 05:47:37 +0000 (05:47 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 3 Feb 2007 05:47:37 +0000 (05:47 +0000)
acls.diff

index 1fc6ccc..910efd6 100644 (file)
--- a/acls.diff
+++ b/acls.diff
@@ -1423,7 +1423,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;
-@@ -509,22 +511,27 @@ static void do_delete_pass(struct file_l
+@@ -512,22 +514,27 @@ static void do_delete_pass(struct file_l
                rprintf(FINFO, "                    \r");
  }
  
@@ -1456,7 +1456,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
             const char *xname)
  {
        if (statret >= 0) { /* A from-dest-dir statret can == 1! */
-@@ -532,20 +539,24 @@ void itemize(struct file_struct *file, i
+@@ -535,20 +542,24 @@ void itemize(struct file_struct *file, i
                    : S_ISDIR(file->mode) ? !omit_dir_times
                    : !S_ISLNK(file->mode);
  
@@ -1486,7 +1486,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        } else
                iflags |= ITEM_IS_NEW;
  
-@@ -799,7 +810,7 @@ void check_for_finished_hlinks(int itemi
+@@ -784,7 +795,7 @@ static int find_fuzzy(struct file_struct
   * 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,
@@ -1495,7 +1495,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                         enum logcode code)
  {
        int best_match = -1;
-@@ -808,7 +819,7 @@ static int try_dests_reg(struct file_str
+@@ -793,7 +804,7 @@ static int try_dests_reg(struct file_str
  
        do {
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1504,7 +1504,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        continue;
                switch (match_level) {
                case 0:
-@@ -816,16 +827,20 @@ static int try_dests_reg(struct file_str
+@@ -801,16 +812,20 @@ static int try_dests_reg(struct file_str
                        match_level = 1;
                        /* FALL THROUGH */
                case 1:
@@ -1528,7 +1528,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                continue;
                        best_match = j;
                        match_level = 3;
-@@ -840,7 +855,7 @@ static int try_dests_reg(struct file_str
+@@ -825,7 +840,7 @@ static int try_dests_reg(struct file_str
        if (j != best_match) {
                j = best_match;
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1537,7 +1537,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        return -1;
        }
  
-@@ -850,16 +865,25 @@ static int try_dests_reg(struct file_str
+@@ -835,16 +850,25 @@ static int try_dests_reg(struct file_str
                        if (!hard_link_one(file, fname, cmpbuf, 1))
                                goto try_a_copy;
                        if (preserve_hard_links && F_IS_HLINKED(file))
@@ -1567,7 +1567,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);
                return -2;
-@@ -876,8 +900,13 @@ static int try_dests_reg(struct file_str
+@@ -861,8 +885,13 @@ static int try_dests_reg(struct file_str
                        }
                        return -1;
                }
@@ -1583,7 +1583,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)
-@@ -888,7 +917,7 @@ static int try_dests_reg(struct file_str
+@@ -873,7 +902,7 @@ static int try_dests_reg(struct file_str
                }
  #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && F_IS_HLINKED(file))
@@ -1592,7 +1592,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  #endif
                return -2;
        }
-@@ -900,7 +929,7 @@ static int try_dests_reg(struct file_str
+@@ -885,7 +914,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,
@@ -1601,7 +1601,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                         enum logcode code)
  {
        char lnk[MAXPATHLEN];
-@@ -933,24 +962,24 @@ static int try_dests_non(struct file_str
+@@ -918,24 +947,24 @@ static int try_dests_non(struct file_str
  
        do {
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1631,7 +1631,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                continue;
                        break;
  #endif
-@@ -965,7 +994,7 @@ static int try_dests_non(struct file_str
+@@ -950,7 +979,7 @@ static int try_dests_non(struct file_str
                case TYPE_SPECIAL:
                case TYPE_DEVICE:
                        devp = F_RDEV_P(file);
@@ -1640,7 +1640,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                continue;
                        break;
  #ifdef SUPPORT_LINKS
-@@ -982,7 +1011,11 @@ static int try_dests_non(struct file_str
+@@ -967,7 +996,11 @@ static int try_dests_non(struct file_str
                        match_level = 2;
                        best_match = j;
                }
@@ -1653,7 +1653,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        match_level = 3;
                        best_match = j;
                        break;
-@@ -995,7 +1028,7 @@ static int try_dests_non(struct file_str
+@@ -980,7 +1013,7 @@ static int try_dests_non(struct file_str
        if (j != best_match) {
                j = best_match;
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1662,7 +1662,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        return -1;
        }
  
-@@ -1026,7 +1059,15 @@ static int try_dests_non(struct file_str
+@@ -1011,7 +1044,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;
@@ -1679,15 +1679,15 @@ 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",
-@@ -1039,6 +1080,7 @@ static int try_dests_non(struct file_str
+@@ -1024,6 +1065,7 @@ static int try_dests_non(struct file_str
  }
  
  static int phase = 0;
 +static int dflt_perms;
  
- /* Acts on cur_flist->file's ndx'th item, whose name is fname.  If a dir,
+ /* Acts on the indicated item in cur_flist whose name is fname.  If a dir,
   * make sure it exists, and has the right permissions/timestamp info.  For
-@@ -1059,7 +1101,8 @@ static void recv_generator(char *fname, 
+@@ -1044,7 +1086,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;
@@ -1697,7 +1697,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;
-@@ -1104,6 +1147,9 @@ static void recv_generator(char *fname, 
+@@ -1089,6 +1132,9 @@ static void recv_generator(char *fname, 
                        return;
                }
        }
@@ -1707,7 +1707,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        if (dry_run > 1) {
                if (fuzzy_dirlist) {
                        flist_free(fuzzy_dirlist);
-@@ -1116,7 +1162,7 @@ static void recv_generator(char *fname, 
+@@ -1101,7 +1147,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
@@ -1716,7 +1716,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",
-@@ -1128,6 +1174,10 @@ static void recv_generator(char *fname, 
+@@ -1113,6 +1159,10 @@ static void recv_generator(char *fname, 
                        }
                        if (fuzzy_basis)
                                need_fuzzy_dirlist = 1;
@@ -1727,7 +1727,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                parent_dirname = dn;
  
-@@ -1137,7 +1187,7 @@ static void recv_generator(char *fname, 
+@@ -1122,7 +1172,7 @@ static void recv_generator(char *fname, 
                        need_fuzzy_dirlist = 0;
                }
  
@@ -1736,7 +1736,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                    keep_dirlinks && S_ISDIR(file->mode));
                stat_errno = errno;
        }
-@@ -1163,8 +1213,9 @@ static void recv_generator(char *fname, 
+@@ -1148,8 +1198,9 @@ static void recv_generator(char *fname, 
         * mode based on the local permissions and some heuristics. */
        if (!preserve_perms) {
                int exists = statret == 0
@@ -1748,7 +1748,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (S_ISDIR(file->mode)) {
-@@ -1173,8 +1224,8 @@ static void recv_generator(char *fname, 
+@@ -1158,8 +1209,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. */
@@ -1759,7 +1759,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                return;
                        statret = -1;
                }
-@@ -1183,14 +1234,14 @@ static void recv_generator(char *fname, 
+@@ -1168,14 +1219,14 @@ static void recv_generator(char *fname, 
                        dry_run++;
                }
                real_ret = statret;
@@ -1776,7 +1776,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                              itemizing, code);
                        if (j == -2) {
                                itemizing = 0;
-@@ -1199,7 +1250,11 @@ static void recv_generator(char *fname, 
+@@ -1184,7 +1235,11 @@ static void recv_generator(char *fname, 
                                statret = 1;
                }
                if (itemizing && f_out != -1) {
@@ -1789,7 +1789,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) {
-@@ -1213,31 +1268,31 @@ static void recv_generator(char *fname, 
+@@ -1198,31 +1253,31 @@ static void recv_generator(char *fname, 
                                    "*** Skipping any contents from this failed directory ***\n");
                                missing_below = F_DEPTH(file);
                                file->flags |= FLAG_MISSING_DIR;
@@ -1830,7 +1830,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  #endif
  
        if (preserve_links && S_ISLNK(file->mode)) {
-@@ -1257,28 +1312,28 @@ static void recv_generator(char *fname, 
+@@ -1242,28 +1297,28 @@ static void recv_generator(char *fname, 
                        char lnk[MAXPATHLEN];
                        int len;
  
@@ -1867,7 +1867,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                              itemizing, code);
                        if (j == -2) {
  #ifndef CAN_HARDLINK_SYMLINK
-@@ -1287,7 +1342,7 @@ static void recv_generator(char *fname, 
+@@ -1272,7 +1327,7 @@ static void recv_generator(char *fname, 
                                } else
  #endif
                                if (!copy_dest)
@@ -1876,7 +1876,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                itemizing = 0;
                                code = FNONE;
                        } else if (j >= 0)
-@@ -1295,7 +1350,7 @@ static void recv_generator(char *fname, 
+@@ -1280,7 +1335,7 @@ static void recv_generator(char *fname, 
                }
  #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && F_HLINK_NOT_LAST(file))
@@ -1885,7 +1885,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  #endif
                if (do_symlink(sl, fname) != 0) {
                        rsyserr(FERROR, errno, "symlink %s -> \"%s\" failed",
-@@ -1303,7 +1358,7 @@ static void recv_generator(char *fname, 
+@@ -1288,7 +1343,7 @@ static void recv_generator(char *fname, 
                } else {
                        set_file_attrs(fname, file, NULL, 0);
                        if (itemizing) {
@@ -1894,7 +1894,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                        ITEM_LOCAL_CHANGE, 0, NULL);
                        }
                        if (code != FNONE && verbose)
-@@ -1319,7 +1374,7 @@ static void recv_generator(char *fname, 
+@@ -1304,7 +1359,7 @@ static void recv_generator(char *fname, 
                                goto return_with_success;
                }
  #endif
@@ -1903,7 +1903,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if ((am_root && preserve_devices && IS_DEVICE(file->mode))
-@@ -1329,33 +1384,38 @@ static void recv_generator(char *fname, 
+@@ -1314,33 +1369,38 @@ static void recv_generator(char *fname, 
                if (statret == 0) {
                        char *t;
                        if (IS_DEVICE(file->mode)) {
@@ -1954,7 +1954,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                              itemizing, code);
                        if (j == -2) {
  #ifndef CAN_HARDLINK_SPECIAL
-@@ -1364,7 +1424,7 @@ static void recv_generator(char *fname, 
+@@ -1349,7 +1409,7 @@ static void recv_generator(char *fname, 
                                } else
  #endif
                                if (!copy_dest)
@@ -1963,7 +1963,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                itemizing = 0;
                                code = FNONE;
                        } else if (j >= 0)
-@@ -1372,7 +1432,7 @@ static void recv_generator(char *fname, 
+@@ -1357,7 +1417,7 @@ static void recv_generator(char *fname, 
                }
  #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && F_HLINK_NOT_LAST(file))
@@ -1972,7 +1972,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  #endif
                if (verbose > 2) {
                        rprintf(FINFO, "mknod(%s, 0%o, [%ld,%ld])\n",
-@@ -1385,7 +1445,11 @@ static void recv_generator(char *fname, 
+@@ -1370,7 +1430,11 @@ static void recv_generator(char *fname, 
                } else {
                        set_file_attrs(fname, file, NULL, 0);
                        if (itemizing) {
@@ -1985,7 +1985,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                        ITEM_LOCAL_CHANGE, 0, NULL);
                        }
                        if (code != FNONE && verbose)
-@@ -1397,14 +1461,14 @@ static void recv_generator(char *fname, 
+@@ -1382,14 +1446,14 @@ static void recv_generator(char *fname, 
                        if (remove_source_files == 1)
                                goto return_with_success;
                }
@@ -2002,7 +2002,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (max_size > 0 && F_LENGTH(file) > max_size) {
-@@ -1413,7 +1477,7 @@ static void recv_generator(char *fname, 
+@@ -1398,7 +1462,7 @@ static void recv_generator(char *fname, 
                                fname = f_name(file, NULL);
                        rprintf(FINFO, "%s is over max-size\n", fname);
                }
@@ -2011,7 +2011,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
        if (min_size > 0 && F_LENGTH(file) < min_size) {
                if (verbose > 1) {
-@@ -1421,39 +1485,39 @@ static void recv_generator(char *fname, 
+@@ -1406,39 +1470,39 @@ static void recv_generator(char *fname, 
                                fname = f_name(file, NULL);
                        rprintf(FINFO, "%s is under min-size\n", fname);
                }
@@ -2060,7 +2060,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                if (j >= 0) {
                        fnamecmp = fnamecmpbuf;
-@@ -1463,7 +1527,7 @@ static void recv_generator(char *fname, 
+@@ -1448,7 +1512,7 @@ static void recv_generator(char *fname, 
        }
  
        real_ret = statret;
@@ -2069,7 +2069,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
-@@ -1482,7 +1546,7 @@ static void recv_generator(char *fname, 
+@@ -1467,7 +1531,7 @@ static void recv_generator(char *fname, 
                                rprintf(FINFO, "fuzzy basis selected for %s: %s\n",
                                        fname, fnamecmpbuf);
                        }
@@ -2078,7 +2078,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        statret = 0;
                        fnamecmp = fnamecmpbuf;
                        fnamecmp_type = FNAMECMP_FUZZY;
-@@ -1492,45 +1556,50 @@ static void recv_generator(char *fname, 
+@@ -1477,45 +1541,50 @@ static void recv_generator(char *fname, 
        if (statret != 0) {
  #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && F_HLINK_NOT_LAST(file))
@@ -2129,7 +2129,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +                      goto cleanup;
          return_with_success:
                if (!dry_run)
-                       send_msg_int(MSG_SUCCESS, ndx + cur_flist->ndx_start);
+                       send_msg_int(MSG_SUCCESS, ndx);
 -              return;
 +              goto cleanup;
        }
@@ -2141,7 +2141,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                fnamecmp = partialptr;
                fnamecmp_type = FNAMECMP_PARTIAL_DIR;
                statret = 0;
-@@ -1555,16 +1624,20 @@ static void recv_generator(char *fname, 
+@@ -1540,16 +1609,20 @@ static void recv_generator(char *fname, 
                /* pretend the file didn't exist */
  #ifdef SUPPORT_HARD_LINKS
                if (preserve_hard_links && F_HLINK_NOT_LAST(file))
@@ -2164,7 +2164,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);
-@@ -1575,7 +1648,7 @@ static void recv_generator(char *fname, 
+@@ -1560,7 +1633,7 @@ static void recv_generator(char *fname, 
                                full_fname(backupptr));
                        unmake_file(back_file);
                        close(fd);
@@ -2173,7 +2173,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) {
-@@ -1583,14 +1656,14 @@ static void recv_generator(char *fname, 
+@@ -1568,14 +1641,14 @@ static void recv_generator(char *fname, 
                                full_fname(backupptr));
                        unmake_file(back_file);
                        close(fd);
@@ -2190,7 +2190,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (verbose > 2)
-@@ -1614,26 +1687,34 @@ static void recv_generator(char *fname, 
+@@ -1599,26 +1672,34 @@ static void recv_generator(char *fname, 
                        iflags |= ITEM_BASIS_TYPE_FOLLOWS;
                if (fnamecmp_type == FNAMECMP_FUZZY)
                        iflags |= ITEM_XNAME_FOLLOWS;
@@ -2231,7 +2231,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  
        if (f_copy >= 0) {
                close(f_copy);
-@@ -1646,6 +1727,13 @@ static void recv_generator(char *fname, 
+@@ -1631,6 +1712,13 @@ static void recv_generator(char *fname, 
        }
  
        close(fd);
@@ -2244,8 +2244,8 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +      return;
  }
  
- static void touch_up_dirs(struct file_list *flist, int ndx,
-@@ -1742,6 +1830,8 @@ void generate_files(int f_out, char *loc
+ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -1799,6 +1887,8 @@ void generate_files(int f_out, const cha
         * notice that and let us know via the redo pipe (or its closing). */
        ignore_timeout = 1;