Fixed failing hunks.
authorWayne Davison <wayned@samba.org>
Fri, 5 May 2006 16:06:22 +0000 (16:06 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 5 May 2006 16:06:22 +0000 (16:06 +0000)
acls.diff
backup-dir-dels.diff

index 5137260..64e83e5 100644 (file)
--- a/acls.diff
+++ b/acls.diff
@@ -1542,7 +1542,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                continue;
                        best_match = j;
                        match_level = 3;
-@@ -653,22 +668,27 @@ static int try_dests_reg(struct file_str
+@@ -653,14 +668,14 @@ static int try_dests_reg(struct file_str
        if (j != best_match) {
                j = best_match;
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1551,20 +1551,21 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        match_level = 0;
        }
  
- #ifdef HAVE_LINK
        if (match_level == 3 && !copy_dest) {
+ #ifdef SUPPORT_HARD_LINKS
                if (link_dest) {
 -                      if (hard_link_one(file, ndx, fname, 0, stp,
 +                      if (hard_link_one(file, ndx, fname, 0, sxp,
                                          cmpbuf, 1,
                                          itemizing && verbose > 1,
                                          code) < 0)
-                               goto try_a_copy;
-                       if (preserve_hard_links && file->link_u.links)
+@@ -669,8 +684,13 @@ static int try_dests_reg(struct file_str
                                hard_link_cluster(file, ndx, itemizing, code);
--              } else if (itemizing)
+               } else
+ #endif
+-              if (itemizing)
 -                      itemize(file, ndx, 0, stp, 0, 0, NULL);
-+              } else if (itemizing) {
++              if (itemizing) {
 +#ifdef SUPPORT_ACLS
 +                      if (preserve_acls && !ACL_READY(*sxp))
 +                              get_acl(fname, sxp);
@@ -1574,7 +1575,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                if (verbose > 1 && maybe_ATTRS_REPORT) {
                        code = daemon_log_format_has_i || dry_run
                             ? FCLIENT : FINFO;
-@@ -687,8 +707,13 @@ static int try_dests_reg(struct file_str
+@@ -688,8 +708,13 @@ static int try_dests_reg(struct file_str
                        }
                        return -1;
                }
@@ -1590,7 +1591,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)
-@@ -713,13 +738,18 @@ static int try_dests_non(struct file_str
+@@ -714,13 +739,18 @@ static int try_dests_non(struct file_str
                         enum logcode code)
  {
        char fnamebuf[MAXPATHLEN];
@@ -1612,7 +1613,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        continue;
                if (S_ISLNK(file->mode)) {
  #ifdef SUPPORT_LINKS
-@@ -732,10 +762,10 @@ static int try_dests_non(struct file_str
+@@ -733,10 +763,10 @@ static int try_dests_non(struct file_str
  #endif
                                continue;
                } else if (IS_SPECIAL(file->mode)) {
@@ -1625,7 +1626,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                continue;
                } else {
                        rprintf(FERROR,
-@@ -764,7 +794,15 @@ static int try_dests_non(struct file_str
+@@ -767,7 +797,15 @@ static int try_dests_non(struct file_str
                        int changes = compare_dest ? 0 : ITEM_LOCAL_CHANGE
                                    + (link_dest ? ITEM_XNAME_FOLLOWS : 0);
                        char *lp = link_dest ? "" : NULL;
@@ -1642,7 +1643,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                if (verbose > 1 && maybe_ATTRS_REPORT) {
                        code = daemon_log_format_has_i || dry_run
-@@ -778,6 +816,7 @@ static int try_dests_non(struct file_str
+@@ -781,6 +819,7 @@ static int try_dests_non(struct file_str
  }
  
  static int phase = 0;
@@ -1650,7 +1651,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
-@@ -799,7 +838,8 @@ static void recv_generator(char *fname, 
+@@ -802,7 +841,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;
@@ -1660,7 +1661,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;
-@@ -850,6 +890,9 @@ static void recv_generator(char *fname, 
+@@ -853,6 +893,9 @@ static void recv_generator(char *fname, 
                dry_run--;
                missing_below = -1;
        }
@@ -1670,7 +1671,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        if (dry_run > 1) {
                statret = -1;
                stat_errno = ENOENT;
-@@ -857,7 +900,7 @@ static void recv_generator(char *fname, 
+@@ -860,7 +903,7 @@ static void recv_generator(char *fname, 
                char *dn = file->dirname ? file->dirname : ".";
                if (parent_dirname != dn && strcmp(parent_dirname, dn) != 0) {
                        if (relative_paths && !implied_dirs
@@ -1679,7 +1680,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",
-@@ -869,6 +912,10 @@ static void recv_generator(char *fname, 
+@@ -872,6 +915,10 @@ static void recv_generator(char *fname, 
                        }
                        if (fuzzy_basis)
                                need_fuzzy_dirlist = 1;
@@ -1690,7 +1691,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                parent_dirname = dn;
  
-@@ -877,7 +924,7 @@ static void recv_generator(char *fname, 
+@@ -880,7 +927,7 @@ static void recv_generator(char *fname, 
                        need_fuzzy_dirlist = 0;
                }
  
@@ -1699,7 +1700,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                    keep_dirlinks && S_ISDIR(file->mode));
                stat_errno = errno;
        }
-@@ -895,8 +942,9 @@ static void recv_generator(char *fname, 
+@@ -898,8 +945,9 @@ static void recv_generator(char *fname, 
         * mode based on the local permissions and some heuristics. */
        if (!preserve_perms) {
                int exists = statret == 0
@@ -1711,7 +1712,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (S_ISDIR(file->mode)) {
-@@ -905,8 +953,8 @@ static void recv_generator(char *fname, 
+@@ -908,8 +956,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. */
@@ -1722,7 +1723,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                return;
                        statret = -1;
                }
-@@ -915,7 +963,11 @@ static void recv_generator(char *fname, 
+@@ -918,7 +966,11 @@ static void recv_generator(char *fname, 
                        dry_run++;
                }
                if (itemizing && f_out != -1) {
@@ -1735,7 +1736,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                statret ? ITEM_LOCAL_CHANGE : 0, 0, NULL);
                }
                if (statret != 0 && do_mkdir(fname,file->mode) < 0 && errno != EEXIST) {
-@@ -927,19 +979,19 @@ static void recv_generator(char *fname, 
+@@ -930,19 +982,19 @@ static void recv_generator(char *fname, 
                                        full_fname(fname));
                        }
                }
@@ -1760,7 +1761,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  
        if (preserve_links && S_ISLNK(file->mode)) {
  #ifdef SUPPORT_LINKS
-@@ -957,7 +1009,7 @@ static void recv_generator(char *fname, 
+@@ -960,7 +1012,7 @@ static void recv_generator(char *fname, 
                        char lnk[MAXPATHLEN];
                        int len;
  
@@ -1769,7 +1770,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                            && (len = readlink(fname, lnk, MAXPATHLEN-1)) > 0) {
                                lnk[len] = 0;
                                /* A link already pointing to the
-@@ -965,10 +1017,10 @@ static void recv_generator(char *fname, 
+@@ -968,10 +1020,10 @@ static void recv_generator(char *fname, 
                                 * required. */
                                if (strcmp(lnk, file->u.link) == 0) {
                                        if (itemizing) {
@@ -1782,7 +1783,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                                       maybe_ATTRS_REPORT);
                                        if (preserve_hard_links
                                            && file->link_u.links) {
-@@ -981,9 +1033,9 @@ static void recv_generator(char *fname, 
+@@ -984,9 +1036,9 @@ static void recv_generator(char *fname, 
                        }
                        /* Not the right symlink (or not a symlink), so
                         * delete it. */
@@ -1794,7 +1795,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                statret = -1;
                } else if (basis_dir[0] != NULL) {
                        if (try_dests_non(file, fname, ndx, itemizing,
-@@ -999,7 +1051,7 @@ static void recv_generator(char *fname, 
+@@ -1002,7 +1054,7 @@ static void recv_generator(char *fname, 
                        }
                }
                if (preserve_hard_links && file->link_u.links
@@ -1803,7 +1804,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                       itemizing, code, HL_SKIP))
                        return;
                if (do_symlink(file->u.link,fname) != 0) {
-@@ -1008,7 +1060,7 @@ static void recv_generator(char *fname, 
+@@ -1011,7 +1063,7 @@ static void recv_generator(char *fname, 
                } else {
                        set_file_attrs(fname, file, NULL, 0);
                        if (itemizing) {
@@ -1812,7 +1813,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                        ITEM_LOCAL_CHANGE, 0, NULL);
                        }
                        if (code && verbose) {
-@@ -1042,18 +1094,22 @@ static void recv_generator(char *fname, 
+@@ -1045,18 +1097,22 @@ static void recv_generator(char *fname, 
                                itemizing = code = 0;
                        }
                }
@@ -1843,7 +1844,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                statret = -1;
                        if (verbose > 2) {
                                rprintf(FINFO,"mknod(%s,0%o,0x%x)\n",
-@@ -1066,7 +1122,7 @@ static void recv_generator(char *fname, 
+@@ -1069,7 +1125,7 @@ static void recv_generator(char *fname, 
                        } else {
                                set_file_attrs(fname, file, NULL, 0);
                                if (itemizing) {
@@ -1852,7 +1853,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                                ITEM_LOCAL_CHANGE, 0, NULL);
                                }
                                if (code && verbose)
-@@ -1078,12 +1134,12 @@ static void recv_generator(char *fname, 
+@@ -1081,12 +1137,12 @@ static void recv_generator(char *fname, 
                        }
                } else {
                        if (itemizing)
@@ -1868,7 +1869,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (!S_ISREG(file->mode)) {
-@@ -1117,7 +1173,7 @@ static void recv_generator(char *fname, 
+@@ -1120,7 +1176,7 @@ static void recv_generator(char *fname, 
        }
  
        if (update_only && statret == 0
@@ -1877,7 +1878,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;
-@@ -1126,18 +1182,18 @@ static void recv_generator(char *fname, 
+@@ -1129,18 +1185,18 @@ static void recv_generator(char *fname, 
        fnamecmp = fname;
        fnamecmp_type = FNAMECMP_FNAME;
  
@@ -1900,7 +1901,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                if (j != -1) {
                        fnamecmp = fnamecmpbuf;
                        fnamecmp_type = j;
-@@ -1146,7 +1202,7 @@ static void recv_generator(char *fname, 
+@@ -1149,7 +1205,7 @@ static void recv_generator(char *fname, 
        }
  
        real_ret = statret;
@@ -1909,7 +1910,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
-@@ -1165,7 +1221,7 @@ static void recv_generator(char *fname, 
+@@ -1168,7 +1224,7 @@ static void recv_generator(char *fname, 
                                rprintf(FINFO, "fuzzy basis selected for %s: %s\n",
                                        fname, fnamecmpbuf);
                        }
@@ -1918,7 +1919,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        statret = 0;
                        fnamecmp = fnamecmpbuf;
                        fnamecmp_type = FNAMECMP_FUZZY;
-@@ -1174,7 +1230,7 @@ static void recv_generator(char *fname, 
+@@ -1177,7 +1233,7 @@ static void recv_generator(char *fname, 
  
        if (statret != 0) {
                if (preserve_hard_links && file->link_u.links
@@ -1927,7 +1928,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                       itemizing, code, HL_SKIP))
                        return;
                if (stat_errno == ENOENT)
-@@ -1184,31 +1240,44 @@ static void recv_generator(char *fname, 
+@@ -1187,31 +1243,44 @@ static void recv_generator(char *fname, 
                return;
        }
  
@@ -1978,7 +1979,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                fnamecmp = partialptr;
                fnamecmp_type = FNAMECMP_PARTIAL_DIR;
                statret = 0;
-@@ -1232,17 +1301,21 @@ static void recv_generator(char *fname, 
+@@ -1235,17 +1304,21 @@ static void recv_generator(char *fname, 
          pretend_missing:
                /* pretend the file didn't exist */
                if (preserve_hard_links && file->link_u.links
@@ -2003,7 +2004,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);
-@@ -1253,7 +1326,7 @@ static void recv_generator(char *fname, 
+@@ -1256,7 +1329,7 @@ static void recv_generator(char *fname, 
                                full_fname(backupptr));
                        free(back_file);
                        close(fd);
@@ -2012,7 +2013,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) {
-@@ -1261,14 +1334,14 @@ static void recv_generator(char *fname, 
+@@ -1264,14 +1337,14 @@ static void recv_generator(char *fname, 
                                full_fname(backupptr));
                        free(back_file);
                        close(fd);
@@ -2029,7 +2030,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (verbose > 2)
-@@ -1286,24 +1359,32 @@ static void recv_generator(char *fname, 
+@@ -1289,24 +1362,32 @@ static void recv_generator(char *fname, 
                        iflags |= ITEM_BASIS_TYPE_FOLLOWS;
                if (fnamecmp_type == FNAMECMP_FUZZY)
                        iflags |= ITEM_XNAME_FOLLOWS;
@@ -2067,7 +2068,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  
        if (f_copy >= 0) {
                close(f_copy);
-@@ -1316,6 +1397,13 @@ static void recv_generator(char *fname, 
+@@ -1319,6 +1400,13 @@ static void recv_generator(char *fname, 
        }
  
        close(fd);
@@ -2081,7 +2082,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)
-@@ -1375,6 +1463,8 @@ void generate_files(int f_out, struct fi
+@@ -1378,6 +1466,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;
  
@@ -5589,7 +5590,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
    {"times",           't', POPT_ARG_VAL,    &preserve_times, 1, 0, 0 },
    {"no-times",         0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
    {"no-t",             0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
-@@ -1070,6 +1082,24 @@ int parse_arguments(int *argc, const cha
+@@ -1072,6 +1084,24 @@ int parse_arguments(int *argc, const cha
                        usage(FINFO);
                        exit_cleanup(0);
  
@@ -5614,7 +5615,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                default:
                        /* A large opt value means that set_refuse_options()
                         * turned this option off. */
-@@ -1504,6 +1534,10 @@ void server_options(char **args,int *arg
+@@ -1503,6 +1533,10 @@ void server_options(char **args,int *arg
  
        if (preserve_hard_links)
                argstr[x++] = 'H';
@@ -5946,7 +5947,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  dit(bf(--chmod)) This option tells rsync to apply one or more
  comma-separated "chmod" strings to the permission of the files in the
  transfer.  The resulting value is treated as though it was the permissions
-@@ -1372,8 +1386,8 @@ if the receiving rsync is at least versi
+@@ -1374,8 +1388,8 @@ if the receiving rsync is at least versi
  with older versions of rsync, but that also turns on the output of other
  verbose messages).
  
@@ -5957,7 +5958,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  type of update being done, bf(X) is replaced by the file-type, and the
  other letters represent attributes that may be output if they are being
  modified.
-@@ -1422,7 +1436,11 @@ quote(itemize(
+@@ -1424,7 +1438,11 @@ quote(itemize(
    sender's value (requires bf(--owner) and super-user privileges).
    it() A bf(g) means the group is different and is being updated to the
    sender's value (requires bf(--group) and the authority to set the group).
@@ -6700,7 +6701,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                for (i = 0; i < flist->count; i++)
 --- old/util.c
 +++ new/util.c
-@@ -1515,3 +1515,31 @@ int bitbag_next_bit(struct bitbag *bb, i
+@@ -1555,3 +1555,31 @@ int bitbag_next_bit(struct bitbag *bb, i
  
        return -1;
  }
index 927f872..f2aabdb 100644 (file)
@@ -201,16 +201,18 @@ Marc St-Onge
    {"list-only",        0,  POPT_ARG_VAL,    &list_only, 2, 0, 0 },
    {"read-batch",       0,  POPT_ARG_STRING, &batch_name, OPT_READ_BATCH, 0, 0 },
    {"write-batch",      0,  POPT_ARG_STRING, &batch_name, OPT_WRITE_BATCH, 0, 0 },
-@@ -1215,6 +1225,8 @@ int parse_arguments(int *argc, const cha
-                       partial_dir = sanitize_path(NULL, partial_dir, NULL, 0, NULL);
-               if (backup_dir)
+@@ -1219,6 +1229,10 @@ int parse_arguments(int *argc, const cha
                        backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, NULL);
-+              if (backup_dir_dels)                                                    
+                       die_on_unsafe_path(backup_dir, 0);
+               }
++              if (backup_dir_dels) {
 +                      backup_dir_dels = sanitize_path(NULL, backup_dir_dels, NULL, 0, NULL);
++                      die_on_unsafe_path(backup_dir_dels, 0);
++              }
        }
        if (server_filter_list.head && !am_sender) {
                struct filter_list_struct *elp = &server_filter_list;
-@@ -1241,6 +1253,14 @@ int parse_arguments(int *argc, const cha
+@@ -1240,6 +1254,14 @@ int parse_arguments(int *argc, const cha
                                return 0;
                        }
                }
@@ -225,7 +227,7 @@ Marc St-Onge
        }
  
        if (!backup_suffix)
-@@ -1252,6 +1272,16 @@ int parse_arguments(int *argc, const cha
+@@ -1251,6 +1273,16 @@ int parse_arguments(int *argc, const cha
                        backup_suffix);
                return 0;
        }
@@ -242,7 +244,7 @@ Marc St-Onge
        if (backup_dir) {
                backup_dir_len = strlcpy(backup_dir_buf, backup_dir, sizeof backup_dir_buf);
                backup_dir_remainder = sizeof backup_dir_buf - backup_dir_len;
-@@ -1275,6 +1305,31 @@ int parse_arguments(int *argc, const cha
+@@ -1274,6 +1306,31 @@ int parse_arguments(int *argc, const cha
                        "P *%s", backup_suffix);
                parse_rule(&filter_list, backup_dir_buf, 0, 0);
        }
@@ -274,7 +276,7 @@ Marc St-Onge
        if (make_backups && !backup_dir)
                omit_dir_times = 1;
  
-@@ -1619,6 +1674,10 @@ void server_options(char **args,int *arg
+@@ -1618,6 +1675,10 @@ void server_options(char **args,int *arg
                args[ac++] = "--backup-dir";
                args[ac++] = backup_dir;
        }
@@ -285,7 +287,7 @@ Marc St-Onge
  
        /* Only send --suffix if it specifies a non-default value. */
        if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) {
-@@ -1627,7 +1686,13 @@ void server_options(char **args,int *arg
+@@ -1626,7 +1687,13 @@ void server_options(char **args,int *arg
                        goto oom;
                args[ac++] = arg;
        }