A patch from Antti Tapaninen.
[rsync/rsync-patches.git] / acls.diff
index d8b5419..937f793 100644 (file)
--- a/acls.diff
+++ b/acls.diff
@@ -1422,7 +1422,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  }
 --- old/generator.c
 +++ new/generator.c
-@@ -36,6 +36,7 @@ extern int recurse;
+@@ -35,6 +35,7 @@ extern int do_progress;
  extern int relative_paths;
  extern int implied_dirs;
  extern int keep_dirlinks;
@@ -1430,7 +1430,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  extern int preserve_links;
  extern int preserve_devices;
  extern int preserve_specials;
-@@ -85,6 +86,7 @@ extern long block_size; /* "long" becaus
+@@ -84,6 +85,7 @@ extern long block_size; /* "long" becaus
  extern int max_delete;
  extern int force_delete;
  extern int one_file_system;
@@ -1438,7 +1438,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  extern struct stats stats;
  extern dev_t filesystem_dev;
  extern char *backup_dir;
-@@ -317,22 +319,27 @@ static void do_delete_pass(struct file_l
+@@ -316,22 +318,27 @@ static void do_delete_pass(struct file_l
                rprintf(FINFO, "                    \r");
  }
  
@@ -1471,7 +1471,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
             int32 iflags, uchar fnamecmp_type, char *xname)
  {
        if (statret >= 0) { /* A from-dest-dir statret can == 1! */
-@@ -340,19 +347,23 @@ void itemize(struct file_struct *file, i
+@@ -339,19 +346,23 @@ void itemize(struct file_struct *file, i
                    : S_ISDIR(file->mode) ? !omit_dir_times
                    : !S_ISLNK(file->mode);
  
@@ -1500,7 +1500,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        } else
                iflags |= ITEM_IS_NEW;
  
-@@ -603,7 +614,7 @@ void check_for_finished_hlinks(int itemi
+@@ -604,7 +615,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,
@@ -1509,7 +1509,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                         int maybe_ATTRS_REPORT, enum logcode code)
  {
        int save_ignore_times = ignore_times;
-@@ -617,7 +628,7 @@ static int try_dests_reg(struct file_str
+@@ -618,7 +629,7 @@ static int try_dests_reg(struct file_str
  
        do {
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1518,7 +1518,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        continue;
                switch (match_level) {
                case 0:
-@@ -625,16 +636,20 @@ static int try_dests_reg(struct file_str
+@@ -626,16 +637,20 @@ static int try_dests_reg(struct file_str
                        match_level = 1;
                        /* FALL THROUGH */
                case 1:
@@ -1542,7 +1542,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                continue;
                        best_match = j;
                        match_level = 3;
-@@ -651,14 +666,14 @@ static int try_dests_reg(struct file_str
+@@ -652,14 +667,14 @@ static int try_dests_reg(struct file_str
        if (j != best_match) {
                j = best_match;
                pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
@@ -1559,7 +1559,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                          cmpbuf, 1,
                                          itemizing && verbose > 1,
                                          code) < 0)
-@@ -667,8 +682,13 @@ static int try_dests_reg(struct file_str
+@@ -668,8 +683,13 @@ static int try_dests_reg(struct file_str
                                hard_link_cluster(file, ndx, itemizing, code);
                } else
  #endif
@@ -1573,9 +1573,9 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +                      itemize(file, ndx, 0, sxp, 0, 0, NULL);
 +              }
                if (verbose > 1 && maybe_ATTRS_REPORT) {
-                       code = logfile_format_has_i || dry_run
-                            ? FCLIENT : FINFO;
-@@ -686,8 +706,13 @@ static int try_dests_reg(struct file_str
+                       rprintf(FCLIENT, "%s is uptodate\n", fname);
+               }
+@@ -685,8 +705,13 @@ static int try_dests_reg(struct file_str
                        }
                        return -1;
                }
@@ -1591,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)
-@@ -712,13 +737,18 @@ static int try_dests_non(struct file_str
+@@ -710,13 +735,18 @@ static int try_dests_non(struct file_str
                         enum logcode code)
  {
        char fnamebuf[MAXPATHLEN];
@@ -1613,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
-@@ -731,10 +761,10 @@ static int try_dests_non(struct file_str
+@@ -729,10 +759,10 @@ static int try_dests_non(struct file_str
  #endif
                                continue;
                } else if (IS_SPECIAL(file->mode)) {
@@ -1626,7 +1626,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                continue;
                } else {
                        rprintf(FERROR,
-@@ -765,7 +795,15 @@ static int try_dests_non(struct file_str
+@@ -763,7 +793,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,8 +1642,8 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +#endif
                }
                if (verbose > 1 && maybe_ATTRS_REPORT) {
-                       code = logfile_format_has_i || dry_run
-@@ -779,6 +817,7 @@ static int try_dests_non(struct file_str
+                       rprintf(FCLIENT, "%s is uptodate\n", fname);
+@@ -775,6 +813,7 @@ static int try_dests_non(struct file_str
  }
  
  static int phase = 0;
@@ -1651,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
-@@ -800,7 +839,8 @@ static void recv_generator(char *fname, 
+@@ -796,7 +835,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;
@@ -1661,9 +1661,9 @@ 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;
-@@ -851,6 +891,9 @@ static void recv_generator(char *fname, 
-               dry_run--;
-               missing_below = -1;
+@@ -852,6 +892,9 @@ static void recv_generator(char *fname, 
+               } else if (!dry_run)
+                       return;
        }
 +#ifdef SUPPORT_ACLS
 +      sx.acc_acl = sx.def_acl = NULL;
@@ -1671,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;
-@@ -858,7 +901,7 @@ static void recv_generator(char *fname, 
+@@ -859,7 +902,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
@@ -1680,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",
-@@ -870,6 +913,10 @@ static void recv_generator(char *fname, 
+@@ -871,6 +914,10 @@ static void recv_generator(char *fname, 
                        }
                        if (fuzzy_basis)
                                need_fuzzy_dirlist = 1;
@@ -1691,7 +1691,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                parent_dirname = dn;
  
-@@ -878,7 +925,7 @@ static void recv_generator(char *fname, 
+@@ -879,7 +926,7 @@ static void recv_generator(char *fname, 
                        need_fuzzy_dirlist = 0;
                }
  
@@ -1700,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;
        }
-@@ -896,8 +943,9 @@ static void recv_generator(char *fname, 
+@@ -897,8 +944,9 @@ static void recv_generator(char *fname, 
         * mode based on the local permissions and some heuristics. */
        if (!preserve_perms) {
                int exists = statret == 0
@@ -1712,7 +1712,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (S_ISDIR(file->mode)) {
-@@ -906,8 +954,8 @@ static void recv_generator(char *fname, 
+@@ -907,8 +955,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. */
@@ -1723,7 +1723,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                return;
                        statret = -1;
                }
-@@ -916,7 +964,11 @@ static void recv_generator(char *fname, 
+@@ -917,7 +965,11 @@ static void recv_generator(char *fname, 
                        dry_run++;
                }
                if (itemizing && f_out != -1) {
@@ -1736,8 +1736,8 @@ 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) {
-@@ -928,19 +980,19 @@ static void recv_generator(char *fname, 
-                                       full_fname(fname));
+@@ -937,19 +989,19 @@ static void recv_generator(char *fname, 
+                               return;
                        }
                }
 -              if (set_file_attrs(fname, file, statret ? NULL : &st, 0)
@@ -1761,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
-@@ -958,7 +1010,7 @@ static void recv_generator(char *fname, 
+@@ -967,7 +1019,7 @@ static void recv_generator(char *fname, 
                        char lnk[MAXPATHLEN];
                        int len;
  
@@ -1770,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
-@@ -966,10 +1018,10 @@ static void recv_generator(char *fname, 
+@@ -975,10 +1027,10 @@ static void recv_generator(char *fname, 
                                 * required. */
                                if (strcmp(lnk, file->u.link) == 0) {
                                        if (itemizing) {
@@ -1783,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) {
-@@ -982,9 +1034,9 @@ static void recv_generator(char *fname, 
+@@ -991,9 +1043,9 @@ static void recv_generator(char *fname, 
                        }
                        /* Not the right symlink (or not a symlink), so
                         * delete it. */
@@ -1795,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,
-@@ -1000,7 +1052,7 @@ static void recv_generator(char *fname, 
+@@ -1009,7 +1061,7 @@ static void recv_generator(char *fname, 
                        }
                }
                if (preserve_hard_links && file->link_u.links
@@ -1804,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) {
-@@ -1009,7 +1061,7 @@ static void recv_generator(char *fname, 
+@@ -1018,7 +1070,7 @@ static void recv_generator(char *fname, 
                } else {
                        set_file_attrs(fname, file, NULL, 0);
                        if (itemizing) {
@@ -1813,7 +1813,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                        ITEM_LOCAL_CHANGE, 0, NULL);
                        }
                        if (code && verbose) {
-@@ -1043,18 +1095,22 @@ static void recv_generator(char *fname, 
+@@ -1052,18 +1104,22 @@ static void recv_generator(char *fname, 
                                itemizing = code = 0;
                        }
                }
@@ -1844,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",
-@@ -1067,7 +1123,7 @@ static void recv_generator(char *fname, 
+@@ -1076,7 +1132,7 @@ static void recv_generator(char *fname, 
                        } else {
                                set_file_attrs(fname, file, NULL, 0);
                                if (itemizing) {
@@ -1853,7 +1853,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                                ITEM_LOCAL_CHANGE, 0, NULL);
                                }
                                if (code && verbose)
-@@ -1079,12 +1135,12 @@ static void recv_generator(char *fname, 
+@@ -1088,12 +1144,12 @@ static void recv_generator(char *fname, 
                        }
                } else {
                        if (itemizing)
@@ -1869,7 +1869,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (!S_ISREG(file->mode)) {
-@@ -1118,7 +1174,7 @@ static void recv_generator(char *fname, 
+@@ -1127,7 +1183,7 @@ static void recv_generator(char *fname, 
        }
  
        if (update_only && statret == 0
@@ -1878,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;
-@@ -1127,18 +1183,18 @@ static void recv_generator(char *fname, 
+@@ -1136,18 +1192,18 @@ static void recv_generator(char *fname, 
        fnamecmp = fname;
        fnamecmp_type = FNAMECMP_FNAME;
  
@@ -1901,7 +1901,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                if (j != -1) {
                        fnamecmp = fnamecmpbuf;
                        fnamecmp_type = j;
-@@ -1147,7 +1203,7 @@ static void recv_generator(char *fname, 
+@@ -1156,7 +1212,7 @@ static void recv_generator(char *fname, 
        }
  
        real_ret = statret;
@@ -1910,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
-@@ -1166,7 +1222,7 @@ static void recv_generator(char *fname, 
+@@ -1175,7 +1231,7 @@ static void recv_generator(char *fname, 
                                rprintf(FINFO, "fuzzy basis selected for %s: %s\n",
                                        fname, fnamecmpbuf);
                        }
@@ -1919,7 +1919,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                        statret = 0;
                        fnamecmp = fnamecmpbuf;
                        fnamecmp_type = FNAMECMP_FUZZY;
-@@ -1175,7 +1231,7 @@ static void recv_generator(char *fname, 
+@@ -1184,7 +1240,7 @@ static void recv_generator(char *fname, 
  
        if (statret != 0) {
                if (preserve_hard_links && file->link_u.links
@@ -1928,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)
-@@ -1185,31 +1241,44 @@ static void recv_generator(char *fname, 
+@@ -1194,31 +1250,44 @@ static void recv_generator(char *fname, 
                return;
        }
  
@@ -1979,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;
-@@ -1233,17 +1302,21 @@ static void recv_generator(char *fname, 
+@@ -1242,17 +1311,21 @@ static void recv_generator(char *fname, 
          pretend_missing:
                /* pretend the file didn't exist */
                if (preserve_hard_links && file->link_u.links
@@ -2004,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);
-@@ -1254,7 +1327,7 @@ static void recv_generator(char *fname, 
+@@ -1263,7 +1336,7 @@ static void recv_generator(char *fname, 
                                full_fname(backupptr));
                        free(back_file);
                        close(fd);
@@ -2013,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) {
-@@ -1262,14 +1335,14 @@ static void recv_generator(char *fname, 
+@@ -1271,14 +1344,14 @@ static void recv_generator(char *fname, 
                                full_fname(backupptr));
                        free(back_file);
                        close(fd);
@@ -2030,7 +2030,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        }
  
        if (verbose > 2)
-@@ -1287,24 +1360,32 @@ static void recv_generator(char *fname, 
+@@ -1296,24 +1369,32 @@ static void recv_generator(char *fname, 
                        iflags |= ITEM_BASIS_TYPE_FOLLOWS;
                if (fnamecmp_type == FNAMECMP_FUZZY)
                        iflags |= ITEM_XNAME_FOLLOWS;
@@ -2068,7 +2068,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  
        if (f_copy >= 0) {
                close(f_copy);
-@@ -1317,6 +1398,13 @@ static void recv_generator(char *fname, 
+@@ -1326,6 +1407,13 @@ static void recv_generator(char *fname, 
        }
  
        close(fd);
@@ -2082,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)
-@@ -1376,6 +1464,8 @@ void generate_files(int f_out, struct fi
+@@ -1385,6 +1473,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;
  
@@ -2099,7 +2099,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  extern int link_dest;
 +extern int preserve_acls;
  extern int make_backups;
- extern int log_format_has_i;
+ extern int stdout_format_has_i;
  extern char *basis_dir[];
 @@ -143,15 +144,19 @@ void init_hard_links(void)
  
@@ -2147,7 +2147,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                                                statret = 1;
 -                                              st = &st3;
 +                                              sxp->st = st3;
-                                               if (verbose < 2 || !log_format_has_i)
+                                               if (verbose < 2 || !stdout_format_has_i)
                                                        itemizing = code = 0;
                                                break;
 @@ -215,12 +220,16 @@ int hard_link_check(struct file_struct *
@@ -5505,7 +5505,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
 +int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype);
 --- old/log.c
 +++ new/log.c
-@@ -592,8 +592,10 @@ static void log_formatted(enum logcode c
+@@ -582,8 +582,10 @@ static void log_formatted(enum logcode c
                        n[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
                        n[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
                        n[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
@@ -5570,7 +5570,16 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  
        /* Note that this field may not have type ino_t.  It depends
         * on the complicated interaction between largefile feature
-@@ -299,6 +305,9 @@ void usage(enum logcode F)
+@@ -282,7 +288,7 @@ void usage(enum logcode F)
+   rprintf(F," -v, --verbose               increase verbosity\n");
+   rprintf(F," -q, --quiet                 suppress non-error messages\n");
+   rprintf(F," -c, --checksum              skip based on checksum, not mod-time & size\n");
+-  rprintf(F," -a, --archive               archive mode; same as -rlptgoD (no -H)\n");
++  rprintf(F," -a, --archive               archive mode; same as -rlptgoD (no -H, -A)\n");
+   rprintf(F,"     --no-OPTION             turn off an implied OPTION (e.g. --no-D)\n");
+   rprintf(F," -r, --recursive             recurse into directories\n");
+   rprintf(F," -R, --relative              use relative path names\n");
+@@ -303,6 +309,9 @@ void usage(enum logcode F)
    rprintf(F," -H, --hard-links            preserve hard links\n");
    rprintf(F," -p, --perms                 preserve permissions\n");
    rprintf(F," -E, --executability         preserve the file's executability\n");
@@ -5580,7 +5589,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
    rprintf(F,"     --chmod=CHMOD           change destination permissions\n");
    rprintf(F," -o, --owner                 preserve owner (super-user only)\n");
    rprintf(F," -g, --group                 preserve group\n");
-@@ -415,6 +424,9 @@ static struct poptOption long_options[] 
+@@ -421,6 +430,9 @@ static struct poptOption long_options[] 
    {"no-perms",         0,  POPT_ARG_VAL,    &preserve_perms, 0, 0, 0 },
    {"no-p",             0,  POPT_ARG_VAL,    &preserve_perms, 0, 0, 0 },
    {"executability",   'E', POPT_ARG_NONE,   &preserve_executability, 0, 0, 0 },
@@ -5590,7 +5599,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 },
-@@ -1080,6 +1092,24 @@ int parse_arguments(int *argc, const cha
+@@ -1083,6 +1095,24 @@ int parse_arguments(int *argc, const cha
                        usage(FINFO);
                        exit_cleanup(0);
  
@@ -5615,7 +5624,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. */
-@@ -1526,6 +1556,10 @@ void server_options(char **args,int *arg
+@@ -1528,6 +1558,10 @@ void server_options(char **args,int *arg
  
        if (preserve_hard_links)
                argstr[x++] = 'H';
@@ -5634,11 +5643,11 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  extern int delay_updates;
 +extern mode_t orig_umask;
  extern struct stats stats;
- extern char *log_format;
+ extern char *stdout_format;
  extern char *tmpdir;
-@@ -344,6 +345,10 @@ int recv_files(int f_in, struct file_lis
-       int save_make_backups = make_backups;
-       int itemizing = am_server ? logfile_format_has_i : log_format_has_i;
+@@ -347,6 +348,10 @@ int recv_files(int f_in, struct file_lis
+       int itemizing = am_server ? logfile_format_has_i : stdout_format_has_i;
+       enum logcode log_code = log_before_transfer ? FLOG : FINFO;
        int max_phase = protocol_version >= 29 ? 2 : 1;
 +      int dflt_perms = (ACCESSPERMS & ~orig_umask);
 +#ifdef SUPPORT_ACLS
@@ -5647,7 +5656,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
        int i, recv_ok;
  
        if (verbose > 2)
-@@ -541,7 +546,16 @@ int recv_files(int f_in, struct file_lis
+@@ -543,7 +548,16 @@ int recv_files(int f_in, struct file_lis
                 * mode based on the local permissions and some heuristics. */
                if (!preserve_perms) {
                        int exists = fd1 != -1;
@@ -5667,15 +5676,15 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                /* We now check to see if we are writing file "inplace" */
 --- old/rsync.c
 +++ new/rsync.c
-@@ -33,6 +33,7 @@
+@@ -32,6 +32,7 @@
  extern int verbose;
  extern int dry_run;
- extern int logfile_format_has_i;
 +extern int preserve_acls;
  extern int preserve_perms;
  extern int preserve_executability;
  extern int preserve_times;
-@@ -101,7 +102,8 @@ void free_sums(struct sum_struct *s)
+@@ -100,7 +101,8 @@ void free_sums(struct sum_struct *s)
  
  /* This is only called when we aren't preserving permissions.  Figure out what
   * the permissions should be and return them merged back into the mode. */
@@ -5685,7 +5694,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  {
        /* If the file already exists, we'll return the local permissions,
         * possibly tweaked by the --executability option. */
-@@ -116,55 +118,63 @@ mode_t dest_mode(mode_t flist_mode, mode
+@@ -115,55 +117,63 @@ mode_t dest_mode(mode_t flist_mode, mode
                                cur_mode |= (cur_mode & 0444) >> 2;
                }
        } else
@@ -5763,7 +5772,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                ;
        else
  #endif
-@@ -174,43 +184,55 @@ int set_file_attrs(char *fname, struct f
+@@ -173,43 +183,55 @@ int set_file_attrs(char *fname, struct f
                                rprintf(FINFO,
                                        "set uid of %s from %ld to %ld\n",
                                        fname,
@@ -5830,9 +5839,9 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
                }
                if (ret == 0) /* ret == 1 if symlink could not be set */
                        updated = 1;
-@@ -225,6 +247,11 @@ int set_file_attrs(char *fname, struct f
+@@ -222,6 +244,11 @@ int set_file_attrs(char *fname, struct f
                else
-                       rprintf(code, "%s is uptodate\n", fname);
+                       rprintf(FCLIENT, "%s is uptodate\n", fname);
        }
 +  cleanup:
 +#ifdef SUPPORT_ACLS
@@ -5897,6 +5906,15 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  /* We have replacement versions of these if they're missing. */
 --- old/rsync.yo
 +++ new/rsync.yo
+@@ -300,7 +300,7 @@ to the detailed description below for a 
+  -v, --verbose               increase verbosity
+  -q, --quiet                 suppress non-error messages
+  -c, --checksum              skip based on checksum, not mod-time & size
+- -a, --archive               archive mode; same as -rlptgoD (no -H)
++ -a, --archive               archive mode; same as -rlptgoD (no -H, -A)
+      --no-OPTION             turn off an implied OPTION (e.g. --no-D)
+  -r, --recursive             recurse into directories
+  -R, --relative              use relative path names
 @@ -321,6 +321,7 @@ to the detailed description below for a 
   -H, --hard-links            preserve hard links
   -p, --perms                 preserve permissions
@@ -5905,7 +5923,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
       --chmod=CHMOD           change destination permissions
   -o, --owner                 preserve owner (super-user only)
   -g, --group                 preserve group
-@@ -744,7 +745,9 @@ quote(itemize(
+@@ -746,7 +747,9 @@ quote(itemize(
    permissions, though the bf(--executability) option might change just
    the execute permission for the file.
    it() New files get their "normal" permission bits set to the source
@@ -5916,7 +5934,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
    their special permission bits disabled except in the case where a new
    directory inherits a setgid bit from its parent directory.
  ))
-@@ -775,9 +778,11 @@ The preservation of the destination's se
+@@ -777,9 +780,11 @@ The preservation of the destination's se
  directories when bf(--perms) is off was added in rsync 2.6.7.  Older rsync
  versions erroneously preserved the three special permission bits for
  newly-created files when bf(--perms) was off, while overriding the
@@ -5931,7 +5949,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync.
  
  dit(bf(-E, --executability)) This option causes rsync to preserve the
  executability (or non-executability) of regular files when bf(--perms) is
-@@ -795,6 +800,15 @@ quote(itemize(
+@@ -797,6 +802,15 @@ quote(itemize(
  
  If bf(--perms) is enabled, this option is ignored.
  
@@ -5947,7 +5965,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
-@@ -1376,8 +1390,8 @@ if the receiving rsync is at least versi
+@@ -1378,8 +1392,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).
  
@@ -5958,7 +5976,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.
-@@ -1426,7 +1440,11 @@ quote(itemize(
+@@ -1428,7 +1442,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).