X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/7170ca8dba0a407cd0c91b41b48163c7b682abb1..5214a41bbae94607b196b199b483710e1babf292:/checksum-reading.diff diff --git a/checksum-reading.diff b/checksum-reading.diff index 4fa0844..214f8a4 100644 --- a/checksum-reading.diff +++ b/checksum-reading.diff @@ -16,7 +16,7 @@ To use this patch, run these commands for a successful build: ./configure (optional if already run) make -based-on: 181c9faf928faad08ef095f4667afe460ec3bef6 +based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d diff --git a/checksum.c b/checksum.c --- a/checksum.c +++ b/checksum.c @@ -41,7 +41,7 @@ diff --git a/clientserver.c b/clientserver.c extern int io_timeout; extern int no_detach; extern int write_batch; -@@ -862,6 +864,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char +@@ -874,6 +876,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; @@ -70,7 +70,7 @@ diff --git a/flist.c b/flist.c extern int module_id; extern int ignore_errors; extern int numeric_ids; -@@ -61,6 +63,7 @@ extern int file_extra_cnt; +@@ -60,6 +62,7 @@ extern int file_extra_cnt; extern int ignore_perishable; extern int non_perishable_cnt; extern int prune_empty_dirs; @@ -78,7 +78,7 @@ diff --git a/flist.c b/flist.c extern int copy_links; extern int copy_unsafe_links; extern int protocol_version; -@@ -71,6 +74,7 @@ extern int sender_symlink_iconv; +@@ -70,6 +73,7 @@ extern int sender_symlink_iconv; extern int output_needs_newline; extern int sender_keeps_checksum; extern int unsort_ndx; @@ -86,8 +86,8 @@ diff --git a/flist.c b/flist.c extern struct stats stats; extern char *filesfrom_host; extern char *usermap, *groupmap; -@@ -87,6 +91,12 @@ extern int filesfrom_convert; - extern iconv_t ic_send, ic_recv; +@@ -94,6 +98,12 @@ extern iconv_t ic_send, ic_recv; + #endif #endif +#define RSYNCSUMS_FILE ".rsyncsums" @@ -99,7 +99,7 @@ diff --git a/flist.c b/flist.c #define PTR_SIZE (sizeof (struct file_struct *)) int io_error; -@@ -127,7 +137,11 @@ static char tmp_sum[MAX_DIGEST_LEN]; +@@ -135,7 +145,11 @@ static char tmp_sum[MAX_DIGEST_LEN]; static char empty_sum[MAX_DIGEST_LEN]; static int flist_count_offset; /* for --delete --progress */ @@ -112,7 +112,7 @@ diff --git a/flist.c b/flist.c static void output_flist(struct file_list *flist); void init_flist(void) -@@ -342,6 +356,238 @@ static void flist_done_allocating(struct file_list *flist) +@@ -350,6 +364,238 @@ static void flist_done_allocating(struct file_list *flist) flist->pool_boundary = ptr; } @@ -351,7 +351,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 -@@ -1114,7 +1360,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1141,7 +1387,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, STRUCT_STAT *stp, int flags, int filter_level) { static char *lastdir; @@ -360,7 +360,7 @@ diff --git a/flist.c b/flist.c struct file_struct *file; char thisname[MAXPATHLEN]; char linkname[MAXPATHLEN]; -@@ -1260,9 +1506,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1287,9 +1533,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, memcpy(lastdir, thisname, len); lastdir[len] = '\0'; lastdir_len = len; @@ -378,7 +378,7 @@ diff --git a/flist.c b/flist.c basename_len = strlen(basename) + 1; /* count the '\0' */ #ifdef SUPPORT_LINKS -@@ -1276,11 +1529,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1307,11 +1560,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, extra_len += EXTRA_LEN; #endif @@ -392,7 +392,7 @@ diff --git a/flist.c b/flist.c #if EXTRA_ROUNDING > 0 if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN)) -@@ -1357,8 +1607,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1394,8 +1644,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, return NULL; } @@ -409,8 +409,8 @@ diff --git a/flist.c b/flist.c if (unsort_ndx) F_NDX(file) = stats.num_dirs; -@@ -2472,7 +2728,7 @@ struct file_list *recv_file_list(int f) - flist_eof = 1; +@@ -2527,7 +2783,7 @@ struct file_list *recv_file_list(int f) + rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i()); } - flist_sort_and_clean(flist, relative_paths); @@ -418,7 +418,7 @@ diff --git a/flist.c b/flist.c if (protocol_version < 30) { /* Recv the io_error flag */ -@@ -2693,7 +2949,7 @@ void flist_free(struct file_list *flist) +@@ -2750,7 +3006,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. */ @@ -427,7 +427,7 @@ diff --git a/flist.c b/flist.c { char fbuf[MAXPATHLEN]; int i, prev_i; -@@ -2744,7 +3000,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root) +@@ -2801,7 +3057,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. */ @@ -436,7 +436,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; -@@ -2760,8 +3016,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root) +@@ -2817,8 +3073,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root) } else keep = j, drop = i; @@ -447,7 +447,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); -@@ -2783,7 +3039,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root) +@@ -2840,7 +3096,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root) } flist->high = prev_i; @@ -497,7 +497,7 @@ diff --git a/generator.c b/generator.c continue; best_match = j; match_level = 2; -@@ -1074,7 +1078,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1081,7 +1085,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, * --ignore-non-existing, daemon exclude, or mkdir failure. */ static struct file_struct *skip_dir = NULL; static struct file_list *fuzzy_dirlist = NULL; @@ -506,7 +506,7 @@ diff --git a/generator.c b/generator.c struct file_struct *fuzzy_file = NULL; int fd = -1, f_copy = -1; stat_x sx, real_sx; -@@ -1158,8 +1162,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1165,8 +1169,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, flist_free(fuzzy_dirlist); fuzzy_dirlist = NULL; } @@ -517,7 +517,7 @@ diff --git a/generator.c b/generator.c #ifdef SUPPORT_ACLS if (!preserve_perms) dflt_perms = default_perms_for_dir(dn); -@@ -1167,10 +1171,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1174,10 +1178,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, } parent_dirname = dn; @@ -537,7 +537,7 @@ diff --git a/generator.c b/generator.c } statret = link_stat(fname, &sx.st, keep_dirlinks && is_dir); -@@ -1616,7 +1625,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1600,7 +1609,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, ; else if (fnamecmp_type == FNAMECMP_FUZZY) ; @@ -549,7 +549,7 @@ diff --git a/generator.c b/generator.c diff --git a/hlink.c b/hlink.c --- a/hlink.c +++ b/hlink.c -@@ -413,7 +413,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname, +@@ -409,7 +409,7 @@ int hard_link_check(struct file_struct *file, int ndx, char *fname, } break; } @@ -577,7 +577,7 @@ diff --git a/itypes.h b/itypes.h diff --git a/loadparm.c b/loadparm.c --- a/loadparm.c +++ b/loadparm.c -@@ -132,6 +132,7 @@ typedef struct { +@@ -133,6 +133,7 @@ typedef struct { /* NOTE: update this macro if the last char* variable changes! */ #define LOCAL_STRING_COUNT() (offsetof(local_vars, uid) / sizeof (char*) + 1) @@ -585,7 +585,7 @@ diff --git a/loadparm.c b/loadparm.c int max_connections; int max_verbosity; int syslog_facility; -@@ -204,6 +205,7 @@ static const all_vars Defaults = { +@@ -205,6 +206,7 @@ static const all_vars Defaults = { /* temp_dir; */ NULL, /* uid; */ NULL, @@ -593,7 +593,7 @@ diff --git a/loadparm.c b/loadparm.c /* max_connections; */ 0, /* max_verbosity; */ 1, /* syslog_facility; */ LOG_DAEMON, -@@ -305,6 +307,13 @@ static struct enum_list enum_facilities[] = { +@@ -306,6 +308,13 @@ static struct enum_list enum_facilities[] = { { -1, NULL } }; @@ -607,7 +607,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}, -@@ -315,6 +324,7 @@ static struct parm_struct parm_table[] = +@@ -316,6 +325,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}, @@ -615,7 +615,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}, -@@ -419,6 +429,7 @@ FN_LOCAL_STRING(lp_secrets_file, secrets_file) +@@ -470,6 +480,7 @@ FN_LOCAL_STRING(lp_secrets_file, secrets_file) FN_LOCAL_STRING(lp_temp_dir, temp_dir) FN_LOCAL_STRING(lp_uid, uid) @@ -634,7 +634,7 @@ diff --git a/options.c b/options.c int max_delete = INT_MIN; OFF_T max_size = 0; OFF_T min_size = 0; -@@ -661,6 +662,7 @@ void usage(enum logcode F) +@@ -662,6 +663,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"); @@ -643,15 +643,15 @@ diff --git a/options.c b/options.c rprintf(F," --no-OPTION turn off an implied OPTION (e.g. --no-D)\n"); rprintf(F," -r, --recursive recurse into directories\n"); @@ -798,7 +800,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM, + OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST, OPT_HELP, OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD, OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE, - OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, -- OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, -+ OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_SUMFILES, +- OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, ++ OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, OPT_SUMFILES, + OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT, OPT_SERVER, OPT_REFUSED_BASE = 9000}; - static struct poptOption long_options[] = { -@@ -933,6 +935,7 @@ static struct poptOption long_options[] = { +@@ -934,6 +936,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 }, @@ -659,7 +659,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 }, -@@ -1631,6 +1634,23 @@ int parse_arguments(int *argc_p, const char ***argv_p) +@@ -1651,6 +1654,23 @@ int parse_arguments(int *argc_p, const char ***argv_p) } break; @@ -683,7 +683,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); -@@ -1831,6 +1851,9 @@ int parse_arguments(int *argc_p, const char ***argv_p) +@@ -1851,6 +1871,9 @@ int parse_arguments(int *argc_p, const char ***argv_p) } #endif @@ -696,8 +696,8 @@ diff --git a/options.c b/options.c diff --git a/rsync.h b/rsync.h --- a/rsync.h +++ b/rsync.h -@@ -716,6 +716,10 @@ extern int xattrs_ndx; - #define F_SUM(f) ((char*)OPT_EXTRA(f, LEN64_BUMP(f) + HLINK_BUMP(f) \ +@@ -727,6 +727,10 @@ extern int xattrs_ndx; + #define F_SUM(f) ((char*)OPT_EXTRA(f, START_BUMP(f) + HLINK_BUMP(f) \ + SUM_EXTRA_CNT - 1)) +/* These are only valid on an entry read from a checksum file. */ @@ -707,7 +707,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) -@@ -903,6 +907,13 @@ typedef struct { +@@ -923,6 +927,13 @@ typedef struct { char fname[1]; /* has variable size */ } relnamecache; @@ -794,7 +794,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 -@@ -292,6 +292,17 @@ locking on this file to ensure that the max connections limit is not +@@ -312,6 +312,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).