Latest patches.
authorWayne Davison <wayned@samba.org>
Mon, 15 Jan 2018 06:46:11 +0000 (22:46 -0800)
committerWayne Davison <wayned@samba.org>
Mon, 15 Jan 2018 06:46:11 +0000 (22:46 -0800)
41 files changed:
acls.diff
adaptec_acl_mods.diff
atimes.diff
backup-deleted.diff
backup-dir-dels.diff
catch_crash_signals.diff
checksum-reading.diff
checksum-updating.diff
checksum-xattr.diff
congestion.diff
copy-devices.diff
crtimes.diff
cvs-entries.diff
date-only.diff
db.diff
detect-renamed-lax.diff
detect-renamed.diff
direct-io.diff
downdate.diff
fileflags.diff
filter-attribute-mods.diff
fsync.diff
hfs-compression.diff
ignore-case.diff
kerberos.diff
link-by-hash.diff
nameconverter.diff
netgroup-auth.diff
omit-dir-changes.diff
slow-down.diff
slp.diff
soften-links.diff
source-backup.diff
source-filter_dest-filter.diff
sparse-block.diff
ssh-4-6-options.diff
time-limit.diff
transliterate.diff
tru64.diff
write-devices.diff
xattrs.diff

index 2a0f4671c1bdbcd5a2bbf91aa5e2a8366042c7ce..b4e49ccfef301383f905fc26f204fe01bad03064 100644 (file)
--- a/acls.diff
+++ b/acls.diff
@@ -9,7 +9,7 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/acls.c b/acls.c
 --- a/acls.c
 +++ b/acls.c
index d1405b90d2315d36770add129e91e37e335c6763..e1a85f1fc95252183d608d27b95e6b7fe43f392e 100644 (file)
@@ -24,7 +24,7 @@ Todo:
 Fix a bug that could lose some bits when stripping some (supposedly)
 superfluous ACL info.
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/lib/sysacls.c b/lib/sysacls.c
 --- a/lib/sysacls.c
 +++ b/lib/sysacls.c
index 184e0932b1eaa5dda4a445c6c863bede0246004d..e09c5d6a7852132aa7ed98ccb4d682d66d519c99 100644 (file)
@@ -4,7 +4,7 @@ To use this patch, run these commands for a successful build:
     ./configure                      (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/compat.c b/compat.c
 --- a/compat.c
 +++ b/compat.c
@@ -37,7 +37,7 @@ diff --git a/compat.c b/compat.c
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -54,6 +54,7 @@ extern int preserve_specials;
+@@ -55,6 +55,7 @@ extern int preserve_specials;
  extern int delete_during;
  extern int missing_args;
  extern int eol_nulls;
@@ -45,7 +45,7 @@ diff --git a/flist.c b/flist.c
  extern int relative_paths;
  extern int implied_dirs;
  extern int ignore_perishable;
-@@ -397,7 +398,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -379,7 +380,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
  #endif
                            int ndx, int first_ndx)
  {
@@ -54,7 +54,7 @@ diff --git a/flist.c b/flist.c
        static mode_t mode;
  #ifdef SUPPORT_HARD_LINKS
        static int64 dev;
-@@ -497,6 +498,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -479,6 +480,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
                modtime = file->modtime;
        if (NSEC_BUMP(file) && protocol_version >= 31)
                xflags |= XMIT_MOD_NSEC;
@@ -68,7 +68,7 @@ diff --git a/flist.c b/flist.c
  
  #ifdef SUPPORT_HARD_LINKS
        if (tmp_dev != -1) {
-@@ -583,6 +591,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -565,6 +573,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
                write_varint(f, F_MOD_NSEC(file));
        if (!(xflags & XMIT_SAME_MODE))
                write_int(f, to_wire_mode(mode));
@@ -77,7 +77,7 @@ diff --git a/flist.c b/flist.c
        if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
                if (protocol_version < 30)
                        write_int(f, uid);
-@@ -670,7 +680,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -652,7 +662,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
  
  static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags)
  {
@@ -86,7 +86,7 @@ diff --git a/flist.c b/flist.c
        static mode_t mode;
  #ifdef SUPPORT_HARD_LINKS
        static int64 dev;
-@@ -817,6 +827,16 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -799,6 +809,16 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
                modtime_nsec = 0;
        if (!(xflags & XMIT_SAME_MODE))
                mode = from_wire_mode(read_int(f));
@@ -103,7 +103,7 @@ diff --git a/flist.c b/flist.c
  
        if (chmod_modes && !S_ISLNK(mode) && mode)
                mode = tweak_mode(mode, chmod_modes);
-@@ -984,6 +1004,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -966,6 +986,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
                F_GROUP(file) = gid;
                file->flags |= gid_flags;
        }
@@ -112,7 +112,7 @@ diff --git a/flist.c b/flist.c
        if (unsort_ndx)
                F_NDX(file) = flist->used + flist->ndx_start;
  
-@@ -1381,6 +1403,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1363,6 +1385,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                F_GROUP(file) = st.st_gid;
        if (am_generator && st.st_uid == our_uid)
                file->flags |= FLAG_OWNED_BY_US;
@@ -129,7 +129,7 @@ diff --git a/generator.c b/generator.c
                  && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
                        iflags |= ITEM_REPORT_TIME;
 +              if (atimes_ndx && !S_ISDIR(file->mode) && !S_ISLNK(file->mode)
-+               && cmp_time(f_atime(file), sxp->st.st_atime) != 0)
++               && cmp_time(f_atime(file), 0, sxp->st.st_atime, 0) != 0)
 +                      iflags |= ITEM_REPORT_ATIME;
  #if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
                if (S_ISLNK(file->mode)) {
@@ -270,7 +270,7 @@ diff --git a/options.c b/options.c
    {"omit-dir-times",  'O', POPT_ARG_VAL,    &omit_dir_times, 1, 0, 0 },
    {"no-omit-dir-times",0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
    {"no-O",             0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
-@@ -2441,6 +2446,8 @@ void server_options(char **args, int *argc_p)
+@@ -2465,6 +2470,8 @@ void server_options(char **args, int *argc_p)
                argstr[x++] = 'D';
        if (preserve_times)
                argstr[x++] = 't';
@@ -282,7 +282,7 @@ diff --git a/options.c b/options.c
 diff --git a/rsync.c b/rsync.c
 --- a/rsync.c
 +++ b/rsync.c
-@@ -543,26 +543,42 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -549,26 +549,42 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
                set_xattr(fname, file, fnamecmp, sxp);
  #endif
  
@@ -307,7 +307,7 @@ diff --git a/rsync.c b/rsync.c
 +      }
 +      if (!(flags & ATTRS_SKIP_ATIME)) {
 +              time_t file_atime = f_atime(file);
-+              if (cmp_time(sxp->st.st_atime, file_atime) != 0) {
++              if (cmp_time(sxp->st.st_atime, 0, file_atime, 0) != 0) {
 +                      sxp->st.st_atime = file_atime;
 +                      updated = 1;
 +              }
@@ -329,7 +329,7 @@ diff --git a/rsync.c b/rsync.c
        }
  
  #ifdef SUPPORT_ACLS
-@@ -666,7 +682,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -672,7 +688,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
  
        /* Change permissions before putting the file into place. */
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
@@ -338,7 +338,7 @@ diff --git a/rsync.c b/rsync.c
  
        /* move tmp file over real file */
        if (DEBUG_GTE(RECV, 1))
-@@ -691,7 +707,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -697,7 +713,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
  
    do_set_file_attrs:
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
@@ -366,7 +366,7 @@ diff --git a/rsync.h b/rsync.h
  
  #define FULL_FLUSH    1
  #define NORMAL_FLUSH  0
-@@ -709,12 +711,14 @@ extern int file_extra_cnt;
+@@ -715,12 +717,14 @@ extern int file_extra_cnt;
  extern int inc_recurse;
  extern int uid_ndx;
  extern int gid_ndx;
@@ -392,7 +392,7 @@ diff --git a/rsync.yo b/rsync.yo
   -O, --omit-dir-times        omit directories from --times
   -J, --omit-link-times       omit symlinks from --times
       --super                 receiver attempts super-user activities
-@@ -1189,6 +1190,12 @@ cause the next transfer to behave as if it used bf(-I), causing all files to be
+@@ -1214,6 +1215,12 @@ cause the next transfer to behave as if it used bf(-I), causing all files to be
  updated (though rsync's delta-transfer algorithm will make the update fairly efficient
  if the files haven't actually changed, you're much better off using bf(-t)).
  
@@ -405,7 +405,7 @@ diff --git a/rsync.yo b/rsync.yo
  dit(bf(-O, --omit-dir-times)) This tells rsync to omit directories when
  it is preserving modification times (see bf(--times)).  If NFS is sharing
  the directories on the receiving side, it is a good idea to use bf(-O).
-@@ -2169,7 +2176,10 @@ quote(itemization(
+@@ -2200,7 +2207,10 @@ quote(itemization(
    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).
@@ -420,8 +420,8 @@ diff --git a/rsync.yo b/rsync.yo
 diff --git a/syscall.c b/syscall.c
 --- a/syscall.c
 +++ b/syscall.c
-@@ -361,15 +361,15 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
- }
+@@ -380,15 +380,15 @@ int do_setattrlist_times(const char *fname, time_t modtime, uint32 mod_nsec)
+ #endif
  
  #ifdef HAVE_UTIMENSAT
 -int do_utimensat(const char *fname, time_t modtime, uint32 mod_nsec)
@@ -439,7 +439,7 @@ diff --git a/syscall.c b/syscall.c
        t[1].tv_sec = modtime;
        t[1].tv_nsec = mod_nsec;
        return utimensat(AT_FDCWD, fname, t, AT_SYMLINK_NOFOLLOW);
-@@ -377,15 +377,15 @@ int do_utimensat(const char *fname, time_t modtime, uint32 mod_nsec)
+@@ -396,15 +396,15 @@ int do_utimensat(const char *fname, time_t modtime, uint32 mod_nsec)
  #endif
  
  #ifdef HAVE_LUTIMES
@@ -458,7 +458,7 @@ diff --git a/syscall.c b/syscall.c
        t[1].tv_sec = modtime;
        t[1].tv_usec = mod_nsec / 1000;
        return lutimes(fname, t);
-@@ -393,22 +393,22 @@ int do_lutimes(const char *fname, time_t modtime, uint32 mod_nsec)
+@@ -412,22 +412,22 @@ int do_lutimes(const char *fname, time_t modtime, uint32 mod_nsec)
  #endif
  
  #ifdef HAVE_UTIMES
@@ -485,7 +485,7 @@ diff --git a/syscall.c b/syscall.c
  {
  #ifdef HAVE_STRUCT_UTIMBUF
        struct utimbuf tbuf;
-@@ -420,11 +420,11 @@ int do_utime(const char *fname, time_t modtime, UNUSED(uint32 mod_nsec))
+@@ -439,11 +439,11 @@ int do_utime(const char *fname, time_t modtime, UNUSED(uint32 mod_nsec))
        RETURN_ERROR_IF_RO_OR_LO;
  
  # ifdef HAVE_STRUCT_UTIMBUF
@@ -691,7 +691,7 @@ diff --git a/tls.c b/tls.c
 diff --git a/util.c b/util.c
 --- a/util.c
 +++ b/util.c
-@@ -117,20 +117,24 @@ void print_child_argv(const char *prefix, char **cmd)
+@@ -117,14 +117,18 @@ void print_child_argv(const char *prefix, char **cmd)
  
  /* This returns 0 for success, 1 for a symlink if symlink time-setting
   * is not possible, or -1 for any other error. */
@@ -714,6 +714,8 @@ diff --git a/util.c b/util.c
        }
  
        switch (switch_step) {
+@@ -140,7 +144,7 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
  #ifdef HAVE_UTIMENSAT
  #include "case_N.h"
 -              if (do_utimensat(fname, modtime, mod_nsec) == 0)
@@ -721,7 +723,7 @@ diff --git a/util.c b/util.c
                        break;
                if (errno != ENOSYS)
                        return -1;
-@@ -140,7 +144,7 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -150,7 +154,7 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
  
  #ifdef HAVE_LUTIMES
  #include "case_N.h"
@@ -730,7 +732,7 @@ diff --git a/util.c b/util.c
                        break;
                if (errno != ENOSYS)
                        return -1;
-@@ -152,17 +156,17 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -162,17 +166,17 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
                switch_step++;
                if (preserve_times & PRESERVE_LINK_TIMES) {
                        preserve_times &= ~PRESERVE_LINK_TIMES;
index 52c62534966a1469eea13e26e59467d61455dad6..33ca8acff17e7e833e7ea380b59ed99d8873570c 100644 (file)
@@ -7,7 +7,7 @@ To use this patch, run these commands for a successful build:
     ./configure                                 (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
@@ -59,7 +59,7 @@ diff --git a/options.c b/options.c
    {"no-backup",        0,  POPT_ARG_VAL,    &make_backups, 0, 0, 0 },
    {"backup-dir",       0,  POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
    {"suffix",           0,  POPT_ARG_STRING, &backup_suffix, 0, 0, 0 },
-@@ -2608,6 +2610,10 @@ void server_options(char **args, int *argc_p)
+@@ -2632,6 +2634,10 @@ void server_options(char **args, int *argc_p)
        }
  
        if (am_sender) {
@@ -73,7 +73,7 @@ diff --git a/options.c b/options.c
 diff --git a/receiver.c b/receiver.c
 --- a/receiver.c
 +++ b/receiver.c
-@@ -418,7 +418,7 @@ static void handle_delayed_updates(char *local_name)
+@@ -416,7 +416,7 @@ static void handle_delayed_updates(char *local_name)
                struct file_struct *file = cur_flist->files[ndx];
                fname = local_name ? local_name : f_name(file, NULL);
                if ((partialptr = partial_dir_fname(fname)) != NULL) {
@@ -82,7 +82,7 @@ diff --git a/receiver.c b/receiver.c
                                continue;
                        if (DEBUG_GTE(RECV, 1)) {
                                rprintf(FINFO, "renaming %s to %s\n",
-@@ -731,7 +731,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -729,7 +729,7 @@ int recv_files(int f_in, int f_out, char *local_name)
                } else {
                        /* Reminder: --inplace && --partial-dir are never
                         * enabled at the same time. */
@@ -94,7 +94,7 @@ diff --git a/receiver.c b/receiver.c
 diff --git a/rsync.c b/rsync.c
 --- a/rsync.c
 +++ b/rsync.c
-@@ -656,7 +656,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -662,7 +662,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
                goto do_set_file_attrs;
        }
  
@@ -114,7 +114,7 @@ diff --git a/rsync.yo b/rsync.yo
       --backup-dir=DIR        make backups into hierarchy based in DIR
       --suffix=SUFFIX         backup suffix (default ~ w/o --backup-dir)
   -u, --update                skip files that are newer on the receiver
-@@ -791,6 +792,11 @@ in the list so that it has a high enough priority to be effective (e.g., if
+@@ -792,6 +793,11 @@ in the list so that it has a high enough priority to be effective (e.g., if
  your rules specify a trailing inclusion/exclusion of '*', the auto-added
  rule would never be reached).
  
index f443a2fb7e0658d2bca7db9ee1414a4749c0bf99..16d0d1d1754c916be69b2719d5ba755240c7f5ee 100644 (file)
@@ -115,7 +115,7 @@ diff --git a/backup.c b/backup.c
                        unmake_file(file);
                }
  
-@@ -156,28 +163,34 @@ static BOOL copy_valid_path(const char *fname)
+@@ -156,7 +163,12 @@ static BOOL copy_valid_path(const char *fname)
  /* Make a complete pathname for backup file and verify any new path elements. */
  char *get_backup_name(const char *fname)
  {
@@ -123,27 +123,13 @@ diff --git a/backup.c b/backup.c
 +      char *suffix = deleting ? backup_suffix_dels : backup_suffix;
 +
        if (backup_dir) {
-               static int initialized = 0;
--              if (!initialized) {
 +              int prefix_len = deleting ? backup_dir_dels_len : backup_dir_len;
 +              unsigned int remainder = deleting ? backup_dir_dels_remainder : backup_dir_remainder;
-+              int init_bits = deleting ? 2 : 1;
-+              if (!(initialized & init_bits)) {
+               static int initialized = 0;
+               if (!initialized) {
                        int ret;
--                      if (backup_dir_len > 1)
--                              backup_dir_buf[backup_dir_len-1] = '\0';
--                      ret = make_path(backup_dir_buf, 0);
--                      if (backup_dir_len > 1)
--                              backup_dir_buf[backup_dir_len-1] = '/';
-+                      if (prefix_len > 1)
-+                              buf[prefix_len-1] = '\0';
-+                      ret = make_path(buf, 0);
-+                      if (prefix_len > 1)
-+                              buf[prefix_len-1] = '/';
-                       if (ret < 0)
-                               return NULL;
--                      initialized = 1;
-+                      initialized |= init_bits;
+@@ -170,14 +182,14 @@ char *get_backup_name(const char *fname)
+                       initialized = 1;
                }
                /* copy fname into backup_dir_buf while validating the dirs. */
 -              if (copy_valid_path(fname))
@@ -156,12 +142,12 @@ diff --git a/backup.c b/backup.c
  
 -      if (stringjoin(backup_dir_buf, MAXPATHLEN, fname, backup_suffix, NULL) < MAXPATHLEN)
 -              return backup_dir_buf;
-+      if (stringjoin(buf, MAXPATHLEN, fname, suffix, NULL) < MAXPATHLEN)
++      if (stringjoin(backup_dir_buf, MAXPATHLEN, fname, suffix, NULL) < MAXPATHLEN)
 +              return buf;
  
        rprintf(FERROR, "backup filename too long\n");
        return NULL;
-@@ -352,3 +365,13 @@ int make_backup(const char *fname, BOOL prefer_rename)
+@@ -352,3 +364,13 @@ int make_backup(const char *fname, BOOL prefer_rename)
                rprintf(FINFO, "backed up %s to %s\n", fname, buf);
        return ret;
  }
@@ -262,7 +248,7 @@ diff --git a/options.c b/options.c
    {"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 },
-@@ -2101,6 +2111,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2125,6 +2135,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        tmpdir = sanitize_path(NULL, tmpdir, NULL, 0, SP_DEFAULT);
                if (backup_dir)
                        backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, SP_DEFAULT);
@@ -271,7 +257,7 @@ diff --git a/options.c b/options.c
        }
        if (daemon_filter_list.head && !am_sender) {
                filter_rule_list *elp = &daemon_filter_list;
-@@ -2122,6 +2134,14 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2146,6 +2158,14 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        if (check_filter(elp, FLOG, dir, 1) < 0)
                                goto options_rejected;
                }
@@ -286,7 +272,7 @@ diff --git a/options.c b/options.c
        }
  
        if (!backup_suffix)
-@@ -2133,6 +2153,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2157,6 +2177,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        backup_suffix);
                return 0;
        }
@@ -307,7 +293,7 @@ diff --git a/options.c b/options.c
        if (backup_dir) {
                size_t len;
                while (*backup_dir == '.' && backup_dir[1] == '/')
-@@ -2168,6 +2202,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2192,6 +2226,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        "P *%s", backup_suffix);
                parse_filter_str(&filter_list, backup_dir_buf, rule_template(0), 0);
        }
@@ -342,7 +328,7 @@ diff --git a/options.c b/options.c
  
        if (preserve_times) {
                preserve_times = PRESERVE_FILE_TIMES;
-@@ -2594,6 +2656,10 @@ void server_options(char **args, int *argc_p)
+@@ -2618,6 +2680,10 @@ void server_options(char **args, int *argc_p)
                args[ac++] = "--backup-dir";
                args[ac++] = backup_dir;
        }
@@ -353,7 +339,7 @@ diff --git a/options.c b/options.c
  
        /* Only send --suffix if it specifies a non-default value. */
        if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) {
-@@ -2602,6 +2668,14 @@ void server_options(char **args, int *argc_p)
+@@ -2626,6 +2692,14 @@ void server_options(char **args, int *argc_p)
                        goto oom;
                args[ac++] = arg;
        }
index d6c3c9714ff04340c19db1f67986eb3c79b036e1..be75bd9119303a01e2166e7683068f03b0005f0e 100644 (file)
@@ -25,7 +25,7 @@ To use this patch, run these commands for a successful build:
     ./configure                                  (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/errcode.h b/errcode.h
 --- a/errcode.h
 +++ b/errcode.h
@@ -65,7 +65,7 @@ diff --git a/main.c b/main.c
  }
  
  void write_del_stats(int f)
-@@ -1466,6 +1469,14 @@ void remember_children(UNUSED(int val))
+@@ -1469,6 +1472,14 @@ void remember_children(UNUSED(int val))
                                break;
                        }
                }
@@ -80,7 +80,7 @@ diff --git a/main.c b/main.c
        }
  #endif
  #ifndef HAVE_SIGACTION
-@@ -1523,6 +1534,12 @@ static void rsync_panic_handler(UNUSED(int whatsig))
+@@ -1526,6 +1537,12 @@ static void rsync_panic_handler(UNUSED(int whatsig))
  }
  #endif
  
@@ -93,7 +93,7 @@ diff --git a/main.c b/main.c
  
  int main(int argc,char *argv[])
  {
-@@ -1545,6 +1562,11 @@ int main(int argc,char *argv[])
+@@ -1548,6 +1565,11 @@ int main(int argc,char *argv[])
        SIGACTMASK(SIGFPE, rsync_panic_handler);
        SIGACTMASK(SIGABRT, rsync_panic_handler);
        SIGACTMASK(SIGBUS, rsync_panic_handler);
index c99d3d27a73f557e2bac28c1201558bec2ba750a..0ccaa6cd17a5dadd4ba5dae4f78ab27434838942 100644 (file)
@@ -16,7 +16,7 @@ To use this patch, run these commands for a successful build:
     ./configure                               (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/clientserver.c b/clientserver.c
 --- a/clientserver.c
 +++ b/clientserver.c
@@ -29,7 +29,7 @@ diff --git a/clientserver.c b/clientserver.c
  extern int io_timeout;
  extern int no_detach;
  extern int write_batch;
-@@ -902,6 +904,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -906,6 +908,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
        } else if (am_root < 0) /* Treat --fake-super from client as --super. */
                am_root = 2;
  
@@ -58,7 +58,7 @@ diff --git a/flist.c b/flist.c
  extern int checksum_type;
  extern int module_id;
  extern int ignore_errors;
-@@ -59,6 +61,7 @@ extern int implied_dirs;
+@@ -60,6 +62,7 @@ extern int implied_dirs;
  extern int ignore_perishable;
  extern int non_perishable_cnt;
  extern int prune_empty_dirs;
@@ -66,7 +66,7 @@ diff --git a/flist.c b/flist.c
  extern int copy_links;
  extern int copy_unsafe_links;
  extern int protocol_version;
-@@ -70,6 +73,7 @@ extern int sender_symlink_iconv;
+@@ -71,6 +74,7 @@ extern int sender_symlink_iconv;
  extern int output_needs_newline;
  extern int sender_keeps_checksum;
  extern int unsort_ndx;
@@ -74,7 +74,7 @@ diff --git a/flist.c b/flist.c
  extern uid_t our_uid;
  extern struct stats stats;
  extern char *filesfrom_host;
-@@ -87,6 +91,20 @@ extern int filesfrom_convert;
+@@ -88,6 +92,20 @@ extern int filesfrom_convert;
  extern iconv_t ic_send, ic_recv;
  #endif
  
@@ -95,9 +95,9 @@ diff --git a/flist.c b/flist.c
  #define PTR_SIZE (sizeof (struct file_struct *))
  
  int io_error;
-@@ -129,7 +147,11 @@ static char tmp_sum[MAX_DIGEST_LEN];
- static char empty_sum[MAX_DIGEST_LEN];
+@@ -131,7 +149,11 @@ static char empty_sum[MAX_DIGEST_LEN];
  static int flist_count_offset; /* for --delete --progress */
+ static int show_filelist_progress;
  
 -static void flist_sort_and_clean(struct file_list *flist, int strip_root);
 +static struct csum_cache {
@@ -108,7 +108,7 @@ diff --git a/flist.c b/flist.c
  static void output_flist(struct file_list *flist);
  
  void init_flist(void)
-@@ -343,6 +365,238 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -325,6 +347,238 @@ static void flist_done_allocating(struct file_list *flist)
                flist->pool_boundary = ptr;
  }
  
@@ -181,7 +181,7 @@ diff --git a/flist.c b/flist.c
 +      F_CTIME(file) = ctime;
 +      F_INODE(file) = inode;
 +      bp = F_SUM(file);
-+      memcpy(bp, sum, checksum_len);
++      memcpy(bp, sum, flist_csum_len);
 +
 +      flist_expand(flist, 1);
 +      flist->files[flist->used++] = file;
@@ -221,7 +221,7 @@ diff --git a/flist.c b/flist.c
 +
 +      while (fgets(line, sizeof line, fp)) {
 +              cp = line;
-+              if (protocol_version >= 30) {
++              if (checksum_type == 5) {
 +                      char *alt_sum = cp;
 +                      if (*cp == '=')
 +                              while (*++cp == '=') {}
@@ -235,7 +235,7 @@ diff --git a/flist.c b/flist.c
 +              if (*cp == '=') {
 +                      continue;
 +              } else {
-+                      for (i = 0; i < checksum_len*2; i++, cp++) {
++                      for (i = 0; i < flist_csum_len*2; i++, cp++) {
 +                              int x;
 +                              if (isXDigit(cp)) {
 +                                      if (isDigit(cp))
@@ -256,7 +256,7 @@ diff --git a/flist.c b/flist.c
 +                      break;
 +              while (*++cp == ' ') {}
 +
-+              if (protocol_version < 30) {
++              if (checksum_type != 5) {
 +                      char *alt_sum = cp;
 +                      if (*cp == '=')
 +                              while (*++cp == '=') {}
@@ -347,7 +347,7 @@ diff --git a/flist.c b/flist.c
  /* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
   * F_PATHNAME(), or (2) "NULL, dir, dirlen" to chdir() to the supplied dir,
   * with dir == NULL taken to be the starting directory, and dirlen < 0
-@@ -1146,7 +1400,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1128,7 +1382,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                              STRUCT_STAT *stp, int flags, int filter_level)
  {
        static char *lastdir;
@@ -356,7 +356,7 @@ diff --git a/flist.c b/flist.c
        struct file_struct *file;
        char thisname[MAXPATHLEN];
        char linkname[MAXPATHLEN];
-@@ -1292,9 +1546,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1274,9 +1528,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                        memcpy(lastdir, thisname, len);
                        lastdir[len] = '\0';
                        lastdir_len = len;
@@ -374,7 +374,7 @@ diff --git a/flist.c b/flist.c
        basename_len = strlen(basename) + 1; /* count the '\0' */
  
  #ifdef SUPPORT_LINKS
-@@ -1312,11 +1573,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1294,11 +1555,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                extra_len += EXTRA_LEN;
  #endif
  
@@ -388,24 +388,24 @@ diff --git a/flist.c b/flist.c
  
  #if EXTRA_ROUNDING > 0
        if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
-@@ -1401,8 +1659,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1383,8 +1641,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                return NULL;
        }
  
 -      if (sender_keeps_checksum && S_ISREG(st.st_mode))
--              memcpy(F_SUM(file), tmp_sum, checksum_len);
+-              memcpy(F_SUM(file), tmp_sum, flist_csum_len);
 +      if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
 +              if (flist && checksum_files)
 +                      get_cached_checksum(0, thisname, file, &st, tmp_sum);
 +              else
 +                      file_checksum(thisname, &st, tmp_sum);
 +              if (sender_keeps_checksum)
-+                      memcpy(F_SUM(file), tmp_sum, checksum_len);
++                      memcpy(F_SUM(file), tmp_sum, flist_csum_len);
 +      }
  
        if (unsort_ndx)
                F_NDX(file) = stats.num_dirs;
-@@ -2584,7 +2848,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2566,7 +2830,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
        /* The --relative option sends paths with a leading slash, so we need
         * to specify the strip_root option here.  We rejected leading slashes
         * for a non-relative transfer in recv_file_entry(). */
@@ -414,7 +414,7 @@ diff --git a/flist.c b/flist.c
  
        if (protocol_version < 30) {
                /* Recv the io_error flag */
-@@ -2835,7 +3099,7 @@ void flist_free(struct file_list *flist)
+@@ -2817,7 +3081,7 @@ void flist_free(struct file_list *flist)
  
  /* This routine ensures we don't have any duplicate names in our file list.
   * duplicate names can cause corruption because of the pipelining. */
@@ -423,7 +423,7 @@ diff --git a/flist.c b/flist.c
  {
        char fbuf[MAXPATHLEN];
        int i, prev_i;
-@@ -2886,7 +3150,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2868,7 +3132,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
                        /* If one is a dir and the other is not, we want to
                         * keep the dir because it might have contents in the
                         * list.  Otherwise keep the first one. */
@@ -432,7 +432,7 @@ diff --git a/flist.c b/flist.c
                                struct file_struct *fp = flist->sorted[j];
                                if (!S_ISDIR(fp->mode))
                                        keep = i, drop = j;
-@@ -2902,8 +3166,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2884,8 +3148,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
                        } else
                                keep = j, drop = i;
  
@@ -443,7 +443,7 @@ diff --git a/flist.c b/flist.c
                                        rprintf(FINFO,
                                            "removing duplicate name %s from file list (%d)\n",
                                            f_name(file, fbuf), drop + flist->ndx_start);
-@@ -2925,7 +3189,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2907,7 +3171,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
        }
        flist->high = prev_i;
  
@@ -481,7 +481,7 @@ diff --git a/generator.c b/generator.c
 +                      get_cached_checksum(slot, fn, file, st, sum);
 +              else
 +                      file_checksum(fn, st, sum);
-               return memcmp(sum, F_SUM(file), checksum_len) == 0;
+               return memcmp(sum, F_SUM(file), flist_csum_len) == 0;
        }
  
 @@ -881,7 +885,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
@@ -537,7 +537,7 @@ diff --git a/generator.c b/generator.c
                statret = link_stat(fname, &sx.st, keep_dirlinks && is_dir);
 @@ -1757,7 +1765,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                ;
-       else if (fnamecmp_type == FNAMECMP_FUZZY)
+       else if (fnamecmp_type >= FNAMECMP_FUZZY)
                ;
 -      else if (unchanged_file(fnamecmp, file, &sx.st)) {
 +      else if (unchanged_file(fnamecmp, file, &sx.st, fnamecmp_type == FNAMECMP_FNAME ? 0 : -1)) {
@@ -575,7 +575,7 @@ diff --git a/itypes.h b/itypes.h
 diff --git a/loadparm.c b/loadparm.c
 --- a/loadparm.c
 +++ b/loadparm.c
-@@ -134,6 +134,7 @@ typedef struct {
+@@ -138,6 +138,7 @@ typedef struct {
  /* NOTE: update this macro if the last char* variable changes! */
  #define LOCAL_STRING_COUNT() (offsetof(local_vars, uid) / sizeof (char*) + 1)
  
@@ -583,7 +583,7 @@ diff --git a/loadparm.c b/loadparm.c
        int max_connections;
        int max_verbosity;
        int syslog_facility;
-@@ -208,6 +209,7 @@ static const all_vars Defaults = {
+@@ -216,6 +217,7 @@ static const all_vars Defaults = {
   /* temp_dir; */              NULL,
   /* uid; */                   NULL,
  
@@ -591,7 +591,7 @@ diff --git a/loadparm.c b/loadparm.c
   /* max_connections; */               0,
   /* max_verbosity; */         1,
   /* syslog_facility; */               LOG_DAEMON,
-@@ -310,6 +312,13 @@ static struct enum_list enum_facilities[] = {
+@@ -318,6 +320,13 @@ static struct enum_list enum_facilities[] = {
        { -1, NULL }
  };
  
@@ -605,7 +605,7 @@ diff --git a/loadparm.c b/loadparm.c
  static struct parm_struct parm_table[] =
  {
   {"address",           P_STRING, P_GLOBAL,&Vars.g.bind_address,        NULL,0},
-@@ -321,6 +330,7 @@ static struct parm_struct parm_table[] =
+@@ -332,6 +341,7 @@ static struct parm_struct parm_table[] =
  
   {"auth users",        P_STRING, P_LOCAL, &Vars.l.auth_users,          NULL,0},
   {"charset",           P_STRING, P_LOCAL, &Vars.l.charset,             NULL,0},
@@ -613,7 +613,7 @@ diff --git a/loadparm.c b/loadparm.c
   {"comment",           P_STRING, P_LOCAL, &Vars.l.comment,             NULL,0},
   {"dont compress",     P_STRING, P_LOCAL, &Vars.l.dont_compress,       NULL,0},
   {"exclude from",      P_STRING, P_LOCAL, &Vars.l.exclude_from,        NULL,0},
-@@ -477,6 +487,7 @@ FN_LOCAL_STRING(lp_secrets_file, secrets_file)
+@@ -493,6 +503,7 @@ FN_LOCAL_STRING(lp_syslog_tag, syslog_tag)
  FN_LOCAL_STRING(lp_temp_dir, temp_dir)
  FN_LOCAL_STRING(lp_uid, uid)
  
@@ -657,7 +657,7 @@ diff --git a/options.c b/options.c
    {"block-size",      'B', POPT_ARG_LONG,   &block_size, 0, 0, 0 },
    {"compare-dest",     0,  POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
    {"copy-dest",        0,  POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
-@@ -1676,6 +1679,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1696,6 +1699,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        }
                        break;
  
@@ -681,7 +681,7 @@ diff --git a/options.c b/options.c
                case OPT_INFO:
                        arg = poptGetOptArg(pc);
                        parse_output_words(info_words, info_levels, arg, USER_PRIORITY);
-@@ -1953,6 +1973,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1977,6 +1997,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
        }
  #endif
  
@@ -694,7 +694,7 @@ diff --git a/options.c b/options.c
 diff --git a/rsync.h b/rsync.h
 --- a/rsync.h
 +++ b/rsync.h
-@@ -772,6 +772,10 @@ extern int xattrs_ndx;
+@@ -778,6 +778,10 @@ extern int xattrs_ndx;
  #define F_SUM(f) ((char*)OPT_EXTRA(f, START_BUMP(f) + HLINK_BUMP(f) \
                                    + SUM_EXTRA_CNT - 1))
  
@@ -705,7 +705,7 @@ diff --git a/rsync.h b/rsync.h
  /* Some utility defines: */
  #define F_IS_ACTIVE(f) (f)->basename[0]
  #define F_IS_HLINKED(f) ((f)->flags & FLAG_HLINKED)
-@@ -969,6 +973,13 @@ typedef struct {
+@@ -980,6 +984,13 @@ typedef struct {
        char fname[1]; /* has variable size */
  } relnamecache;
  
@@ -730,7 +730,7 @@ diff --git a/rsync.yo b/rsync.yo
   -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
       --no-OPTION             turn off an implied OPTION (e.g. --no-D)
   -r, --recursive             recurse into directories
-@@ -630,9 +631,9 @@ uses a "quick check" that (by default) checks if each file's size and time
+@@ -631,9 +632,9 @@ uses a "quick check" that (by default) checks if each file's size and time
  of last modification match between the sender and receiver.  This option
  changes this to compare a 128-bit checksum for each file that has a
  matching size.  Generating the checksums means that both sides will expend
@@ -743,7 +743,7 @@ diff --git a/rsync.yo b/rsync.yo
  
  The sending side generates its checksums while it is doing the file-system
  scan that builds the list of the available files.  The receiver generates
-@@ -640,6 +641,8 @@ its checksums when it is scanning for changed files, and will checksum any
+@@ -641,6 +642,8 @@ its checksums when it is scanning for changed files, and will checksum any
  file that has the same size as the corresponding sender's file:  files with
  either a changed size or a changed checksum are selected for transfer.
  
@@ -752,7 +752,7 @@ diff --git a/rsync.yo b/rsync.yo
  Note that rsync always verifies that each em(transferred) file was
  correctly reconstructed on the receiving side by checking a whole-file
  checksum that is generated as the file is transferred, but that
-@@ -649,6 +652,36 @@ option's before-the-transfer "Does this file need to be updated?" check.
+@@ -650,6 +653,36 @@ option's before-the-transfer "Does this file need to be updated?" check.
  For protocol 30 and beyond (first supported in 3.0.0), the checksum used is
  MD5.  For older protocols, the checksum used is MD4.
  
@@ -792,7 +792,7 @@ diff --git a/rsync.yo b/rsync.yo
 diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
 --- a/rsyncd.conf.yo
 +++ b/rsyncd.conf.yo
-@@ -334,6 +334,17 @@ locking on this file to ensure that the max connections limit is not
+@@ -355,6 +355,17 @@ locking on this file to ensure that the max connections limit is not
  exceeded for the modules sharing the lock file.
  The default is tt(/var/run/rsyncd.lock).
  
index 7f8f5f67a02c5ddb8f4666e09f910583ae76d430..2312e95efe7adc3f71b35ab7a3aa57f2c34548b6 100644 (file)
@@ -29,7 +29,7 @@ diff --git a/flist.c b/flist.c
  extern int am_root;
  extern int am_server;
  extern int am_daemon;
-@@ -107,6 +108,9 @@ extern iconv_t ic_send, ic_recv;
+@@ -108,6 +109,9 @@ extern iconv_t ic_send, ic_recv;
  
  #define PTR_SIZE (sizeof (struct file_struct *))
  
@@ -37,11 +37,11 @@ diff --git a/flist.c b/flist.c
 +#define FLAG_SUM_KEEP (1<<2) /* keep entry when rewriting */
 +
  int io_error;
- int checksum_len;
+ int flist_csum_len;
  dev_t filesystem_dev; /* used to implement -x */
-@@ -147,8 +151,13 @@ static char tmp_sum[MAX_DIGEST_LEN];
- static char empty_sum[MAX_DIGEST_LEN];
+@@ -149,8 +153,13 @@ static char empty_sum[MAX_DIGEST_LEN];
  static int flist_count_offset; /* for --delete --progress */
+ static int show_filelist_progress;
  
 +#define REGULAR_SKIPPED(flist) ((flist)->to_redo)
 +
@@ -53,7 +53,7 @@ diff --git a/flist.c b/flist.c
  } *csum_cache = NULL;
  
  static void flist_sort_and_clean(struct file_list *flist, int flags);
-@@ -365,7 +374,79 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -347,7 +356,79 @@ static void flist_done_allocating(struct file_list *flist)
                flist->pool_boundary = ptr;
  }
  
@@ -105,11 +105,11 @@ diff --git a/flist.c b/flist.c
 +      for (i = flist->low; i <= flist->high; i++) {
 +              struct file_struct *file = flist->sorted[i];
 +              const char *cp = F_SUM(file);
-+              const char *end = cp + checksum_len;
++              const char *end = cp + flist_csum_len;
 +              const char *alt_sum = file->basename + strlen(file->basename) + 1;
 +              if (whole_dir && !(file->flags & FLAG_SUM_KEEP))
 +                      continue;
-+              if (protocol_version >= 30)
++              if (checksum_type == 5)
 +                      fprintf(out_fp, "%s ", alt_sum);
 +              if (file->flags & FLAG_SUM_MISSING) {
 +                      do {
@@ -120,7 +120,7 @@ diff --git a/flist.c b/flist.c
 +                              fprintf(out_fp, "%02x", (int)CVAL(cp, 0));
 +                      } while (++cp != end);
 +              }
-+              if (protocol_version < 30)
++              if (checksum_type != 5)
 +                      fprintf(out_fp, " %s", alt_sum);
 +              fprintf(out_fp, " %10.0f %10.0f %10lu %10lu %s\n",
 +                      (double)F_LENGTH(file), (double)file->modtime,
@@ -134,7 +134,7 @@ diff --git a/flist.c b/flist.c
  {
        int slot, slots = am_sender ? 1 : basis_dir_cnt + 1;
  
-@@ -379,6 +460,9 @@ void reset_checksum_cache()
+@@ -361,6 +442,9 @@ void reset_checksum_cache()
                struct file_list *flist = csum_cache[slot].flist;
  
                if (flist) {
@@ -144,7 +144,7 @@ diff --git a/flist.c b/flist.c
                        /* Reset the pool memory and empty the file-list array. */
                        pool_free_old(flist->file_pool,
                                      pool_boundary(flist->file_pool, 0));
-@@ -389,6 +473,10 @@ void reset_checksum_cache()
+@@ -371,6 +455,10 @@ void reset_checksum_cache()
                flist->low = 0;
                flist->high = -1;
                flist->next = NULL;
@@ -155,7 +155,7 @@ diff --git a/flist.c b/flist.c
        }
  }
  
-@@ -396,7 +484,7 @@ void reset_checksum_cache()
+@@ -378,7 +466,7 @@ void reset_checksum_cache()
  static int add_checksum(struct file_list *flist, const char *dirname,
                        const char *basename, int basename_len, OFF_T file_length,
                        time_t mtime, uint32 ctime, uint32 inode,
@@ -164,31 +164,31 @@ diff --git a/flist.c b/flist.c
  {
        struct file_struct *file;
        int alloc_len, extra_len;
-@@ -413,7 +501,7 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -395,7 +483,7 @@ static int add_checksum(struct file_list *flist, const char *dirname,
        if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
                extra_len = (extra_len | (EXTRA_ROUNDING * EXTRA_LEN)) + EXTRA_LEN;
  #endif
 -      alloc_len = FILE_STRUCT_LEN + extra_len + basename_len;
-+      alloc_len = FILE_STRUCT_LEN + extra_len + basename_len + checksum_len*2 + 1;
++      alloc_len = FILE_STRUCT_LEN + extra_len + basename_len + flist_csum_len*2 + 1;
        bp = pool_alloc(flist->file_pool, alloc_len, "add_checksum");
  
        memset(bp, 0, extra_len + FILE_STRUCT_LEN);
-@@ -422,7 +510,14 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -404,7 +492,14 @@ static int add_checksum(struct file_list *flist, const char *dirname,
        bp += FILE_STRUCT_LEN;
  
        memcpy(bp, basename, basename_len);
 +      if (alt_sum)
-+              strlcpy(bp+basename_len, alt_sum, checksum_len*2 + 1);
++              strlcpy(bp+basename_len, alt_sum, flist_csum_len*2 + 1);
 +      else {
-+              memset(bp+basename_len, '=', checksum_len*2);
-+              bp[basename_len+checksum_len*2] = '\0';
++              memset(bp+basename_len, '=', flist_csum_len*2);
++              bp[basename_len+flist_csum_len*2] = '\0';
 +      }
  
 +      file->flags = flags;
        file->mode = S_IFREG;
        file->modtime = mtime;
        file->len32 = (uint32)file_length;
-@@ -451,10 +546,11 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -433,10 +528,11 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
        char line[MAXPATHLEN+1024], fbuf[MAXPATHLEN], sum[MAX_DIGEST_LEN];
        FILE *fp;
        char *cp;
@@ -201,32 +201,32 @@ diff --git a/flist.c b/flist.c
        int dlen = dirname ? strlcpy(fbuf, dirname, sizeof fbuf) : 0;
  
        if (dlen >= (int)(sizeof fbuf - 1 - RSYNCSUMS_LEN))
-@@ -475,7 +571,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -457,7 +553,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
        while (fgets(line, sizeof line, fp)) {
                cp = line;
-               if (protocol_version >= 30) {
+               if (checksum_type == 5) {
 -                      char *alt_sum = cp;
 +                      alt_sum = cp;
                        if (*cp == '=')
                                while (*++cp == '=') {}
                        else
-@@ -486,7 +582,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -468,7 +564,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
                }
  
                if (*cp == '=') {
 -                      continue;
-+                      for (i = 0; i < checksum_len*2; i++, cp++) {
++                      for (i = 0; i < flist_csum_len*2; i++, cp++) {
 +                              if (*cp != '=') {
 +                                      cp = "";
 +                                      break;
 +                              }
 +                      }
-+                      memset(sum, 0, checksum_len);
++                      memset(sum, 0, flist_csum_len);
 +                      flags = FLAG_SUM_MISSING;
                } else {
-                       for (i = 0; i < checksum_len*2; i++, cp++) {
+                       for (i = 0; i < flist_csum_len*2; i++, cp++) {
                                int x;
-@@ -504,13 +607,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -486,13 +589,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
                                else
                                        sum[i/2] = x << 4;
                        }
@@ -236,13 +236,13 @@ diff --git a/flist.c b/flist.c
                        break;
                while (*++cp == ' ') {}
  
-               if (protocol_version < 30) {
+               if (checksum_type != 5) {
 -                      char *alt_sum = cp;
 +                      alt_sum = cp;
                        if (*cp == '=')
                                while (*++cp == '=') {}
                        else
-@@ -560,24 +664,112 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -542,24 +646,112 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
                        continue;
  
                strlcpy(fbuf+dlen, cp, sizeof fbuf - dlen);
@@ -280,22 +280,22 @@ diff --git a/flist.c b/flist.c
 +
 +      if (file_flist != flist->next) {
 +              const char *cp = F_SUM(file);
-+              const char *end = cp + checksum_len;
++              const char *end = cp + flist_csum_len;
 +
 +              if (!(out_fp = fopen(fbuf, "a")))
 +                      return;
 +
-+              if (protocol_version >= 30) {
-+                      for (j = 0; j < checksum_len; j++)
++              if (checksum_type == 5) {
++                      for (j = 0; j < flist_csum_len; j++)
 +                              fputs("==", out_fp);
 +                      fputc(' ', out_fp);
 +              }
 +              do {
 +                      fprintf(out_fp, "%02x", (int)CVAL(cp, 0));
 +              } while (++cp != end);
-+              if (protocol_version < 30) {
++              if (checksum_type != 5) {
 +                      fputc(' ', out_fp);
-+                      for (j = 0; j < checksum_len; j++)
++                      for (j = 0; j < flist_csum_len; j++)
 +                              fputs("==", out_fp);
 +              }
 +              fprintf(out_fp, " %10.0f %10.0f %10lu %10lu %s\n",
@@ -357,7 +357,7 @@ diff --git a/flist.c b/flist.c
                read_checksums(slot, flist, file->dirname);
        }
  
-@@ -589,12 +781,31 @@ void get_cached_checksum(int slot, const char *fname, struct file_struct *file,
+@@ -571,12 +763,31 @@ void get_cached_checksum(int slot, const char *fname, struct file_struct *file,
                 && (checksum_files & CSF_LAX
                  || (F_CTIME(fp) == (uint32)stp->st_ctime
                   && F_INODE(fp) == (uint32)stp->st_ino))) {
@@ -390,7 +390,7 @@ diff --git a/flist.c b/flist.c
  }
  
  /* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
-@@ -1501,6 +1712,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1483,6 +1694,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
        if (is_excluded(thisname, S_ISDIR(st.st_mode) != 0, filter_level)) {
                if (ignore_perishable)
                        non_perishable_cnt++;
@@ -399,7 +399,7 @@ diff --git a/flist.c b/flist.c
                return NULL;
        }
  
-@@ -1547,13 +1760,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1529,13 +1742,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                        lastdir[len] = '\0';
                        lastdir_len = len;
                        if (checksum_files && am_sender && flist)
@@ -415,7 +415,7 @@ diff --git a/flist.c b/flist.c
                }
        }
        basename_len = strlen(basename) + 1; /* count the '\0' */
-@@ -1661,7 +1874,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1643,7 +1856,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
  
        if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
                if (flist && checksum_files)
@@ -424,7 +424,7 @@ diff --git a/flist.c b/flist.c
                else
                        file_checksum(thisname, &st, tmp_sum);
                if (sender_keeps_checksum)
-@@ -2037,6 +2250,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -2019,6 +2232,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
  
        closedir(d);
  
@@ -434,7 +434,7 @@ diff --git a/flist.c b/flist.c
        if (f >= 0 && recurse && !divert_dirs) {
                int i, end = flist->used - 1;
                /* send_if_directory() bumps flist->used, so use "end". */
-@@ -2696,6 +2912,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2678,6 +2894,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
                        rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
        }
  
@@ -463,7 +463,7 @@ diff --git a/generator.c b/generator.c
 +                      get_cached_checksum(slot, fn, file, -1, st, sum);
                else
                        file_checksum(fn, st, sum);
-               return memcmp(sum, F_SUM(file), checksum_len) == 0;
+               return memcmp(sum, F_SUM(file), flist_csum_len) == 0;
 @@ -1318,7 +1319,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                                }
                        }
@@ -533,7 +533,7 @@ diff --git a/io.c b/io.c
 diff --git a/loadparm.c b/loadparm.c
 --- a/loadparm.c
 +++ b/loadparm.c
-@@ -316,6 +316,10 @@ static struct enum_list enum_csum_modes[] = {
+@@ -324,6 +324,10 @@ static struct enum_list enum_csum_modes[] = {
        { CSF_IGNORE_FILES, "none" },
        { CSF_LAX_MODE, "lax" },
        { CSF_STRICT_MODE, "strict" },
@@ -547,7 +547,7 @@ diff --git a/loadparm.c b/loadparm.c
 diff --git a/options.c b/options.c
 --- a/options.c
 +++ b/options.c
-@@ -1681,7 +1681,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1701,7 +1701,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
  
                case OPT_SUMFILES:
                        arg = poptGetOptArg(pc);
@@ -575,7 +575,7 @@ diff --git a/receiver.c b/receiver.c
  extern int whole_file;
  extern int inplace;
  extern int allowed_lull;
-@@ -431,7 +432,7 @@ static void handle_delayed_updates(char *local_name)
+@@ -429,7 +430,7 @@ static void handle_delayed_updates(char *local_name)
                                        "rename failed for %s (from %s)",
                                        full_fname(fname), partialptr);
                        } else {
@@ -584,7 +584,7 @@ diff --git a/receiver.c b/receiver.c
                                 || (preserve_hard_links && F_IS_HLINKED(file)))
                                        send_msg_int(MSG_SUCCESS, ndx);
                                handle_partial_dir(partialptr, PDIR_DELETE);
-@@ -893,7 +894,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -891,7 +892,7 @@ int recv_files(int f_in, int f_out, char *local_name)
                case 2:
                        break;
                case 1:
@@ -596,7 +596,7 @@ diff --git a/receiver.c b/receiver.c
 diff --git a/rsync.h b/rsync.h
 --- a/rsync.h
 +++ b/rsync.h
-@@ -975,6 +975,8 @@ typedef struct {
+@@ -986,6 +986,8 @@ typedef struct {
  
  #define CSF_ENABLE (1<<1)
  #define CSF_LAX (1<<2)
@@ -608,7 +608,7 @@ diff --git a/rsync.h b/rsync.h
 diff --git a/rsync.yo b/rsync.yo
 --- a/rsync.yo
 +++ b/rsync.yo
-@@ -661,9 +661,13 @@ computed just as it would be if bf(--sumfiles) was not specified.
+@@ -662,9 +662,13 @@ computed just as it would be if bf(--sumfiles) was not specified.
  
  The MODE value is either "lax", for relaxed checking (which compares size
  and mtime), "strict" (which also compares ctime and inode), or "none" to
@@ -628,7 +628,7 @@ diff --git a/rsync.yo b/rsync.yo
 diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
 --- a/rsyncd.conf.yo
 +++ b/rsyncd.conf.yo
-@@ -337,13 +337,15 @@ The default is tt(/var/run/rsyncd.lock).
+@@ -358,13 +358,15 @@ The default is tt(/var/run/rsyncd.lock).
  dit(bf(checksum files)) This parameter tells rsync to make use of any cached
  checksum information it finds in per-directory .rsyncsums files when the
  current transfer is using the bf(--checksum) option.  The value can be set
index 4fd2113f43376ec8a2be23c29ea4e3ab323778ab..9f4872d8a7f9df158cd71da6f7e4b190ce90a5bc 100644 (file)
@@ -8,11 +8,11 @@ To use this patch, run these commands for a successful build:
     ./configure                               (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -1313,7 +1313,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1295,7 +1295,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
  #endif
  
        if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
@@ -32,7 +32,7 @@ diff --git a/generator.c b/generator.c
 -              file_checksum(fn, st, sum);
 +              if (!get_sum_xattr(fn, st, sum))
 +                      file_checksum(fn, st, sum);
-               return memcmp(sum, F_SUM(file), checksum_len) == 0;
+               return memcmp(sum, F_SUM(file), flist_csum_len) == 0;
        }
  
 diff --git a/support/xsums b/support/xsums
@@ -247,16 +247,17 @@ new file mode 100755
 diff --git a/xattrs.c b/xattrs.c
 --- a/xattrs.c
 +++ b/xattrs.c
-@@ -37,6 +37,8 @@ extern int preserve_links;
+@@ -36,7 +36,9 @@ extern int preserve_xattrs;
+ extern int preserve_links;
  extern int preserve_devices;
  extern int preserve_specials;
++extern int checksum_type;
  extern int checksum_seed;
-+extern int checksum_len;
-+extern int protocol_version;
++extern int flist_csum_len;
+ extern int saw_xattr_filter;
  
  #define RSYNC_XAL_INITIAL 5
- #define RSYNC_XAL_LIST_INITIAL 100
-@@ -72,6 +74,10 @@ extern int checksum_seed;
+@@ -73,6 +75,10 @@ extern int saw_xattr_filter;
  #define XACC_ACL_ATTR RSYNC_PREFIX "%" XACC_ACL_SUFFIX
  #define XDEF_ACL_SUFFIX "dacl"
  #define XDEF_ACL_ATTR RSYNC_PREFIX "%" XDEF_ACL_SUFFIX
@@ -267,7 +268,7 @@ diff --git a/xattrs.c b/xattrs.c
  
  typedef struct {
        char *datum, *name;
-@@ -264,7 +270,9 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+@@ -266,7 +272,9 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
                         || (am_root < 0
                          && (strcmp(name+RPRE_LEN+1, XSTAT_SUFFIX) == 0
                           || strcmp(name+RPRE_LEN+1, XACC_ACL_SUFFIX) == 0
@@ -278,14 +279,13 @@ diff --git a/xattrs.c b/xattrs.c
                                continue;
                }
  
-@@ -1120,6 +1128,39 @@ int del_def_xattr_acl(const char *fname)
+@@ -1138,6 +1146,38 @@ int del_def_xattr_acl(const char *fname)
  }
  #endif
  
 +int get_sum_xattr(const char *fname, STRUCT_STAT *stp, char *sum)
 +{
-+      const char *mdattr = protocol_version >= 30
-+                         ? MD5_ATTR : MD4_ATTR;
++      const char *mdattr = checksum_type == 5 ? MD5_ATTR : MD4_ATTR;
 +      char buf[256];
 +      uint32 file_length, mtime;
 +      int len;
@@ -298,7 +298,7 @@ diff --git a/xattrs.c b/xattrs.c
 +                      mdattr, full_fname(fname));
 +              return 0;
 +      }
-+      if (len != 4 + 4 + checksum_len) {
++      if (len != 4 + 4 + flist_csum_len) {
 +              rprintf(FERROR, "Corrupt %s xattr attached to %s -- skipping\n",
 +                      mdattr, full_fname(fname));
 +              return 0;
@@ -310,7 +310,7 @@ diff --git a/xattrs.c b/xattrs.c
 +      if ((uint32)stp->st_size != file_length || (uint32)stp->st_mtime != mtime)
 +              return 0;
 +
-+      memcpy(sum, buf + 8, checksum_len);
++      memcpy(sum, buf + 8, flist_csum_len);
 +
 +      return 1;
 +}
index ced4aab3d09fc4dcabd2aa5da6f65cfee692fc8d..9e863f1303ff7721dbcaadc71c7502518627bf97 100644 (file)
@@ -27,11 +27,11 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/loadparm.c b/loadparm.c
 --- a/loadparm.c
 +++ b/loadparm.c
-@@ -109,6 +109,7 @@ typedef struct {
+@@ -112,6 +112,7 @@ typedef struct {
        char *auth_users;
        char *charset;
        char *comment;
@@ -39,7 +39,7 @@ diff --git a/loadparm.c b/loadparm.c
        char *dont_compress;
        char *exclude;
        char *exclude_from;
-@@ -134,6 +135,7 @@ typedef struct {
+@@ -138,6 +139,7 @@ typedef struct {
  /* NOTE: update this macro if the last char* variable changes! */
  #define LOCAL_STRING_COUNT() (offsetof(local_vars, uid) / sizeof (char*) + 1)
  
@@ -47,7 +47,7 @@ diff --git a/loadparm.c b/loadparm.c
        int max_connections;
        int max_verbosity;
        int syslog_facility;
-@@ -185,6 +187,7 @@ static const all_vars Defaults = {
+@@ -192,6 +194,7 @@ static const all_vars Defaults = {
   /* auth_users; */            NULL,
   /* charset; */               NULL,
   /* comment; */               NULL,
@@ -55,7 +55,7 @@ diff --git a/loadparm.c b/loadparm.c
   /* dont_compress; */         DEFAULT_DONT_COMPRESS,
   /* exclude; */                       NULL,
   /* exclude_from; */          NULL,
-@@ -208,6 +211,7 @@ static const all_vars Defaults = {
+@@ -216,6 +219,7 @@ static const all_vars Defaults = {
   /* temp_dir; */              NULL,
   /* uid; */                   NULL,
  
@@ -63,7 +63,7 @@ diff --git a/loadparm.c b/loadparm.c
   /* max_connections; */               0,
   /* max_verbosity; */         1,
   /* syslog_facility; */               LOG_DAEMON,
-@@ -322,6 +326,8 @@ static struct parm_struct parm_table[] =
+@@ -333,6 +337,8 @@ static struct parm_struct parm_table[] =
   {"auth users",        P_STRING, P_LOCAL, &Vars.l.auth_users,          NULL,0},
   {"charset",           P_STRING, P_LOCAL, &Vars.l.charset,             NULL,0},
   {"comment",           P_STRING, P_LOCAL, &Vars.l.comment,             NULL,0},
@@ -72,7 +72,7 @@ diff --git a/loadparm.c b/loadparm.c
   {"dont compress",     P_STRING, P_LOCAL, &Vars.l.dont_compress,       NULL,0},
   {"exclude from",      P_STRING, P_LOCAL, &Vars.l.exclude_from,        NULL,0},
   {"exclude",           P_STRING, P_LOCAL, &Vars.l.exclude,             NULL,0},
-@@ -454,6 +460,7 @@ FN_GLOBAL_INTEGER(lp_rsync_port, &Vars.g.rsync_port)
+@@ -469,6 +475,7 @@ FN_GLOBAL_INTEGER(lp_rsync_port, &Vars.g.rsync_port)
  FN_LOCAL_STRING(lp_auth_users, auth_users)
  FN_LOCAL_STRING(lp_charset, charset)
  FN_LOCAL_STRING(lp_comment, comment)
@@ -80,7 +80,7 @@ diff --git a/loadparm.c b/loadparm.c
  FN_LOCAL_STRING(lp_dont_compress, dont_compress)
  FN_LOCAL_STRING(lp_exclude, exclude)
  FN_LOCAL_STRING(lp_exclude_from, exclude_from)
-@@ -477,6 +484,7 @@ FN_LOCAL_STRING(lp_secrets_file, secrets_file)
+@@ -493,6 +500,7 @@ FN_LOCAL_STRING(lp_syslog_tag, syslog_tag)
  FN_LOCAL_STRING(lp_temp_dir, temp_dir)
  FN_LOCAL_STRING(lp_uid, uid)
  
index 40b400e2bd527d065af11fce68fcea9dfe36e7a0..e408cd73ef429e891c9c8e050bb7287df8b4a7fa 100644 (file)
@@ -8,7 +8,7 @@ To use this patch, run these commands for a successful build:
     ./configure                      (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
@@ -56,7 +56,7 @@ diff --git a/options.c b/options.c
    {"specials",         0,  POPT_ARG_VAL,    &preserve_specials, 1, 0, 0 },
    {"no-specials",      0,  POPT_ARG_VAL,    &preserve_specials, 0, 0, 0 },
    {"links",           'l', POPT_ARG_VAL,    &preserve_links, 1, 0, 0 },
-@@ -2773,6 +2776,9 @@ void server_options(char **args, int *argc_p)
+@@ -2797,6 +2800,9 @@ void server_options(char **args, int *argc_p)
        else if (remove_source_files)
                args[ac++] = "--remove-sent-files";
  
@@ -77,7 +77,7 @@ diff --git a/rsync.c b/rsync.c
  extern int am_root;
  extern int am_server;
  extern int am_daemon;
-@@ -404,7 +405,8 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr,
+@@ -410,7 +411,8 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr,
  
        if (iflags & ITEM_TRANSFER) {
                int i = ndx - cur_flist->ndx_start;
index 2fa60f74e09a933aac472533496e05fe253aedfa..fc51eceb922b134374de2ad500b4aa6307b95cb5 100644 (file)
@@ -42,7 +42,7 @@ diff --git a/compat.c b/compat.c
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -55,6 +55,7 @@ extern int preserve_fileflags;
+@@ -56,6 +56,7 @@ extern int preserve_fileflags;
  extern int delete_during;
  extern int missing_args;
  extern int eol_nulls;
@@ -50,7 +50,7 @@ diff --git a/flist.c b/flist.c
  extern int relative_paths;
  extern int implied_dirs;
  extern int ignore_perishable;
-@@ -398,7 +399,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -380,7 +381,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
  #endif
                            int ndx, int first_ndx)
  {
@@ -59,7 +59,7 @@ diff --git a/flist.c b/flist.c
        static mode_t mode;
  #ifdef SUPPORT_FILEFLAGS
        static uint32 fileflags;
-@@ -509,6 +510,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -491,6 +492,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
                modtime = file->modtime;
        if (NSEC_BUMP(file) && protocol_version >= 31)
                xflags |= XMIT_MOD_NSEC;
@@ -73,7 +73,7 @@ diff --git a/flist.c b/flist.c
  
  #ifdef SUPPORT_HARD_LINKS
        if (tmp_dev != -1) {
-@@ -593,6 +601,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -575,6 +583,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
        }
        if (xflags & XMIT_MOD_NSEC)
                write_varint(f, F_MOD_NSEC(file));
@@ -82,7 +82,7 @@ diff --git a/flist.c b/flist.c
        if (!(xflags & XMIT_SAME_MODE))
                write_int(f, to_wire_mode(mode));
  #ifdef SUPPORT_FILEFLAGS
-@@ -686,7 +696,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -668,7 +678,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
  
  static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags)
  {
@@ -91,7 +91,7 @@ diff --git a/flist.c b/flist.c
        static mode_t mode;
  #ifdef SUPPORT_FILEFLAGS
        static uint32 fileflags;
-@@ -838,6 +848,19 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -820,6 +830,19 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
                modtime_nsec = read_varint(f);
        else
                modtime_nsec = 0;
@@ -111,7 +111,7 @@ diff --git a/flist.c b/flist.c
        if (!(xflags & XMIT_SAME_MODE))
                mode = from_wire_mode(read_int(f));
  
-@@ -1015,6 +1038,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -997,6 +1020,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
                F_GROUP(file) = gid;
                file->flags |= gid_flags;
        }
@@ -120,7 +120,7 @@ diff --git a/flist.c b/flist.c
        if (unsort_ndx)
                F_NDX(file) = flist->used + flist->ndx_start;
  
-@@ -1416,6 +1441,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1398,6 +1423,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                F_GROUP(file) = st.st_gid;
        if (am_generator && st.st_uid == our_uid)
                file->flags |= FLAG_OWNED_BY_US;
@@ -140,8 +140,8 @@ diff --git a/generator.c b/generator.c
  extern int preserve_hard_links;
  extern int preserve_executability;
  extern int preserve_fileflags;
-@@ -384,6 +385,16 @@ static void do_delete_pass(void)
-               rprintf(FINFO, "                    \r");
+@@ -393,6 +394,16 @@ static inline int time_diff(STRUCT_STAT *stp, struct file_struct *file)
+ #endif
  }
  
 +static inline int all_time_diff(stat_x *sxp, struct file_struct *file, const char *fname)
@@ -154,9 +154,9 @@ diff --git a/generator.c b/generator.c
 +      return cmp_time(sxp->crtime, 0, f_crtime(file), 0);
 +}
 +
- static inline int time_diff(STRUCT_STAT *stp, struct file_struct *file)
+ static inline int perms_differ(struct file_struct *file, stat_x *sxp)
  {
- #ifdef ST_MTIME_NSEC
+       if (preserve_perms)
 @@ -447,7 +458,7 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
  {
        if (S_ISLNK(file->mode)) {
@@ -309,7 +309,7 @@ diff --git a/options.c b/options.c
    {"omit-dir-times",  'O', POPT_ARG_VAL,    &omit_dir_times, 1, 0, 0 },
    {"no-omit-dir-times",0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
    {"no-O",             0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
-@@ -2467,6 +2472,8 @@ void server_options(char **args, int *argc_p)
+@@ -2491,6 +2496,8 @@ void server_options(char **args, int *argc_p)
                argstr[x++] = 'D';
        if (preserve_times)
                argstr[x++] = 't';
@@ -321,7 +321,7 @@ diff --git a/options.c b/options.c
 diff --git a/rsync.c b/rsync.c
 --- a/rsync.c
 +++ b/rsync.c
-@@ -581,6 +581,9 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -587,6 +587,9 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
         || (!(preserve_times & PRESERVE_DIR_TIMES) && S_ISDIR(sxp->st.st_mode))
         || (!(preserve_times & PRESERVE_LINK_TIMES) && S_ISLNK(sxp->st.st_mode)))
                flags |= ATTRS_SKIP_MTIME;
@@ -331,7 +331,7 @@ diff --git a/rsync.c b/rsync.c
        if (!(flags & ATTRS_SKIP_MTIME)
         && (sxp->st.st_mtime != file->modtime
  #ifdef ST_MTIME_NSEC
-@@ -598,6 +601,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -604,6 +607,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
                else
                        file->flags |= FLAG_TIME_FAILED;
        }
@@ -346,7 +346,7 @@ diff --git a/rsync.c b/rsync.c
  
  #ifdef SUPPORT_ACLS
        /* It's OK to call set_acl() now, even for a dir, as the generator
-@@ -714,7 +725,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -720,7 +731,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
        /* Change permissions before putting the file into place. */
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
                       ATTRS_DELAY_IMMUTABLE
@@ -355,7 +355,7 @@ diff --git a/rsync.c b/rsync.c
  
        /* move tmp file over real file */
        if (DEBUG_GTE(RECV, 1))
-@@ -743,7 +754,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -749,7 +760,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
  
    do_set_file_attrs:
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
@@ -394,7 +394,7 @@ diff --git a/rsync.h b/rsync.h
  #define ITEM_REPORT_CHANGE (1<<1)
  #define ITEM_REPORT_SIZE (1<<2)     /* regular files only */
  #define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */
-@@ -734,6 +736,7 @@ extern int file_extra_cnt;
+@@ -740,6 +742,7 @@ extern int file_extra_cnt;
  extern int inc_recurse;
  extern int uid_ndx;
  extern int gid_ndx;
@@ -402,7 +402,7 @@ diff --git a/rsync.h b/rsync.h
  extern int fileflags_ndx;
  extern int acls_ndx;
  extern int xattrs_ndx;
-@@ -741,6 +744,7 @@ extern int xattrs_ndx;
+@@ -747,6 +750,7 @@ extern int xattrs_ndx;
  #define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
  #define EXTRA_LEN (sizeof (union file_extras))
  #define PTR_EXTRA_CNT ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN)
@@ -410,7 +410,7 @@ diff --git a/rsync.h b/rsync.h
  #define DEV_EXTRA_CNT 2
  #define DIRNODE_EXTRA_CNT 3
  #define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN)
-@@ -1021,6 +1025,7 @@ typedef struct {
+@@ -1032,6 +1036,7 @@ typedef struct {
  
  typedef struct {
      STRUCT_STAT st;
@@ -429,7 +429,7 @@ diff --git a/rsync.yo b/rsync.yo
   -O, --omit-dir-times        omit directories from --times
   -J, --omit-link-times       omit symlinks from --times
       --super                 receiver attempts super-user activities
-@@ -1217,6 +1218,9 @@ cause the next transfer to behave as if it used bf(-I), causing all files to be
+@@ -1242,6 +1243,9 @@ cause the next transfer to behave as if it used bf(-I), causing all files to be
  updated (though rsync's delta-transfer algorithm will make the update fairly efficient
  if the files haven't actually changed, you're much better off using bf(-t)).
  
@@ -439,7 +439,7 @@ diff --git a/rsync.yo b/rsync.yo
  dit(bf(-O, --omit-dir-times)) This tells rsync to omit directories when
  it is preserving modification times (see bf(--times)).  If NFS is sharing
  the directories on the receiving side, it is a good idea to use bf(-O).
-@@ -2142,7 +2146,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -2173,7 +2177,7 @@ with older versions of rsync, but that also turns on the output of other
  verbose messages).
  
  The "%i" escape has a cryptic output that is 11 letters long.  The general
@@ -448,7 +448,7 @@ diff --git a/rsync.yo b/rsync.yo
  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.
-@@ -2201,6 +2205,8 @@ quote(itemization(
+@@ -2232,6 +2236,8 @@ quote(itemization(
    it() The bf(f) means that the fileflags information changed.
    it() The bf(a) means that the ACL information changed.
    it() The bf(x) means that the extended attribute information changed.
@@ -474,9 +474,9 @@ diff --git a/syscall.c b/syscall.c
  #define RETURN_ERROR_IF(x,e) \
        do { \
                if (x) { \
-@@ -472,6 +479,36 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
- #endif
+@@ -491,6 +498,36 @@ int do_setattrlist_times(const char *fname, time_t modtime, uint32 mod_nsec)
  }
+ #endif
  
 +time_t get_create_time(const char *path)
 +{
index d60f6c6e23b2aa270c0d8a1317db0f6de15b3008..aaa6dd3874681d24b1540bbef7bb3d3b5e75ba9e 100644 (file)
@@ -8,11 +8,11 @@ To use this patch, run these commands for a successful build:
     ./configure                                 (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/exclude.c b/exclude.c
 --- a/exclude.c
 +++ b/exclude.c
-@@ -261,6 +261,8 @@ static void add_rule(filter_rule_list *listp, const char *pat, unsigned int pat_
+@@ -263,6 +263,8 @@ static void add_rule(filter_rule_list *listp, const char *pat, unsigned int pat_
  
                if (!(lp = new_array0(filter_rule_list, 1)))
                        out_of_memory("add_rule");
@@ -21,7 +21,7 @@ diff --git a/exclude.c b/exclude.c
                if (asprintf(&lp->debug_type, " [per-dir %s]", cp) < 0)
                        out_of_memory("add_rule");
                rule->u.mergelist = lp;
-@@ -530,6 +532,14 @@ void *push_local_filters(const char *dir, unsigned int dirlen)
+@@ -532,6 +534,14 @@ void *push_local_filters(const char *dir, unsigned int dirlen)
                                set_filter_dir(dir, dirlen);
                }
  
@@ -36,7 +36,7 @@ diff --git a/exclude.c b/exclude.c
                if (strlcpy(dirbuf + dirbuf_len, ex->pattern,
                    MAXPATHLEN - dirbuf_len) < MAXPATHLEN - dirbuf_len) {
                        parse_filter_file(lp, dirbuf, ex,
-@@ -1146,6 +1156,7 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
+@@ -1175,6 +1185,7 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
        char line[BIGPATHBUFLEN];
        char *eob = line + sizeof line - 1;
        BOOL word_split = (template->rflags & FILTRULE_WORD_SPLIT) != 0;
@@ -44,7 +44,7 @@ diff --git a/exclude.c b/exclude.c
  
        if (!fname || !*fname)
                return;
-@@ -1192,6 +1203,24 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
+@@ -1221,6 +1232,24 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
                                }
                                break;
                        }
@@ -69,7 +69,7 @@ diff --git a/exclude.c b/exclude.c
                        if (word_split && isspace(ch))
                                break;
                        if (eol_nulls? !ch : (ch == '\n' || ch == '\r'))
-@@ -1201,13 +1230,14 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
+@@ -1230,13 +1259,14 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
                        else
                                overflow = 1;
                }
index bff6b3d147cb0e35a5dc61d8c469634c5c253ca7..1a080a17c5614a779b8b2b0779eb647c8de49743 100644 (file)
@@ -14,7 +14,7 @@ To use this patch, run these commands for a successful build:
     ./configure                                 (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
@@ -31,7 +31,7 @@ diff --git a/generator.c b/generator.c
  int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
  {
 +      if (date_only)
-+              return cmp_time(st->st_mtime, file->modtime) == 0;
++              return time_diff(st, file) == 0;
 +
        if (st->st_size != F_LENGTH(file))
                return 0;
@@ -63,7 +63,7 @@ diff --git a/options.c b/options.c
    {"one-file-system", 'x', POPT_ARG_NONE,   0, 'x', 0, 0 },
    {"no-one-file-system",0, POPT_ARG_VAL,    &one_file_system, 0, 0, 0 },
    {"no-x",             0,  POPT_ARG_VAL,    &one_file_system, 0, 0, 0 },
-@@ -2659,6 +2662,9 @@ void server_options(char **args, int *argc_p)
+@@ -2683,6 +2686,9 @@ void server_options(char **args, int *argc_p)
        else if (missing_args == 1 && !am_sender)
                args[ac++] = "--ignore-missing-args";
  
@@ -84,7 +84,7 @@ diff --git a/rsync.yo b/rsync.yo
   -@, --modify-window=NUM     set the accuracy for mod-time comparisons
   -T, --temp-dir=DIR          create temporary files in directory DIR
   -y, --fuzzy                 find similar file for basis if no dest file
-@@ -606,6 +607,12 @@ time to just looking for files that have changed in size.  This is useful
+@@ -607,6 +608,12 @@ time to just looking for files that have changed in size.  This is useful
  when starting to use rsync after using another mirroring system which may
  not preserve timestamps exactly.
  
diff --git a/db.diff b/db.diff
index 48a46e30de1533f4e2ae0051bc2d99ce71b100a0..b7c479d48bb0a7ac7deb50827d069e89734cd6b7 100644 (file)
--- a/db.diff
+++ b/db.diff
@@ -21,7 +21,7 @@ To use this patch, run these commands for a successful build:
     ./configure
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/.gitignore b/.gitignore
 --- a/.gitignore
 +++ b/.gitignore
@@ -141,21 +141,19 @@ diff --git a/checksum.c b/checksum.c
  extern char *checksum_choice;
  
  #define CSUM_NONE 0
-@@ -213,6 +214,9 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
+@@ -220,6 +221,8 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
                        md5_update(&m, (uchar *)map_ptr(buf, i, remainder), remainder);
  
                md5_result(&m, (uchar *)sum);
-+
 +              if (use_db)
 +                      db_set_checksum(5, st_p, sum);
                break;
          case CSUM_MD4:
          case CSUM_MD4_OLD:
-@@ -233,6 +237,9 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
+@@ -241,6 +244,8 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
                        mdfour_update(&m, (uchar *)map_ptr(buf, i, remainder), remainder);
  
                mdfour_result(&m, (uchar *)sum);
-+
 +              if (use_db)
 +                      db_set_checksum(4, st_p, sum);
                break;
@@ -204,7 +202,7 @@ diff --git a/clientserver.c b/clientserver.c
  extern char *bind_address;
  extern char *config_file;
  extern char *logfile_format;
-@@ -685,6 +688,11 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -687,6 +690,11 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
  
        log_init(1);
  
@@ -216,7 +214,7 @@ diff --git a/clientserver.c b/clientserver.c
  #ifdef HAVE_PUTENV
        if (*lp_prexfer_exec(i) || *lp_postxfer_exec(i)) {
                int status;
-@@ -890,6 +898,8 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -894,6 +902,8 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
  
        am_server = 1; /* Don't let someone try to be tricky. */
        quiet = 0;
@@ -236,7 +234,7 @@ diff --git a/configure.ac b/configure.ac
      netdb.h malloc.h float.h limits.h iconv.h libcharset.h langinfo.h \
      sys/acl.h acl/libacl.h attr/xattr.h sys/xattr.h sys/extattr.h \
      popt.h popt/popt.h linux/falloc.h netinet/in_systm.h netinet/ip.h \
-@@ -1098,6 +1099,48 @@ if test x"$enable_acl_support" = x"no" -o x"$enable_xattr_support" = x"no" -o x"
+@@ -1099,6 +1100,48 @@ if test x"$enable_acl_support" = x"no" -o x"$enable_xattr_support" = x"no" -o x"
      fi
  fi
  
@@ -314,11 +312,11 @@ new file mode 100644
 +#include "itypes.h"
 +#include "inums.h"
 +
-+extern int protocol_version;
 +extern int recurse;
 +extern int same_db;
 +extern int am_receiver;
 +extern int am_generator;
++extern int checksum_type;
 +extern int db_clean, db_check, db_do_md4, db_do_md5, db_update, db_lax, db_init, db_mounts;
 +extern int db_output_name, db_output_sum, db_output_info, db_output_unchanged, db_output_dirs, db_output_msgs;
 +extern int saw_db_output_opt, saw_db_sum_opt;
@@ -511,7 +509,7 @@ new file mode 100644
 +              return 0;
 +      }
 +
-+      md_num = protocol_version >= 30 ? 5 : 4;
++      md_num = checksum_type == 5 ? 5 : 4;
 +
 +      if (error_log) {
 +              if (use_db != DB_TYPE_SQLITE)
@@ -1472,7 +1470,7 @@ new file mode 100644
 +              if (ok) {
 +                      rprintf(FCLIENT, "[%s] Found DB checksum for %s,%s,%d: %s\n",
 +                              who_am_i(), big_num(st_p->st_dev),
-+                              big_num(st_p->st_ino), md_num, sum_as_hex(md_num, sum));
++                              big_num(st_p->st_ino), md_num, sum_as_hex(md_num, sum, 0));
 +              } else {
 +                      rprintf(FCLIENT, "[%s] No DB checksum for %s,%s,%d\n",
 +                              who_am_i(), big_num(st_p->st_dev),
@@ -1552,7 +1550,7 @@ new file mode 100644
 +              if (DEBUG_GTE(DB, 3)) {
 +                      rprintf(FCLIENT, "DB checksum for %s,%s,%d: %s\n",
 +                              big_num(st_p->st_dev), big_num(st_p->st_ino), sum_type[j],
-+                              sum_as_hex(sum_type[j], dbsum + MD5_DIGEST_LEN*j));
++                              sum_as_hex(sum_type[j], dbsum + MD5_DIGEST_LEN*j, 0));
 +              }
 +
 +              if (sum_type[j] == 4) {
@@ -1659,7 +1657,7 @@ new file mode 100644
 +              if (DEBUG_GTE(DB, 2)) {
 +                      rprintf(FCLIENT, "[%s] Set DB checksum for %s,%s,%d: %s\n",
 +                              who_am_i(), big_num(st_p->st_dev), big_num(st_p->st_ino),
-+                              md_num, sum_as_hex(md_num, sum));
++                              md_num, sum_as_hex(md_num, sum, 0));
 +              }
 +      } else {
 +              rprintf(log_code, "[%s] Failed to set checksum for %s,%s,%d: %s (%d) -- closing DB\n",
@@ -1982,9 +1980,9 @@ new file mode 100644
 +              }
 +              if (db_output_sum) {
 +                      if (db_do_md4)
-+                              printf("%s ", sum_as_hex(4, sum4));
++                              printf("%s ", sum_as_hex(4, sum4, 0));
 +                      if (db_do_md5)
-+                              printf("%s ", sum_as_hex(5, sum5));
++                              printf("%s ", sum_as_hex(5, sum5, 0));
 +              }
 +              if (db_output_name) {
 +                      if (db_output_sum)
@@ -2008,7 +2006,7 @@ new file mode 100644
 +      struct name_list *names;
 +      int exit_code = 0;
 +
-+      protocol_version = 31;
++      checksum_type = 5;
 +
 +      need_sum_cnt = db_do_md4 + db_do_md5;
 +
@@ -2205,7 +2203,7 @@ new file mode 100644
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -53,6 +53,7 @@ extern int preserve_devices;
+@@ -54,6 +54,7 @@ extern int preserve_devices;
  extern int preserve_specials;
  extern int delete_during;
  extern int missing_args;
@@ -2213,7 +2211,7 @@ diff --git a/flist.c b/flist.c
  extern int eol_nulls;
  extern int relative_paths;
  extern int implied_dirs;
-@@ -1312,11 +1313,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1294,11 +1295,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                extra_len += EXTRA_LEN;
  #endif
  
@@ -2227,22 +2225,22 @@ diff --git a/flist.c b/flist.c
  
  #if EXTRA_ROUNDING > 0
        if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
-@@ -1401,8 +1399,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1383,8 +1381,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                return NULL;
        }
  
 -      if (sender_keeps_checksum && S_ISREG(st.st_mode))
--              memcpy(F_SUM(file), tmp_sum, checksum_len);
+-              memcpy(F_SUM(file), tmp_sum, flist_csum_len);
 +      if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
 +              if (!use_db || !db_get_checksum(&st, tmp_sum))
 +                      file_checksum(thisname, &st, tmp_sum);
 +              if (sender_keeps_checksum)
-+                      memcpy(F_SUM(file), tmp_sum, checksum_len);
++                      memcpy(F_SUM(file), tmp_sum, flist_csum_len);
 +      }
  
        if (unsort_ndx)
                F_NDX(file) = stats.num_dirs;
-@@ -2063,6 +2065,9 @@ void send_extra_file_list(int f, int at_least)
+@@ -2045,6 +2047,9 @@ void send_extra_file_list(int f, int at_least)
    finish:
        if (io_error != save_io_error && protocol_version == 30 && !ignore_errors)
                send_msg_int(MSG_IO_ERROR, io_error);
@@ -2252,7 +2250,7 @@ diff --git a/flist.c b/flist.c
  }
  
  struct file_list *send_file_list(int f, int argc, char *argv[])
-@@ -2086,6 +2091,13 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2068,6 +2073,13 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
                     | (eol_nulls || reading_remotely ? RL_EOL_NULLS : 0);
        int implied_dot_dir = 0;
  
@@ -2264,9 +2262,9 @@ diff --git a/flist.c b/flist.c
 +      }
 +
        rprintf(FLOG, "building file list\n");
-       if (show_filelist_p())
+       if (show_filelist_progress)
                start_filelist_progress("building file list");
-@@ -2432,6 +2444,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2414,6 +2426,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
                        rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
        }
  
@@ -2294,7 +2292,7 @@ diff --git a/generator.c b/generator.c
 -              file_checksum(fn, st, sum);
 +              if (!use_db || !db_get_checksum(st, sum))
 +                      file_checksum(fn, st, sum);
-               return memcmp(sum, F_SUM(file), checksum_len) == 0;
+               return memcmp(sum, F_SUM(file), flist_csum_len) == 0;
        }
  
 @@ -2225,6 +2227,13 @@ void generate_files(int f_out, const char *local_name)
@@ -2379,7 +2377,7 @@ diff --git a/io.c b/io.c
 diff --git a/loadparm.c b/loadparm.c
 --- a/loadparm.c
 +++ b/loadparm.c
-@@ -109,6 +109,7 @@ typedef struct {
+@@ -112,6 +112,7 @@ typedef struct {
        char *auth_users;
        char *charset;
        char *comment;
@@ -2387,7 +2385,7 @@ diff --git a/loadparm.c b/loadparm.c
        char *dont_compress;
        char *exclude;
        char *exclude_from;
-@@ -139,6 +140,7 @@ typedef struct {
+@@ -143,6 +144,7 @@ typedef struct {
        int syslog_facility;
        int timeout;
  
@@ -2395,7 +2393,7 @@ diff --git a/loadparm.c b/loadparm.c
        BOOL fake_super;
        BOOL forward_lookup;
        BOOL ignore_errors;
-@@ -185,6 +187,7 @@ static const all_vars Defaults = {
+@@ -192,6 +194,7 @@ static const all_vars Defaults = {
   /* auth_users; */            NULL,
   /* charset; */               NULL,
   /* comment; */               NULL,
@@ -2403,7 +2401,7 @@ diff --git a/loadparm.c b/loadparm.c
   /* dont_compress; */         DEFAULT_DONT_COMPRESS,
   /* exclude; */                       NULL,
   /* exclude_from; */          NULL,
-@@ -213,6 +216,7 @@ static const all_vars Defaults = {
+@@ -221,6 +224,7 @@ static const all_vars Defaults = {
   /* syslog_facility; */               LOG_DAEMON,
   /* timeout; */                       0,
  
@@ -2411,7 +2409,7 @@ diff --git a/loadparm.c b/loadparm.c
   /* fake_super; */            False,
   /* forward_lookup; */                True,
   /* ignore_errors; */         False,
-@@ -322,6 +326,8 @@ static struct parm_struct parm_table[] =
+@@ -333,6 +337,8 @@ static struct parm_struct parm_table[] =
   {"auth users",        P_STRING, P_LOCAL, &Vars.l.auth_users,          NULL,0},
   {"charset",           P_STRING, P_LOCAL, &Vars.l.charset,             NULL,0},
   {"comment",           P_STRING, P_LOCAL, &Vars.l.comment,             NULL,0},
@@ -2420,7 +2418,7 @@ diff --git a/loadparm.c b/loadparm.c
   {"dont compress",     P_STRING, P_LOCAL, &Vars.l.dont_compress,       NULL,0},
   {"exclude from",      P_STRING, P_LOCAL, &Vars.l.exclude_from,        NULL,0},
   {"exclude",           P_STRING, P_LOCAL, &Vars.l.exclude,             NULL,0},
-@@ -454,6 +460,7 @@ FN_GLOBAL_INTEGER(lp_rsync_port, &Vars.g.rsync_port)
+@@ -469,6 +475,7 @@ FN_GLOBAL_INTEGER(lp_rsync_port, &Vars.g.rsync_port)
  FN_LOCAL_STRING(lp_auth_users, auth_users)
  FN_LOCAL_STRING(lp_charset, charset)
  FN_LOCAL_STRING(lp_comment, comment)
@@ -2428,7 +2426,7 @@ diff --git a/loadparm.c b/loadparm.c
  FN_LOCAL_STRING(lp_dont_compress, dont_compress)
  FN_LOCAL_STRING(lp_exclude, exclude)
  FN_LOCAL_STRING(lp_exclude_from, exclude_from)
-@@ -482,6 +489,7 @@ FN_LOCAL_INTEGER(lp_max_verbosity, max_verbosity)
+@@ -498,6 +505,7 @@ FN_LOCAL_INTEGER(lp_max_verbosity, max_verbosity)
  FN_LOCAL_INTEGER(lp_syslog_facility, syslog_facility)
  FN_LOCAL_INTEGER(lp_timeout, timeout)
  
@@ -2463,7 +2461,7 @@ diff --git a/main.c b/main.c
  extern char *shell_cmd;
  extern char *batch_name;
  extern char *password_file;
-@@ -1100,6 +1103,9 @@ void start_server(int f_in, int f_out, int argc, char *argv[])
+@@ -1103,6 +1106,9 @@ void start_server(int f_in, int f_out, int argc, char *argv[])
        if (am_daemon && io_timeout && protocol_version >= 31)
                send_msg_int(MSG_IO_TIMEOUT, io_timeout);
  
@@ -2473,7 +2471,7 @@ diff --git a/main.c b/main.c
        if (am_sender) {
                keep_dirlinks = 0; /* Must be disabled on the sender. */
                if (need_messages_from_generator)
-@@ -1381,6 +1387,9 @@ static int start_client(int argc, char *argv[])
+@@ -1384,6 +1390,9 @@ static int start_client(int argc, char *argv[])
                }
        }
  
@@ -2653,7 +2651,7 @@ diff --git a/options.c b/options.c
  
  static char err_buf[200];
  
-@@ -1281,6 +1348,100 @@ static void create_refuse_error(int which)
+@@ -1281,6 +1348,101 @@ static void create_refuse_error(int which)
        }
  }
  
@@ -2751,12 +2749,13 @@ diff --git a/options.c b/options.c
 +      run_dbonly(poptGetArgs(pc));
 +      exit(42); /* NOT REACHED */
 +}
- /**
-  * Process command line arguments.  Called on both local and remote.
-@@ -1298,10 +1459,18 @@ int parse_arguments(int *argc_p, const char ***argv_p)
-       int argc = *argc_p;
++
+ /* This is used to make sure that --daemon & --server cannot be aliased to
+  * something else. These options have always disabled popt aliases for the
+  * parsing of a daemon or server command-line, but we have to make sure that
+@@ -1315,10 +1477,18 @@ int parse_arguments(int *argc_p, const char ***argv_p)
        int opt;
+       int orig_protect_args = protect_args;
  
 +      arg = *argv + strlen(*argv);
 +      if (arg - *argv > 2 && strcmp(arg-2, "db") == 0) {
@@ -2773,7 +2772,7 @@ diff --git a/options.c b/options.c
  #ifdef ICONV_OPTION
                if (!*lp_charset(module_id))
                        set_refuse_options("iconv");
-@@ -1424,6 +1593,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1444,6 +1614,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        am_daemon = 1;
                        return 1;
  
@@ -2786,7 +2785,7 @@ diff --git a/options.c b/options.c
                case OPT_MODIFY_WINDOW:
                        /* The value has already been set by popt, but
                         * we need to remember that we're using a
-@@ -1498,6 +1673,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1518,6 +1694,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        preserve_devices = preserve_specials = 0;
                        break;
  
@@ -2853,7 +2852,7 @@ diff --git a/receiver.c b/receiver.c
  extern int am_root;
  extern int am_server;
  extern int inc_recurse;
-@@ -431,6 +433,11 @@ static void handle_delayed_updates(char *local_name)
+@@ -429,6 +431,11 @@ static void handle_delayed_updates(char *local_name)
                                        "rename failed for %s (from %s)",
                                        full_fname(fname), partialptr);
                        } else {
@@ -2865,7 +2864,7 @@ diff --git a/receiver.c b/receiver.c
                                if (remove_source_files
                                 || (preserve_hard_links && F_IS_HLINKED(file)))
                                        send_msg_int(MSG_SUCCESS, ndx);
-@@ -537,6 +544,9 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -535,6 +542,9 @@ int recv_files(int f_in, int f_out, char *local_name)
        if (delay_updates)
                delayed_bits = bitbag_create(cur_flist->used + 1);
  
@@ -2875,7 +2874,7 @@ diff --git a/receiver.c b/receiver.c
        while (1) {
                cleanup_disable();
  
-@@ -865,6 +875,8 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -863,6 +873,8 @@ int recv_files(int f_in, int f_out, char *local_name)
                                do_unlink(partialptr);
                                handle_partial_dir(partialptr, PDIR_DELETE);
                        }
@@ -2884,7 +2883,7 @@ diff --git a/receiver.c b/receiver.c
                } else if (keep_partial && partialptr) {
                        if (!handle_partial_dir(partialptr, PDIR_CREATE)) {
                                rprintf(FERROR,
-@@ -878,6 +890,8 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -876,6 +888,8 @@ int recv_files(int f_in, int f_out, char *local_name)
                                recv_ok = -1;
                        else if (delay_updates && recv_ok) {
                                bitbag_set_bit(delayed_bits, ndx);
@@ -2904,7 +2903,7 @@ diff --git a/rsync.c b/rsync.c
  extern int am_starting_up;
  extern int allow_8bit_chars;
  extern int protocol_version;
-@@ -742,6 +743,8 @@ struct file_list *flist_for_ndx(int ndx, const char *fatal_error_loc)
+@@ -748,6 +749,8 @@ struct file_list *flist_for_ndx(int ndx, const char *fatal_error_loc)
  
  const char *who_am_i(void)
  {
@@ -2933,7 +2932,7 @@ diff --git a/rsync.h b/rsync.h
  #define NDX_DONE -1
  #define NDX_FLIST_EOF -2
  #define NDX_DEL_STATS -3
-@@ -1256,7 +1260,8 @@ extern short info_levels[], debug_levels[];
+@@ -1267,7 +1271,8 @@ extern short info_levels[], debug_levels[];
  #define DEBUG_CHDIR (DEBUG_BIND+1)
  #define DEBUG_CONNECT (DEBUG_CHDIR+1)
  #define DEBUG_CMD (DEBUG_CONNECT+1)
@@ -2956,7 +2955,7 @@ diff --git a/rsync.yo b/rsync.yo
   -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
       --no-OPTION             turn off an implied OPTION (e.g. --no-D)
   -r, --recursive             recurse into directories
-@@ -649,6 +652,67 @@ option's before-the-transfer "Does this file need to be updated?" check.
+@@ -650,6 +653,67 @@ option's before-the-transfer "Does this file need to be updated?" check.
  For protocol 30 and beyond (first supported in 3.0.0), the checksum used is
  MD5.  For older protocols, the checksum used is MD4.
  
@@ -2992,7 +2991,7 @@ diff --git a/rsync.yo b/rsync.yo
 +
 +For a local copy, this option affects both the source and the destination.
 +If you wish a local copy to enable this option just for the destination
-+files, specify bf(-M--db=CONFIG) (the same for bf(-M--db-lax) If you wish
++files, specify bf(-M--db=CONFIG) (the same for bf(-M--db-lax)). If you wish
 +a local copy to enable this option just for the source files, combine
 +bf(--db=CONFIG) with bf(-M--no-db) (similarly use bf(-M--no-db-lax)).
 +
@@ -3027,7 +3026,7 @@ diff --git a/rsync.yo b/rsync.yo
 diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
 --- a/rsyncd.conf.yo
 +++ b/rsyncd.conf.yo
-@@ -316,6 +316,22 @@ is daemon.  This setting has no effect if the "log file" setting is a
+@@ -326,6 +326,22 @@ is daemon.  This setting has no effect if the "log file" setting is a
  non-empty string (either set in the per-modules settings, or inherited
  from the global settings).
  
@@ -3047,9 +3046,9 @@ diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
 +lax (no ctime) lookups.  See the rsync manpage's section -n bf(--db-lax) for
 +some warnings about using this setting.
 +
- dit(bf(max verbosity)) This parameter allows you to control
- the maximum amount of verbose information that you'll allow the daemon to
- generate (since the information goes into the log file). The default is 1,
+ dit(bf(syslog tag)) This parameter allows you to specify the syslog
+ tag to use when logging messages from the rsync daemon. The default is
+ "rsyncd".  This setting has no effect if the "log file" setting is a
 diff --git a/rsyncdb-mountinfo b/rsyncdb-mountinfo
 new file mode 100755
 --- /dev/null
index 9400bb1663cea983f94e3a16015e4698985f3822..930d7c829ac8c58d8e4019bd509e5ceed86f03f7 100644 (file)
@@ -80,7 +80,7 @@ diff --git a/options.c b/options.c
    {"fuzzy",           'y', POPT_ARG_NONE,   0, 'y', 0, 0 },
    {"no-fuzzy",         0,  POPT_ARG_VAL,    &fuzzy_basis, 0, 0, 0 },
    {"no-y",             0,  POPT_ARG_VAL,    &fuzzy_basis, 0, 0, 0 },
-@@ -2646,8 +2650,14 @@ void server_options(char **args, int *argc_p)
+@@ -2670,8 +2674,14 @@ void server_options(char **args, int *argc_p)
                        args[ac++] = "--super";
                if (size_only)
                        args[ac++] = "--size-only";
@@ -109,7 +109,7 @@ diff --git a/rsync.yo b/rsync.yo
       --compare-dest=DIR      also compare received files relative to DIR
       --copy-dest=DIR         ... and include copies of unchanged files
       --link-dest=DIR         hardlink to files in DIR when unchanged
-@@ -1848,6 +1850,17 @@ the bf(--partial-dir) option, that directory will be used instead.  These
+@@ -1879,6 +1881,17 @@ the bf(--partial-dir) option, that directory will be used instead.  These
  potential alternate-basis files will be removed as the transfer progresses.
  This option conflicts with bf(--inplace) and bf(--append).
  
index 4d0ad5a448d76ab8d9666653b911484e129bd05b..200cc6f64b8a8128e549b5ebba52f64843c170f0 100644 (file)
@@ -38,7 +38,7 @@ TODO:
   a file that can't use it, while missing out on giving it to a file
   that could use it.
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/backup.c b/backup.c
 --- a/backup.c
 +++ b/backup.c
@@ -132,7 +132,7 @@ diff --git a/delete.c b/delete.c
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -61,6 +61,7 @@ extern int non_perishable_cnt;
+@@ -62,6 +62,7 @@ extern int non_perishable_cnt;
  extern int prune_empty_dirs;
  extern int copy_links;
  extern int copy_unsafe_links;
@@ -140,7 +140,7 @@ diff --git a/flist.c b/flist.c
  extern int protocol_version;
  extern int sanitize_paths;
  extern int munge_symlinks;
-@@ -126,6 +127,8 @@ static int64 tmp_dev = -1, tmp_ino;
+@@ -127,6 +128,8 @@ static int64 tmp_dev = -1, tmp_ino;
  #endif
  static char tmp_sum[MAX_DIGEST_LEN];
  
@@ -148,9 +148,9 @@ diff --git a/flist.c b/flist.c
 +
  static char empty_sum[MAX_DIGEST_LEN];
  static int flist_count_offset; /* for --delete --progress */
-@@ -292,6 +295,45 @@ static int is_excluded(const char *fname, int is_dir, int filter_level)
-       return 0;
+ static int show_filelist_progress;
+@@ -274,6 +277,45 @@ static inline int is_excluded(const char *fname, int is_dir, int filter_level)
+       return name_is_excluded(fname, is_dir ? NAME_IS_DIR : NAME_IS_FILE, filter_level);
  }
  
 +static int fattr_compare(struct file_struct **file1, struct file_struct **file2)
@@ -173,7 +173,7 @@ diff --git a/flist.c b/flist.c
 +              return len1 < len2 ? -1 : 1;
 +
 +      if (always_checksum) {
-+              diff = u_memcmp(F_SUM(f1), F_SUM(f2), checksum_len);
++              diff = u_memcmp(F_SUM(f1), F_SUM(f2), flist_csum_len);
 +              if (diff)
 +                      return diff;
 +      } else if (f1->modtime != f2->modtime)
@@ -195,7 +195,7 @@ diff --git a/flist.c b/flist.c
  static void send_directory(int f, struct file_list *flist,
                           char *fbuf, int len, int flags);
  
-@@ -2586,6 +2628,25 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2568,6 +2610,25 @@ struct file_list *recv_file_list(int f, int dir_ndx)
         * for a non-relative transfer in recv_file_entry(). */
        flist_sort_and_clean(flist, relative_paths);
  
@@ -394,7 +394,7 @@ diff --git a/generator.c b/generator.c
 +                              file_checksum(fname, &st, F_SUM(f));
 +                              f->flags |= FLAG_FILE_SENT;
 +                      }
-+                      diff = u_memcmp(F_SUM(fmid), F_SUM(f), checksum_len);
++                      diff = u_memcmp(F_SUM(fmid), F_SUM(f), flist_csum_len);
 +                      if (diff) {
 +                              if (diff < 0)
 +                                      low = mid + 1;
@@ -613,7 +613,7 @@ diff --git a/options.c b/options.c
    {"fuzzy",           'y', POPT_ARG_NONE,   0, 'y', 0, 0 },
    {"no-fuzzy",         0,  POPT_ARG_VAL,    &fuzzy_basis, 0, 0, 0 },
    {"no-y",             0,  POPT_ARG_VAL,    &fuzzy_basis, 0, 0, 0 },
-@@ -2250,7 +2253,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2274,7 +2277,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                inplace = 1;
        }
  
@@ -622,7 +622,7 @@ diff --git a/options.c b/options.c
                partial_dir = tmp_partialdir;
  
        if (inplace) {
-@@ -2259,6 +2262,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2283,6 +2286,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        snprintf(err_buf, sizeof err_buf,
                                 "--%s cannot be used with --%s\n",
                                 append_mode ? "append" : "inplace",
@@ -630,7 +630,7 @@ diff --git a/options.c b/options.c
                                 delay_updates ? "delay-updates" : "partial-dir");
                        return 0;
                }
-@@ -2642,6 +2646,8 @@ void server_options(char **args, int *argc_p)
+@@ -2666,6 +2670,8 @@ void server_options(char **args, int *argc_p)
                        args[ac++] = "--super";
                if (size_only)
                        args[ac++] = "--size-only";
@@ -642,7 +642,7 @@ diff --git a/options.c b/options.c
 diff --git a/receiver.c b/receiver.c
 --- a/receiver.c
 +++ b/receiver.c
-@@ -216,7 +216,7 @@ int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file)
+@@ -214,7 +214,7 @@ int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file)
         * information should have been previously transferred, but that may
         * not be the case with -R */
        if (fd == -1 && relative_paths && errno == ENOENT
@@ -682,7 +682,7 @@ diff --git a/rsync.yo b/rsync.yo
       --compare-dest=DIR      also compare received files relative to DIR
       --copy-dest=DIR         ... and include copies of unchanged files
       --link-dest=DIR         hardlink to files in DIR when unchanged
-@@ -1832,6 +1833,21 @@ Note that the use of the bf(--delete) option might get rid of any potential
+@@ -1863,6 +1864,21 @@ Note that the use of the bf(--delete) option might get rid of any potential
  fuzzy-match files, so either use bf(--delete-after) or specify some
  filename exclusions if you need to prevent this.
  
@@ -707,7 +707,7 @@ diff --git a/rsync.yo b/rsync.yo
 diff --git a/util.c b/util.c
 --- a/util.c
 +++ b/util.c
-@@ -175,7 +175,7 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -185,7 +185,7 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
  /* Create any necessary directories in fname.  Any missing directories are
   * created with default permissions.  Returns < 0 on error, or the number
   * of directories created. */
@@ -716,7 +716,7 @@ diff --git a/util.c b/util.c
  {
        char *end, *p;
        int ret = 0;
-@@ -206,7 +206,7 @@ int make_path(char *fname, int flags)
+@@ -216,7 +216,7 @@ int make_path(char *fname, int flags)
                                else
                                        errno = ENOTDIR;
                        }
@@ -725,7 +725,7 @@ diff --git a/util.c b/util.c
                        ret++;
                        break;
                }
-@@ -245,7 +245,7 @@ int make_path(char *fname, int flags)
+@@ -255,7 +255,7 @@ int make_path(char *fname, int flags)
                p += strlen(p);
                if (ret < 0) /* Skip mkdir on error, but keep restoring the path. */
                        continue;
@@ -734,7 +734,7 @@ diff --git a/util.c b/util.c
                        ret = -ret - 1;
                else
                        ret++;
-@@ -1159,6 +1159,32 @@ char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr)
+@@ -1169,6 +1169,32 @@ char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr)
        return path;
  }
  
@@ -767,7 +767,7 @@ diff --git a/util.c b/util.c
  /**
   * Return a quoted string with the full pathname of the indicated filename.
   * The string " (in MODNAME)" may also be appended.  The returned pointer
-@@ -1252,7 +1278,7 @@ int handle_partial_dir(const char *fname, int create)
+@@ -1262,7 +1288,7 @@ int handle_partial_dir(const char *fname, int create)
                        }
                        statret = -1;
                }
index 946c1b93872ae4fcead3fac9c5de1d55113daf2b..74889400ddb20f28818c8cc5c3ec60f6715f793d 100644 (file)
@@ -10,7 +10,7 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/options.c b/options.c
 --- a/options.c
 +++ b/options.c
@@ -50,7 +50,7 @@ diff --git a/rsync.yo b/rsync.yo
   -m, --prune-empty-dirs      prune empty directory chains from file-list
       --numeric-ids           don't map uid/gid values by user/group name
       --usermap=STRING        custom username mapping
-@@ -2401,6 +2402,14 @@ See also the "atomic-rsync" perl script in the "support" subdir for an
+@@ -2435,6 +2436,14 @@ See also the "atomic-rsync" perl script in the "support" subdir for an
  update algorithm that is even more atomic (it uses bf(--link-dest) and a
  parallel hierarchy of files).
  
@@ -101,7 +101,7 @@ diff --git a/syscall.c b/syscall.c
        return open(pathname, flags | O_BINARY, mode);
  }
  
-@@ -526,6 +536,9 @@ int do_open_nofollow(const char *pathname, int flags)
+@@ -545,6 +555,9 @@ int do_open_nofollow(const char *pathname, int flags)
  #endif
        }
  
index 6ae4e5125028bf2dcad7205bd5bd8c54a7362020..5e543bc1f9fd3a2e9dc208a0b9b862bc3811aa33 100644 (file)
@@ -7,7 +7,7 @@ To use this patch, run these commands for a successful build:
     ./configure                                 (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
@@ -19,12 +19,11 @@ diff --git a/generator.c b/generator.c
  extern int human_readable;
  extern int ignore_existing;
  extern int ignore_non_existing;
-@@ -1688,6 +1689,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1688,6 +1689,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                goto cleanup;
        }
  
-+      if (downdate_only && statret == 0
-+          && cmp_time(sx.st.st_mtime, file->modtime) < 0) {
++      if (downdate_only && statret == 0 && time_diff(&sx.st, file) < 0) {
 +              if (INFO_GTE(SKIP, 1))
 +                      rprintf(FINFO, "%s is older\n", fname);
 +              return;
@@ -33,7 +32,7 @@ diff --git a/generator.c b/generator.c
        fnamecmp_type = FNAMECMP_FNAME;
  
        if (statret == 0 && !S_ISREG(sx.st.st_mode)) {
-@@ -2112,6 +2120,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2112,6 +2119,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
                        ignore_existing = -ignore_existing;
                        ignore_non_existing = -ignore_non_existing;
                        update_only = -update_only;
@@ -41,7 +40,7 @@ diff --git a/generator.c b/generator.c
                        always_checksum = -always_checksum;
                        size_only = -size_only;
                        append_mode = -append_mode;
-@@ -2137,6 +2146,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2137,6 +2145,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
                        ignore_existing = -ignore_existing;
                        ignore_non_existing = -ignore_non_existing;
                        update_only = -update_only;
index 1181de61451e2962431c7adac85d385177ff36d9..6a08207dab22c6d05d621e80e103c307fb0f0595 100644 (file)
@@ -8,7 +8,7 @@ To use this patch, run these commands for a successful build:
     ./configure
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/Makefile.in b/Makefile.in
 --- a/Makefile.in
 +++ b/Makefile.in
@@ -66,7 +66,7 @@ diff --git a/compat.c b/compat.c
 diff --git a/configure.ac b/configure.ac
 --- a/configure.ac
 +++ b/configure.ac
-@@ -593,6 +593,7 @@ AC_FUNC_UTIME_NULL
+@@ -594,6 +594,7 @@ AC_FUNC_UTIME_NULL
  AC_FUNC_ALLOCA
  AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
      fchmod fstat ftruncate strchr readlink link utime utimes lutimes strftime \
@@ -122,7 +122,7 @@ diff --git a/delete.c b/delete.c
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -51,6 +51,7 @@ extern int preserve_links;
+@@ -52,6 +52,7 @@ extern int preserve_links;
  extern int preserve_hard_links;
  extern int preserve_devices;
  extern int preserve_specials;
@@ -130,7 +130,7 @@ diff --git a/flist.c b/flist.c
  extern int delete_during;
  extern int missing_args;
  extern int eol_nulls;
-@@ -399,6 +400,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -381,6 +382,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
  {
        static time_t modtime;
        static mode_t mode;
@@ -140,7 +140,7 @@ diff --git a/flist.c b/flist.c
  #ifdef SUPPORT_HARD_LINKS
        static int64 dev;
  #endif
-@@ -442,6 +446,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -424,6 +428,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
                xflags |= XMIT_SAME_MODE;
        else
                mode = file->mode;
@@ -155,7 +155,7 @@ diff --git a/flist.c b/flist.c
  
        if (preserve_devices && IS_DEVICE(mode)) {
                if (protocol_version < 28) {
-@@ -583,6 +595,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -565,6 +577,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
                write_varint(f, F_MOD_NSEC(file));
        if (!(xflags & XMIT_SAME_MODE))
                write_int(f, to_wire_mode(mode));
@@ -166,7 +166,7 @@ diff --git a/flist.c b/flist.c
        if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
                if (protocol_version < 30)
                        write_int(f, uid);
-@@ -672,6 +688,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -654,6 +670,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
  {
        static int64 modtime;
        static mode_t mode;
@@ -176,7 +176,7 @@ diff --git a/flist.c b/flist.c
  #ifdef SUPPORT_HARD_LINKS
        static int64 dev;
  #endif
-@@ -779,6 +798,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -761,6 +780,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
                        modtime = first->modtime;
                        modtime_nsec = F_MOD_NSEC(first);
                        mode = first->mode;
@@ -187,7 +187,7 @@ diff --git a/flist.c b/flist.c
                        if (preserve_uid)
                                uid = F_OWNER(first);
                        if (preserve_gid)
-@@ -820,6 +843,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -802,6 +825,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
  
        if (chmod_modes && !S_ISLNK(mode) && mode)
                mode = tweak_mode(mode, chmod_modes);
@@ -198,7 +198,7 @@ diff --git a/flist.c b/flist.c
  
        if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
                if (protocol_version < 30)
-@@ -978,6 +1005,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -960,6 +987,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
        }
  #endif
        file->mode = mode;
@@ -209,7 +209,7 @@ diff --git a/flist.c b/flist.c
        if (preserve_uid)
                F_OWNER(file) = uid;
        if (preserve_gid) {
-@@ -1375,6 +1406,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1357,6 +1388,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
        }
  #endif
        file->mode = st.st_mode;
@@ -348,7 +348,7 @@ diff --git a/main.c b/main.c
  extern int file_total;
  extern int recurse;
  extern int xfer_dirs;
-@@ -847,6 +851,22 @@ static int do_recv(int f_in, int f_out, char *local_name)
+@@ -850,6 +854,22 @@ static int do_recv(int f_in, int f_out, char *local_name)
         * points to an identical file won't be replaced by the referent. */
        copy_links = copy_dirlinks = copy_unsafe_links = 0;
  
@@ -469,7 +469,7 @@ diff --git a/options.c b/options.c
    {"ignore-errors",    0,  POPT_ARG_VAL,    &ignore_errors, 1, 0, 0 },
    {"no-ignore-errors", 0,  POPT_ARG_VAL,    &ignore_errors, 0, 0, 0 },
    {"max-delete",       0,  POPT_ARG_INT,    &max_delete, 0, 0, 0 },
-@@ -2543,6 +2569,9 @@ void server_options(char **args, int *argc_p)
+@@ -2567,6 +2593,9 @@ void server_options(char **args, int *argc_p)
        if (xfer_dirs && !recurse && delete_mode && am_sender)
                args[ac++] = "--no-r";
  
@@ -479,7 +479,7 @@ diff --git a/options.c b/options.c
        if (do_compression && def_compress_level != Z_DEFAULT_COMPRESSION) {
                if (asprintf(&arg, "--compress-level=%d", def_compress_level) < 0)
                        goto oom;
-@@ -2636,6 +2665,16 @@ void server_options(char **args, int *argc_p)
+@@ -2660,6 +2689,16 @@ void server_options(char **args, int *argc_p)
                        args[ac++] = "--delete-excluded";
                if (force_delete)
                        args[ac++] = "--force";
@@ -507,7 +507,7 @@ diff --git a/rsync.c b/rsync.c
  extern int preserve_executability;
  extern int preserve_times;
  extern int am_root;
-@@ -452,6 +453,39 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms,
+@@ -458,6 +459,39 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms,
        return new_mode;
  }
  
@@ -547,7 +547,7 @@ diff --git a/rsync.c b/rsync.c
  int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
                   const char *fnamecmp, int flags)
  {
-@@ -513,7 +547,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -519,7 +553,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
                if (am_root >= 0) {
                        uid_t uid = change_uid ? (uid_t)F_OWNER(file) : sxp->st.st_uid;
                        gid_t gid = change_gid ? (gid_t)F_GROUP(file) : sxp->st.st_gid;
@@ -556,7 +556,7 @@ diff --git a/rsync.c b/rsync.c
                                /* We shouldn't have attempted to change uid
                                 * or gid unless have the privilege. */
                                rsyserr(FERROR_XFER, errno, "%s %s failed",
-@@ -553,7 +587,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -559,7 +593,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
          || (NSEC_BUMP(file) && (uint32)sxp->st.ST_MTIME_NSEC != F_MOD_NSEC(file))
  #endif
          )) {
@@ -565,7 +565,7 @@ diff --git a/rsync.c b/rsync.c
                if (ret < 0) {
                        rsyserr(FERROR_XFER, errno, "failed to set times on %s",
                                full_fname(fname));
-@@ -580,7 +614,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -586,7 +620,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
  
  #ifdef HAVE_CHMOD
        if (!BITS_EQUAL(sxp->st.st_mode, new_mode, CHMOD_BITS)) {
@@ -574,7 +574,7 @@ diff --git a/rsync.c b/rsync.c
                if (ret < 0) {
                        rsyserr(FERROR_XFER, errno,
                                "failed to set permissions on %s",
-@@ -592,6 +626,19 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -598,6 +632,19 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
        }
  #endif
  
@@ -594,7 +594,7 @@ diff --git a/rsync.c b/rsync.c
        if (INFO_GTE(NAME, 2) && flags & ATTRS_REPORT) {
                if (updated)
                        rprintf(FCLIENT, "%s\n", fname);
-@@ -666,7 +713,8 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -672,7 +719,8 @@ int finish_transfer(const char *fname, const char *fnametmp,
  
        /* Change permissions before putting the file into place. */
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
@@ -604,7 +604,7 @@ diff --git a/rsync.c b/rsync.c
  
        /* move tmp file over real file */
        if (DEBUG_GTE(RECV, 1))
-@@ -683,6 +731,10 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -689,6 +737,10 @@ int finish_transfer(const char *fname, const char *fnametmp,
        }
        if (ret == 0) {
                /* The file was moved into place (not copied), so it's done. */
@@ -642,7 +642,7 @@ diff --git a/rsync.h b/rsync.h
  #define ITEM_BASIS_TYPE_FOLLOWS (1<<11)
  #define ITEM_XNAME_FOLLOWS (1<<12)
  #define ITEM_IS_NEW (1<<13)
-@@ -522,6 +525,28 @@ typedef unsigned int size_t;
+@@ -528,6 +531,28 @@ typedef unsigned int size_t;
  #endif
  #endif
  
@@ -671,7 +671,7 @@ diff --git a/rsync.h b/rsync.h
  /* Find a variable that is either exactly 32-bits or longer.
   * If some code depends on 32-bit truncation, it will need to
   * take special action in a "#if SIZEOF_INT32 > 4" section. */
-@@ -709,6 +734,7 @@ extern int file_extra_cnt;
+@@ -715,6 +740,7 @@ extern int file_extra_cnt;
  extern int inc_recurse;
  extern int uid_ndx;
  extern int gid_ndx;
@@ -679,7 +679,7 @@ diff --git a/rsync.h b/rsync.h
  extern int acls_ndx;
  extern int xattrs_ndx;
  
-@@ -750,6 +776,11 @@ extern int xattrs_ndx;
+@@ -756,6 +782,11 @@ extern int xattrs_ndx;
  /* When the associated option is on, all entries will have these present: */
  #define F_OWNER(f) REQ_EXTRA(f, uid_ndx)->unum
  #define F_GROUP(f) REQ_EXTRA(f, gid_ndx)->unum
@@ -714,7 +714,7 @@ diff --git a/rsync.yo b/rsync.yo
       --max-delete=NUM        don't delete more than NUM files
       --max-size=SIZE         don't transfer any file larger than SIZE
       --min-size=SIZE         don't transfer any file smaller than SIZE
-@@ -657,7 +661,8 @@ specified, in which case bf(-r) is not implied.
+@@ -658,7 +662,8 @@ specified, in which case bf(-r) is not implied.
  
  Note that bf(-a) bf(does not preserve hardlinks), because
  finding multiply-linked files is expensive.  You must separately
@@ -724,7 +724,7 @@ diff --git a/rsync.yo b/rsync.yo
  
  dit(--no-OPTION) You may turn off one or more implied options by prefixing
  the option name with "no-".  Not all options may be prefixed with a "no-":
-@@ -959,7 +964,7 @@ they would be using bf(--copy-links).
+@@ -963,7 +968,7 @@ they would be using bf(--copy-links).
  Without this option, if the sending side has replaced a directory with a
  symlink to a directory, the receiving side will delete anything that is in
  the way of the new symlink, including a directory hierarchy (as long as
@@ -733,9 +733,9 @@ diff --git a/rsync.yo b/rsync.yo
  
  See also bf(--keep-dirlinks) for an analogous option for the receiving
  side.
-@@ -1122,6 +1127,29 @@ Note that this option does not copy rsyncs special xattr values (e.g. those
- used by bf(--fake-super)) unless you repeat the option (e.g. -XX).  This
- "copy all xattrs" mode cannot be used with bf(--fake-super).
+@@ -1147,6 +1152,29 @@ Note that the bf(-X) option does not copy rsync's special xattr values (e.g.
+ those used by bf(--fake-super)) unless you repeat the option (e.g. -XX).
This "copy all xattrs" mode cannot be used with bf(--fake-super).
  
 +dit(bf(--fileflags)) This option causes rsync to update the file-flags to be
 +the same as the source files and directories (if your OS supports the
@@ -763,7 +763,7 @@ diff --git a/rsync.yo b/rsync.yo
  dit(bf(--chmod)) This option tells rsync to apply one or more
  comma-separated "chmod" modes to the permission of the files in the
  transfer.  The resulting value is treated as though it were the permissions
-@@ -1474,12 +1502,13 @@ display as a "*missing" entry in the bf(--list-only) output.
+@@ -1502,12 +1530,13 @@ display as a "*missing" entry in the bf(--list-only) output.
  dit(bf(--ignore-errors)) Tells bf(--delete) to go ahead and delete files
  even when there are I/O errors.
  
@@ -780,7 +780,7 @@ diff --git a/rsync.yo b/rsync.yo
  bf(--recursive) option was also enabled.
  
  dit(bf(--max-delete=NUM)) This tells rsync not to delete more than NUM
-@@ -2113,7 +2142,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -2144,7 +2173,7 @@ with older versions of rsync, but that also turns on the output of other
  verbose messages).
  
  The "%i" escape has a cryptic output that is 11 letters long.  The general
@@ -789,7 +789,7 @@ diff --git a/rsync.yo b/rsync.yo
  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.
-@@ -2169,7 +2198,7 @@ quote(itemization(
+@@ -2200,7 +2229,7 @@ quote(itemization(
    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).
@@ -801,14 +801,14 @@ diff --git a/rsync.yo b/rsync.yo
 diff --git a/syscall.c b/syscall.c
 --- a/syscall.c
 +++ b/syscall.c
-@@ -40,6 +40,7 @@ extern int read_only;
+@@ -38,6 +38,7 @@ extern int am_root;
+ extern int am_sender;
+ extern int read_only;
  extern int list_only;
++extern int force_change;
  extern int inplace;
  extern int preallocate_files;
-+extern int force_change;
  extern int preserve_perms;
- extern int preserve_executability;
 @@ -67,7 +68,23 @@ int do_unlink(const char *fname)
  {
        if (dry_run) return 0;
@@ -1005,7 +1005,7 @@ diff --git a/t_stub.c b/t_stub.c
  int preserve_xattrs = 0;
 @@ -102,3 +103,23 @@ filter_rule_list daemon_filter_list;
  {
-       return cst ? 16 : 1;
+       return cst || !flg ? 16 : 1;
  }
 +
 +#if defined SUPPORT_FILEFLAGS || defined SUPPORT_FORCE_CHANGE
@@ -1076,7 +1076,7 @@ diff --git a/util.c b/util.c
  {
        static int switch_step = 0;
  
-@@ -132,6 +160,11 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -142,6 +170,11 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
  #include "case_N.h"
                if (do_utimensat(fname, modtime, mod_nsec) == 0)
                        break;
@@ -1088,7 +1088,7 @@ diff --git a/util.c b/util.c
                if (errno != ENOSYS)
                        return -1;
                switch_step++;
-@@ -142,6 +175,11 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -152,6 +185,11 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
  #include "case_N.h"
                if (do_lutimes(fname, modtime, mod_nsec) == 0)
                        break;
@@ -1100,7 +1100,7 @@ diff --git a/util.c b/util.c
                if (errno != ENOSYS)
                        return -1;
                switch_step++;
-@@ -165,6 +203,13 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -175,6 +213,13 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
                if (do_utime(fname, modtime, mod_nsec) == 0)
                        break;
  #endif
@@ -1117,7 +1117,7 @@ diff --git a/util.c b/util.c
 diff --git a/xattrs.c b/xattrs.c
 --- a/xattrs.c
 +++ b/xattrs.c
-@@ -1206,7 +1206,7 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
+@@ -1224,7 +1224,7 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
        mode = (fst.st_mode & _S_IFMT) | (fmode & ACCESSPERMS)
             | (S_ISDIR(fst.st_mode) ? 0700 : 0600);
        if (fst.st_mode != mode)
index 4871f10576436e56e1473c3582ac0c741edf7923..e55f2415e4bbb24cd116d38a4e3cb45590f59afa 100644 (file)
@@ -9,25 +9,27 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/exclude.c b/exclude.c
 --- a/exclude.c
 +++ b/exclude.c
-@@ -44,8 +44,11 @@ filter_rule_list filter_list = { .debug_type = "" };
+@@ -44,10 +44,13 @@ filter_rule_list filter_list = { .debug_type = "" };
  filter_rule_list cvs_filter_list = { .debug_type = " [global CVS]" };
  filter_rule_list daemon_filter_list = { .debug_type = " [daemon]" };
  
--/* Need room enough for ":MODS " prefix plus some room to grow. */
--#define MAX_RULE_PREFIX (16)
 +filter_rule *last_hit_filter_rule;
 +
+ int saw_xattr_filter = 0;
+-/* Need room enough for ":MODS " prefix plus some room to grow. */
+-#define MAX_RULE_PREFIX (16)
 +/* Need room enough for ":MODS " prefix, which can now include
 + * chmod/user/group values. */
 +#define MAX_RULE_PREFIX (256)
  
  #define SLASH_WILD3_SUFFIX "/***"
  
-@@ -124,8 +127,27 @@ static void teardown_mergelist(filter_rule *ex)
+@@ -126,8 +129,27 @@ static void teardown_mergelist(filter_rule *ex)
                mergelist_cnt--;
  }
  
@@ -55,7 +57,28 @@ diff --git a/exclude.c b/exclude.c
        if (ex->rflags & FILTRULE_PERDIR_MERGE)
                teardown_mergelist(ex);
        free(ex->pattern);
-@@ -720,7 +742,8 @@ static void report_filter_result(enum logcode code, char const *name,
+@@ -729,7 +751,9 @@ static void report_filter_result(enum logcode code, char const *name,
+ /* This function is used to check if a file should be included/excluded
+  * from the list of files based on its name and type etc.  The value of
+- * filter_level is set to either SERVER_FILTERS or ALL_FILTERS. */
++ * filter_level is set to either SERVER_FILTERS or ALL_FILTERS.
++ * "last_hit_filter_rule" will be set to the operative filter, or NULL if none. */
++
+ int name_is_excluded(const char *fname, int name_flags, int filter_level)
+ {
+       if (daemon_filter_list.head && check_filter(&daemon_filter_list, FLOG, fname, name_flags) < 0) {
+@@ -738,6 +762,9 @@ int name_is_excluded(const char *fname, int name_flags, int filter_level)
+               return 1;
+       }
++      /* Don't leave a daemon include in last_hit_filter_rule. */
++      last_hit_filter_rule = NULL;
++
+       if (filter_level != ALL_FILTERS)
+               return 0;
+@@ -748,7 +775,8 @@ int name_is_excluded(const char *fname, int name_flags, int filter_level)
  }
  
  /* Return -1 if file "name" is defined to be excluded by the specified
@@ -63,12 +86,12 @@ diff --git a/exclude.c b/exclude.c
 + * exclude list, 1 if it is included, and 0 if it was not matched.
 + * Sets last_hit_filter_rule to the filter that was hit, or NULL if none. */
  int check_filter(filter_rule_list *listp, enum logcode code,
-                const char *name, int name_is_dir)
+                const char *name, int name_flags)
  {
-@@ -746,10 +769,12 @@ int check_filter(filter_rule_list *listp, enum logcode code,
-               if (rule_matches(name, ent, name_is_dir)) {
-                       report_filter_result(code, name, ent, name_is_dir,
-                                            listp->debug_type);
+@@ -771,10 +799,12 @@ int check_filter(filter_rule_list *listp, enum logcode code,
+               }
+               if (rule_matches(name, ent, name_flags)) {
+                       report_filter_result(code, name, ent, name_flags, listp->debug_type);
 +                      last_hit_filter_rule = ent;
                        return ent->rflags & FILTRULE_INCLUDE ? 1 : -1;
                }
@@ -78,7 +101,7 @@ diff --git a/exclude.c b/exclude.c
        return 0;
  }
  
-@@ -766,9 +791,46 @@ static const uchar *rule_strcmp(const uchar *str, const char *rule, int rule_len
+@@ -791,9 +821,46 @@ static const uchar *rule_strcmp(const uchar *str, const char *rule, int rule_len
        return NULL;
  }
  
@@ -126,7 +149,7 @@ diff --git a/exclude.c b/exclude.c
  
  /* Gets the next include/exclude rule from *rulestr_ptr and advances
   * *rulestr_ptr to point beyond it.  Stores the pattern's start (within
-@@ -783,6 +845,7 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
+@@ -808,6 +875,7 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
                                   const char **pat_ptr, unsigned int *pat_len_ptr)
  {
        const uchar *s = (const uchar *)*rulestr_ptr;
@@ -134,7 +157,7 @@ diff --git a/exclude.c b/exclude.c
        filter_rule *rule;
        unsigned int len;
  
-@@ -802,6 +865,12 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
+@@ -827,6 +895,12 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
        /* Inherit from the template.  Don't inherit FILTRULES_SIDES; we check
         * that later. */
        rule->rflags = template->rflags & FILTRULES_FROM_CONTAINER;
@@ -147,7 +170,7 @@ diff --git a/exclude.c b/exclude.c
  
        /* Figure out what kind of a filter rule "s" is pointing at.  Note
         * that if FILTRULE_NO_PREFIXES is set, the rule is either an include
-@@ -947,11 +1016,63 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
+@@ -972,11 +1046,63 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
                                        goto invalid;
                                rule->rflags |= FILTRULE_EXCLUDE_SELF;
                                break;
@@ -211,7 +234,7 @@ diff --git a/exclude.c b/exclude.c
                        case 'p':
                                rule->rflags |= FILTRULE_PERISHABLE;
                                break;
-@@ -1270,6 +1391,23 @@ char *get_rule_prefix(filter_rule *rule, const char *pat, int for_xfer,
+@@ -1299,6 +1425,23 @@ char *get_rule_prefix(filter_rule *rule, const char *pat, int for_xfer,
                else if (am_sender)
                        return NULL;
        }
@@ -238,7 +261,7 @@ diff --git a/exclude.c b/exclude.c
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -81,6 +81,7 @@ extern struct chmod_mode_struct *chmod_modes;
+@@ -82,6 +82,7 @@ extern struct chmod_mode_struct *chmod_modes;
  
  extern filter_rule_list filter_list;
  extern filter_rule_list daemon_filter_list;
@@ -246,26 +269,7 @@ diff --git a/flist.c b/flist.c
  
  #ifdef ICONV_OPTION
  extern int filesfrom_convert;
-@@ -275,7 +276,8 @@ static inline int path_is_daemon_excluded(char *path, int ignore_filename)
- /* This function is used to check if a file should be included/excluded
-  * from the list of files based on its name and type etc.  The value of
-- * filter_level is set to either SERVER_FILTERS or ALL_FILTERS. */
-+ * filter_level is set to either SERVER_FILTERS or ALL_FILTERS.
-+ * "last_hit_filter_rule" will be set to the operative filter, or NULL if none. */
- static int is_excluded(const char *fname, int is_dir, int filter_level)
- {
- #if 0 /* This currently never happens, so avoid a useless compare. */
-@@ -284,6 +286,8 @@ static int is_excluded(const char *fname, int is_dir, int filter_level)
- #endif
-       if (is_daemon_excluded(fname, is_dir))
-               return 1;
-+      /* Don't leave a daemon include in last_hit_filter_rule. */
-+      last_hit_filter_rule = NULL;
-       if (filter_level != ALL_FILTERS)
-               return 0;
-       if (filter_list.head
-@@ -1174,7 +1178,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1156,7 +1157,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
        } else if (readlink_stat(thisname, &st, linkname) != 0) {
                int save_errno = errno;
                /* See if file is excluded before reporting an error. */
@@ -274,7 +278,7 @@ diff --git a/flist.c b/flist.c
                 && (is_excluded(thisname, 0, filter_level)
                  || is_excluded(thisname, 1, filter_level))) {
                        if (ignore_perishable && save_errno != ENOENT)
-@@ -1219,6 +1223,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1201,6 +1202,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
  
        if (filter_level == NO_FILTERS)
                goto skip_filters;
@@ -287,7 +291,7 @@ diff --git a/flist.c b/flist.c
  
        if (S_ISDIR(st.st_mode)) {
                if (!xfer_dirs) {
-@@ -1421,12 +1431,23 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1403,12 +1410,23 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
                                          int flags, int filter_level)
  {
        struct file_struct *file;
@@ -312,7 +316,7 @@ diff --git a/flist.c b/flist.c
                file->mode = tweak_mode(file->mode, chmod_modes);
  
        if (f >= 0) {
-@@ -2317,7 +2338,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2299,7 +2317,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
                        struct file_struct *file;
                        file = send_file_name(f, flist, fbuf, &st,
                                              FLAG_TOP_DIR | FLAG_CONTENT_DIR | flags,
@@ -321,7 +325,7 @@ diff --git a/flist.c b/flist.c
                        if (!file)
                                continue;
                        if (inc_recurse) {
-@@ -2331,7 +2352,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2313,7 +2331,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
                        } else
                                send_if_directory(f, flist, file, fbuf, len, flags);
                } else
@@ -343,22 +347,22 @@ diff --git a/rsync.h b/rsync.h
  
  #define XFLG_FATAL_ERRORS     (1<<0)
  #define XFLG_OLD_PREFIXES     (1<<1)
-@@ -856,6 +859,8 @@ struct map_struct {
+@@ -862,6 +865,8 @@ struct map_struct {
        int status;             /* first errno from read errors         */
  };
  
 +struct chmod_mode_struct;
 +
- #define FILTRULE_WILD         (1<<0) /* pattern has '*', '[', and/or '?' */
- #define FILTRULE_WILD2                (1<<1) /* pattern has '**' */
- #define FILTRULE_WILD2_PREFIX (1<<2) /* pattern starts with "**" */
-@@ -876,8 +881,18 @@ struct map_struct {
- #define FILTRULE_RECEIVER_SIDE        (1<<17)/* rule applies to the receiving side */
+ #define NAME_IS_FILE          (0)    /* filter name as a file */
+ #define NAME_IS_DIR           (1<<0) /* filter name as a dir */
+ #define NAME_IS_XATTR         (1<<2) /* filter name as an xattr */
+@@ -887,8 +892,18 @@ struct map_struct {
  #define FILTRULE_CLEAR_LIST   (1<<18)/* this item is the "!" token */
  #define FILTRULE_PERISHABLE   (1<<19)/* perishable if parent dir goes away */
-+#define FILTRULE_CHMOD                (1<<20)/* chmod-tweak matching files */
-+#define FILTRULE_FORCE_OWNER  (1<<21)/* force owner of matching files */
-+#define FILTRULE_FORCE_GROUP  (1<<22)/* force group of matching files */
+ #define FILTRULE_XATTR                (1<<20)/* rule only applies to xattr names */
++#define FILTRULE_CHMOD                (1<<21)/* chmod-tweak matching files */
++#define FILTRULE_FORCE_OWNER  (1<<22)/* force owner of matching files */
++#define FILTRULE_FORCE_GROUP  (1<<23)/* force group of matching files */
  
  #define FILTRULES_SIDES (FILTRULE_SENDER_SIDE | FILTRULE_RECEIVER_SIDE)
 +#define FILTRULES_ATTRS (FILTRULE_CHMOD | FILTRULE_FORCE_OWNER | FILTRULE_FORCE_GROUP)
@@ -371,7 +375,7 @@ diff --git a/rsync.h b/rsync.h
  
  typedef struct filter_struct {
        struct filter_struct *next;
-@@ -887,6 +902,11 @@ typedef struct filter_struct {
+@@ -898,6 +913,11 @@ typedef struct filter_struct {
                int slash_cnt;
                struct filter_list_struct *mergelist;
        } u;
@@ -386,7 +390,7 @@ diff --git a/rsync.h b/rsync.h
 diff --git a/rsync.yo b/rsync.yo
 --- a/rsync.yo
 +++ b/rsync.yo
-@@ -1144,6 +1144,8 @@ quote(--chmod=D2775,F664)
+@@ -1169,6 +1169,8 @@ quote(--chmod=D2775,F664)
  
  It is also legal to specify multiple bf(--chmod) options, as each
  additional option is just appended to the list of changes to make.
@@ -395,7 +399,7 @@ diff --git a/rsync.yo b/rsync.yo
  
  See the bf(--perms) and bf(--executability) options for how the resulting
  permission value can be applied to the files in the transfer.
-@@ -2063,6 +2065,10 @@ be omitted, but if USER is empty, a leading colon must be supplied.
+@@ -2094,6 +2096,10 @@ be omitted, but if USER is empty, a leading colon must be supplied.
  If you specify "--chown=foo:bar, this is exactly the same as specifying
  "--usermap=*:foo --groupmap=*:bar", only easier.
  
@@ -406,7 +410,7 @@ diff --git a/rsync.yo b/rsync.yo
  dit(bf(--timeout=TIMEOUT)) This option allows you to set a maximum I/O
  timeout in seconds. If no data is transferred for the specified time
  then rsync will exit. The default is 0, which means no timeout.
-@@ -2926,6 +2932,15 @@ itemization(
+@@ -2965,6 +2971,15 @@ itemization(
    option's default rules that exclude things like "CVS" and "*.o" are
    marked as perishable, and will not prevent a directory that was removed
    on the source from being deleted on the destination.
@@ -419,10 +423,10 @@ diff --git a/rsync.yo b/rsync.yo
 +  it() A bf(g+nop()(GROUP)) on an include rule pretends that matching source files
 +  are owned by bf(GROUP) (a name or numeric gid).  This happens before any gid
 +  mapping by name or bf(--groupmap).
- )
- manpagesection(MERGE-FILE FILTER RULES)
-@@ -2987,6 +3002,12 @@ itemization(
+   it() An bf(x) indicates that a rule affects xattr names in xattr copy/delete
+   operations (and is thus ignored when matching file/dir names). If no
+   xattr-matching rules are specified, a default xattr filtering rule is
+@@ -3030,6 +3045,12 @@ itemization(
    a rule prefix such as bf(hide)).
  )
  
@@ -438,7 +442,7 @@ diff --git a/rsync.yo b/rsync.yo
 diff --git a/util.c b/util.c
 --- a/util.c
 +++ b/util.c
-@@ -878,6 +878,25 @@ size_t stringjoin(char *dest, size_t destsize, ...)
+@@ -888,6 +888,25 @@ size_t stringjoin(char *dest, size_t destsize, ...)
        return ret;
  }
  
index 043d27dbdf3cd77aee01d88c26a6cee9ac00516f..2ddf4aa4c9fe2b6bfc8e30df12480a8f86798962 100644 (file)
@@ -7,7 +7,7 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/options.c b/options.c
 --- a/options.c
 +++ b/options.c
@@ -35,7 +35,7 @@ diff --git a/options.c b/options.c
    {"rsh",             'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 },
    {"rsync-path",       0,  POPT_ARG_STRING, &rsync_path, 0, 0, 0 },
    {"temp-dir",        'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
-@@ -2722,6 +2725,9 @@ void server_options(char **args, int *argc_p)
+@@ -2746,6 +2749,9 @@ void server_options(char **args, int *argc_p)
                        args[ac++] = tmpdir;
                }
  
@@ -56,9 +56,9 @@ diff --git a/receiver.c b/receiver.c
  extern int basis_dir_cnt;
  extern int make_backups;
  extern int cleanup_got_literal;
-@@ -392,6 +393,12 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -390,6 +391,12 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
  
-       checksum_len = sum_end(file_sum1);
+       sum_len = sum_end(file_sum1);
  
 +      if (do_fsync && fd != -1 && fsync(fd) != 0) {
 +              rsyserr(FERROR, errno, "fsync failed on %s",
@@ -72,14 +72,14 @@ diff --git a/receiver.c b/receiver.c
 diff --git a/t_stub.c b/t_stub.c
 --- a/t_stub.c
 +++ b/t_stub.c
-@@ -22,6 +22,7 @@
+@@ -21,6 +21,7 @@
  #include "rsync.h"
  
- int inplace = 0;
 +int do_fsync = 0;
+ int inplace = 0;
  int modify_window = 0;
  int preallocate_files = 0;
- int protect_args = 0;
 diff --git a/util.c b/util.c
 --- a/util.c
 +++ b/util.c
@@ -91,7 +91,7 @@ diff --git a/util.c b/util.c
  extern int protect_args;
  extern int modify_window;
  extern int relative_paths;
-@@ -404,6 +405,13 @@ int copy_file(const char *source, const char *dest, int ofd, mode_t mode)
+@@ -414,6 +415,13 @@ int copy_file(const char *source, const char *dest, int ofd, mode_t mode)
                rsyserr(FERROR_XFER, errno, "ftruncate %s", full_fname(dest));
        }
  
index e15bf066ddb3523c054c23242b38e3a822860e6d..db8f53ddbbf53e376a305ef5a053ceef195b4141 100644 (file)
@@ -22,7 +22,7 @@ based-on: patch/master/crtimes
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -1583,6 +1583,9 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1565,6 +1565,9 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
  #ifdef SUPPORT_XATTRS
                if (preserve_xattrs) {
                        sx.st.st_mode = file->mode;
@@ -280,7 +280,7 @@ diff --git a/options.c b/options.c
    {"ignore-errors",    0,  POPT_ARG_VAL,    &ignore_errors, 1, 0, 0 },
    {"no-ignore-errors", 0,  POPT_ARG_VAL,    &ignore_errors, 0, 0, 0 },
    {"max-delete",       0,  POPT_ARG_INT,    &max_delete, 0, 0, 0 },
-@@ -1984,6 +1995,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2008,6 +2019,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
        }
  #endif
  
@@ -296,7 +296,7 @@ diff --git a/options.c b/options.c
        if (block_size > MAX_BLOCK_SIZE) {
                snprintf(err_buf, sizeof err_buf,
                         "--block-size=%lu is too large (max: %u)\n", block_size, MAX_BLOCK_SIZE);
-@@ -2579,6 +2599,11 @@ void server_options(char **args, int *argc_p)
+@@ -2603,6 +2623,11 @@ void server_options(char **args, int *argc_p)
        if (preserve_fileflags)
                args[ac++] = "--fileflags";
  
@@ -311,7 +311,7 @@ diff --git a/options.c b/options.c
 diff --git a/rsync.c b/rsync.c
 --- a/rsync.c
 +++ b/rsync.c
-@@ -573,8 +573,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -579,8 +579,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
  #ifdef SUPPORT_XATTRS
        if (am_root < 0)
                set_stat_xattr(fname, file, new_mode);
@@ -327,7 +327,7 @@ diff --git a/rsync.c b/rsync.c
  #endif
  
        if (!preserve_times
-@@ -585,6 +591,9 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -591,6 +597,9 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
        if (sxp->st.st_ino == 2 && S_ISDIR(sxp->st.st_mode))
                flags |= ATTRS_SKIP_CRTIME;
        if (!(flags & ATTRS_SKIP_MTIME)
@@ -337,7 +337,7 @@ diff --git a/rsync.c b/rsync.c
         && (sxp->st.st_mtime != file->modtime
  #ifdef ST_MTIME_NSEC
          || (NSEC_BUMP(file) && (uint32)sxp->st.ST_MTIME_NSEC != F_MOD_NSEC(file))
-@@ -647,6 +656,16 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -653,6 +662,16 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
                 && !set_fileflags(fname, fileflags))
                        goto cleanup;
                updated = 1;
@@ -357,7 +357,7 @@ diff --git a/rsync.c b/rsync.c
 diff --git a/rsync.h b/rsync.h
 --- a/rsync.h
 +++ b/rsync.h
-@@ -549,6 +549,17 @@ typedef unsigned int size_t;
+@@ -555,6 +555,17 @@ typedef unsigned int size_t;
  #define ST_FLAGS(st) NO_FFLAGS
  #endif
  
@@ -387,7 +387,7 @@ diff --git a/rsync.yo b/rsync.yo
   -o, --owner                 preserve owner (super-user only)
   -g, --group                 preserve group
       --devices               preserve device files (super-user only)
-@@ -1151,6 +1153,42 @@ flags on files and directories that are being updated or deleted on the
+@@ -1176,6 +1178,42 @@ flags on files and directories that are being updated or deleted on the
  receiving side.  It does not try to affect user flags.  This option overrides
  bf(--force-change) and bf(--force-uchange).
  
@@ -452,7 +452,7 @@ diff --git a/xattrs.c b/xattrs.c
  extern int preserve_links;
  extern int preserve_devices;
  extern int preserve_specials;
-@@ -41,6 +42,10 @@ extern int checksum_seed;
+@@ -42,6 +43,10 @@ extern int saw_xattr_filter;
  #define RSYNC_XAL_INITIAL 5
  #define RSYNC_XAL_LIST_INITIAL 100
  
@@ -463,7 +463,7 @@ diff --git a/xattrs.c b/xattrs.c
  #define MAX_FULL_DATUM 32
  
  #define HAS_PREFIX(str, prfx) (*(str) == *(prfx) \
-@@ -73,6 +78,17 @@ extern int checksum_seed;
+@@ -74,6 +79,17 @@ extern int saw_xattr_filter;
  #define XDEF_ACL_SUFFIX "dacl"
  #define XDEF_ACL_ATTR RSYNC_PREFIX "%" XDEF_ACL_SUFFIX
  
@@ -481,7 +481,7 @@ diff --git a/xattrs.c b/xattrs.c
  typedef struct {
        char *datum, *name;
        size_t datum_len, name_len;
-@@ -184,8 +200,7 @@ static ssize_t get_xattr_names(const char *fname)
+@@ -185,8 +201,7 @@ static ssize_t get_xattr_names(const char *fname)
  /* On entry, the *len_ptr parameter contains the size of the extra space we
   * should allocate when we create a buffer for the data.  On exit, it contains
   * the length of the datum. */
@@ -491,7 +491,7 @@ diff --git a/xattrs.c b/xattrs.c
  {
        size_t datum_len = sys_lgetxattr(fname, name, NULL, 0);
        size_t extra_len = *len_ptr;
-@@ -194,7 +209,7 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
+@@ -195,7 +210,7 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
        *len_ptr = datum_len;
  
        if (datum_len == (size_t)-1) {
@@ -499,8 +499,8 @@ diff --git a/xattrs.c b/xattrs.c
 +              if (errno == ENOTSUP || flags & GXD_NO_MISSING_ERROR)
                        return NULL;
                rsyserr(FERROR_XFER, errno,
-                       "get_xattr_data: lgetxattr(\"%s\",\"%s\",0) failed",
-@@ -202,6 +217,15 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
+                       "get_xattr_data: lgetxattr(%s,\"%s\",0) failed",
+@@ -203,6 +218,15 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
                return NULL;
        }
  
@@ -516,7 +516,7 @@ diff --git a/xattrs.c b/xattrs.c
        if (!datum_len && !extra_len)
                extra_len = 1; /* request non-zero amount of memory */
        if (datum_len + extra_len < datum_len)
-@@ -230,7 +254,29 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
+@@ -231,7 +255,31 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
        return ptr;
  }
  
@@ -543,11 +543,13 @@ diff --git a/xattrs.c b/xattrs.c
 +      }
 +}
 +
++$$$ERROR$$$ the old patch needs reworking since rsync_xal_get() has totally changed!
++
 +static int rsync_xal_get(const char *fname, stat_x *sxp)
  {
        ssize_t list_len, name_len;
        size_t datum_len, name_offset;
-@@ -239,7 +285,8 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+@@ -240,7 +288,8 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
        int user_only = am_sender ? 0 : !am_root;
  #endif
        rsync_xa *rxa;
@@ -557,7 +559,7 @@ diff --git a/xattrs.c b/xattrs.c
  
        /* This puts the name list into the "namebuf" buffer. */
        if ((list_len = get_xattr_names(fname)) < 0)
-@@ -269,20 +316,23 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+@@ -271,11 +320,15 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
                }
  
                datum_len = name_len; /* Pass extra size to get_xattr_data() */
@@ -572,10 +574,9 @@ diff --git a/xattrs.c b/xattrs.c
                        /* For large datums, we store a flag and a checksum. */
 +                      char *datum = ptr;
                        name_offset = 1 + MAX_DIGEST_LEN;
--                      sum_init(-1, checksum_seed);
--                      sum_update(ptr, datum_len);
--                      free(ptr);
+                       sum_init(-1, checksum_seed);
+                       sum_update(ptr, datum_len);
+@@ -284,7 +337,9 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
                        if (!(ptr = new_array(char, name_offset + name_len)))
                                out_of_memory("rsync_xal_get");
                        *ptr = XSTATE_ABBREV;
@@ -586,7 +587,7 @@ diff --git a/xattrs.c b/xattrs.c
                } else
                        name_offset = datum_len;
  
-@@ -328,7 +378,7 @@ int get_xattr(const char *fname, stat_x *sxp)
+@@ -330,7 +385,7 @@ int get_xattr(const char *fname, stat_x *sxp)
        } else if (IS_MISSING_FILE(sxp->st))
                return 0;
  
@@ -595,7 +596,7 @@ diff --git a/xattrs.c b/xattrs.c
                free_xattr(sxp);
                return -1;
        }
-@@ -363,6 +413,8 @@ int copy_xattrs(const char *source, const char *dest)
+@@ -367,6 +422,8 @@ int copy_xattrs(const char *source, const char *dest)
                datum_len = 0;
                if (!(ptr = get_xattr_data(source, name, &datum_len, 0)))
                        return -1;
@@ -604,18 +605,7 @@ diff --git a/xattrs.c b/xattrs.c
                if (sys_lsetxattr(dest, name, ptr, datum_len) < 0) {
                        int save_errno = errno ? errno : EINVAL;
                        rsyserr(FERROR_XFER, errno,
-@@ -402,6 +454,10 @@ static int64 xattr_lookup_hash(const item_list *xalp)
- static int find_matching_xattr(const item_list *xalp)
- {
-+#ifdef HAVE_OSX_XATTRS
-+      xalp = NULL;
-+      return -1; /* find_matching_xattr is a waste of cycles for MOSX clients */
-+#else
-       const struct ht_int64_node *node;
-       const rsync_xa_list_ref *ref;
-       int64 key;
-@@ -453,6 +509,7 @@ static int find_matching_xattr(const item_list *xalp)
+@@ -457,6 +514,7 @@ static int find_matching_xattr(const item_list *xalp)
        }
  
        return -1;
@@ -623,7 +613,7 @@ diff --git a/xattrs.c b/xattrs.c
  }
  
  /* Store *xalp on the end of rsync_xal_l */
-@@ -674,11 +731,13 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
+@@ -678,11 +736,13 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
  
                        /* Re-read the long datum. */
                        if (!(ptr = get_xattr_data(fname, rxa->name, &len, 0))) {
@@ -638,7 +628,7 @@ diff --git a/xattrs.c b/xattrs.c
                        write_varint(f_out, len); /* length might have changed! */
                        write_bigbuf(f_out, ptr, len);
                        free(ptr);
-@@ -953,7 +1012,7 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
+@@ -969,7 +1029,7 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
        int user_only = am_root <= 0;
  #endif
        size_t name_len;
@@ -647,8 +637,8 @@ diff --git a/xattrs.c b/xattrs.c
  
        /* This puts the current name list into the "namebuf" buffer. */
        if ((list_len = get_xattr_names(fname)) < 0)
-@@ -965,7 +1024,10 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
-               if (XATTR_ABBREV(rxas[i])) {
+@@ -982,7 +1042,10 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
+                       int sum_len;
                        /* See if the fnamecmp version is identical. */
                        len = name_len = rxas[i].name_len;
 -                      if ((ptr = get_xattr_data(fnamecmp, name, &len, 1)) == NULL) {
@@ -659,7 +649,7 @@ diff --git a/xattrs.c b/xattrs.c
                          still_abbrev:
                                if (am_generator)
                                        continue;
-@@ -974,14 +1036,14 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
+@@ -991,6 +1054,8 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
                                ret = -1;
                                continue;
                        }
@@ -668,16 +658,7 @@ diff --git a/xattrs.c b/xattrs.c
                        if (len != rxas[i].datum_len) {
                                free(ptr);
                                goto still_abbrev;
-                       }
--                      sum_init(-1, checksum_seed);
--                      sum_update(ptr, len);
--                      sum_end(sum);
-+                      checksum_xattr_data(sum, ptr, len, sxp);
-                       if (memcmp(sum, rxas[i].datum + 1, MAX_DIGEST_LEN) != 0) {
-                               free(ptr);
-                               goto still_abbrev;
-@@ -1050,6 +1112,10 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
+@@ -1068,6 +1133,10 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
                }
        }
  
@@ -688,7 +669,7 @@ diff --git a/xattrs.c b/xattrs.c
        return ret;
  }
  
-@@ -1099,7 +1165,7 @@ char *get_xattr_acl(const char *fname, int is_access_acl, size_t *len_p)
+@@ -1117,7 +1186,7 @@ char *get_xattr_acl(const char *fname, int is_access_acl, size_t *len_p)
  {
        const char *name = is_access_acl ? XACC_ACL_ATTR : XDEF_ACL_ATTR;
        *len_p = 0; /* no extra data alloc needed from get_xattr_data() */
@@ -697,7 +678,7 @@ diff --git a/xattrs.c b/xattrs.c
  }
  
  int set_xattr_acl(const char *fname, int is_access_acl, const char *buf, size_t buf_len)
-@@ -1242,11 +1308,33 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
+@@ -1260,11 +1329,33 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
        return 0;
  }
  
@@ -731,7 +712,7 @@ diff --git a/xattrs.c b/xattrs.c
        return ret;
  }
  
-@@ -1255,6 +1343,9 @@ int x_lstat(const char *fname, STRUCT_STAT *fst, STRUCT_STAT *xst)
+@@ -1273,6 +1364,9 @@ int x_lstat(const char *fname, STRUCT_STAT *fst, STRUCT_STAT *xst)
        int ret = do_lstat(fname, fst);
        if ((ret < 0 || get_stat_xattr(fname, -1, fst, xst) < 0) && xst)
                xst->st_mode = 0;
@@ -741,7 +722,7 @@ diff --git a/xattrs.c b/xattrs.c
        return ret;
  }
  
-@@ -1263,6 +1354,9 @@ int x_fstat(int fd, STRUCT_STAT *fst, STRUCT_STAT *xst)
+@@ -1281,6 +1375,9 @@ int x_fstat(int fd, STRUCT_STAT *fst, STRUCT_STAT *xst)
        int ret = do_fstat(fd, fst);
        if ((ret < 0 || get_stat_xattr(NULL, fd, fst, xst) < 0) && xst)
                xst->st_mode = 0;
index ee8a86a44210f5480b27435545349093f58bd8de..5fcfd994ef2b5d2b4c65a4cf6d4d0f922f51c864 100644 (file)
@@ -12,7 +12,7 @@ TODO:
  - Make this code handle multibyte character encodings, and honor the
    --iconv setting when converting case.
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/exclude.c b/exclude.c
 --- a/exclude.c
 +++ b/exclude.c
@@ -24,7 +24,7 @@ diff --git a/exclude.c b/exclude.c
  
  extern int am_server;
  extern int am_sender;
-@@ -685,16 +686,15 @@ static int rule_matches(const char *fname, filter_rule *ex, int name_is_dir)
+@@ -690,16 +691,15 @@ static int rule_matches(const char *fname, filter_rule *ex, int name_flags)
                if (litmatch_array(pattern, strings, slash_handling))
                        return ret_match;
        } else if (anchored_match) {
@@ -55,8 +55,8 @@ diff --git a/flist.c b/flist.c
 +extern int ignore_case;
  extern int ignore_errors;
  extern int numeric_ids;
- extern int recurse;
-@@ -3076,6 +3077,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+ extern int quiet;
+@@ -3057,6 +3058,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
  {
        int dif;
        const uchar *c1, *c2;
@@ -64,7 +64,7 @@ diff --git a/flist.c b/flist.c
        enum fnc_state state1, state2;
        enum fnc_type type1, type2;
        enum fnc_type t_path = protocol_version >= 29 ? t_PATH : t_ITEM;
-@@ -3186,7 +3188,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -3167,7 +3169,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
                        if (type1 != type2)
                                return type1 == t_PATH ? 1 : -1;
                }
@@ -237,7 +237,7 @@ diff --git a/options.c b/options.c
    {"files-from",       0,  POPT_ARG_STRING, &files_from, 0, 0, 0 },
    {"from0",           '0', POPT_ARG_VAL,    &eol_nulls, 1, 0, 0},
    {"no-from0",         0,  POPT_ARG_VAL,    &eol_nulls, 0, 0, 0},
-@@ -2672,6 +2676,9 @@ void server_options(char **args, int *argc_p)
+@@ -2696,6 +2700,9 @@ void server_options(char **args, int *argc_p)
                args[ac++] = arg;
        }
  
@@ -258,7 +258,7 @@ diff --git a/rsync.yo b/rsync.yo
       --address=ADDRESS       bind address for outgoing socket to daemon
       --port=PORT             specify double-colon alternate port number
       --sockopts=OPTIONS      specify custom TCP options
-@@ -1783,6 +1784,10 @@ default (with is overridden by both the environment and the command-line).
+@@ -1814,6 +1815,10 @@ default (with is overridden by both the environment and the command-line).
  This option will eventually become a new default setting at some
  as-yet-undetermined point in the future.
  
index 4842b45f52ee7fc1196226a80841abd9dca33db1..19b76f08df95f7f56d04d6dffe1b0d5c2cce4ba7 100644 (file)
@@ -9,7 +9,7 @@ To use this patch, run these commands for a successful build:
     ./configure
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/Makefile.in b/Makefile.in
 --- a/Makefile.in
 +++ b/Makefile.in
@@ -25,7 +25,7 @@ diff --git a/Makefile.in b/Makefile.in
 diff --git a/clientserver.c b/clientserver.c
 --- a/clientserver.c
 +++ b/clientserver.c
-@@ -128,7 +128,7 @@ int start_socket_client(char *host, int remote_argc, char *remote_argv[],
+@@ -130,7 +130,7 @@ int start_socket_client(char *host, int remote_argc, char *remote_argv[],
        setup_iconv();
  #endif
  
@@ -34,7 +34,7 @@ diff --git a/clientserver.c b/clientserver.c
  
        return ret ? ret : client_run(fd, fd, -1, argc, argv);
  }
-@@ -207,7 +207,7 @@ static int exchange_protocols(int f_in, int f_out, char *buf, size_t bufsiz, int
+@@ -209,7 +209,7 @@ static int exchange_protocols(int f_in, int f_out, char *buf, size_t bufsiz, int
        return 0;
  }
  
@@ -43,7 +43,7 @@ diff --git a/clientserver.c b/clientserver.c
  {
        int i, modlen;
        char line[BIGPATHBUFLEN];
-@@ -293,6 +293,17 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
+@@ -295,6 +295,17 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
                        continue;
                }
  
@@ -61,7 +61,7 @@ diff --git a/clientserver.c b/clientserver.c
                if (strcmp(line,"@RSYNCD: OK") == 0)
                        break;
  
-@@ -561,7 +572,12 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -563,7 +574,12 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
        }
  
        read_only = lp_read_only(i); /* may also be overridden by auth_server() */
@@ -78,7 +78,7 @@ diff --git a/clientserver.c b/clientserver.c
 diff --git a/configure.ac b/configure.ac
 --- a/configure.ac
 +++ b/configure.ac
-@@ -695,6 +695,31 @@ if test x"$enable_iconv" != x"no"; then
+@@ -696,6 +696,31 @@ if test x"$enable_iconv" != x"no"; then
        AC_DEFINE(UTF8_CHARSET, "UTF-8", [String to pass to iconv() for the UTF-8 charset.])
  fi
  
@@ -460,7 +460,7 @@ new file mode 100644
 diff --git a/loadparm.c b/loadparm.c
 --- a/loadparm.c
 +++ b/loadparm.c
-@@ -151,6 +151,7 @@ typedef struct {
+@@ -155,6 +155,7 @@ typedef struct {
        BOOL strict_modes;
        BOOL transfer_logging;
        BOOL use_chroot;
@@ -468,7 +468,7 @@ diff --git a/loadparm.c b/loadparm.c
        BOOL write_only;
  } local_vars;
  
-@@ -225,6 +226,7 @@ static const all_vars Defaults = {
+@@ -233,6 +234,7 @@ static const all_vars Defaults = {
   /* strict_modes; */          True,
   /* transfer_logging; */      False,
   /* use_chroot; */            True,
@@ -476,7 +476,7 @@ diff --git a/loadparm.c b/loadparm.c
   /* write_only; */            False,
   }
  };
-@@ -362,6 +364,7 @@ static struct parm_struct parm_table[] =
+@@ -374,6 +376,7 @@ static struct parm_struct parm_table[] =
   {"transfer logging",  P_BOOL,   P_LOCAL, &Vars.l.transfer_logging,    NULL,0},
   {"uid",               P_STRING, P_LOCAL, &Vars.l.uid,                 NULL,0},
   {"use chroot",        P_BOOL,   P_LOCAL, &Vars.l.use_chroot,          NULL,0},
@@ -484,7 +484,7 @@ diff --git a/loadparm.c b/loadparm.c
   {"write only",        P_BOOL,   P_LOCAL, &Vars.l.write_only,          NULL,0},
   {NULL,                P_BOOL,   P_NONE,  NULL,                        NULL,0}
  };
-@@ -494,6 +497,7 @@ FN_LOCAL_BOOL(lp_reverse_lookup, reverse_lookup)
+@@ -510,6 +513,7 @@ FN_LOCAL_BOOL(lp_reverse_lookup, reverse_lookup)
  FN_LOCAL_BOOL(lp_strict_modes, strict_modes)
  FN_LOCAL_BOOL(lp_transfer_logging, transfer_logging)
  FN_LOCAL_BOOL(lp_use_chroot, use_chroot)
@@ -495,7 +495,7 @@ diff --git a/loadparm.c b/loadparm.c
 diff --git a/main.c b/main.c
 --- a/main.c
 +++ b/main.c
-@@ -1418,7 +1418,7 @@ static int start_client(int argc, char *argv[])
+@@ -1421,7 +1421,7 @@ static int start_client(int argc, char *argv[])
         * remote shell command, we need to do the RSYNCD protocol first */
        if (daemon_over_rsh) {
                int tmpret;
@@ -507,7 +507,7 @@ diff --git a/main.c b/main.c
 diff --git a/rsync.h b/rsync.h
 --- a/rsync.h
 +++ b/rsync.h
-@@ -472,6 +472,15 @@ enum delret {
+@@ -478,6 +478,15 @@ enum delret {
  #define iconv_t int
  #endif
  
index 706c87389eaf33365a9bdcc33f017a409a8f6a7e..490424f734b3621a9c27247a7d665013dff9f843 100644 (file)
@@ -12,7 +12,7 @@ To use this patch, run these commands for a successful build:
     ./configure
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/Makefile.in b/Makefile.in
 --- a/Makefile.in
 +++ b/Makefile.in
@@ -28,7 +28,7 @@ diff --git a/Makefile.in b/Makefile.in
 diff --git a/checksum.c b/checksum.c
 --- a/checksum.c
 +++ b/checksum.c
-@@ -21,10 +21,13 @@
+@@ -21,9 +21,12 @@
  
  #include "rsync.h"
  
@@ -36,13 +36,12 @@ diff --git a/checksum.c b/checksum.c
  extern int checksum_seed;
  extern int protocol_version;
  extern int proper_seed_order;
- extern char *checksum_choice;
 +extern char *link_by_hash_dir;
-+extern char link_by_hash_sum[MAX_DIGEST_LEN];
++extern char link_by_hash_extra_sum[MAX_DIGEST_LEN];
+ extern char *checksum_choice;
  
  #define CSUM_NONE 0
- #define CSUM_ARCHAIC 1
-@@ -244,7 +247,7 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
+@@ -252,7 +255,7 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
  }
  
  static int32 sumresidue;
@@ -51,48 +50,33 @@ diff --git a/checksum.c b/checksum.c
  static int cursum_type;
  
  void sum_init(int csum_type, int seed)
-@@ -255,6 +258,9 @@ void sum_init(int csum_type, int seed)
-               csum_type = parse_csum_name(NULL, 0);
-       cursum_type = csum_type;
-+      if (link_by_hash_dir && cursum_type != CSUM_MD5)
-+              md5_begin(&md2);
-+
+@@ -266,6 +269,8 @@ void sum_init(int csum_type, int seed)
        switch (csum_type) {
          case CSUM_MD5:
                md5_begin(&md);
-@@ -285,6 +291,9 @@ void sum_init(int csum_type, int seed)
-  **/
- void sum_update(const char *p, int32 len)
- {
-+      if (link_by_hash_dir && cursum_type != CSUM_MD5)
-+              md5_update(&md2, (uchar *)p, len);
-+
++              if (link_by_hash_dir)
++                      md5_begin(&md2);
+               break;
+         case CSUM_MD4:
+               mdfour_begin(&md);
+@@ -299,6 +304,8 @@ void sum_update(const char *p, int32 len)
        switch (cursum_type) {
          case CSUM_MD5:
                md5_update(&md, (uchar *)p, len);
-@@ -315,6 +324,7 @@ void sum_update(const char *p, int32 len)
-               sumresidue = len;
-               if (sumresidue)
-                       memcpy(md.buffer, p, sumresidue);
-+
-               break;
-         case CSUM_NONE:
++              if (link_by_hash_dir)
++                      md5_update(&md2, (uchar *)p, len);
                break;
-@@ -323,6 +333,13 @@ void sum_update(const char *p, int32 len)
- int sum_end(char *sum)
- {
-+      if (link_by_hash_dir) {
-+              if (cursum_type != CSUM_MD5)
-+                      md5_result(&md2, (uchar *)link_by_hash_sum);
-+              else
-+                      memcpy(link_by_hash_sum, sum, sizeof link_by_hash_sum);
-+      }
-+
+         case CSUM_MD4:
+         case CSUM_MD4_OLD:
+@@ -344,6 +351,8 @@ int sum_end(char *sum)
        switch (cursum_type) {
          case CSUM_MD5:
                md5_result(&md, (uchar *)sum);
++              if (link_by_hash_dir)
++                      md5_result(&md2, (uchar *)link_by_hash_extra_sum);
+               break;
+         case CSUM_MD4:
+         case CSUM_MD4_OLD:
 diff --git a/clientserver.c b/clientserver.c
 --- a/clientserver.c
 +++ b/clientserver.c
@@ -104,7 +88,7 @@ diff --git a/clientserver.c b/clientserver.c
  extern char *logfile_format;
  extern char *files_from;
  extern char *tmpdir;
-@@ -541,6 +542,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -543,6 +544,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
                return -1;
        }
  
@@ -129,7 +113,7 @@ diff --git a/hashlink.c b/hashlink.c
 new file mode 100644
 --- /dev/null
 +++ b/hashlink.c
-@@ -0,0 +1,91 @@
+@@ -0,0 +1,92 @@
 +/*
 +   Copyright (C) Cronosys, LLC 2004
 +
@@ -155,8 +139,9 @@ new file mode 100644
 +
 +extern int protocol_version;
 +extern char *link_by_hash_dir;
++extern char sender_file_sum[MAX_DIGEST_LEN];
 +
-+char link_by_hash_sum[MAX_DIGEST_LEN];
++char link_by_hash_extra_sum[MAX_DIGEST_LEN]; /* Only used when md4 sums are in the transfer */
 +
 +#ifdef HAVE_LINK
 +
@@ -174,7 +159,7 @@ new file mode 100644
 +      if (F_LENGTH(file) == 0)
 +              return;
 +
-+      hex = sum_as_hex(5, link_by_hash_sum);
++      hex = sum_as_hex(5, protocol_version >= 30 ? sender_file_sum : link_by_hash_extra_sum, 0);
 +      if (asprintf(&hashname, "%s/%.3s/%.3s/%.3s/%s.%s.000000",
 +                   link_by_hash_dir, hex, hex+3, hex+6, hex+9, big_num(F_LENGTH(file))) < 0)
 +      {
@@ -224,7 +209,7 @@ new file mode 100644
 diff --git a/loadparm.c b/loadparm.c
 --- a/loadparm.c
 +++ b/loadparm.c
-@@ -119,6 +119,7 @@ typedef struct {
+@@ -122,6 +122,7 @@ typedef struct {
        char *include;
        char *include_from;
        char *incoming_chmod;
@@ -232,7 +217,7 @@ diff --git a/loadparm.c b/loadparm.c
        char *lock_file;
        char *log_file;
        char *log_format;
-@@ -195,6 +196,7 @@ static const all_vars Defaults = {
+@@ -202,6 +203,7 @@ static const all_vars Defaults = {
   /* include; */                       NULL,
   /* include_from; */          NULL,
   /* incoming_chmod; */                NULL,
@@ -240,7 +225,7 @@ diff --git a/loadparm.c b/loadparm.c
   /* lock_file; */             DEFAULT_LOCK_FILE,
   /* log_file; */              NULL,
   /* log_format; */            "%o %h [%a] %m (%u) %f %l",
-@@ -336,6 +338,7 @@ static struct parm_struct parm_table[] =
+@@ -347,6 +349,7 @@ static struct parm_struct parm_table[] =
   {"include from",      P_STRING, P_LOCAL, &Vars.l.include_from,        NULL,0},
   {"include",           P_STRING, P_LOCAL, &Vars.l.include,             NULL,0},
   {"incoming chmod",    P_STRING, P_LOCAL, &Vars.l.incoming_chmod,      NULL,0},
@@ -248,7 +233,7 @@ diff --git a/loadparm.c b/loadparm.c
   {"list",              P_BOOL,   P_LOCAL, &Vars.l.list,                NULL,0},
   {"lock file",         P_STRING, P_LOCAL, &Vars.l.lock_file,           NULL,0},
   {"log file",          P_STRING, P_LOCAL, &Vars.l.log_file,            NULL,0},
-@@ -464,6 +467,7 @@ FN_LOCAL_STRING(lp_hosts_deny, hosts_deny)
+@@ -479,6 +482,7 @@ FN_LOCAL_STRING(lp_hosts_deny, hosts_deny)
  FN_LOCAL_STRING(lp_include, include)
  FN_LOCAL_STRING(lp_include_from, include_from)
  FN_LOCAL_STRING(lp_incoming_chmod, incoming_chmod)
@@ -309,7 +294,7 @@ diff --git a/options.c b/options.c
    {"fuzzy",           'y', POPT_ARG_NONE,   0, 'y', 0, 0 },
    {"no-fuzzy",         0,  POPT_ARG_VAL,    &fuzzy_basis, 0, 0, 0 },
    {"no-y",             0,  POPT_ARG_VAL,    &fuzzy_basis, 0, 0, 0 },
-@@ -1313,6 +1317,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1330,6 +1334,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                iconv_opt = strdup(arg);
  #endif
  
@@ -319,7 +304,7 @@ diff --git a/options.c b/options.c
        /* TODO: Call poptReadDefaultConfig; handle errors. */
  
        /* The context leaks in case of an error, but if there's a
-@@ -1788,6 +1795,21 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1808,6 +1815,21 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        return 0;
  #endif
  
@@ -341,7 +326,7 @@ diff --git a/options.c b/options.c
                default:
                        /* A large opt value means that set_refuse_options()
                         * turned this option off. */
-@@ -2099,6 +2121,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2123,6 +2145,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        tmpdir = sanitize_path(NULL, tmpdir, NULL, 0, SP_DEFAULT);
                if (backup_dir)
                        backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, SP_DEFAULT);
@@ -350,7 +335,7 @@ diff --git a/options.c b/options.c
        }
        if (daemon_filter_list.head && !am_sender) {
                filter_rule_list *elp = &daemon_filter_list;
-@@ -2751,6 +2775,12 @@ void server_options(char **args, int *argc_p)
+@@ -2775,6 +2799,12 @@ void server_options(char **args, int *argc_p)
        } else if (inplace)
                args[ac++] = "--inplace";
  
@@ -371,10 +356,10 @@ diff --git a/rsync.c b/rsync.c
  extern int keep_dirlinks;
  extern int make_backups;
 +extern char *link_by_hash_dir;
+ extern int sanitize_paths;
  extern struct file_list *cur_flist, *first_flist, *dir_flist;
  extern struct chmod_mode_struct *daemon_chmod_modes;
- #ifdef ICONV_OPTION
-@@ -683,6 +684,10 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -689,6 +690,10 @@ int finish_transfer(const char *fname, const char *fnametmp,
        }
        if (ret == 0) {
                /* The file was moved into place (not copied), so it's done. */
@@ -388,7 +373,7 @@ diff --git a/rsync.c b/rsync.c
 diff --git a/rsync.h b/rsync.h
 --- a/rsync.h
 +++ b/rsync.h
-@@ -1265,7 +1265,8 @@ extern short info_levels[], debug_levels[];
+@@ -1276,7 +1276,8 @@ extern short info_levels[], debug_levels[];
  #define DEBUG_FUZZY (DEBUG_FLIST+1)
  #define DEBUG_GENR (DEBUG_FUZZY+1)
  #define DEBUG_HASH (DEBUG_GENR+1)
@@ -409,7 +394,7 @@ diff --git a/rsync.yo b/rsync.yo
   -z, --compress              compress file data during the transfer
       --compress-level=NUM    explicitly set compression level
       --skip-compress=LIST    skip compressing files with suffix in LIST
-@@ -1913,6 +1914,48 @@ bf(--link-dest) from working properly for a non-super-user when bf(-o) was
+@@ -1944,6 +1945,48 @@ bf(--link-dest) from working properly for a non-super-user when bf(-o) was
  specified (or implied by bf(-a)).  You can work-around this bug by avoiding
  the bf(-o) option when sending to an old rsync.
  
@@ -461,7 +446,7 @@ diff --git a/rsync.yo b/rsync.yo
 diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
 --- a/rsyncd.conf.yo
 +++ b/rsyncd.conf.yo
-@@ -287,6 +287,21 @@ message telling them to try later.  The default is 0, which means no limit.
+@@ -297,6 +297,21 @@ message telling them to try later.  The default is 0, which means no limit.
  A negative value disables the module.
  See also the "lock file" parameter.
  
index 2a096b4d7c2f0fec797b79ef62dc1830f2bc842a..208c8a3aa2031ff1048cce1101bab92422106da7 100644 (file)
@@ -20,7 +20,7 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/authenticate.c b/authenticate.c
 --- a/authenticate.c
 +++ b/authenticate.c
@@ -63,7 +63,7 @@ diff --git a/authenticate.c b/authenticate.c
 diff --git a/clientserver.c b/clientserver.c
 --- a/clientserver.c
 +++ b/clientserver.c
-@@ -63,6 +63,7 @@ extern iconv_t ic_send, ic_recv;
+@@ -65,6 +65,7 @@ extern gid_t our_gid;
  char *auth_user;
  int read_only = 0;
  int module_id = -1;
@@ -71,7 +71,7 @@ diff --git a/clientserver.c b/clientserver.c
  struct chmod_mode_struct *daemon_chmod_modes;
  
  /* module_dirlen is the length of the module_dir string when in daemon
-@@ -74,6 +75,7 @@ unsigned int module_dirlen = 0;
+@@ -76,6 +77,7 @@ unsigned int module_dirlen = 0;
  char *full_module_path;
  
  static int rl_nulls = 0;
@@ -79,7 +79,7 @@ diff --git a/clientserver.c b/clientserver.c
  
  #ifdef HAVE_SIGACTION
  static struct sigaction sigact;
-@@ -686,7 +688,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -688,7 +690,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
        log_init(1);
  
  #ifdef HAVE_PUTENV
@@ -88,7 +88,7 @@ diff --git a/clientserver.c b/clientserver.c
                int status;
  
                /* For post-xfer exec, fork a new process to run the rsync
-@@ -768,6 +770,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -770,6 +772,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
                        set_blocking(pre_exec_arg_fd);
                        set_blocking(pre_exec_error_fd);
                }
@@ -133,7 +133,7 @@ diff --git a/clientserver.c b/clientserver.c
        }
  #endif
  
-@@ -1005,6 +1045,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -1009,6 +1049,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
        return 0;
  }
  
@@ -181,7 +181,7 @@ diff --git a/clientserver.c b/clientserver.c
 diff --git a/loadparm.c b/loadparm.c
 --- a/loadparm.c
 +++ b/loadparm.c
-@@ -123,6 +123,7 @@ typedef struct {
+@@ -126,6 +126,7 @@ typedef struct {
        char *log_file;
        char *log_format;
        char *name;
@@ -189,7 +189,7 @@ diff --git a/loadparm.c b/loadparm.c
        char *outgoing_chmod;
        char *path;
        char *postxfer_exec;
-@@ -199,6 +200,7 @@ static const all_vars Defaults = {
+@@ -206,6 +207,7 @@ static const all_vars Defaults = {
   /* log_file; */              NULL,
   /* log_format; */            "%o %h [%a] %m (%u) %f %l",
   /* name; */                  NULL,
@@ -197,7 +197,7 @@ diff --git a/loadparm.c b/loadparm.c
   /* outgoing_chmod; */                NULL,
   /* path; */                  NULL,
   /* postxfer_exec; */         NULL,
-@@ -344,6 +346,7 @@ static struct parm_struct parm_table[] =
+@@ -355,6 +357,7 @@ static struct parm_struct parm_table[] =
   {"max verbosity",     P_INTEGER,P_LOCAL, &Vars.l.max_verbosity,       NULL,0},
   {"munge symlinks",    P_BOOL,   P_LOCAL, &Vars.l.munge_symlinks,      NULL,0},
   {"name",              P_STRING, P_LOCAL, &Vars.l.name,                NULL,0},
@@ -205,43 +205,18 @@ diff --git a/loadparm.c b/loadparm.c
   {"numeric ids",       P_BOOL,   P_LOCAL, &Vars.l.numeric_ids,         NULL,0},
   {"outgoing chmod",    P_STRING, P_LOCAL, &Vars.l.outgoing_chmod,      NULL,0},
   {"path",              P_PATH,   P_LOCAL, &Vars.l.path,                NULL,0},
-@@ -472,6 +475,7 @@ FN_LOCAL_STRING(lp_outgoing_chmod, outgoing_chmod)
+@@ -487,6 +490,7 @@ FN_LOCAL_STRING(lp_outgoing_chmod, outgoing_chmod)
  FN_LOCAL_STRING(lp_path, path)
  FN_LOCAL_STRING(lp_postxfer_exec, postxfer_exec)
  FN_LOCAL_STRING(lp_prexfer_exec, prexfer_exec)
 +FN_LOCAL_STRING(lp_name_converter, name_converter)
  FN_LOCAL_STRING(lp_refuse_options, refuse_options)
  FN_LOCAL_STRING(lp_secrets_file, secrets_file)
- FN_LOCAL_STRING(lp_temp_dir, temp_dir)
+ FN_LOCAL_STRING(lp_syslog_tag, syslog_tag)
 diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
 --- a/rsyncd.conf.yo
 +++ b/rsyncd.conf.yo
-@@ -199,7 +199,7 @@ if the module is not read-only).
- When this parameter is enabled, the "numeric-ids" option will also default to
- being enabled (disabling name lookups).  See below for what a chroot needs in
--order for name lookups to succeed.
-+order for name lookups to succeed. See also the "name converter" parameter.
- If you copy library resources into the module's chroot area, you
- should protect them through your OS's normal user/group or ACL settings (to
-@@ -224,11 +224,14 @@ running as root (see "uid") or for "fake super" to be configured.
- A chroot-enabled module should not have this parameter enabled unless you've
- taken steps to ensure that the module has the necessary resources it needs
- to translate names, and that it is not possible for a user to change those
--resources.  That includes being the code being able to call functions like
-+resources.  That can include being able to call functions like
- code(getpwuid()), code(getgrgid()), code(getpwname()), and code(getgrnam())).
- You should test what libraries and config files are required for your OS
- and get those setup before starting to test name mapping in rsync.
-+See also the "name converter" support for a way to convert names w/o any
-+extra files in the chroot.
-+
- dit(bf(munge symlinks)) This parameter tells rsync to modify
- all symlinks in the same way as the (non-daemon-affecting)
- bf(--munge-links) command-line option (using a method described below).
-@@ -267,6 +270,30 @@ path elements that rsync believes will allow a symlink to escape the module's
+@@ -277,6 +277,27 @@ path elements that rsync believes will allow a symlink to escape the module's
  hierarchy.  There are tricky ways to work around this, though, so you had
  better trust your users if you choose this combination of parameters.
  
@@ -265,9 +240,6 @@ diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
 +bf(RSYNC_MODULE_PATH), bf(RSYNC_HOST_ADDR), bf(RSYNC_HOST_NAME), and
 +bf(RSYNC_USER_NAME).  This is useful if you want to customize the
 +conversion using a single program invocation.
-+
-+NOTE: if "use chroot" is enabled, you must explicity set "numeric ids"
-+to False.
 +
  dit(bf(charset)) This specifies the name of the character set in which the
  module's filenames are stored.  If the client uses an bf(--iconv) option,
index 2e83e78d0c2acf307f03746a6ce2bd1c0efab676..1ba9e456aad0cf86c33e348fef7acb5684e07646 100644 (file)
@@ -9,7 +9,7 @@ To use this patch, run these commands for a successful build:
     ./configure                           (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/access.c b/access.c
 --- a/access.c
 +++ b/access.c
index 7cf573f6892736ccae9107231a28242f7dd237d5..51105b1c1fb6508518469492fb8fede204534a72 100644 (file)
@@ -7,7 +7,7 @@ To use this patch, run these commands for a successful build:
     ./configure                              (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
@@ -78,7 +78,7 @@ diff --git a/options.c b/options.c
    {"modify-window",   '@', POPT_ARG_INT,    &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
    {"super",            0,  POPT_ARG_VAL,    &am_root, 2, 0, 0 },
    {"no-super",         0,  POPT_ARG_VAL,    &am_root, 0, 0, 0 },
-@@ -2167,6 +2170,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2191,6 +2194,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                parse_filter_str(&filter_list, backup_dir_buf, rule_template(0), 0);
        }
  
@@ -88,7 +88,7 @@ diff --git a/options.c b/options.c
        if (preserve_times) {
                preserve_times = PRESERVE_FILE_TIMES;
                if (!omit_dir_times)
-@@ -2410,6 +2416,8 @@ void server_options(char **args, int *argc_p)
+@@ -2434,6 +2440,8 @@ void server_options(char **args, int *argc_p)
                        argstr[x++] = 'O';
                if (omit_link_times)
                        argstr[x++] = 'J';
@@ -108,7 +108,7 @@ diff --git a/rsync.c b/rsync.c
  extern int am_root;
  extern int am_server;
  extern int am_daemon;
-@@ -489,9 +490,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -495,9 +496,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
                get_acl(fname, sxp);
  #endif
  
@@ -133,7 +133,7 @@ diff --git a/rsync.yo b/rsync.yo
       --super                 receiver attempts super-user activities
       --fake-super            store/recover privileged attrs using xattrs
   -S, --sparse                turn sequences of nulls into sparse blocks
-@@ -1208,6 +1209,10 @@ directories.
+@@ -1233,6 +1234,10 @@ directories.
  dit(bf(-J, --omit-link-times)) This tells rsync to omit symlinks when
  it is preserving modification times (see bf(--times)).
  
index 24ad381afa7ed96ef273d5b0fd3b2cc8086ab6cd..b6564079a37ad59b9249dfbf0334bfc0ded62ace 100644 (file)
@@ -14,11 +14,11 @@ To use this patch, run these commands for a successful build:
     ./configure                           (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -70,6 +70,7 @@ extern int sender_symlink_iconv;
+@@ -71,6 +71,7 @@ extern int sender_symlink_iconv;
  extern int output_needs_newline;
  extern int sender_keeps_checksum;
  extern int unsort_ndx;
@@ -26,7 +26,7 @@ diff --git a/flist.c b/flist.c
  extern uid_t our_uid;
  extern struct stats stats;
  extern char *filesfrom_host;
-@@ -1762,6 +1763,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1744,6 +1745,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
                }
  
                send_file_name(f, flist, fbuf, NULL, flags, filter_level);
index b430e204216d165006e7157fc0c8efff3b677d62..422425bd7da90cf464bf0913a2afae5b67ef3c81 100644 (file)
--- a/slp.diff
+++ b/slp.diff
@@ -10,7 +10,7 @@ To use this patch, run these commands for a successful build:
 TODO: the configure changes should abort if the user requests --enable-slp
 and we can't honor that request.
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/Makefile.in b/Makefile.in
 --- a/Makefile.in
 +++ b/Makefile.in
@@ -44,7 +44,7 @@ diff --git a/Makefile.in b/Makefile.in
 diff --git a/clientserver.c b/clientserver.c
 --- a/clientserver.c
 +++ b/clientserver.c
-@@ -1193,6 +1193,13 @@ int daemon_main(void)
+@@ -1234,6 +1234,13 @@ int daemon_main(void)
         * address too.  In fact, why not just do getnameinfo on the
         * local address??? */
  
@@ -61,7 +61,7 @@ diff --git a/clientserver.c b/clientserver.c
 diff --git a/configure.ac b/configure.ac
 --- a/configure.ac
 +++ b/configure.ac
-@@ -751,6 +751,29 @@ if test $rsync_cv_can_hardlink_special = yes; then
+@@ -752,6 +752,29 @@ if test $rsync_cv_can_hardlink_special = yes; then
      AC_DEFINE(CAN_HARDLINK_SPECIAL, 1, [Define to 1 if link() can hard-link special files.])
  fi
  
@@ -94,7 +94,7 @@ diff --git a/configure.ac b/configure.ac
 diff --git a/loadparm.c b/loadparm.c
 --- a/loadparm.c
 +++ b/loadparm.c
-@@ -99,6 +99,9 @@ typedef struct {
+@@ -102,6 +102,9 @@ typedef struct {
  
        int listen_backlog;
        int rsync_port;
@@ -104,7 +104,7 @@ diff --git a/loadparm.c b/loadparm.c
  } global_vars;
  
  /* This structure describes a single section.  Their order must match the
-@@ -317,6 +320,9 @@ static struct parm_struct parm_table[] =
+@@ -328,6 +331,9 @@ static struct parm_struct parm_table[] =
   {"motd file",         P_STRING, P_GLOBAL,&Vars.g.motd_file,           NULL,0},
   {"pid file",          P_STRING, P_GLOBAL,&Vars.g.pid_file,            NULL,0},
   {"port",              P_INTEGER,P_GLOBAL,&Vars.g.rsync_port,          NULL,0},
@@ -114,7 +114,7 @@ diff --git a/loadparm.c b/loadparm.c
   {"socket options",    P_STRING, P_GLOBAL,&Vars.g.socket_options,      NULL,0},
  
   {"auth users",        P_STRING, P_LOCAL, &Vars.l.auth_users,          NULL,0},
-@@ -450,6 +456,9 @@ FN_GLOBAL_STRING(lp_socket_options, &Vars.g.socket_options)
+@@ -465,6 +471,9 @@ FN_GLOBAL_STRING(lp_socket_options, &Vars.g.socket_options)
  
  FN_GLOBAL_INTEGER(lp_listen_backlog, &Vars.g.listen_backlog)
  FN_GLOBAL_INTEGER(lp_rsync_port, &Vars.g.rsync_port)
@@ -127,7 +127,7 @@ diff --git a/loadparm.c b/loadparm.c
 diff --git a/main.c b/main.c
 --- a/main.c
 +++ b/main.c
-@@ -1267,6 +1267,18 @@ static int start_client(int argc, char *argv[])
+@@ -1270,6 +1270,18 @@ static int start_client(int argc, char *argv[])
  
        if (!read_batch) { /* for read_batch, NO source is specified */
                char *path = check_for_hostspec(argv[0], &shell_machine, &rsync_port);
@@ -218,7 +218,7 @@ new file mode 100644
 diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
 --- a/rsyncd.conf.yo
 +++ b/rsyncd.conf.yo
-@@ -126,6 +126,15 @@ via the bf(--sockopts) command-line option.
+@@ -127,6 +127,15 @@ via the bf(--sockopts) command-line option.
  dit(bf(listen backlog)) You can override the default backlog value when the
  daemon listens for connections.  It defaults to 5.
  
@@ -231,10 +231,10 @@ diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
 +Using 3600 (one hour) is a good number if you tend to change your
 +configuration.
 +
enddit()
+ )
  
  manpagesection(MODULE PARAMETERS)
-@@ -863,6 +872,7 @@ use chroot = yes
+@@ -907,6 +916,7 @@ use chroot = yes
  max connections = 4
  syslog facility = local5
  pid file = /var/run/rsyncd.pid
index 8e1ab552fb51fa53312f6586d6f53c673f495bc7..2c8bf6fc3ef7f15e7e273b6d515b16cbe7711dd9 100644 (file)
@@ -10,7 +10,7 @@ To use this patch, run these commands for a successful build:
     ./configure                           (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/syscall.c b/syscall.c
 --- a/syscall.c
 +++ b/syscall.c
index 85162f84a611376a3b2b7741cfcf018c72f23782..caf407a22e07abbb9a0b629f43e037e8172a2169 100644 (file)
@@ -9,7 +9,7 @@ To use this patch, run these commands for a successful build:
 
 -- Matt McCutchen <hashproduct@gmail.com>
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/options.c b/options.c
 --- a/options.c
 +++ b/options.c
@@ -37,7 +37,7 @@ diff --git a/options.c b/options.c
    {"no-backup",        0,  POPT_ARG_VAL,    &make_backups, 0, 0, 0 },
    {"backup-dir",       0,  POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
    {"suffix",           0,  POPT_ARG_STRING, &backup_suffix, 0, 0, 0 },
-@@ -2650,6 +2653,8 @@ void server_options(char **args, int *argc_p)
+@@ -2674,6 +2677,8 @@ void server_options(char **args, int *argc_p)
                                goto oom;
                        args[ac++] = arg;
                }
@@ -57,7 +57,7 @@ diff --git a/rsync.yo b/rsync.yo
       --del                   an alias for --delete-during
       --delete                delete extraneous files from dest dirs
       --delete-before         receiver deletes before xfer, not during
-@@ -1371,6 +1372,14 @@ bf(--exclude='*.new') for the rsync transfer).
+@@ -1399,6 +1400,14 @@ bf(--exclude='*.new') for the rsync transfer).
  Starting with 3.1.0, rsync will skip the sender-side removal (and output an
  error) if the file's size or modify time has not stayed unchanged.
  
index 481c884a2549bc74945de65d1c9ae7687decd0e7..7bfe7fc93beef10837a3a2e3251fa9138fd2e1a6 100644 (file)
@@ -30,7 +30,7 @@ To use this patch, run these commands for a successful build:
     ./configure                                (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
@@ -117,7 +117,7 @@ diff --git a/options.c b/options.c
  #ifdef HAVE_SETVBUF
    {"outbuf",           0,  POPT_ARG_STRING, &outbuf_mode, 0, 0, 0 },
  #endif
-@@ -2294,6 +2303,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2318,6 +2327,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                }
        }
  
@@ -134,7 +134,7 @@ diff --git a/options.c b/options.c
        if (files_from) {
                char *h, *p;
                int q;
-@@ -2659,6 +2678,25 @@ void server_options(char **args, int *argc_p)
+@@ -2683,6 +2702,25 @@ void server_options(char **args, int *argc_p)
        else if (missing_args == 1 && !am_sender)
                args[ac++] = "--ignore-missing-args";
  
@@ -260,7 +260,7 @@ diff --git a/receiver.c b/receiver.c
  extern char *partial_dir;
  extern char *basis_dir[MAX_BASIS_DIRS+1];
  extern char sender_file_sum[MAX_DIGEST_LEN];
-@@ -530,6 +531,8 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -528,6 +529,8 @@ int recv_files(int f_in, int f_out, char *local_name)
        const char *parent_dirname = "";
  #endif
        int ndx, recv_ok;
@@ -269,7 +269,7 @@ diff --git a/receiver.c b/receiver.c
  
        if (DEBUG_GTE(RECV, 1))
                rprintf(FINFO, "recv_files(%d) starting\n", cur_flist->used);
-@@ -537,6 +540,23 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -535,6 +538,23 @@ int recv_files(int f_in, int f_out, char *local_name)
        if (delay_updates)
                delayed_bits = bitbag_create(cur_flist->used + 1);
  
@@ -293,7 +293,7 @@ diff --git a/receiver.c b/receiver.c
        while (1) {
                cleanup_disable();
  
-@@ -841,6 +861,9 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -839,6 +859,9 @@ int recv_files(int f_in, int f_out, char *local_name)
                else if (!am_server && INFO_GTE(NAME, 1) && INFO_EQ(PROGRESS, 1))
                        rprintf(FINFO, "%s\n", fname);
  
@@ -303,7 +303,7 @@ diff --git a/receiver.c b/receiver.c
                /* recv file data */
                recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
                                       fname, fd2, F_LENGTH(file));
-@@ -855,6 +878,16 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -853,6 +876,16 @@ int recv_files(int f_in, int f_out, char *local_name)
                        exit_cleanup(RERR_FILEIO);
                }
  
@@ -351,7 +351,7 @@ diff --git a/rsync.yo b/rsync.yo
       --protocol=NUM          force an older protocol version to be used
       --iconv=CONVERT_SPEC    request charset conversion of filenames
       --checksum-seed=NUM     set block/file checksum seed (advanced)
-@@ -2582,6 +2585,33 @@ file previously generated by bf(--write-batch).
+@@ -2616,6 +2619,33 @@ file previously generated by bf(--write-batch).
  If em(FILE) is bf(-), the batch data will be read from standard input.
  See the "BATCH MODE" section for details.
  
@@ -382,9 +382,9 @@ diff --git a/rsync.yo b/rsync.yo
 +received on input, you should use --times-only to disable size and
 +content checks on subsequent rsync runs.
 +
- dit(bf(--protocol=NUM)) Force an older protocol version to be used.  This
- is useful for creating a batch file that is compatible with an older
- version of rsync.  For instance, if rsync 2.6.4 is being used with the
+ )
+ description(
 diff --git a/sender.c b/sender.c
 --- a/sender.c
 +++ b/sender.c
index 99563338305728bbdf4bda20c4da6dd474886554..f32891a25fb0d80cd04822254abd4d02dcba3fc1 100644 (file)
@@ -18,7 +18,7 @@ To use this patch, run these commands for a successful build:
     ./configure                               (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/fileio.c b/fileio.c
 --- a/fileio.c
 +++ b/fileio.c
@@ -66,7 +66,7 @@ diff --git a/options.c b/options.c
    {"preallocate",      0,  POPT_ARG_NONE,   &preallocate_files, 0, 0, 0},
    {"inplace",          0,  POPT_ARG_VAL,    &inplace, 1, 0, 0 },
    {"no-inplace",       0,  POPT_ARG_VAL,    &inplace, 0, 0, 0 },
-@@ -2576,6 +2579,12 @@ void server_options(char **args, int *argc_p)
+@@ -2600,6 +2603,12 @@ void server_options(char **args, int *argc_p)
                args[ac++] = arg;
        }
  
@@ -90,7 +90,7 @@ diff --git a/rsync.yo b/rsync.yo
       --preallocate           allocate dest files before writing
   -n, --dry-run               perform a trial run with no changes made
   -W, --whole-file            copy files whole (w/o delta-xfer algorithm)
-@@ -1274,6 +1275,15 @@ If combined with bf(--sparse), the file will only have sparse blocks (as
+@@ -1299,6 +1300,15 @@ If combined with bf(--sparse), the file will only have sparse blocks (as
  opposed to allocated sequences of null bytes) if the kernel version and
  filesystem type support creating holes in the allocated data.
  
index 85bf2b3a1fc3b15cac5b0f57c322bfb227898a1e..82d38660e26cb24c154cb8577ed1e63833bd3dc5 100644 (file)
@@ -7,7 +7,7 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/main.c b/main.c
 --- a/main.c
 +++ b/main.c
@@ -69,7 +69,7 @@ diff --git a/main.c b/main.c
 diff --git a/rsync.yo b/rsync.yo
 --- a/rsync.yo
 +++ b/rsync.yo
-@@ -2621,14 +2621,18 @@ regardless of the remote charset you actually pass.  Thus, you may feel free to
+@@ -2658,14 +2658,18 @@ regardless of the remote charset you actually pass.  Thus, you may feel free to
  specify just the local charset for a daemon transfer (e.g. bf(--iconv=utf8)).
  
  dit(bf(-4, --ipv4) or bf(-6, --ipv6)) Tells rsync to prefer IPv4/IPv6
index ecff0c194cbc8f639cf06884aa3bb61a0f13d0e3..66a2d6bfa4929376d1b5e387882f8554a9c9c0dc 100644 (file)
@@ -9,7 +9,7 @@ To use this patch, run these commands for a successful build:
     ./configure                              (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/io.c b/io.c
 --- a/io.c
 +++ b/io.c
@@ -79,7 +79,7 @@ diff --git a/options.c b/options.c
    {"rsh",             'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 },
    {"rsync-path",       0,  POPT_ARG_STRING, &rsync_path, 0, 0, 0 },
    {"temp-dir",        'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
-@@ -1788,6 +1794,36 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1808,6 +1814,36 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        return 0;
  #endif
  
@@ -116,7 +116,7 @@ diff --git a/options.c b/options.c
                default:
                        /* A large opt value means that set_refuse_options()
                         * turned this option off. */
-@@ -2588,6 +2624,15 @@ void server_options(char **args, int *argc_p)
+@@ -2612,6 +2648,15 @@ void server_options(char **args, int *argc_p)
                args[ac++] = arg;
        }
  
@@ -144,7 +144,7 @@ diff --git a/rsync.yo b/rsync.yo
       --write-batch=FILE      write a batched update to FILE
       --only-write-batch=FILE like --write-batch but w/o updating dest
       --read-batch=FILE       read a batched update from FILE
-@@ -2556,6 +2558,19 @@ files can show up as being rapidly sent when the data is quickly buffered,
+@@ -2590,6 +2592,19 @@ files can show up as being rapidly sent when the data is quickly buffered,
  while other can show up as very slow when the flushing of the output buffer
  occurs.  This may be fixed in a future version.
  
index d36069bb50004fd829b61324c4a495a31f8e0553..d1690cdc744ca2b50f774a20fc94bd1ce6d6fc82 100644 (file)
@@ -10,11 +10,11 @@ To use this patch, run these commands for a successful build:
     ./configure                                 (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/flist.c b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -74,6 +74,7 @@ extern uid_t our_uid;
+@@ -75,6 +75,7 @@ extern uid_t our_uid;
  extern struct stats stats;
  extern char *filesfrom_host;
  extern char *usermap, *groupmap;
@@ -22,7 +22,7 @@ diff --git a/flist.c b/flist.c
  
  extern char curr_dir[MAXPATHLEN];
  
-@@ -100,6 +101,8 @@ int file_total = 0; /* total of all active items over all file-lists */
+@@ -101,6 +102,8 @@ int file_total = 0; /* total of all active items over all file-lists */
  int file_old_total = 0; /* total of active items that will soon be gone */
  int flist_eof = 0; /* all the file-lists are now known */
  
@@ -31,7 +31,7 @@ diff --git a/flist.c b/flist.c
  #define NORMAL_NAME 0
  #define SLASH_ENDING_NAME 1
  #define DOTDIR_NAME 2
-@@ -668,6 +671,23 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -650,6 +653,23 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
                stats.total_size += F_LENGTH(file);
  }
  
@@ -55,7 +55,7 @@ diff --git a/flist.c b/flist.c
  static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags)
  {
        static int64 modtime;
-@@ -733,9 +753,13 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -715,9 +735,13 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
                        outbuf.len = 0;
                }
                thisname[outbuf.len] = '\0';
@@ -69,7 +69,7 @@ diff --git a/flist.c b/flist.c
        if (*thisname
         && (clean_fname(thisname, CFN_REFUSE_DOT_DOT_DIRS) < 0 || (!relative_paths && *thisname == '/'))) {
                rprintf(FERROR, "ABORTING due to unsafe pathname from sender: %s\n", thisname);
-@@ -2452,6 +2476,15 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2434,6 +2458,15 @@ struct file_list *recv_file_list(int f, int dir_ndx)
                        parse_name_map(usermap, True);
                if (groupmap)
                        parse_name_map(groupmap, False);
@@ -112,7 +112,7 @@ diff --git a/options.c b/options.c
    {"ipv4",            '4', POPT_ARG_VAL,    &default_af_hint, AF_INET, 0, 0 },
    {"ipv6",            '6', POPT_ARG_VAL,    &default_af_hint, AF_INET6, 0, 0 },
    {"8-bit-output",    '8', POPT_ARG_VAL,    &allow_8bit_chars, 1, 0, 0 },
-@@ -2340,6 +2343,24 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2364,6 +2367,24 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                }
        }
  
@@ -137,7 +137,7 @@ diff --git a/options.c b/options.c
        am_starting_up = 0;
  
        return 1;
-@@ -2768,6 +2789,12 @@ void server_options(char **args, int *argc_p)
+@@ -2792,6 +2813,12 @@ void server_options(char **args, int *argc_p)
        if (relative_paths && !implied_dirs && (!am_sender || protocol_version >= 30))
                args[ac++] = "--no-implied-dirs";
  
@@ -161,7 +161,7 @@ diff --git a/rsync.yo b/rsync.yo
       --checksum-seed=NUM     set block/file checksum seed (advanced)
   -4, --ipv4                  prefer IPv4
   -6, --ipv6                  prefer IPv6
-@@ -2620,6 +2621,22 @@ daemon uses the charset specified in its "charset" configuration parameter
+@@ -2657,6 +2658,22 @@ daemon uses the charset specified in its "charset" configuration parameter
  regardless of the remote charset you actually pass.  Thus, you may feel free to
  specify just the local charset for a daemon transfer (e.g. bf(--iconv=utf8)).
  
index 10865f6ee4a55e972e9a23e01db577a0bd546948..b8987ce215921bed1a269f127cfd17dcb745c736 100644 (file)
@@ -6,7 +6,7 @@ To use this patch, run these commands for a successful build:
     ./configure                          (optional if already run)
     make
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/syscall.c b/syscall.c
 --- a/syscall.c
 +++ b/syscall.c
index 82293ec96c315c7b33b8a34350e035e986be3eda..bb1ef23819ec6becc0b8a3b8f98f110751e00285 100644 (file)
@@ -10,7 +10,7 @@ To use this patch, run these commands for a successful build:
 This patch has not yet been tested by me (Wayne), but was provided
 Darryl Dixon.  Thanks!
 
-based-on: d1a1fec1340254926e17f5d83f848f7574286a33
+based-on: c4a3f55be35726d0a033996dc37b0fb248b45cb5
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
@@ -58,7 +58,7 @@ diff --git a/options.c b/options.c
    {"specials",         0,  POPT_ARG_VAL,    &preserve_specials, 1, 0, 0 },
    {"no-specials",      0,  POPT_ARG_VAL,    &preserve_specials, 0, 0, 0 },
    {"links",           'l', POPT_ARG_VAL,    &preserve_links, 1, 0, 0 },
-@@ -1788,6 +1791,11 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1808,6 +1811,11 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        return 0;
  #endif
  
@@ -70,7 +70,7 @@ diff --git a/options.c b/options.c
                default:
                        /* A large opt value means that set_refuse_options()
                         * turned this option off. */
-@@ -2768,6 +2776,9 @@ void server_options(char **args, int *argc_p)
+@@ -2792,6 +2800,9 @@ void server_options(char **args, int *argc_p)
        if (relative_paths && !implied_dirs && (!am_sender || protocol_version >= 30))
                args[ac++] = "--no-implied-dirs";
  
@@ -91,7 +91,7 @@ diff --git a/receiver.c b/receiver.c
  extern int preserve_xattrs;
  extern int basis_dir_cnt;
  extern int make_backups;
-@@ -233,7 +234,7 @@ int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file)
+@@ -231,7 +232,7 @@ int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file)
  }
  
  static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
@@ -100,40 +100,67 @@ diff --git a/receiver.c b/receiver.c
  {
        static char file_sum1[MAX_DIGEST_LEN];
        struct map_struct *mapbuf;
-@@ -241,20 +242,20 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
-       int checksum_len;
-       int32 len;
-       OFF_T offset = 0;
--      OFF_T offset2;
-+      OFF_T offset2, total_size = F_LENGTH(file);
-       char *data;
-       int32 i;
+@@ -245,10 +246,10 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
        char *map = NULL;
  
  #ifdef SUPPORT_PREALLOCATION
 -      if (preallocate_files && fd != -1 && total_size > 0 && (!inplace || total_size > size_r)) {
-+      if (preallocate_files && fd != -1 && total_size > 0 && !IS_DEVICE(file->mode) && (!inplace || total_size > size_r)) {
++      if (preallocate_files && fd != -1 && F_LENGTH(file) > 0 && (!inplace || F_LENGTH(file) > size_r)) {
                /* Try to preallocate enough space for file's eventual length.  Can
                 * reduce fragmentation on filesystems like ext4, xfs, and NTFS. */
-               if ((preallocated_len = do_fallocate(fd, 0, total_size)) < 0)
+-              if ((preallocated_len = do_fallocate(fd, 0, total_size)) < 0)
++              if ((preallocated_len = do_fallocate(fd, 0, F_LENGTH(file))) < 0)
                        rsyserr(FWARNING, errno, "do_fallocate %s", full_fname(fname));
        } else
  #endif
--      if (inplace) {
-+      if (inplace && !IS_DEVICE(file->mode)) {
+@@ -285,7 +286,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+               if (append_mode == 2 && mapbuf) {
+                       for (j = CHUNK_SIZE; j < sum.flength; j += CHUNK_SIZE) {
+                               if (INFO_GTE(PROGRESS, 1))
+-                                      show_progress(offset, total_size);
++                                      show_progress(offset, F_LENGTH(file));
+                               sum_update(map_ptr(mapbuf, offset, CHUNK_SIZE),
+                                          CHUNK_SIZE);
+                               offset = j;
+@@ -293,7 +294,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+                       if (offset < sum.flength) {
+                               int32 len = (int32)(sum.flength - offset);
+                               if (INFO_GTE(PROGRESS, 1))
+-                                      show_progress(offset, total_size);
++                                      show_progress(offset, F_LENGTH(file));
+                               sum_update(map_ptr(mapbuf, offset, len), len);
+                       }
+               }
+@@ -307,7 +308,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+       while ((i = recv_token(f_in, &data)) != 0) {
+               if (INFO_GTE(PROGRESS, 1))
+-                      show_progress(offset, total_size);
++                      show_progress(offset, F_LENGTH(file));
+               if (allowed_lull)
+                       maybe_send_keepalive(time(NULL), MSK_ALLOW_FLUSH | MSK_ACTIVE_RECEIVER);
+@@ -377,16 +378,16 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
  #ifdef HAVE_FTRUNCATE
-               /* The most compatible way to create a sparse file is to start with no length. */
-               if (sparse_files > 0 && whole_file && fd >= 0 && do_ftruncate(fd, 0) == 0)
-@@ -381,7 +382,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
        /* inplace: New data could be shorter than old data.
-        * preallocate_files: total_size could have been an overestimate.
+-       * preallocate_files: total_size could have been an overestimate.
++       * preallocate_files: F_LENGTH(file) could have been an overestimate.
         *     Cut off any extra preallocated zeros from dest file. */
 -      if ((inplace || preallocated_len > offset) && fd != -1 && do_ftruncate(fd, offset) < 0) {
 +      if ((inplace || preallocated_len > offset) && fd != -1 && !IS_DEVICE(file->mode) && do_ftruncate(fd, offset) < 0) {
                rsyserr(FERROR_XFER, errno, "ftruncate failed on %s",
                        full_fname(fname));
        }
-@@ -404,9 +405,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+ #endif
+       if (INFO_GTE(PROGRESS, 1))
+-              end_progress(total_size);
++              end_progress(F_LENGTH(file));
+       sum_len = sum_end(file_sum1);
+@@ -402,9 +403,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
  }
  
  
@@ -145,7 +172,7 @@ diff --git a/receiver.c b/receiver.c
  }
  
  static void handle_delayed_updates(char *local_name)
-@@ -662,7 +663,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -660,7 +661,7 @@ int recv_files(int f_in, int f_out, char *local_name)
                                        "(Skipping batched update for%s \"%s\")\n",
                                        redoing ? " resend of" : "",
                                        fname);
@@ -154,7 +181,7 @@ diff --git a/receiver.c b/receiver.c
                                file->flags |= FLAG_FILE_SENT;
                                continue;
                        }
-@@ -673,13 +674,13 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -671,13 +672,13 @@ int recv_files(int f_in, int f_out, char *local_name)
                if (!do_xfers) { /* log the transfer */
                        log_item(FCLIENT, file, iflags, NULL);
                        if (read_batch)
@@ -170,7 +197,7 @@ diff --git a/receiver.c b/receiver.c
                        if (inc_recurse)
                                send_msg_int(MSG_SUCCESS, ndx);
                        continue;
-@@ -769,7 +770,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -767,7 +768,7 @@ int recv_files(int f_in, int f_out, char *local_name)
                } else if (do_fstat(fd1,&st) != 0) {
                        rsyserr(FERROR_XFER, errno, "fstat %s failed",
                                full_fname(fnamecmp));
@@ -179,7 +206,7 @@ diff --git a/receiver.c b/receiver.c
                        close(fd1);
                        if (inc_recurse)
                                send_msg_int(MSG_NO_SEND, ndx);
-@@ -784,18 +785,32 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -782,18 +783,32 @@ int recv_files(int f_in, int f_out, char *local_name)
                         */
                        rprintf(FERROR_XFER, "recv_files: %s is a directory\n",
                                full_fname(fnamecmp));
@@ -214,7 +241,7 @@ diff --git a/receiver.c b/receiver.c
                /* If we're not preserving permissions, change the file-list's
                 * mode based on the local permissions and some heuristics. */
                if (!preserve_perms) {
-@@ -827,7 +842,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -825,7 +840,7 @@ int recv_files(int f_in, int f_out, char *local_name)
                }
  
                if (fd2 == -1) {
@@ -223,7 +250,7 @@ diff --git a/receiver.c b/receiver.c
                        if (fd1 != -1)
                                close(fd1);
                        if (inc_recurse)
-@@ -842,8 +857,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -840,8 +855,7 @@ int recv_files(int f_in, int f_out, char *local_name)
                        rprintf(FINFO, "%s\n", fname);
  
                /* recv file data */
index 16119d0a091331e3393365edc9f7d35cd6f67410..92c063758b4f8aed327e57c598e677244c893188 100644 (file)
@@ -39,15 +39,15 @@ diff --git a/xattrs.c b/xattrs.c
  #include "lib/sysxattrs.h"
  
  #ifdef SUPPORT_XATTRS
-@@ -37,6 +38,7 @@ extern int preserve_links;
- extern int preserve_devices;
+@@ -38,6 +39,7 @@ extern int preserve_devices;
  extern int preserve_specials;
  extern int checksum_seed;
+ extern int saw_xattr_filter;
 +extern int protocol_version;
  
  #define RSYNC_XAL_INITIAL 5
  #define RSYNC_XAL_LIST_INITIAL 100
-@@ -272,7 +274,7 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+@@ -274,7 +276,7 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
                if (!(ptr = get_xattr_data(fname, name, &datum_len, 0)))
                        return -1;
  
@@ -56,7 +56,7 @@ diff --git a/xattrs.c b/xattrs.c
                        /* For large datums, we store a flag and a checksum. */
                        name_offset = 1 + MAX_DIGEST_LEN;
                        sum_init(-1, checksum_seed);
-@@ -436,7 +438,7 @@ static int find_matching_xattr(const item_list *xalp)
+@@ -440,7 +442,7 @@ static int find_matching_xattr(const item_list *xalp)
                         || rxas1[j].datum_len != rxas2[j].datum_len
                         || strcmp(rxas1[j].name, rxas2[j].name))
                                break;
@@ -65,7 +65,7 @@ diff --git a/xattrs.c b/xattrs.c
                                if (memcmp(rxas1[j].datum + 1,
                                           rxas2[j].datum + 1,
                                           MAX_DIGEST_LEN) != 0)
-@@ -511,13 +513,22 @@ int send_xattr(int f, stat_x *sxp)
+@@ -515,13 +517,22 @@ int send_xattr(int f, stat_x *sxp)
  {
        int ndx = find_matching_xattr(sxp->xattr);
  
@@ -91,7 +91,7 @@ diff --git a/xattrs.c b/xattrs.c
                for (rxa = sxp->xattr->items; count--; rxa++) {
                        size_t name_len = rxa->name_len;
                        const char *name = rxa->name;
-@@ -536,8 +547,8 @@ int send_xattr(int f, stat_x *sxp)
+@@ -540,8 +551,8 @@ int send_xattr(int f, stat_x *sxp)
                                name_len += UPRE_LEN;
                        }
  #endif
@@ -102,7 +102,7 @@ diff --git a/xattrs.c b/xattrs.c
  #ifndef HAVE_LINUX_XATTRS
                        if (name_len > rxa->name_len) {
                                write_buf(f, USER_PREFIX, UPRE_LEN);
-@@ -545,7 +556,7 @@ int send_xattr(int f, stat_x *sxp)
+@@ -549,7 +560,7 @@ int send_xattr(int f, stat_x *sxp)
                        }
  #endif
                        write_buf(f, name, name_len);
@@ -111,7 +111,7 @@ diff --git a/xattrs.c b/xattrs.c
                                write_buf(f, rxa->datum + 1, MAX_DIGEST_LEN);
                        else
                                write_bigbuf(f, rxa->datum, rxa->datum_len);
-@@ -596,7 +607,7 @@ int xattr_diff(struct file_struct *file, stat_x *sxp, int find_all)
+@@ -600,7 +611,7 @@ int xattr_diff(struct file_struct *file, stat_x *sxp, int find_all)
                cmp = rec_cnt ? strcmp(snd_rxa->name, rec_rxa->name) : -1;
                if (cmp > 0)
                        same = 0;
@@ -120,7 +120,7 @@ diff --git a/xattrs.c b/xattrs.c
                        same = cmp == 0 && snd_rxa->datum_len == rec_rxa->datum_len
                            && memcmp(snd_rxa->datum + 1, rec_rxa->datum + 1,
                                      MAX_DIGEST_LEN) == 0;
-@@ -642,6 +653,9 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
+@@ -646,6 +657,9 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
        int cnt, prior_req = 0;
        rsync_xa *rxa;
  
@@ -130,7 +130,7 @@ diff --git a/xattrs.c b/xattrs.c
        glst += F_XATTR(file);
        lst = &glst->xa_items;
  
-@@ -701,6 +715,9 @@ int recv_xattr_request(struct file_struct *file, int f_in)
+@@ -705,6 +719,9 @@ int recv_xattr_request(struct file_struct *file, int f_in)
        rsync_xa *rxa;
        int rel_pos, cnt, num, got_xattr_data = 0;
  
@@ -140,7 +140,7 @@ diff --git a/xattrs.c b/xattrs.c
        if (F_XATTR(file) < 0) {
                rprintf(FERROR, "recv_xattr_request: internal data error!\n");
                exit_cleanup(RERR_PROTOCOL);
-@@ -787,7 +804,22 @@ void receive_xattr(int f, struct file_struct *file)
+@@ -791,7 +808,22 @@ void receive_xattr(int f, struct file_struct *file)
  #else
        int need_sort = 1;
  #endif
@@ -164,7 +164,7 @@ diff --git a/xattrs.c b/xattrs.c
  
        if (ndx < 0 || (size_t)ndx > rsync_xal_l.count) {
                rprintf(FERROR, "receive_xattr: xa index %d out of"
-@@ -800,7 +832,7 @@ void receive_xattr(int f, struct file_struct *file)
+@@ -804,7 +836,7 @@ void receive_xattr(int f, struct file_struct *file)
                return;
        }
  
@@ -173,7 +173,7 @@ diff --git a/xattrs.c b/xattrs.c
                (void)EXPAND_ITEM_LIST(&temp_xattr, rsync_xa, count);
                temp_xattr.count = 0;
        }
-@@ -808,9 +840,10 @@ void receive_xattr(int f, struct file_struct *file)
+@@ -812,9 +844,10 @@ void receive_xattr(int f, struct file_struct *file)
        for (num = 1; num <= count; num++) {
                char *ptr, *name;
                rsync_xa *rxa;
@@ -186,4 +186,4 @@ diff --git a/xattrs.c b/xattrs.c
 +                              ? 1 + MAX_DIGEST_LEN : datum_len;
                size_t extra_len = MIGHT_NEED_RPRE ? RPRE_LEN : 0;
                if ((dget_len + extra_len < dget_len)
-                || (dget_len + extra_len + name_len < dget_len))
+                || (dget_len + extra_len + name_len < dget_len + extra_len))