Fixed failing hunks.
authorWayne Davison <wayned@samba.org>
Sat, 22 Sep 2007 21:46:23 +0000 (21:46 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 22 Sep 2007 21:46:23 +0000 (21:46 +0000)
checksum-updating.diff
xattrs.diff

index 309b516..a5a4a82 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;
+@@ -38,6 +38,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;
-@@ -676,6 +677,8 @@ static int rsync_module(int f_in, int f_
+@@ -677,6 +678,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 @@
+@@ -26,6 +26,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;
-@@ -58,6 +59,7 @@ extern int implied_dirs;
+@@ -59,6 +60,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;
-@@ -81,6 +83,9 @@ extern iconv_t ic_send, ic_recv;
+@@ -83,6 +85,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 */
-@@ -116,6 +121,10 @@ static char empty_sum[MAX_DIGEST_LEN];
+@@ -118,6 +123,10 @@ static char empty_sum[MAX_DIGEST_LEN];
  static int flist_count_offset; /* for --delete --progress */
  static int dir_count = 0;
  static int high_hlink_ndx;
@@ -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);
-@@ -332,6 +341,301 @@ static void flist_done_allocating(struct
+@@ -334,6 +343,301 @@ static void flist_done_allocating(struct
                flist->pool_boundary = ptr;
  }
  
@@ -369,7 +369,7 @@ To use this patch, run these commands for a successful build:
  int push_pathname(const char *dir, int len)
  {
        if (dir == pathname)
-@@ -1010,7 +1314,7 @@ struct file_struct *make_file(const char
+@@ -1005,7 +1309,7 @@ struct file_struct *make_file(const char
                              STRUCT_STAT *stp, int flags, int filter_level)
  {
        static char *lastdir;
@@ -378,7 +378,7 @@ To use this patch, run these commands for a successful build:
        struct file_struct *file;
        char thisname[MAXPATHLEN];
        char linkname[MAXPATHLEN];
-@@ -1097,6 +1401,8 @@ struct file_struct *make_file(const char
+@@ -1095,6 +1399,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++;
@@ -453,7 +453,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) {
-@@ -1510,6 +1856,9 @@ static void send_directory(int f, struct
+@@ -1509,6 +1855,9 @@ static void send_directory(int f, struct
  
        closedir(d);
  
@@ -463,7 +463,7 @@ To use this patch, run these commands for a successful build:
        if (f >= 0 && recurse && !divert_dirs) {
                int i, end = flist->used - 1;
                /* send_if_directory() bumps flist->used, so use "end". */
-@@ -1952,7 +2301,11 @@ struct file_list *send_file_list(int f, 
+@@ -2063,7 +2412,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);
                }
@@ -476,7 +476,7 @@ To use this patch, run these commands for a successful build:
  
        return flist;
  }
-@@ -2245,7 +2598,7 @@ void flist_free(struct file_list *flist)
+@@ -2355,7 +2708,7 @@ void flist_free(struct file_list *flist)
  
        if (!flist->prev || !flist_cnt)
                pool_destroy(flist->file_pool);
@@ -485,9 +485,24 @@ 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)
+--- old/ifuncs.h
++++ new/ifuncs.h
+@@ -64,6 +64,12 @@ isDigit(const char *ptr)
+ }
+ static inline int
++isXDigit(const char *ptr)
++{
++      return isxdigit(*(unsigned char *)ptr);
++}
++
++static inline int
+ isPrint(const char *ptr)
+ {
+       return isprint(*(unsigned char *)ptr);
 --- old/loadparm.c
 +++ new/loadparm.c
-@@ -152,6 +152,7 @@ typedef struct
+@@ -153,6 +153,7 @@ typedef struct
        int syslog_facility;
        int timeout;
  
@@ -495,7 +510,7 @@ To use this patch, run these commands for a successful build:
        BOOL fake_super;
        BOOL ignore_errors;
        BOOL ignore_nonreadable;
-@@ -200,6 +201,7 @@ static service sDefault =
+@@ -201,6 +202,7 @@ static service sDefault =
   /* syslog_facility; */               LOG_DAEMON,
   /* timeout; */                       0,
  
@@ -503,7 +518,7 @@ To use this patch, run these commands for a successful build:
   /* fake_super; */            False,
   /* ignore_errors; */         False,
   /* ignore_nonreadable; */    False,
-@@ -316,6 +318,7 @@ static struct parm_struct parm_table[] =
+@@ -317,6 +319,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},
@@ -511,7 +526,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},
-@@ -421,6 +424,7 @@ FN_LOCAL_BOOL(lp_fake_super, fake_super)
+@@ -422,6 +425,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)
@@ -521,7 +536,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;
+@@ -110,6 +110,7 @@ size_t bwlimit_writemax = 0;
  int ignore_existing = 0;
  int ignore_non_existing = 0;
  int need_messages_from_generator = 0;
@@ -529,7 +544,7 @@ To use this patch, run these commands for a successful build:
  int max_delete = INT_MIN;
  OFF_T max_size = 0;
  OFF_T min_size = 0;
-@@ -309,6 +310,7 @@ void usage(enum logcode F)
+@@ -310,6 +311,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");
@@ -545,7 +560,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 },
-@@ -1948,7 +1951,9 @@ void server_options(char **args, int *ar
+@@ -1956,7 +1959,9 @@ void server_options(char **args, int *ar
                                args[ac++] = basis_dir[i];
                        }
                }
@@ -558,7 +573,7 @@ To use this patch, run these commands for a successful build:
                if (append_mode > 1)
 --- old/rsync.h
 +++ new/rsync.h
-@@ -631,6 +631,10 @@ extern int xattrs_ndx;
+@@ -639,6 +639,10 @@ extern int xattrs_ndx;
  #define F_SUM(f) ((char*)OPT_EXTRA(f, LEN64_BUMP(f) + HLINK_BUMP(f) \
                                    + SUM_EXTRA_CNT - 1))
  
@@ -569,19 +584,6 @@ To use this patch, run these commands for a successful build:
  /* Some utility defines: */
  #define F_IS_ACTIVE(f) (f)->basename[0]
  #define F_IS_HLINKED(f) ((f)->flags & FLAG_HLINKED)
-@@ -1069,6 +1073,12 @@ isDigit(const char *ptr)
- }
- static inline int
-+isXDigit(const char *ptr)
-+{
-+      return isxdigit(*(unsigned char *)ptr);
-+}
-+
-+static inline int
- isPrint(const char *ptr)
- {
-       return isprint(*(unsigned char *)ptr);
 --- old/rsync.yo
 +++ new/rsync.yo
 @@ -322,6 +322,7 @@ to the detailed description below for a 
@@ -592,7 +594,7 @@ To use this patch, run these commands for a successful build:
   -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
-@@ -519,9 +520,9 @@ uses a "quick check" that (by default) c
+@@ -520,9 +521,9 @@ uses a "quick check" that (by default) c
  of last modification match between the sender and receiver.  This option
  changes this to compare a 128-bit MD4 checksum for each file that has a
  matching size.  Generating the checksums means that both sides will expend
@@ -605,7 +607,7 @@ To use this patch, run these commands for a successful build:
  
  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
-@@ -529,12 +530,42 @@ its checksums when it is scanning for ch
+@@ -530,12 +531,42 @@ its checksums when it is scanning for ch
  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.
  
@@ -650,7 +652,7 @@ To use this patch, run these commands for a successful build:
  everything (with -H being a notable omission).
 --- old/rsyncd.conf.yo
 +++ new/rsyncd.conf.yo
-@@ -198,6 +198,20 @@ locking on this file to ensure that the 
+@@ -199,6 +199,20 @@ locking on this file to ensure that the 
  exceeded for the modules sharing the lock file.
  The default is tt(/var/run/rsyncd.lock).
  
index 6cfc8d0..16548fb 100644 (file)
@@ -12,7 +12,7 @@ To use this patch, run these commands for a successful build:
 
 --- old/compat.c
 +++ new/compat.c
-@@ -148,13 +148,6 @@ void setup_protocol(int f_out,int f_in)
+@@ -163,13 +163,6 @@ void setup_protocol(int f_out,int f_in)
        if (protocol_version < 30) {
                if (append_mode == 1)
                        append_mode = 2;
@@ -28,15 +28,15 @@ To use this patch, run these commands for a successful build:
        if (delete_mode && !(delete_before+delete_during+delete_after)) {
 --- old/xattrs.c
 +++ new/xattrs.c
-@@ -20,6 +20,7 @@
-  */
+@@ -21,6 +21,7 @@
  
  #include "rsync.h"
+ #include "ifuncs.h"
 +#include "io.h"
  #include "lib/sysxattrs.h"
  
  #ifdef SUPPORT_XATTRS
-@@ -32,6 +33,7 @@ extern int read_only;
+@@ -33,6 +34,7 @@ extern int read_only;
  extern int list_only;
  extern int preserve_xattrs;
  extern int checksum_seed;
@@ -44,7 +44,7 @@ To use this patch, run these commands for a successful build:
  
  #define RSYNC_XAL_INITIAL 5
  #define RSYNC_XAL_LIST_INITIAL 100
-@@ -232,7 +234,7 @@ static int rsync_xal_get(const char *fna
+@@ -233,7 +235,7 @@ static int rsync_xal_get(const char *fna
                if (!(ptr = get_xattr_data(fname, name, &datum_len, 0)))
                        return -1;
  
@@ -53,7 +53,7 @@ To use this patch, run these commands for a successful build:
                        /* For large datums, we store a flag and a checksum. */
                        name_offset = 1 + MAX_DIGEST_LEN;
                        sum_init(checksum_seed);
-@@ -296,7 +298,7 @@ static int find_matching_xattr(item_list
+@@ -297,7 +299,7 @@ static int find_matching_xattr(item_list
                         || rxas1[j].datum_len != rxas2[j].datum_len
                         || strcmp(rxas1[j].name, rxas2[j].name))
                                break;
@@ -62,7 +62,7 @@ To use this patch, run these commands for a successful build:
                                if (memcmp(rxas1[j].datum + 1,
                                           rxas2[j].datum + 1,
                                           MAX_DIGEST_LEN) != 0)
-@@ -333,34 +335,43 @@ int send_xattr(statx *sxp, int f)
+@@ -334,34 +336,43 @@ int send_xattr(statx *sxp, int f)
  {
        int ndx = find_matching_xattr(sxp->xattr);
  
@@ -116,7 +116,7 @@ To use this patch, run these commands for a successful build:
                                write_buf(f, rxa->datum + 1, MAX_DIGEST_LEN);
                        else
                                write_buf(f, rxa->datum, rxa->datum_len);
-@@ -410,7 +421,7 @@ int xattr_diff(struct file_struct *file,
+@@ -411,7 +422,7 @@ int xattr_diff(struct file_struct *file,
                cmp = rec_cnt ? strcmp(snd_rxa->name, rec_rxa->name) : -1;
                if (cmp > 0)
                        same = 0;
@@ -125,7 +125,7 @@ To use this patch, run these commands for a successful build:
                        same = cmp == 0 && snd_rxa->datum_len == rec_rxa->datum_len
                            && memcmp(snd_rxa->datum + 1, rec_rxa->datum + 1,
                                      MAX_DIGEST_LEN) == 0;
-@@ -453,6 +464,9 @@ void send_xattr_request(const char *fnam
+@@ -454,6 +465,9 @@ void send_xattr_request(const char *fnam
        int j, cnt, prior_req = -1;
        rsync_xa *rxa;
  
@@ -135,7 +135,7 @@ To use this patch, run these commands for a successful build:
        lst += F_XATTR(file);
        cnt = lst->count;
        for (rxa = lst->items, j = 0; j < cnt; rxa++, j++) {
-@@ -524,6 +538,9 @@ void recv_xattr_request(struct file_stru
+@@ -525,6 +539,9 @@ void recv_xattr_request(struct file_stru
        rsync_xa *rxa;
        int rel_pos, cnt;
  
@@ -145,7 +145,7 @@ To use this patch, run these commands for a successful build:
        if (F_XATTR(file) < 0) {
                rprintf(FERROR, "recv_xattr_request: internal data error!\n");
                exit_cleanup(RERR_STREAMIO);
-@@ -570,7 +587,22 @@ void receive_xattr(struct file_struct *f
+@@ -571,7 +588,22 @@ void receive_xattr(struct file_struct *f
  {
        static item_list temp_xattr = EMPTY_ITEM_LIST;
        int count;
@@ -169,7 +169,7 @@ To use this patch, run these commands for a successful build:
  
        if (ndx < 0 || (size_t)ndx > rsync_xal_l.count) {
                rprintf(FERROR, "receive_xattr: xa index %d out of"
-@@ -583,7 +615,7 @@ void receive_xattr(struct file_struct *f
+@@ -584,7 +616,7 @@ void receive_xattr(struct file_struct *f
                return;
        }
        
@@ -178,7 +178,7 @@ To use this patch, run these commands for a successful build:
                (void)EXPAND_ITEM_LIST(&temp_xattr, rsync_xa, count);
                temp_xattr.count = 0;
        }
-@@ -591,9 +623,10 @@ void receive_xattr(struct file_struct *f
+@@ -592,9 +624,10 @@ void receive_xattr(struct file_struct *f
        while (count--) {
                char *ptr, *name;
                rsync_xa *rxa;