Fixed failing hunks.
[rsync/rsync-patches.git] / checksum-updating.diff
index 95ce768..b25d101 100644 (file)
@@ -11,7 +11,7 @@ To use this patch, run these commands for a successful build:
 
 --- old/clientserver.c
 +++ new/clientserver.c
-@@ -37,6 +37,7 @@ extern int sanitize_paths;
+@@ -36,6 +36,7 @@ extern int sanitize_paths;
  extern int filesfrom_fd;
  extern int remote_protocol;
  extern int protocol_version;
@@ -19,7 +19,7 @@ To use this patch, run these commands for a successful build:
  extern int io_timeout;
  extern int no_detach;
  extern int default_af_hint;
-@@ -634,6 +635,8 @@ static int rsync_module(int f_in, int f_
+@@ -640,6 +641,8 @@ static int rsync_module(int f_in, int f_
        else if (am_root < 0) /* Treat --fake-super from client as --super. */
                am_root = 2;
  
@@ -30,7 +30,7 @@ To use this patch, run these commands for a successful build:
  
 --- old/flist.c
 +++ new/flist.c
-@@ -25,6 +25,7 @@
+@@ -24,6 +24,7 @@
  #include "io.h"
  
  extern int verbose;
@@ -38,7 +38,7 @@ To use this patch, run these commands for a successful build:
  extern int list_only;
  extern int am_root;
  extern int am_server;
-@@ -57,6 +58,7 @@ extern int implied_dirs;
+@@ -56,6 +57,7 @@ extern int implied_dirs;
  extern int file_extra_cnt;
  extern int ignore_perishable;
  extern int non_perishable_cnt;
@@ -46,7 +46,7 @@ To use this patch, run these commands for a successful build:
  extern int prune_empty_dirs;
  extern int copy_links;
  extern int copy_unsafe_links;
-@@ -79,6 +81,9 @@ extern iconv_t ic_send, ic_recv;
+@@ -78,6 +80,9 @@ extern iconv_t ic_send, ic_recv;
  
  #define PTR_SIZE (sizeof (struct file_struct *))
  
@@ -56,7 +56,7 @@ To use this patch, run these commands for a successful build:
  int io_error;
  int checksum_len;
  dev_t filesystem_dev; /* used to implement -x */
-@@ -101,6 +106,10 @@ static char tmp_sum[MAX_DIGEST_LEN];
+@@ -100,6 +105,10 @@ static char tmp_sum[MAX_DIGEST_LEN];
  static char empty_sum[MAX_DIGEST_LEN];
  static int flist_count_offset; /* for --delete --progress */
  static int dir_count = 0;
@@ -67,7 +67,7 @@ To use this patch, run these commands for a successful build:
  
  static void clean_flist(struct file_list *flist, int strip_root);
  static void output_flist(struct file_list *flist);
-@@ -317,6 +326,304 @@ static void flist_done_allocating(struct
+@@ -316,6 +325,304 @@ static void flist_done_allocating(struct
                flist->pool_boundary = ptr;
  }
  
@@ -372,7 +372,7 @@ To use this patch, run these commands for a successful build:
  int push_pathname(const char *dir, int len)
  {
        if (dir == pathname)
-@@ -973,34 +1280,24 @@ static struct file_struct *recv_file_ent
+@@ -972,34 +1279,24 @@ static struct file_struct *recv_file_ent
        return file;
  }
  
@@ -412,8 +412,8 @@ To use this patch, run these commands for a successful build:
 +      STRUCT_STAT st;
        char *bp;
  
-       if (strlcpy(thisname, fname, sizeof thisname)
-@@ -1077,6 +1374,8 @@ struct file_struct *make_file(const char
+       if (strlcpy(thisname, fname, sizeof thisname) >= sizeof thisname) {
+@@ -1075,6 +1372,8 @@ struct file_struct *make_file(const char
        if (is_excluded(thisname, S_ISDIR(st.st_mode) != 0, filter_level)) {
                if (ignore_perishable)
                        non_perishable_cnt++;
@@ -422,7 +422,7 @@ To use this patch, run these commands for a successful build:
                return NULL;
        }
  
-@@ -1115,9 +1414,16 @@ struct file_struct *make_file(const char
+@@ -1113,9 +1412,16 @@ struct file_struct *make_file(const char
                        memcpy(lastdir, thisname, len);
                        lastdir[len] = '\0';
                        lastdir_len = len;
@@ -440,7 +440,7 @@ To use this patch, run these commands for a successful build:
        basename_len = strlen(basename) + 1; /* count the '\0' */
  
  #ifdef SUPPORT_LINKS
-@@ -1193,11 +1499,44 @@ struct file_struct *make_file(const char
+@@ -1191,11 +1497,44 @@ struct file_struct *make_file(const char
        }
  #endif
  
@@ -488,42 +488,7 @@ To use this patch, run these commands for a successful build:
        /* This code is only used by the receiver when it is building
         * a list of files for a delete pass. */
        if (keep_dirlinks && linkname_len && flist) {
-@@ -1241,14 +1580,14 @@ void unmake_file(struct file_struct *fil
- static struct file_struct *send_file_name(int f, struct file_list *flist,
-                                         char *fname, STRUCT_STAT *stp,
--                                        int flags, int filter_flags)
-+                                        int flags, int filter_level)
- {
-       struct file_struct *file;
- #if defined SUPPORT_ACLS || defined SUPPORT_XATTRS
-       statx sx;
- #endif
--      file = make_file(fname, flist, stp, flags, filter_flags);
-+      file = make_file(fname, flist, stp, flags, filter_level);
-       if (!file)
-               return NULL;
-@@ -1442,7 +1781,7 @@ static void send_directory(int f, struct
-       DIR *d;
-       int divert_dirs = (flags & FLAG_DIVERT_DIRS) != 0;
-       int start = flist->count;
--      int filter_flags = f == -2 ? SERVER_FILTERS : ALL_FILTERS;
-+      int filter_level = f == -2 ? SERVER_FILTERS : ALL_FILTERS;
-       assert(flist != NULL);
-@@ -1471,7 +1810,7 @@ static void send_directory(int f, struct
-                       continue;
-               }
--              send_file_name(f, flist, fbuf, NULL, flags, filter_flags);
-+              send_file_name(f, flist, fbuf, NULL, flags, filter_level);
-       }
-       fbuf[len] = '\0';
-@@ -1483,6 +1822,9 @@ static void send_directory(int f, struct
+@@ -1481,6 +1820,9 @@ static void send_directory(int f, struct
  
        closedir(d);
  
@@ -531,9 +496,9 @@ To use this patch, run these commands for a successful build:
 +              write_checksums(NULL, 1);
 +
        if (f >= 0 && recurse && !divert_dirs) {
-               int i, end = flist->count - 1;
-               /* send_if_directory() bumps flist->count, so use "end". */
-@@ -1916,7 +2258,11 @@ struct file_list *send_file_list(int f, 
+               int i, end = flist->used - 1;
+               /* send_if_directory() bumps flist->used, so use "end". */
+@@ -1924,7 +2266,11 @@ struct file_list *send_file_list(int f, 
                         * file-list to check if this is a 1-file xfer. */
                        send_extra_file_list(f, 1);
                }
@@ -546,7 +511,7 @@ To use this patch, run these commands for a successful build:
  
        return flist;
  }
-@@ -2206,7 +2552,7 @@ void flist_free(struct file_list *flist)
+@@ -2217,7 +2563,7 @@ void flist_free(struct file_list *flist)
  
        if (!flist->prev || !flist_cnt)
                pool_destroy(flist->file_pool);
@@ -555,17 +520,9 @@ To use this patch, run these commands for a successful build:
                pool_free_old(flist->file_pool, flist->pool_boundary);
  
        if (flist->sorted && flist->sorted != flist->files)
-@@ -2225,6 +2571,7 @@ static void clean_flist(struct file_list
-       if (!flist)
-               return;
-       if (flist->count == 0) {
-+              flist->low = 0;
-               flist->high = -1;
-               return;
-       }
 --- old/loadparm.c
 +++ new/loadparm.c
-@@ -149,6 +149,7 @@ typedef struct
+@@ -148,6 +148,7 @@ typedef struct
        int syslog_facility;
        int timeout;
  
@@ -573,7 +530,7 @@ To use this patch, run these commands for a successful build:
        BOOL fake_super;
        BOOL ignore_errors;
        BOOL ignore_nonreadable;
-@@ -197,6 +198,7 @@ static service sDefault =
+@@ -196,6 +197,7 @@ static service sDefault =
   /* syslog_facility; */               LOG_DAEMON,
   /* timeout; */                       0,
  
@@ -581,7 +538,7 @@ To use this patch, run these commands for a successful build:
   /* fake_super; */            False,
   /* ignore_errors; */         False,
   /* ignore_nonreadable; */    False,
-@@ -313,6 +315,7 @@ static struct parm_struct parm_table[] =
+@@ -312,6 +314,7 @@ static struct parm_struct parm_table[] =
   {"lock file",         P_STRING, P_LOCAL, &sDefault.lock_file,         NULL,0},
   {"log file",          P_STRING, P_LOCAL, &sDefault.log_file,          NULL,0},
   {"log format",        P_STRING, P_LOCAL, &sDefault.log_format,        NULL,0},
@@ -589,7 +546,7 @@ To use this patch, run these commands for a successful build:
   {"max connections",   P_INTEGER,P_LOCAL, &sDefault.max_connections,   NULL,0},
   {"max verbosity",     P_INTEGER,P_LOCAL, &sDefault.max_verbosity,     NULL,0},
   {"name",              P_STRING, P_LOCAL, &sDefault.name,              NULL,0},
-@@ -418,6 +421,7 @@ FN_LOCAL_BOOL(lp_fake_super, fake_super)
+@@ -417,6 +420,7 @@ FN_LOCAL_BOOL(lp_fake_super, fake_super)
  FN_LOCAL_BOOL(lp_ignore_errors, ignore_errors)
  FN_LOCAL_BOOL(lp_ignore_nonreadable, ignore_nonreadable)
  FN_LOCAL_BOOL(lp_list, list)
@@ -599,7 +556,7 @@ To use this patch, run these commands for a successful build:
  FN_LOCAL_BOOL(lp_transfer_logging, transfer_logging)
 --- old/options.c
 +++ new/options.c
-@@ -109,6 +109,7 @@ size_t bwlimit_writemax = 0;
+@@ -108,6 +108,7 @@ size_t bwlimit_writemax = 0;
  int ignore_existing = 0;
  int ignore_non_existing = 0;
  int need_messages_from_generator = 0;
@@ -607,7 +564,7 @@ To use this patch, run these commands for a successful build:
  int max_delete = -1;
  OFF_T max_size = 0;
  OFF_T min_size = 0;
-@@ -302,6 +303,7 @@ void usage(enum logcode F)
+@@ -301,6 +302,7 @@ void usage(enum logcode F)
    rprintf(F," -q, --quiet                 suppress non-error messages\n");
    rprintf(F,"     --no-motd               suppress daemon-mode MOTD (see manpage caveat)\n");
    rprintf(F," -c, --checksum              skip based on checksum, not mod-time & size\n");
@@ -615,7 +572,7 @@ To use this patch, run these commands for a successful build:
    rprintf(F," -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)\n");
    rprintf(F,"     --no-OPTION             turn off an implied OPTION (e.g. --no-D)\n");
    rprintf(F," -r, --recursive             recurse into directories\n");
-@@ -542,6 +544,7 @@ static struct poptOption long_options[] 
+@@ -541,6 +543,7 @@ static struct poptOption long_options[] 
    {"checksum",        'c', POPT_ARG_VAL,    &always_checksum, 1, 0, 0 },
    {"no-checksum",      0,  POPT_ARG_VAL,    &always_checksum, 0, 0, 0 },
    {"no-c",             0,  POPT_ARG_VAL,    &always_checksum, 0, 0, 0 },
@@ -623,7 +580,7 @@ To use this patch, run these commands for a successful build:
    {"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 },
-@@ -1896,7 +1899,9 @@ void server_options(char **args,int *arg
+@@ -1898,7 +1901,9 @@ void server_options(char **args,int *arg
                                args[ac++] = basis_dir[i];
                        }
                }
@@ -636,7 +593,7 @@ To use this patch, run these commands for a successful build:
                args[ac++] = "--append";
 --- old/rsync.h
 +++ new/rsync.h
-@@ -589,6 +589,7 @@ extern int preserve_xattrs;
+@@ -588,6 +588,7 @@ extern int xattrs_ndx;
  #define EXTRA_LEN (sizeof (union file_extras))
  #define PTR_EXTRA_LEN ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN)
  #define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN)