From: Wayne Davison Date: Fri, 5 May 2006 16:09:53 +0000 (+0000) Subject: Fixed some patch fuzz. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/f4e59d468a45c3197973f5d59d6b72ad44c4e523 Fixed some patch fuzz. --- diff --git a/early-checksum.diff b/early-checksum.diff index 5794dd4..c16aa57 100644 --- a/early-checksum.diff +++ b/early-checksum.diff @@ -18,7 +18,7 @@ for a local copy, so the old algorithm is used for local copies. extern int module_id; extern int ignore_errors; extern int numeric_ids; -@@ -699,6 +700,16 @@ static struct file_struct *receive_file_ +@@ -692,6 +693,16 @@ static struct file_struct *receive_file_ sum = empty_sum; } read_buf(f, sum, checksum_len); @@ -37,7 +37,7 @@ for a local copy, so the old algorithm is used for local copies. return file; --- old/generator.c +++ new/generator.c -@@ -73,6 +73,7 @@ extern int ignore_timeout; +@@ -71,6 +71,7 @@ extern int ignore_timeout; extern int protocol_version; extern int fuzzy_basis; extern int always_checksum; @@ -45,7 +45,7 @@ for a local copy, so the old algorithm is used for local copies. extern int checksum_len; extern char *partial_dir; extern char *basis_dir[]; -@@ -376,7 +377,8 @@ void itemize(struct file_struct *file, i +@@ -374,7 +375,8 @@ void itemize(struct file_struct *file, i /* Perform our quick-check heuristic for determining if a file is unchanged. */ @@ -55,7 +55,7 @@ for a local copy, so the old algorithm is used for local copies. { if (st->st_size != file->length) return 0; -@@ -385,6 +387,8 @@ int unchanged_file(char *fn, struct file +@@ -383,6 +385,8 @@ int unchanged_file(char *fn, struct file of the file time to determine whether to sync */ if (always_checksum && S_ISREG(st->st_mode)) { char sum[MD4_SUM_LENGTH]; @@ -64,7 +64,7 @@ for a local copy, so the old algorithm is used for local copies. file_checksum(fn, sum, st->st_size); return memcmp(sum, file->u.sum, checksum_len) == 0; } -@@ -628,7 +632,7 @@ static int try_dests_reg(struct file_str +@@ -626,7 +630,7 @@ static int try_dests_reg(struct file_str match_level = 1; /* FALL THROUGH */ case 1: @@ -73,7 +73,7 @@ for a local copy, so the old algorithm is used for local copies. continue; best_match = j; match_level = 2; -@@ -1197,7 +1201,7 @@ static void recv_generator(char *fname, +@@ -1194,7 +1198,7 @@ static void recv_generator(char *fname, ; else if (fnamecmp_type == FNAMECMP_FUZZY) ; @@ -103,17 +103,17 @@ for a local copy, so the old algorithm is used for local copies. extern int recurse; extern int relative_paths; extern int sanitize_paths; -@@ -66,6 +67,9 @@ extern char *rsync_path; - extern char *shell_cmd; +@@ -69,6 +70,9 @@ extern char *shell_cmd; extern char *batch_name; + extern struct filter_list_struct server_filter_list; +extern char curr_dir[MAXPATHLEN]; + +int pre_checksum = 0; int local_server = 0; - int startdir_depth = 0; mode_t orig_umask = 0; -@@ -741,6 +745,7 @@ static void do_server_recv(int f_in, int + struct file_list *the_file_list; +@@ -749,6 +753,7 @@ static void do_server_recv(int f_in, int struct file_list *flist; char *local_name = NULL; char *dir = NULL; @@ -121,7 +121,7 @@ for a local copy, so the old algorithm is used for local copies. int save_verbose = verbose; if (filesfrom_fd >= 0) { -@@ -784,6 +789,10 @@ static void do_server_recv(int f_in, int +@@ -792,6 +797,10 @@ static void do_server_recv(int f_in, int filesfrom_fd = -1; } @@ -132,7 +132,7 @@ for a local copy, so the old algorithm is used for local copies. flist = recv_file_list(f_in); verbose = save_verbose; if (!flist) { -@@ -792,6 +801,9 @@ static void do_server_recv(int f_in, int +@@ -800,6 +809,9 @@ static void do_server_recv(int f_in, int } the_file_list = flist; @@ -142,7 +142,7 @@ for a local copy, so the old algorithm is used for local copies. if (argc > 0) local_name = get_local_name(flist,argv[0]); -@@ -851,6 +863,7 @@ int client_run(int f_in, int f_out, pid_ +@@ -883,6 +895,7 @@ int client_run(int f_in, int f_out, pid_ { struct file_list *flist = NULL; int exit_code = 0, exit_code2 = 0; @@ -150,7 +150,7 @@ for a local copy, so the old algorithm is used for local copies. char *local_name = NULL; cleanup_child_pid = pid; -@@ -925,11 +938,18 @@ int client_run(int f_in, int f_out, pid_ +@@ -957,11 +970,18 @@ int client_run(int f_in, int f_out, pid_ filesfrom_fd = -1; } diff --git a/log-file.diff b/log-file.diff index f86ec96..b796b39 100644 --- a/log-file.diff +++ b/log-file.diff @@ -3,7 +3,7 @@ are doing, similar to how a daemon logs its actions. --- old/cleanup.c +++ new/cleanup.c -@@ -21,10 +21,13 @@ +@@ -23,10 +23,13 @@ #include "rsync.h" @@ -17,7 +17,7 @@ are doing, similar to how a daemon logs its actions. #ifdef HAVE_SIGACTION static struct sigaction sigact; -@@ -149,7 +152,7 @@ void _exit_cleanup(int code, const char +@@ -151,7 +154,7 @@ void _exit_cleanup(int code, const char code = RERR_PARTIAL; } @@ -28,7 +28,7 @@ are doing, similar to how a daemon logs its actions. if (verbose > 2) { --- old/clientserver.c +++ new/clientserver.c -@@ -44,10 +44,14 @@ extern int protocol_version; +@@ -39,10 +39,14 @@ extern int protocol_version; extern int io_timeout; extern int no_detach; extern int default_af_hint; @@ -43,7 +43,7 @@ are doing, similar to how a daemon logs its actions. extern char *files_from; extern char *tmpdir; extern struct chmod_mode_struct *chmod_modes; -@@ -55,8 +59,6 @@ extern struct filter_list_struct server_ +@@ -50,8 +54,6 @@ extern struct filter_list_struct server_ char *auth_user; int read_only = 0; @@ -52,7 +52,7 @@ are doing, similar to how a daemon logs its actions. int module_id = -1; struct chmod_mode_struct *daemon_chmod_modes; -@@ -329,11 +331,12 @@ static int rsync_module(int f_in, int f_ +@@ -324,11 +326,12 @@ static int rsync_module(int f_in, int f_ read_only = 1; if (lp_transfer_logging(i)) { @@ -72,7 +72,7 @@ are doing, similar to how a daemon logs its actions. am_root = (MY_UID() == 0); --- old/flist.c +++ new/flist.c -@@ -95,15 +95,15 @@ static int show_filelist_p(void) +@@ -91,15 +91,15 @@ static int show_filelist_p(void) static void start_filelist_progress(char *kind) { @@ -91,7 +91,7 @@ are doing, similar to how a daemon logs its actions. } static void maybe_emit_filelist_progress(int count) -@@ -295,7 +295,7 @@ void flist_expand(struct file_list *flis +@@ -283,7 +283,7 @@ void flist_expand(struct file_list *flis flist->malloced); if (verbose >= 2 && flist->malloced != FLIST_START) { @@ -100,7 +100,7 @@ are doing, similar to how a daemon logs its actions. who_am_i(), (double)sizeof flist->files[0] * flist->malloced, (new_ptr == flist->files) ? " not" : ""); -@@ -1077,6 +1077,7 @@ struct file_list *send_file_list(int f, +@@ -1059,6 +1059,7 @@ struct file_list *send_file_list(int f, int64 start_write; int use_ff_fd = 0; @@ -108,7 +108,7 @@ are doing, similar to how a daemon logs its actions. if (show_filelist_p()) start_filelist_progress("building file list"); -@@ -1343,6 +1344,7 @@ struct file_list *recv_file_list(int f) +@@ -1329,6 +1330,7 @@ struct file_list *recv_file_list(int f) unsigned short flags; int64 start_read; @@ -127,8 +127,8 @@ are doing, similar to how a daemon logs its actions. extern int am_root; extern int am_server; extern int am_daemon; -@@ -661,7 +661,7 @@ static int try_dests_reg(struct file_str - } else if (itemizing) +@@ -672,7 +672,7 @@ static int try_dests_reg(struct file_str + if (itemizing) itemize(file, ndx, 0, stp, 0, 0, NULL); if (verbose > 1 && maybe_ATTRS_REPORT) { - code = daemon_log_format_has_i || dry_run @@ -136,7 +136,7 @@ are doing, similar to how a daemon logs its actions. ? FCLIENT : FINFO; rprintf(code, "%s is uptodate\n", fname); } -@@ -684,7 +684,7 @@ static int try_dests_reg(struct file_str +@@ -694,7 +694,7 @@ static int try_dests_reg(struct file_str if (maybe_ATTRS_REPORT && ((!itemizing && verbose && match_level == 2) || (verbose > 1 && match_level == 3))) { @@ -145,7 +145,7 @@ are doing, similar to how a daemon logs its actions. ? FCLIENT : FINFO; rprintf(code, "%s%s\n", fname, match_level == 3 ? " is uptodate" : ""); -@@ -758,7 +758,7 @@ static int try_dests_non(struct file_str +@@ -770,7 +770,7 @@ static int try_dests_non(struct file_str itemize(file, ndx, 0, &st, changes, 0, lp); } if (verbose > 1 && maybe_ATTRS_REPORT) { @@ -154,7 +154,7 @@ are doing, similar to how a daemon logs its actions. ? FCLIENT : FINFO; rprintf(code, "%s is uptodate\n", fname); } -@@ -1327,9 +1327,9 @@ void generate_files(int f_out, struct fi +@@ -1339,9 +1339,9 @@ void generate_files(int f_out, struct fi if (protocol_version >= 29) { itemizing = 1; maybe_ATTRS_REPORT = log_format_has_i ? 0 : ATTRS_REPORT; @@ -168,7 +168,7 @@ are doing, similar to how a daemon logs its actions. } else if (!am_server) { --- old/log.c +++ new/log.c -@@ -44,18 +44,19 @@ extern int protocol_version; +@@ -39,18 +39,19 @@ extern int protocol_version; extern int preserve_times; extern int log_format_has_i; extern int log_format_has_o_or_i; @@ -191,7 +191,7 @@ are doing, similar to how a daemon logs its actions. struct stats stats; int log_got_error = 0; -@@ -109,10 +110,10 @@ static void logit(int priority, char *bu +@@ -104,10 +105,10 @@ static void logit(int priority, char *bu { if (logfile_was_closed) logfile_reopen(); @@ -205,7 +205,7 @@ are doing, similar to how a daemon logs its actions. } else { syslog(priority, "%s", buf); } -@@ -145,14 +146,14 @@ static void syslog_init() +@@ -140,14 +141,14 @@ static void syslog_init() static void logfile_open(void) { mode_t old_umask = umask(022 | orig_umask); @@ -223,9 +223,9 @@ are doing, similar to how a daemon logs its actions. rprintf(FINFO, "Ignoring \"log file\" setting.\n"); } } -@@ -171,9 +172,11 @@ void log_init(void) - t = time(NULL); - localtime(&t); +@@ -163,9 +164,11 @@ void log_init(void) + * before the chroot. */ + timestring(time(NULL)); - /* optionally use a log file instead of syslog */ - logfname = lp_log_file(); @@ -238,7 +238,7 @@ are doing, similar to how a daemon logs its actions. logfile_open(); else syslog_init(); -@@ -181,10 +184,10 @@ void log_init(void) +@@ -173,10 +176,10 @@ void log_init(void) void logfile_close(void) { @@ -252,7 +252,7 @@ are doing, similar to how a daemon logs its actions. } } -@@ -243,9 +246,9 @@ void rwrite(enum logcode code, char *buf +@@ -235,9 +238,9 @@ void rwrite(enum logcode code, char *buf if (code == FCLIENT) code = FINFO; @@ -264,7 +264,7 @@ are doing, similar to how a daemon logs its actions. int priority = code == FERROR ? LOG_WARNING : LOG_INFO; if (in_block) -@@ -254,10 +257,11 @@ void rwrite(enum logcode code, char *buf +@@ -246,10 +249,11 @@ void rwrite(enum logcode code, char *buf if (!log_initialised) log_init(); strlcpy(msg, buf, MIN((int)sizeof msg, len + 1)); @@ -278,7 +278,7 @@ are doing, similar to how a daemon logs its actions. return; } else if (code == FLOG) return; -@@ -403,26 +407,14 @@ void rflush(enum logcode code) +@@ -395,26 +399,14 @@ void rflush(enum logcode code) { FILE *f = NULL; @@ -309,7 +309,7 @@ are doing, similar to how a daemon logs its actions. fflush(f); } -@@ -695,12 +687,12 @@ void log_item(struct file_struct *file, +@@ -687,12 +679,12 @@ void log_item(struct file_struct *file, { char *s_or_r = am_sender ? "send" : "recv"; @@ -326,7 +326,7 @@ are doing, similar to how a daemon logs its actions. } } -@@ -712,7 +704,7 @@ void maybe_log_item(struct file_struct * +@@ -704,7 +696,7 @@ void maybe_log_item(struct file_struct * || log_format_has_i > 1 || (verbose > 1 && log_format_has_i)); int local_change = iflags & ITEM_LOCAL_CHANGE && significant_flags; if (am_server) { @@ -335,7 +335,7 @@ are doing, similar to how a daemon logs its actions. log_item(file, &stats, iflags, buf); } else if (see_item || local_change || *buf || (S_ISDIR(file->mode) && significant_flags)) -@@ -740,10 +732,10 @@ void log_delete(char *fname, int mode) +@@ -732,10 +724,10 @@ void log_delete(char *fname, int mode) ITEM_DELETED, NULL); } @@ -350,7 +350,7 @@ are doing, similar to how a daemon logs its actions. --- old/main.c +++ new/main.c -@@ -168,7 +168,6 @@ static void handle_stats(int f) +@@ -176,7 +176,6 @@ static void handle_stats(int f) return; if (am_daemon) { @@ -360,7 +360,7 @@ are doing, similar to how a daemon logs its actions. } --- old/options.c +++ new/options.c -@@ -146,6 +146,8 @@ char *basis_dir[MAX_BASIS_DIRS+1]; +@@ -148,6 +148,8 @@ char *basis_dir[MAX_BASIS_DIRS+1]; char *config_file = NULL; char *shell_cmd = NULL; char *log_format = NULL; @@ -369,7 +369,7 @@ are doing, similar to how a daemon logs its actions. char *password_file = NULL; char *rsync_path = RSYNC_PATH; char *backup_dir = NULL; -@@ -162,7 +164,9 @@ int verbose = 0; +@@ -164,7 +166,9 @@ int verbose = 0; int quiet = 0; int log_before_transfer = 0; int log_format_has_i = 0; @@ -379,7 +379,7 @@ are doing, similar to how a daemon logs its actions. int always_checksum = 0; int list_only = 0; -@@ -359,6 +363,7 @@ void usage(enum logcode F) +@@ -361,6 +365,7 @@ void usage(enum logcode F) rprintf(F," --progress show progress during transfer\n"); rprintf(F," -P same as --partial --progress\n"); rprintf(F," -i, --itemize-changes output a change-summary for all updates\n"); @@ -387,7 +387,7 @@ are doing, similar to how a daemon logs its actions. rprintf(F," --log-format=FORMAT output filenames using the specified format\n"); rprintf(F," --password-file=FILE read password from FILE\n"); rprintf(F," --list-only list the files instead of copying them\n"); -@@ -492,6 +497,7 @@ static struct poptOption long_options[] +@@ -494,6 +499,7 @@ static struct poptOption long_options[] {"partial-dir", 0, POPT_ARG_STRING, &partial_dir, 0, 0, 0 }, {"delay-updates", 0, POPT_ARG_NONE, &delay_updates, 0, 0, 0 }, {"prune-empty-dirs",'m', POPT_ARG_NONE, &prune_empty_dirs, 0, 0, 0 }, @@ -395,7 +395,7 @@ are doing, similar to how a daemon logs its actions. {"log-format", 0, POPT_ARG_STRING, &log_format, 0, 0, 0 }, {"itemize-changes", 'i', POPT_ARG_NONE, 0, 'i', 0, 0 }, {"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 }, -@@ -1311,6 +1317,21 @@ int parse_arguments(int *argc, const cha +@@ -1306,6 +1312,21 @@ int parse_arguments(int *argc, const cha if (log_format_has_i || log_format_has(log_format, 'o')) log_format_has_o_or_i = 1; @@ -419,7 +419,7 @@ are doing, similar to how a daemon logs its actions. if (bwlimit) { --- old/progress.c +++ new/progress.c -@@ -103,7 +103,7 @@ static void rprint_progress(OFF_T ofs, O +@@ -105,7 +105,7 @@ static void rprint_progress(OFF_T ofs, O stats.num_files); } else strcpy(eol, "\r"); @@ -430,7 +430,7 @@ are doing, similar to how a daemon logs its actions. } --- old/receiver.c +++ new/receiver.c -@@ -27,7 +27,7 @@ extern int am_server; +@@ -29,7 +29,7 @@ extern int am_server; extern int do_progress; extern int log_before_transfer; extern int log_format_has_i; @@ -439,7 +439,7 @@ are doing, similar to how a daemon logs its actions. extern int csum_length; extern int read_batch; extern int write_batch; -@@ -341,8 +341,7 @@ int recv_files(int f_in, struct file_lis +@@ -343,8 +343,7 @@ int recv_files(int f_in, struct file_lis struct file_struct *file; struct stats initial_stats; int save_make_backups = make_backups; @@ -492,7 +492,7 @@ are doing, similar to how a daemon logs its actions. --log-format=FORMAT output filenames using the specified format --password-file=FILE read password from FILE --list-only list the files instead of copying them -@@ -1430,6 +1431,23 @@ the string "*deleting" for each item tha +@@ -1432,6 +1433,23 @@ the string "*deleting" for each item tha you are talking to a recent enough rsync that it logs deletions instead of outputting them as a verbose message). @@ -518,7 +518,7 @@ are doing, similar to how a daemon logs its actions. string containing embedded single-character escape sequences prefixed with --- old/sender.c +++ new/sender.c -@@ -25,7 +25,7 @@ extern int am_server; +@@ -28,7 +28,7 @@ extern int am_server; extern int am_daemon; extern int log_before_transfer; extern int log_format_has_i; @@ -527,7 +527,7 @@ are doing, similar to how a daemon logs its actions. extern int csum_length; extern int append_mode; extern int io_error; -@@ -215,8 +215,7 @@ void send_files(struct file_list *flist, +@@ -218,8 +218,7 @@ void send_files(struct file_list *flist, int phase = 0, max_phase = protocol_version >= 29 ? 2 : 1; struct stats initial_stats; int save_make_backups = make_backups;