From: Wayne Davison Date: Sun, 16 Dec 2007 23:13:34 +0000 (+0000) Subject: The patches for 3.0.0pre7. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/f2863bc00ee660400c314a756d19ce5455dce87d The patches for 3.0.0pre7. --- diff --git a/atimes.diff b/atimes.diff index 353a9e3..1b01c7e 100644 --- a/atimes.diff +++ b/atimes.diff @@ -47,7 +47,7 @@ diff --git a/flist.c b/flist.c extern int relative_paths; extern int implied_dirs; extern int file_extra_cnt; -@@ -344,6 +345,7 @@ int push_pathname(const char *dir, int len) +@@ -343,6 +344,7 @@ int push_pathname(const char *dir, int len) static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ndx) { static time_t modtime; @@ -69,7 +69,7 @@ diff --git a/flist.c b/flist.c #ifdef SUPPORT_HARD_LINKS if (tmp_dev != 0) { -@@ -523,6 +532,8 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ +@@ -522,6 +531,8 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ } if (!(xflags & XMIT_SAME_MODE)) write_int(f, to_wire_mode(mode)); @@ -78,7 +78,7 @@ diff --git a/flist.c b/flist.c if (uid_ndx && !(xflags & XMIT_SAME_UID)) { if (protocol_version < 30) write_int(f, uid); -@@ -609,7 +620,7 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ +@@ -608,7 +619,7 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ static struct file_struct *recv_file_entry(struct file_list *flist, int xflags, int f) { @@ -87,7 +87,7 @@ diff --git a/flist.c b/flist.c static mode_t mode; #ifdef SUPPORT_HARD_LINKS static int64 dev; -@@ -742,6 +753,16 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -741,6 +752,16 @@ static struct file_struct *recv_file_entry(struct file_list *flist, } if (!(xflags & XMIT_SAME_MODE)) mode = from_wire_mode(read_int(f)); @@ -104,7 +104,7 @@ diff --git a/flist.c b/flist.c if (chmod_modes && !S_ISLNK(mode)) mode = tweak_mode(mode, chmod_modes); -@@ -872,6 +893,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -871,6 +892,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist, F_GROUP(file) = gid; file->flags |= gid_flags; } @@ -113,7 +113,7 @@ diff --git a/flist.c b/flist.c if (unsort_ndx) F_NDX(file) = flist->used + flist->ndx_start; -@@ -1200,6 +1223,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1197,6 +1220,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, F_OWNER(file) = st.st_uid; if (gid_ndx) F_GROUP(file) = st.st_gid; @@ -204,7 +204,7 @@ diff --git a/log.c b/log.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -57,6 +57,7 @@ int preserve_specials = 0; +@@ -58,6 +58,7 @@ int preserve_specials = 0; int preserve_uid = 0; int preserve_gid = 0; int preserve_times = 0; @@ -212,7 +212,7 @@ diff --git a/options.c b/options.c int update_only = 0; int cvs_exclude = 0; int dry_run = 0; -@@ -347,6 +348,7 @@ void usage(enum logcode F) +@@ -348,6 +349,7 @@ void usage(enum logcode F) rprintf(F," -D same as --devices --specials\n"); rprintf(F," -t, --times preserve modification times\n"); rprintf(F," -O, --omit-dir-times omit directories from --times\n"); @@ -220,7 +220,7 @@ diff --git a/options.c b/options.c rprintf(F," --super receiver attempts super-user activities\n"); #ifdef SUPPORT_XATTRS rprintf(F," --fake-super store/recover privileged attrs using xattrs\n"); -@@ -482,6 +484,9 @@ static struct poptOption long_options[] = { +@@ -483,6 +485,9 @@ static struct poptOption long_options[] = { {"times", 't', POPT_ARG_VAL, &preserve_times, 2, 0, 0 }, {"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 }, {"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 }, @@ -230,7 +230,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 }, -@@ -1716,6 +1721,8 @@ void server_options(char **args, int *argc_p) +@@ -1724,6 +1729,8 @@ void server_options(char **args, int *argc_p) argstr[x++] = 'D'; if (preserve_times) argstr[x++] = 't'; @@ -250,7 +250,7 @@ diff --git a/rsync.c b/rsync.c extern int preserve_times; extern int am_root; extern int am_server; -@@ -343,6 +344,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -344,6 +345,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, int updated = 0; stat_x sx2; int change_uid, change_gid; @@ -258,7 +258,7 @@ diff --git a/rsync.c b/rsync.c mode_t new_mode = file->mode; int inherit; -@@ -386,18 +388,36 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -387,18 +389,36 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, set_xattr(fname, file, fnamecmp, sxp); #endif diff --git a/backup-dir-dels.diff b/backup-dir-dels.diff index 64c2f5e..014c325 100644 --- a/backup-dir-dels.diff +++ b/backup-dir-dels.diff @@ -147,7 +147,7 @@ diff --git a/generator.c b/generator.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -148,10 +148,14 @@ int no_detach +@@ -149,10 +149,14 @@ int no_detach int write_batch = 0; int read_batch = 0; int backup_dir_len = 0; @@ -162,7 +162,7 @@ diff --git a/options.c b/options.c char *tmpdir = NULL; char *partial_dir = NULL; char *basis_dir[MAX_BASIS_DIRS+1]; -@@ -163,7 +167,9 @@ char *stdout_format = NULL; +@@ -164,7 +168,9 @@ char *stdout_format = NULL; char *password_file = NULL; char *rsync_path = RSYNC_PATH; char *backup_dir = NULL; @@ -172,7 +172,7 @@ diff --git a/options.c b/options.c char *sockopts = NULL; int rsync_port = 0; int compare_dest = 0; -@@ -319,6 +325,8 @@ void usage(enum logcode F) +@@ -320,6 +326,8 @@ void usage(enum logcode F) rprintf(F," -b, --backup make backups (see --suffix & --backup-dir)\n"); rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n"); rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX); @@ -181,7 +181,7 @@ diff --git a/options.c b/options.c rprintf(F," -u, --update skip files that are newer on the receiver\n"); rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n"); rprintf(F," --append append data onto shorter files\n"); -@@ -590,7 +598,9 @@ static struct poptOption long_options[] = { +@@ -591,7 +599,9 @@ static struct poptOption long_options[] = { {"backup", 'b', POPT_ARG_VAL, &make_backups, 1, 0, 0 }, {"no-backup", 0, POPT_ARG_VAL, &make_backups, 0, 0, 0 }, {"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 }, @@ -191,7 +191,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 }, -@@ -1402,6 +1412,8 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1404,6 +1414,8 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) tmpdir = sanitize_path(NULL, tmpdir, NULL, 0); if (backup_dir) backup_dir = sanitize_path(NULL, backup_dir, NULL, 0); @@ -200,8 +200,8 @@ diff --git a/options.c b/options.c } if (server_filter_list.head && !am_sender) { struct filter_list_struct *elp = &server_filter_list; -@@ -1419,6 +1431,14 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) - if (check_filter(elp, backup_dir, 1) < 0) +@@ -1425,6 +1437,14 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) + if (check_filter(elp, dir, 1) < 0) goto options_rejected; } + /* Clean backup_dir_dels same as for backup_dir */ @@ -215,7 +215,7 @@ diff --git a/options.c b/options.c } if (!backup_suffix) -@@ -1430,6 +1450,16 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1436,6 +1456,16 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) backup_suffix); return 0; } @@ -232,7 +232,7 @@ diff --git a/options.c b/options.c if (backup_dir) { backup_dir_len = strlcpy(backup_dir_buf, backup_dir, sizeof backup_dir_buf); backup_dir_remainder = sizeof backup_dir_buf - backup_dir_len; -@@ -1453,6 +1483,31 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1459,6 +1489,31 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) "P *%s", backup_suffix); parse_rule(&filter_list, backup_dir_buf, 0, 0); } @@ -264,7 +264,7 @@ diff --git a/options.c b/options.c if (make_backups && !backup_dir) { omit_dir_times = 0; /* Implied, so avoid -O to sender. */ -@@ -1844,6 +1899,10 @@ void server_options(char **args, int *argc_p) +@@ -1852,6 +1907,10 @@ void server_options(char **args, int *argc_p) args[ac++] = "--backup-dir"; args[ac++] = backup_dir; } @@ -275,7 +275,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) { -@@ -1852,7 +1911,13 @@ void server_options(char **args, int *argc_p) +@@ -1860,7 +1919,13 @@ void server_options(char **args, int *argc_p) goto oom; args[ac++] = arg; } diff --git a/catch_crash_signals.diff b/catch_crash_signals.diff index 544781e..5cfea99 100644 --- a/catch_crash_signals.diff +++ b/catch_crash_signals.diff @@ -51,7 +51,7 @@ diff --git a/log.c b/log.c diff --git a/main.c b/main.c --- a/main.c +++ b/main.c -@@ -162,8 +162,11 @@ static void wait_process_with_flush(pid_t pid, int *exit_code_ptr) +@@ -164,8 +164,11 @@ static void wait_process_with_flush(pid_t pid, int *exit_code_ptr) *exit_code_ptr = RERR_TERMINATED; else *exit_code_ptr = RERR_WAITCHILD; @@ -64,7 +64,7 @@ diff --git a/main.c b/main.c } /* This function gets called from all 3 processes. We want the client side -@@ -1341,6 +1344,14 @@ RETSIGTYPE remember_children(UNUSED(int val)) +@@ -1344,6 +1347,14 @@ RETSIGTYPE remember_children(UNUSED(int val)) break; } } @@ -79,7 +79,7 @@ diff --git a/main.c b/main.c } #endif #ifndef HAVE_SIGACTION -@@ -1399,6 +1410,12 @@ static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig)) +@@ -1402,6 +1413,12 @@ static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig)) } #endif @@ -92,7 +92,7 @@ diff --git a/main.c b/main.c int main(int argc,char *argv[]) { -@@ -1421,6 +1438,11 @@ int main(int argc,char *argv[]) +@@ -1424,6 +1441,11 @@ int main(int argc,char *argv[]) SIGACTMASK(SIGFPE, rsync_panic_handler); SIGACTMASK(SIGABRT, rsync_panic_handler); SIGACTMASK(SIGBUS, rsync_panic_handler); diff --git a/checksum-reading.diff b/checksum-reading.diff index ef5ace4..0a23786 100644 --- a/checksum-reading.diff +++ b/checksum-reading.diff @@ -19,15 +19,15 @@ To use this patch, run these commands for a successful build: diff --git a/flist.c b/flist.c --- a/flist.c +++ b/flist.c -@@ -122,6 +122,7 @@ static char empty_sum[MAX_DIGEST_LEN]; +@@ -121,6 +121,7 @@ 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; - static int high_hlink_ndx; +static struct file_list *checksum_flist = NULL; - static void clean_flist(struct file_list *flist, int strip_root); + static void flist_sort_and_clean(struct file_list *flist, int strip_root); static void output_flist(struct file_list *flist); -@@ -314,6 +315,186 @@ static void flist_done_allocating(struct file_list *flist) +@@ -313,6 +314,186 @@ static void flist_done_allocating(struct file_list *flist) flist->pool_boundary = ptr; } @@ -214,7 +214,7 @@ diff --git a/flist.c b/flist.c int push_pathname(const char *dir, int len) { if (dir == pathname) -@@ -1005,7 +1186,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1003,7 +1184,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, STRUCT_STAT *stp, int flags, int filter_level) { static char *lastdir; @@ -223,7 +223,7 @@ diff --git a/flist.c b/flist.c struct file_struct *file; char thisname[MAXPATHLEN]; char linkname[MAXPATHLEN]; -@@ -1133,9 +1314,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1130,9 +1311,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, memcpy(lastdir, thisname, len); lastdir[len] = '\0'; lastdir_len = len; @@ -241,7 +241,7 @@ diff --git a/flist.c b/flist.c basename_len = strlen(basename) + 1; /* count the '\0' */ #ifdef SUPPORT_LINKS -@@ -1211,11 +1399,21 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1208,11 +1396,21 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, } #endif @@ -266,7 +266,7 @@ diff --git a/flist.c b/flist.c /* 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) { -@@ -2079,7 +2277,11 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) +@@ -2063,7 +2261,11 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) * file-list to check if this is a 1-file xfer. */ send_extra_file_list(f, 1); } diff --git a/checksum-updating.diff b/checksum-updating.diff index e916af7..08498f2 100644 --- a/checksum-updating.diff +++ b/checksum-updating.diff @@ -58,17 +58,17 @@ diff --git a/flist.c b/flist.c int io_error; int checksum_len; dev_t filesystem_dev; /* used to implement -x */ -@@ -122,6 +127,9 @@ static char empty_sum[MAX_DIGEST_LEN]; +@@ -121,6 +126,9 @@ 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; - static int high_hlink_ndx; +static int checksum_matches = 0; +static int checksum_updates = 0; +static int regular_skipped = 0; static struct file_list *checksum_flist = NULL; - static void clean_flist(struct file_list *flist, int strip_root); -@@ -317,7 +325,8 @@ static void flist_done_allocating(struct file_list *flist) + static void flist_sort_and_clean(struct file_list *flist, int strip_root); +@@ -316,7 +324,8 @@ static void flist_done_allocating(struct file_list *flist) /* The len count is the length of the basename + 1 for the null. */ static int add_checksum(const char *dirname, const char *basename, int len, @@ -78,7 +78,7 @@ diff --git a/flist.c b/flist.c { struct file_struct *file; int alloc_len, extra_len; -@@ -328,13 +337,14 @@ static int add_checksum(const char *dirname, const char *basename, int len, +@@ -327,13 +336,14 @@ static int add_checksum(const char *dirname, const char *basename, int len, if (file_length == 0) return 0; @@ -95,7 +95,7 @@ diff --git a/flist.c b/flist.c bp = pool_alloc(checksum_flist->file_pool, alloc_len, "add_checksum"); memset(bp, 0, extra_len + FILE_STRUCT_LEN); -@@ -343,7 +353,14 @@ static int add_checksum(const char *dirname, const char *basename, int len, +@@ -342,7 +352,14 @@ static int add_checksum(const char *dirname, const char *basename, int len, bp += FILE_STRUCT_LEN; memcpy(bp, basename, len); @@ -110,7 +110,7 @@ diff --git a/flist.c b/flist.c file->mode = S_IFREG; file->modtime = mtime; file->len32 = (uint32)file_length; -@@ -354,6 +371,8 @@ static int add_checksum(const char *dirname, const char *basename, int len, +@@ -353,6 +370,8 @@ static int add_checksum(const char *dirname, const char *basename, int len, file->dirname = dirname; bp = F_SUM(file); memcpy(bp, sum, checksum_len); @@ -119,7 +119,7 @@ diff --git a/flist.c b/flist.c flist_expand(checksum_flist, 1); checksum_flist->files[checksum_flist->used++] = file; -@@ -363,17 +382,104 @@ static int add_checksum(const char *dirname, const char *basename, int len, +@@ -362,17 +381,104 @@ static int add_checksum(const char *dirname, const char *basename, int len, return 1; } @@ -225,7 +225,7 @@ diff --git a/flist.c b/flist.c if (checksum_flist) { /* Reset the pool memory and empty the file-list array. */ pool_free_old(checksum_flist->file_pool, -@@ -384,6 +490,9 @@ static void read_checksums(const char *dirname) +@@ -383,6 +489,9 @@ static void read_checksums(const char *dirname) checksum_flist->low = 0; checksum_flist->high = -1; @@ -235,7 +235,7 @@ diff --git a/flist.c b/flist.c if (!dirname) return; -@@ -402,7 +511,7 @@ static void read_checksums(const char *dirname) +@@ -401,7 +510,7 @@ static void read_checksums(const char *dirname) while (fgets(line, sizeof line, fp)) { cp = line; if (protocol_version >= 30) { @@ -244,7 +244,7 @@ diff --git a/flist.c b/flist.c if (*cp == '=') while (*++cp == '=') {} else -@@ -413,7 +522,14 @@ static void read_checksums(const char *dirname) +@@ -412,7 +521,14 @@ static void read_checksums(const char *dirname) } if (*cp == '=') { @@ -260,7 +260,7 @@ diff --git a/flist.c b/flist.c } else { for (i = 0; i < checksum_len*2; i++, cp++) { int x; -@@ -431,13 +547,14 @@ static void read_checksums(const char *dirname) +@@ -430,13 +546,14 @@ static void read_checksums(const char *dirname) else sum[i/2] = x << 4; } @@ -276,7 +276,7 @@ diff --git a/flist.c b/flist.c if (*cp == '=') while (*++cp == '=') {} else -@@ -461,16 +578,16 @@ static void read_checksums(const char *dirname) +@@ -460,16 +577,16 @@ static void read_checksums(const char *dirname) break; while (*++cp == ' ') {} @@ -297,7 +297,7 @@ diff --git a/flist.c b/flist.c if (*cp != ' ') break; while (*++cp == ' ') {} -@@ -487,8 +604,13 @@ static void read_checksums(const char *dirname) +@@ -486,8 +603,13 @@ static void read_checksums(const char *dirname) continue; strlcpy(fbuf+dlen, cp, sizeof fbuf - dlen); @@ -312,7 +312,7 @@ diff --git a/flist.c b/flist.c } fclose(fp); -@@ -1274,6 +1396,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1272,6 +1394,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++; @@ -321,7 +321,7 @@ diff --git a/flist.c b/flist.c return NULL; } -@@ -1405,13 +1529,36 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1402,13 +1526,36 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, int j; if (flist && (j = flist_find(checksum_flist, file)) >= 0) { struct file_struct *fp = checksum_flist->sorted[j]; @@ -373,7 +373,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". */ -@@ -2281,7 +2431,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) +@@ -2265,7 +2415,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) flist_eof = 1; if (checksum_updating && always_checksum && flist_eof) @@ -420,7 +420,7 @@ diff --git a/loadparm.c b/loadparm.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -111,6 +111,7 @@ size_t bwlimit_writemax = 0; +@@ -112,6 +112,7 @@ size_t bwlimit_writemax = 0; int ignore_existing = 0; int ignore_non_existing = 0; int need_messages_from_generator = 0; @@ -428,7 +428,7 @@ diff --git a/options.c b/options.c int max_delete = INT_MIN; OFF_T max_size = 0; OFF_T min_size = 0; -@@ -311,6 +312,7 @@ void usage(enum logcode F) +@@ -312,6 +313,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"); @@ -436,7 +436,7 @@ diff --git a/options.c b/options.c 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"); -@@ -559,6 +561,7 @@ static struct poptOption long_options[] = { +@@ -560,6 +562,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 }, @@ -444,7 +444,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 }, -@@ -1957,7 +1960,9 @@ void server_options(char **args, int *argc_p) +@@ -1965,7 +1968,9 @@ void server_options(char **args, int *argc_p) args[ac++] = basis_dir[i]; } } diff --git a/checksum-xattr.diff b/checksum-xattr.diff index 2cac1f5..7eb2b6a 100644 --- a/checksum-xattr.diff +++ b/checksum-xattr.diff @@ -11,7 +11,7 @@ To use this patch, run these commands for a successful build: diff --git a/flist.c b/flist.c --- a/flist.c +++ b/flist.c -@@ -1211,7 +1211,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1208,7 +1208,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, } #endif diff --git a/copy-devices.diff b/copy-devices.diff index c237aab..be1a45f 100644 --- a/copy-devices.diff +++ b/copy-devices.diff @@ -31,7 +31,7 @@ diff --git a/generator.c b/generator.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -46,6 +46,7 @@ int append_mode = 0; +@@ -47,6 +47,7 @@ int append_mode = 0; int keep_dirlinks = 0; int copy_dirlinks = 0; int copy_links = 0; @@ -39,7 +39,7 @@ diff --git a/options.c b/options.c int preserve_links = 0; int preserve_hard_links = 0; int preserve_acls = 0; -@@ -343,6 +344,7 @@ void usage(enum logcode F) +@@ -344,6 +345,7 @@ void usage(enum logcode F) rprintf(F," -o, --owner preserve owner (super-user only)\n"); rprintf(F," -g, --group preserve group\n"); rprintf(F," --devices preserve device files (super-user only)\n"); @@ -47,7 +47,7 @@ diff --git a/options.c b/options.c rprintf(F," --specials preserve special files\n"); rprintf(F," -D same as --devices --specials\n"); rprintf(F," -t, --times preserve modification times\n"); -@@ -499,6 +501,7 @@ static struct poptOption long_options[] = { +@@ -500,6 +502,7 @@ static struct poptOption long_options[] = { {"no-D", 0, POPT_ARG_NONE, 0, OPT_NO_D, 0, 0 }, {"devices", 0, POPT_ARG_VAL, &preserve_devices, 1, 0, 0 }, {"no-devices", 0, POPT_ARG_VAL, &preserve_devices, 0, 0, 0 }, @@ -55,7 +55,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 }, -@@ -1991,6 +1994,9 @@ void server_options(char **args, int *argc_p) +@@ -1999,6 +2002,9 @@ void server_options(char **args, int *argc_p) else if (remove_source_files) args[ac++] = "--remove-sent-files"; @@ -76,7 +76,7 @@ diff --git a/rsync.c b/rsync.c extern int am_root; extern int am_server; extern int am_sender; -@@ -289,7 +290,8 @@ int read_ndx_and_attrs(int f_in, int *iflag_ptr, uchar *type_ptr, +@@ -290,7 +291,8 @@ int read_ndx_and_attrs(int f_in, int *iflag_ptr, uchar *type_ptr, if (iflags & ITEM_TRANSFER) { int i = ndx - cur_flist->ndx_start; @@ -89,7 +89,7 @@ diff --git a/rsync.c b/rsync.c diff --git a/sender.c b/sender.c --- a/sender.c +++ b/sender.c -@@ -314,6 +314,20 @@ void send_files(int f_in, int f_out) +@@ -315,6 +315,20 @@ void send_files(int f_in, int f_out) exit_cleanup(RERR_PROTOCOL); } diff --git a/daemon-forward-lookup.diff b/daemon-forward-lookup.diff new file mode 100644 index 0000000..a10df18 --- /dev/null +++ b/daemon-forward-lookup.diff @@ -0,0 +1,66 @@ +This patch adds a forward lookup of any hostnames listed in the +"hosts allow" or "hosts deny" daemon config options. Based on +a patch by Paul Williamson. + +To use this patch, run these commands for a successful build: + + patch -p1 h_addr_list[i] != NULL; i++) { ++ tok = inet_ntoa(*(struct in_addr*)(hp->h_addr_list[i])); ++ if (match_address(addr, tok)) ++ return 1; ++ } ++ ++ return 0; ++} ++ + static int access_match(char *list, char *addr, char *host) + { + char *tok; +@@ -223,7 +260,7 @@ static int access_match(char *list, char *addr, char *host) + strlower(host); + + for (tok = strtok(list2, " ,\t"); tok; tok = strtok(NULL, " ,\t")) { +- if (match_hostname(host, tok) || match_address(addr, tok)) { ++ if (match_hostname(host, tok) || match_address(addr, tok) || match_hostlookup(addr, tok)) { + free(list2); + return 1; + } diff --git a/date-only.diff b/date-only.diff index 54b41aa..00eb2cb 100644 --- a/date-only.diff +++ b/date-only.diff @@ -38,7 +38,7 @@ diff --git a/generator.c b/generator.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -104,6 +104,7 @@ int keep_partial = 0; +@@ -105,6 +105,7 @@ int keep_partial = 0; int safe_symlinks = 0; int copy_unsafe_links = 0; int size_only = 0; @@ -46,7 +46,7 @@ diff --git a/options.c b/options.c int daemon_bwlimit = 0; int bwlimit = 0; int fuzzy_basis = 0; -@@ -382,6 +383,7 @@ void usage(enum logcode F) +@@ -383,6 +384,7 @@ void usage(enum logcode F) rprintf(F," --contimeout=SECONDS set daemon connection timeout in seconds\n"); rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n"); rprintf(F," --size-only skip files that match in size\n"); @@ -54,7 +54,7 @@ diff --git a/options.c b/options.c rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n"); rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n"); rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n"); -@@ -522,6 +524,7 @@ static struct poptOption long_options[] = { +@@ -523,6 +525,7 @@ static struct poptOption long_options[] = { {"chmod", 0, POPT_ARG_STRING, 0, OPT_CHMOD, 0, 0 }, {"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 }, {"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 }, @@ -62,7 +62,7 @@ diff --git a/options.c b/options.c {"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 }, {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 }, {"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 }, -@@ -1896,6 +1899,9 @@ void server_options(char **args, int *argc_p) +@@ -1904,6 +1907,9 @@ void server_options(char **args, int *argc_p) } } diff --git a/detect-renamed-lax.diff b/detect-renamed-lax.diff index c2296e8..38f029c 100644 --- a/detect-renamed-lax.diff +++ b/detect-renamed-lax.diff @@ -59,7 +59,7 @@ diff --git a/generator.c b/generator.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -387,6 +387,8 @@ void usage(enum logcode F) +@@ -388,6 +388,8 @@ void usage(enum logcode F) rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n"); rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n"); rprintf(F," --detect-renamed try to find renamed files to speed up the transfer\n"); @@ -68,7 +68,7 @@ diff --git a/options.c b/options.c rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n"); rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n"); rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n"); -@@ -565,7 +567,9 @@ static struct poptOption long_options[] = { +@@ -566,7 +568,9 @@ static struct poptOption long_options[] = { {"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 }, {"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 }, {"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 }, @@ -79,7 +79,7 @@ diff --git a/options.c b/options.c {"fuzzy", 'y', POPT_ARG_NONE, &fuzzy_basis, 0, 0, 0 }, {"compress", 'z', POPT_ARG_NONE, 0, 'z', 0, 0 }, {"no-compress", 0, POPT_ARG_VAL, &do_compression, 0, 0, 0 }, -@@ -1892,8 +1896,14 @@ void server_options(char **args, int *argc_p) +@@ -1900,8 +1904,14 @@ void server_options(char **args, int *argc_p) args[ac++] = "--super"; if (size_only) args[ac++] = "--size-only"; diff --git a/detect-renamed.diff b/detect-renamed.diff index 5a2b3e1..6a30631 100644 --- a/detect-renamed.diff +++ b/detect-renamed.diff @@ -71,7 +71,7 @@ diff --git a/flist.c b/flist.c static char empty_sum[MAX_DIGEST_LEN]; static int flist_count_offset; /* for --delete --progress */ static int dir_count = 0; -@@ -262,6 +265,45 @@ static int is_excluded(char *fname, int is_dir, int filter_level) +@@ -261,6 +264,45 @@ static int is_excluded(char *fname, int is_dir, int filter_level) return 0; } @@ -117,9 +117,9 @@ diff --git a/flist.c b/flist.c static void send_directory(int f, struct file_list *flist, char *fbuf, int len, int flags); -@@ -2183,6 +2225,25 @@ struct file_list *recv_file_list(int f) +@@ -2167,6 +2209,25 @@ struct file_list *recv_file_list(int f) - clean_flist(flist, relative_paths); + flist_sort_and_clean(flist, relative_paths); + if (detect_renamed) { + int j = flist->used; @@ -548,7 +548,7 @@ diff --git a/generator.c b/generator.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -80,6 +80,7 @@ int am_generator = 0; +@@ -81,6 +81,7 @@ int am_generator = 0; int am_starting_up = 1; int relative_paths = -1; int implied_dirs = 1; @@ -556,7 +556,7 @@ diff --git a/options.c b/options.c int numeric_ids = 0; int allow_8bit_chars = 0; int force_delete = 0; -@@ -385,6 +386,7 @@ void usage(enum logcode F) +@@ -386,6 +387,7 @@ void usage(enum logcode F) rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n"); rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n"); rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n"); @@ -564,7 +564,7 @@ diff --git a/options.c b/options.c rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n"); rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n"); rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n"); -@@ -563,6 +565,7 @@ static struct poptOption long_options[] = { +@@ -564,6 +566,7 @@ static struct poptOption long_options[] = { {"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 }, {"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 }, {"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 }, @@ -572,7 +572,7 @@ diff --git a/options.c b/options.c {"fuzzy", 'y', POPT_ARG_NONE, &fuzzy_basis, 0, 0, 0 }, {"compress", 'z', POPT_ARG_NONE, 0, 'z', 0, 0 }, {"no-compress", 0, POPT_ARG_VAL, &do_compression, 0, 0, 0 }, -@@ -1535,7 +1538,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1541,7 +1544,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) inplace = 1; } @@ -581,7 +581,7 @@ diff --git a/options.c b/options.c partial_dir = tmp_partialdir; if (inplace) { -@@ -1544,6 +1547,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1550,6 +1553,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) snprintf(err_buf, sizeof err_buf, "--%s cannot be used with --%s\n", append_mode ? "append" : "inplace", @@ -589,7 +589,7 @@ diff --git a/options.c b/options.c delay_updates ? "delay-updates" : "partial-dir"); return 0; } -@@ -1888,6 +1892,8 @@ void server_options(char **args, int *argc_p) +@@ -1896,6 +1900,8 @@ void server_options(char **args, int *argc_p) args[ac++] = "--super"; if (size_only) args[ac++] = "--size-only"; @@ -634,7 +634,7 @@ diff --git a/rsync.yo b/rsync.yo diff --git a/util.c b/util.c --- a/util.c +++ b/util.c -@@ -1019,6 +1019,32 @@ int handle_partial_dir(const char *fname, int create) +@@ -1022,6 +1022,32 @@ int handle_partial_dir(const char *fname, int create) return 1; } diff --git a/downdate.diff b/downdate.diff index 5ef63b1..652d460 100644 --- a/downdate.diff +++ b/downdate.diff @@ -51,7 +51,7 @@ diff --git a/generator.c b/generator.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -58,6 +58,7 @@ int preserve_uid = 0; +@@ -59,6 +59,7 @@ int preserve_uid = 0; int preserve_gid = 0; int preserve_times = 0; int update_only = 0; @@ -59,7 +59,7 @@ diff --git a/options.c b/options.c int cvs_exclude = 0; int dry_run = 0; int do_xfers = 1; -@@ -320,6 +321,7 @@ void usage(enum logcode F) +@@ -321,6 +322,7 @@ void usage(enum logcode F) rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n"); rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX); rprintf(F," -u, --update skip files that are newer on the receiver\n"); @@ -67,7 +67,7 @@ diff --git a/options.c b/options.c rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n"); rprintf(F," --append append data onto shorter files\n"); rprintf(F," --append-verify like --append, but with old data in file checksum\n"); -@@ -524,6 +526,7 @@ static struct poptOption long_options[] = { +@@ -525,6 +527,7 @@ static struct poptOption long_options[] = { {"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 }, {"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 }, {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 }, diff --git a/drop-cache.diff b/drop-cache.diff index d3448df..a18bd98 100644 --- a/drop-cache.diff +++ b/drop-cache.diff @@ -139,7 +139,7 @@ diff --git a/generator.c b/generator.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -58,6 +58,7 @@ int preserve_uid = 0; +@@ -59,6 +59,7 @@ int preserve_uid = 0; int preserve_gid = 0; int preserve_times = 0; int update_only = 0; @@ -147,7 +147,7 @@ diff --git a/options.c b/options.c int cvs_exclude = 0; int dry_run = 0; int do_xfers = 1; -@@ -320,6 +321,9 @@ void usage(enum logcode F) +@@ -321,6 +322,9 @@ void usage(enum logcode F) rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n"); rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX); rprintf(F," -u, --update skip files that are newer on the receiver\n"); @@ -157,7 +157,7 @@ diff --git a/options.c b/options.c rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n"); rprintf(F," --append append data onto shorter files\n"); rprintf(F," --append-verify like --append, but with old data in file checksum\n"); -@@ -524,6 +528,9 @@ static struct poptOption long_options[] = { +@@ -525,6 +529,9 @@ static struct poptOption long_options[] = { {"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 }, {"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 }, {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 }, @@ -167,7 +167,7 @@ diff --git a/options.c b/options.c {"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 }, {"ignore-non-existing",0,POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 }, {"ignore-existing", 0, POPT_ARG_NONE, &ignore_existing, 0, 0, 0 }, -@@ -1662,6 +1669,11 @@ void server_options(char **args, int *argc_p) +@@ -1670,6 +1677,11 @@ void server_options(char **args, int *argc_p) if (!am_sender) args[ac++] = "--sender"; @@ -202,7 +202,7 @@ diff --git a/rsync.yo b/rsync.yo -S, --sparse handle sparse files efficiently + --drop-cache tell OS to drop caching of file data -n, --dry-run perform a trial run with no changes made - -W, --whole-file copy files whole (without rsync algorithm) + -W, --whole-file copy files whole (w/o delta-xfer algorithm) -x, --one-file-system don't cross filesystem boundaries @@ -1023,6 +1024,10 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs" filesystem. It doesn't seem to handle seeks over null regions diff --git a/flags.diff b/flags.diff index 8ad65fc..3e3320d 100644 --- a/flags.diff +++ b/flags.diff @@ -60,7 +60,7 @@ diff --git a/flist.c b/flist.c extern int uid_ndx; extern int gid_ndx; extern int eol_nulls; -@@ -345,6 +346,9 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ +@@ -344,6 +345,9 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ { static time_t modtime; static mode_t mode; @@ -83,7 +83,7 @@ diff --git a/flist.c b/flist.c if ((preserve_devices && IS_DEVICE(mode)) || (preserve_specials && IS_SPECIAL(mode))) { -@@ -523,6 +533,10 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ +@@ -522,6 +532,10 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ } if (!(xflags & XMIT_SAME_MODE)) write_int(f, to_wire_mode(mode)); @@ -94,7 +94,7 @@ diff --git a/flist.c b/flist.c if (uid_ndx && !(xflags & XMIT_SAME_UID)) { if (protocol_version < 30) write_int(f, uid); -@@ -611,6 +625,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -610,6 +624,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist, { static int64 modtime; static mode_t mode; @@ -104,7 +104,7 @@ diff --git a/flist.c b/flist.c #ifdef SUPPORT_HARD_LINKS static int64 dev; #endif -@@ -742,9 +759,12 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -741,9 +758,12 @@ static struct file_struct *recv_file_entry(struct file_list *flist, } if (!(xflags & XMIT_SAME_MODE)) mode = from_wire_mode(read_int(f)); @@ -118,7 +118,7 @@ diff --git a/flist.c b/flist.c if (uid_ndx && !(xflags & XMIT_SAME_UID)) { if (protocol_version < 30) -@@ -866,6 +886,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -865,6 +885,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist, OPT_EXTRA(file, 0)->unum = (uint32)(file_length >> 32); } file->mode = mode; @@ -129,7 +129,7 @@ diff --git a/flist.c b/flist.c if (uid_ndx) F_OWNER(file) = uid; if (gid_ndx) { -@@ -1196,6 +1220,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1193,6 +1217,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, OPT_EXTRA(file, 0)->unum = (uint32)(st.st_size >> 32); } file->mode = st.st_mode; @@ -311,7 +311,7 @@ diff --git a/generator.c b/generator.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -51,6 +51,7 @@ int preserve_hard_links = 0; +@@ -52,6 +52,7 @@ int preserve_hard_links = 0; int preserve_acls = 0; int preserve_xattrs = 0; int preserve_perms = 0; @@ -319,7 +319,7 @@ diff --git a/options.c b/options.c int preserve_executability = 0; int preserve_devices = 0; int preserve_specials = 0; -@@ -222,6 +223,7 @@ static void print_rsync_version(enum logcode f) +@@ -223,6 +224,7 @@ static void print_rsync_version(enum logcode f) char const *links = "no "; char const *iconv = "no "; char const *ipv6 = "no "; @@ -327,7 +327,7 @@ diff --git a/options.c b/options.c STRUCT_STAT *dumstat; #if SUBPROTOCOL_VERSION != 0 -@@ -251,6 +253,9 @@ static void print_rsync_version(enum logcode f) +@@ -252,6 +254,9 @@ static void print_rsync_version(enum logcode f) #ifdef ICONV_OPTION iconv = ""; #endif @@ -337,7 +337,7 @@ diff --git a/options.c b/options.c rprintf(f, "%s version %s protocol version %d%s\n", RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol); -@@ -264,8 +269,8 @@ static void print_rsync_version(enum logcode f) +@@ -265,8 +270,8 @@ static void print_rsync_version(enum logcode f) (int)(sizeof (int64) * 8)); rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n", got_socketpair, hardlinks, links, ipv6, have_inplace); @@ -348,7 +348,7 @@ diff --git a/options.c b/options.c #ifdef MAINTAINER_MODE rprintf(f, "Panic Action: \"%s\"\n", get_panic_action()); -@@ -332,6 +337,7 @@ void usage(enum logcode F) +@@ -333,6 +338,7 @@ void usage(enum logcode F) rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n"); rprintf(F," -H, --hard-links preserve hard links\n"); rprintf(F," -p, --perms preserve permissions\n"); @@ -356,7 +356,7 @@ diff --git a/options.c b/options.c rprintf(F," -E, --executability preserve the file's executability\n"); rprintf(F," --chmod=CHMOD affect file and/or directory permissions\n"); #ifdef SUPPORT_ACLS -@@ -472,6 +478,8 @@ static struct poptOption long_options[] = { +@@ -473,6 +479,8 @@ static struct poptOption long_options[] = { {"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 }, {"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 }, {"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 }, @@ -365,7 +365,7 @@ diff --git a/options.c b/options.c {"executability", 'E', POPT_ARG_NONE, &preserve_executability, 0, 0, 0 }, {"acls", 'A', POPT_ARG_NONE, 0, 'A', 0, 0 }, {"no-acls", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 }, -@@ -1287,6 +1295,15 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1289,6 +1297,15 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) } #endif @@ -381,7 +381,7 @@ diff --git a/options.c b/options.c if (write_batch && read_batch) { snprintf(err_buf, sizeof err_buf, "--write-batch and --read-batch can not be used together\n"); -@@ -1795,6 +1812,9 @@ void server_options(char **args, int *argc_p) +@@ -1803,6 +1820,9 @@ void server_options(char **args, int *argc_p) if (xfer_dirs && !recurse && delete_mode && am_sender) args[ac++] = "--no-r"; @@ -419,7 +419,7 @@ diff --git a/rsync.c b/rsync.c static const char *default_charset(void) { # if defined HAVE_LIBCHARSET_H && defined HAVE_LOCALE_CHARSET -@@ -337,6 +348,41 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms, +@@ -338,6 +349,41 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms, return new_mode; } @@ -461,7 +461,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) { -@@ -468,6 +514,15 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -469,6 +515,15 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, } #endif @@ -477,7 +477,7 @@ diff --git a/rsync.c b/rsync.c if (verbose > 1 && flags & ATTRS_REPORT) { if (updated) rprintf(FCLIENT, "%s\n", fname); -@@ -527,6 +582,9 @@ void finish_transfer(const char *fname, const char *fnametmp, +@@ -528,6 +583,9 @@ void finish_transfer(const char *fname, const char *fnametmp, set_file_attrs(fnametmp, file, NULL, fnamecmp, ok_to_set_time ? 0 : ATTRS_SKIP_MTIME); @@ -487,7 +487,7 @@ diff --git a/rsync.c b/rsync.c /* move tmp file over real file */ if (verbose > 2) rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname); -@@ -541,6 +599,9 @@ void finish_transfer(const char *fname, const char *fnametmp, +@@ -542,6 +600,9 @@ void finish_transfer(const char *fname, const char *fnametmp, } if (ret == 0) { /* The file was moved into place (not copied), so it's done. */ diff --git a/fsync.diff b/fsync.diff index a189255..dc856d8 100644 --- a/fsync.diff +++ b/fsync.diff @@ -10,7 +10,7 @@ To use this patch, run these commands for a successful build: diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -46,6 +46,7 @@ int append_mode = 0; +@@ -47,6 +47,7 @@ int append_mode = 0; int keep_dirlinks = 0; int copy_dirlinks = 0; int copy_links = 0; @@ -18,7 +18,7 @@ diff --git a/options.c b/options.c int preserve_links = 0; int preserve_hard_links = 0; int preserve_acls = 0; -@@ -377,6 +378,7 @@ void usage(enum logcode F) +@@ -378,6 +379,7 @@ void usage(enum logcode F) rprintf(F," --partial-dir=DIR put a partially transferred file into DIR\n"); rprintf(F," --delay-updates put all updated files into place at transfer's end\n"); rprintf(F," -m, --prune-empty-dirs prune empty directory chains from the file-list\n"); @@ -26,7 +26,7 @@ diff --git a/options.c b/options.c rprintf(F," --numeric-ids don't map uid/gid values by user/group name\n"); rprintf(F," --timeout=SECONDS set I/O timeout in seconds\n"); rprintf(F," --contimeout=SECONDS set daemon connection timeout in seconds\n"); -@@ -606,6 +608,7 @@ static struct poptOption long_options[] = { +@@ -607,6 +609,7 @@ static struct poptOption long_options[] = { {"timeout", 0, POPT_ARG_INT, &io_timeout, 0, 0, 0 }, {"no-timeout", 0, POPT_ARG_VAL, &io_timeout, 0, 0, 0 }, {"contimeout", 0, POPT_ARG_INT, &connect_timeout, 0, 0, 0 }, @@ -34,7 +34,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 }, -@@ -1946,6 +1949,9 @@ void server_options(char **args, int *argc_p) +@@ -1954,6 +1957,9 @@ void server_options(char **args, int *argc_p) args[ac++] = tmpdir; } diff --git a/ignore-case.diff b/ignore-case.diff index 94f8f79..6faa4a6 100644 --- a/ignore-case.diff +++ b/ignore-case.diff @@ -55,7 +55,7 @@ diff --git a/flist.c b/flist.c extern int ignore_errors; extern int numeric_ids; extern int recurse; -@@ -2619,6 +2620,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2) +@@ -2604,6 +2605,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2) { int dif; const uchar *c1, *c2; @@ -63,7 +63,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; -@@ -2729,7 +2731,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2) +@@ -2714,7 +2716,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2) if (type1 != type2) return type1 == t_PATH ? 1 : -1; } @@ -211,7 +211,7 @@ diff --git a/lib/wildmatch.c b/lib/wildmatch.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -116,6 +116,7 @@ OFF_T max_size = 0; +@@ -117,6 +117,7 @@ OFF_T max_size = 0; OFF_T min_size = 0; int ignore_errors = 0; int modify_window = 0; @@ -219,7 +219,7 @@ diff --git a/options.c b/options.c int blocking_io = -1; int checksum_seed = 0; int inplace = 0; -@@ -402,6 +403,7 @@ void usage(enum logcode F) +@@ -403,6 +404,7 @@ void usage(enum logcode F) rprintf(F," --files-from=FILE read list of source-file names from FILE\n"); rprintf(F," -0, --from0 all *-from/filter files are delimited by 0s\n"); rprintf(F," -s, --protect-args no space-splitting; only wildcard special-chars\n"); @@ -227,7 +227,7 @@ diff --git a/options.c b/options.c rprintf(F," --address=ADDRESS bind address for outgoing socket to daemon\n"); rprintf(F," --port=PORT specify double-colon alternate port number\n"); rprintf(F," --sockopts=OPTIONS specify custom TCP options\n"); -@@ -595,6 +597,8 @@ static struct poptOption long_options[] = { +@@ -596,6 +598,8 @@ static struct poptOption long_options[] = { {"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 }, {"only-write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_ONLY_WRITE_BATCH, 0, 0 }, @@ -236,7 +236,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}, -@@ -1908,6 +1912,9 @@ void server_options(char **args, int *argc_p) +@@ -1916,6 +1920,9 @@ void server_options(char **args, int *argc_p) args[ac++] = arg; } diff --git a/link-by-hash.diff b/link-by-hash.diff index 9cc0144..7dcea6b 100644 --- a/link-by-hash.diff +++ b/link-by-hash.diff @@ -35,7 +35,7 @@ diff --git a/flist.c b/flist.c extern char curr_dir[MAXPATHLEN]; -@@ -823,7 +824,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -822,7 +823,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist, extra_len += (S_ISDIR(mode) ? 2 : 1) * EXTRA_LEN; #endif @@ -388,7 +388,7 @@ new file mode 100644 diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -155,6 +155,7 @@ char *backup_suffix = NULL; +@@ -156,6 +156,7 @@ char *backup_suffix = NULL; char *tmpdir = NULL; char *partial_dir = NULL; char *basis_dir[MAX_BASIS_DIRS+1]; @@ -396,7 +396,7 @@ diff --git a/options.c b/options.c char *config_file = NULL; char *shell_cmd = NULL; char *logfile_name = NULL; -@@ -388,6 +389,7 @@ void usage(enum logcode F) +@@ -389,6 +390,7 @@ void usage(enum logcode F) rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n"); rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n"); rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n"); @@ -404,7 +404,7 @@ diff --git a/options.c b/options.c rprintf(F," -z, --compress compress file data during the transfer\n"); rprintf(F," --compress-level=NUM explicitly set compression level\n"); rprintf(F," --skip-compress=LIST skip compressing files with a suffix in LIST\n"); -@@ -440,7 +442,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM, +@@ -441,7 +443,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, @@ -413,7 +413,7 @@ diff --git a/options.c b/options.c OPT_SERVER, OPT_REFUSED_BASE = 9000}; static struct poptOption long_options[] = { -@@ -563,6 +565,7 @@ static struct poptOption long_options[] = { +@@ -564,6 +566,7 @@ static struct poptOption long_options[] = { {"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 }, {"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 }, {"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 }, @@ -421,7 +421,7 @@ diff --git a/options.c b/options.c {"fuzzy", 'y', POPT_ARG_NONE, &fuzzy_basis, 0, 0, 0 }, {"compress", 'z', POPT_ARG_NONE, 0, 'z', 0, 0 }, {"no-compress", 0, POPT_ARG_VAL, &do_compression, 0, 0, 0 }, -@@ -1224,6 +1227,21 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1226,6 +1229,21 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) return 0; #endif @@ -443,7 +443,7 @@ diff --git a/options.c b/options.c default: /* A large opt value means that set_refuse_options() * turned this option off. */ -@@ -1966,6 +1984,11 @@ void server_options(char **args, int *argc_p) +@@ -1974,6 +1992,11 @@ void server_options(char **args, int *argc_p) } else if (inplace) args[ac++] = "--inplace"; @@ -520,7 +520,7 @@ diff --git a/receiver.c b/receiver.c } static void handle_delayed_updates(char *local_name) -@@ -673,7 +684,7 @@ int recv_files(int f_in, char *local_name) +@@ -675,7 +686,7 @@ int recv_files(int f_in, char *local_name) /* recv file data */ recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size, @@ -540,7 +540,7 @@ diff --git a/rsync.c b/rsync.c extern struct file_list *cur_flist, *first_flist, *dir_flist; extern struct chmod_mode_struct *daemon_chmod_modes; #ifdef ICONV_OPTION -@@ -530,8 +531,15 @@ void finish_transfer(const char *fname, const char *fnametmp, +@@ -531,8 +532,15 @@ void finish_transfer(const char *fname, const char *fnametmp, /* move tmp file over real file */ if (verbose > 2) rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname); @@ -561,8 +561,8 @@ diff --git a/rsync.c b/rsync.c diff --git a/rsync.h b/rsync.h --- a/rsync.h +++ b/rsync.h -@@ -817,6 +817,14 @@ struct stats { - int current_file_index; +@@ -816,6 +816,14 @@ struct stats { + int num_transferred_files; }; +struct hashfile_struct { diff --git a/log-checksum.diff b/log-checksum.diff index 530ca18..c24f568 100644 --- a/log-checksum.diff +++ b/log-checksum.diff @@ -98,7 +98,7 @@ diff --git a/match.c b/match.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -1469,7 +1469,8 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1475,7 +1475,8 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) else if (log_format_has(stdout_format, 'i')) stdout_format_has_i = itemize_changes | 1; if (!log_format_has(stdout_format, 'b') diff --git a/omit-dir-changes.diff b/omit-dir-changes.diff index 7721f3f..58ad0c3 100644 --- a/omit-dir-changes.diff +++ b/omit-dir-changes.diff @@ -53,7 +53,7 @@ diff --git a/generator.c b/generator.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -57,6 +57,7 @@ int preserve_specials = 0; +@@ -58,6 +58,7 @@ int preserve_specials = 0; int preserve_uid = 0; int preserve_gid = 0; int preserve_times = 0; @@ -61,7 +61,7 @@ diff --git a/options.c b/options.c int update_only = 0; int cvs_exclude = 0; int dry_run = 0; -@@ -347,6 +348,7 @@ void usage(enum logcode F) +@@ -348,6 +349,7 @@ void usage(enum logcode F) rprintf(F," -D same as --devices --specials\n"); rprintf(F," -t, --times preserve modification times\n"); rprintf(F," -O, --omit-dir-times omit directories from --times\n"); @@ -69,7 +69,7 @@ diff --git a/options.c b/options.c rprintf(F," --super receiver attempts super-user activities\n"); #ifdef SUPPORT_XATTRS rprintf(F," --fake-super store/recover privileged attrs using xattrs\n"); -@@ -485,6 +487,7 @@ static struct poptOption long_options[] = { +@@ -486,6 +488,7 @@ static struct poptOption long_options[] = { {"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 }, @@ -77,7 +77,7 @@ diff --git a/options.c b/options.c {"modify-window", 0, 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 }, -@@ -1454,6 +1457,8 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1460,6 +1463,8 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) parse_rule(&filter_list, backup_dir_buf, 0, 0); } @@ -86,7 +86,7 @@ diff --git a/options.c b/options.c if (make_backups && !backup_dir) { omit_dir_times = 0; /* Implied, so avoid -O to sender. */ if (preserve_times > 1) -@@ -1690,6 +1695,8 @@ void server_options(char **args, int *argc_p) +@@ -1698,6 +1703,8 @@ void server_options(char **args, int *argc_p) argstr[x++] = 'm'; if (omit_dir_times) argstr[x++] = 'O'; @@ -106,7 +106,7 @@ diff --git a/rsync.c b/rsync.c extern int am_root; extern int am_server; extern int am_sender; -@@ -400,9 +401,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -401,9 +402,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, updated = 1; } diff --git a/openssl-support.diff b/openssl-support.diff index 2953149..e6b1e13 100644 --- a/openssl-support.diff +++ b/openssl-support.diff @@ -222,7 +222,7 @@ diff --git a/configure.in b/configure.in diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -183,6 +183,14 @@ int logfile_format_has_o_or_i = 0; +@@ -184,6 +184,14 @@ int logfile_format_has_o_or_i = 0; int always_checksum = 0; int list_only = 0; @@ -237,7 +237,7 @@ diff --git a/options.c b/options.c #define MAX_BATCH_NAME_LEN 256 /* Must be less than MAXPATHLEN-13 */ char *batch_name = NULL; -@@ -222,6 +230,7 @@ static void print_rsync_version(enum logcode f) +@@ -223,6 +231,7 @@ static void print_rsync_version(enum logcode f) char const *links = "no "; char const *iconv = "no "; char const *ipv6 = "no "; @@ -245,7 +245,7 @@ diff --git a/options.c b/options.c STRUCT_STAT *dumstat; #if SUBPROTOCOL_VERSION != 0 -@@ -251,6 +260,9 @@ static void print_rsync_version(enum logcode f) +@@ -252,6 +261,9 @@ static void print_rsync_version(enum logcode f) #ifdef ICONV_OPTION iconv = ""; #endif @@ -255,7 +255,7 @@ diff --git a/options.c b/options.c rprintf(f, "%s version %s protocol version %d%s\n", RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol); -@@ -264,8 +276,8 @@ static void print_rsync_version(enum logcode f) +@@ -265,8 +277,8 @@ static void print_rsync_version(enum logcode f) (int)(sizeof (int64) * 8)); rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n", got_socketpair, hardlinks, links, ipv6, have_inplace); @@ -266,7 +266,7 @@ diff --git a/options.c b/options.c #ifdef MAINTAINER_MODE rprintf(f, "Panic Action: \"%s\"\n", get_panic_action()); -@@ -427,6 +439,13 @@ void usage(enum logcode F) +@@ -428,6 +440,13 @@ void usage(enum logcode F) #endif rprintf(F," -4, --ipv4 prefer IPv4\n"); rprintf(F," -6, --ipv6 prefer IPv6\n"); @@ -280,7 +280,7 @@ diff --git a/options.c b/options.c rprintf(F," --version print version number\n"); rprintf(F,"(-h) --help show this help (-h works with no other options)\n"); -@@ -440,7 +459,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM, +@@ -441,7 +460,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, @@ -289,7 +289,7 @@ diff --git a/options.c b/options.c OPT_SERVER, OPT_REFUSED_BASE = 9000}; static struct poptOption long_options[] = { -@@ -626,6 +645,13 @@ static struct poptOption long_options[] = { +@@ -627,6 +646,13 @@ static struct poptOption long_options[] = { {"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 }, {"server", 0, POPT_ARG_NONE, 0, OPT_SERVER, 0, 0 }, {"sender", 0, POPT_ARG_NONE, 0, OPT_SENDER, 0, 0 }, @@ -303,7 +303,7 @@ diff --git a/options.c b/options.c /* All the following options switch us into daemon-mode option-parsing. */ {"config", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 }, {"daemon", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 }, -@@ -651,6 +677,13 @@ static void daemon_usage(enum logcode F) +@@ -652,6 +678,13 @@ static void daemon_usage(enum logcode F) rprintf(F," -v, --verbose increase verbosity\n"); rprintf(F," -4, --ipv4 prefer IPv4\n"); rprintf(F," -6, --ipv6 prefer IPv6\n"); @@ -317,7 +317,7 @@ diff --git a/options.c b/options.c rprintf(F," --help show this help screen\n"); rprintf(F,"\n"); -@@ -675,6 +708,13 @@ static struct poptOption long_daemon_options[] = { +@@ -676,6 +709,13 @@ static struct poptOption long_daemon_options[] = { {"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 }, {"server", 0, POPT_ARG_NONE, &am_server, 0, 0, 0 }, {"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 }, @@ -331,7 +331,7 @@ diff --git a/options.c b/options.c {"verbose", 'v', POPT_ARG_NONE, 0, 'v', 0, 0 }, {"no-verbose", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 }, {"no-v", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 }, -@@ -949,6 +989,12 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -950,6 +990,12 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) verbose++; break; @@ -344,7 +344,7 @@ diff --git a/options.c b/options.c default: rprintf(FERROR, "rsync: %s: %s (in daemon mode)\n", -@@ -972,6 +1018,17 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -973,6 +1019,17 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) exit_cleanup(RERR_SYNTAX); } @@ -362,7 +362,7 @@ diff --git a/options.c b/options.c *argv_p = argv = poptGetArgs(pc); *argc_p = argc = count_args(argv); am_starting_up = 0; -@@ -1224,6 +1281,12 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1226,6 +1283,12 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) return 0; #endif @@ -375,7 +375,7 @@ diff --git a/options.c b/options.c default: /* A large opt value means that set_refuse_options() * turned this option off. */ -@@ -1538,6 +1601,17 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1544,6 +1607,17 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) if (delay_updates && !partial_dir) partial_dir = tmp_partialdir; @@ -393,7 +393,7 @@ diff --git a/options.c b/options.c if (inplace) { #ifdef HAVE_FTRUNCATE if (partial_dir) { -@@ -2010,10 +2084,27 @@ char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr) +@@ -2018,10 +2092,27 @@ char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr) char *p; int not_host; int hostlen; diff --git a/preallocate.diff b/preallocate.diff index 6c43dbe..f59b856 100644 --- a/preallocate.diff +++ b/preallocate.diff @@ -24,7 +24,7 @@ diff --git a/configure.in b/configure.in diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -71,6 +71,7 @@ int remove_source_files = 0; +@@ -72,6 +72,7 @@ int remove_source_files = 0; int one_file_system = 0; int protocol_version = PROTOCOL_VERSION; int sparse_files = 0; @@ -32,7 +32,7 @@ diff --git a/options.c b/options.c int do_compression = 0; int def_compress_level = Z_DEFAULT_COMPRESSION; int am_root = 0; /* 0 = normal, 1 = root, 2 = --super, -1 = --fake-super */ -@@ -222,6 +223,7 @@ static void print_rsync_version(enum logcode f) +@@ -223,6 +224,7 @@ static void print_rsync_version(enum logcode f) char const *links = "no "; char const *iconv = "no "; char const *ipv6 = "no "; @@ -40,7 +40,7 @@ diff --git a/options.c b/options.c STRUCT_STAT *dumstat; #if SUBPROTOCOL_VERSION != 0 -@@ -251,6 +253,9 @@ static void print_rsync_version(enum logcode f) +@@ -252,6 +254,9 @@ static void print_rsync_version(enum logcode f) #ifdef ICONV_OPTION iconv = ""; #endif @@ -50,7 +50,7 @@ diff --git a/options.c b/options.c rprintf(f, "%s version %s protocol version %d%s\n", RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol); -@@ -264,8 +269,8 @@ static void print_rsync_version(enum logcode f) +@@ -265,8 +270,8 @@ static void print_rsync_version(enum logcode f) (int)(sizeof (int64) * 8)); rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n", got_socketpair, hardlinks, links, ipv6, have_inplace); @@ -61,7 +61,7 @@ diff --git a/options.c b/options.c #ifdef MAINTAINER_MODE rprintf(f, "Panic Action: \"%s\"\n", get_panic_action()); -@@ -352,6 +357,9 @@ void usage(enum logcode F) +@@ -353,6 +358,9 @@ void usage(enum logcode F) rprintf(F," --fake-super store/recover privileged attrs using xattrs\n"); #endif rprintf(F," -S, --sparse handle sparse files efficiently\n"); @@ -69,9 +69,9 @@ diff --git a/options.c b/options.c + rprintf(F," --preallocate posix_fallocate dest files before writing them\n"); +#endif rprintf(F," -n, --dry-run perform a trial run with no changes made\n"); - rprintf(F," -W, --whole-file copy files whole (without rsync algorithm)\n"); + rprintf(F," -W, --whole-file copy files whole (without delta-xfer algorithm)\n"); rprintf(F," -x, --one-file-system don't cross filesystem boundaries\n"); -@@ -530,6 +538,7 @@ static struct poptOption long_options[] = { +@@ -531,6 +539,7 @@ static struct poptOption long_options[] = { {"max-size", 0, POPT_ARG_STRING, &max_size_arg, OPT_MAX_SIZE, 0, 0 }, {"min-size", 0, POPT_ARG_STRING, &min_size_arg, OPT_MIN_SIZE, 0, 0 }, {"sparse", 'S', POPT_ARG_NONE, &sparse_files, 0, 0, 0 }, @@ -79,7 +79,7 @@ diff --git a/options.c b/options.c {"inplace", 0, POPT_ARG_NONE, &inplace, 0, 0, 0 }, {"append", 0, POPT_ARG_NONE, 0, OPT_APPEND, 0, 0 }, {"append-verify", 0, POPT_ARG_VAL, &append_mode, 2, 0, 0 }, -@@ -1287,6 +1296,15 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1289,6 +1298,15 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) } #endif @@ -95,7 +95,7 @@ diff --git a/options.c b/options.c if (write_batch && read_batch) { snprintf(err_buf, sizeof err_buf, "--write-batch and --read-batch can not be used together\n"); -@@ -1991,6 +2009,9 @@ void server_options(char **args, int *argc_p) +@@ -1999,6 +2017,9 @@ void server_options(char **args, int *argc_p) else if (remove_source_files) args[ac++] = "--remove-sent-files"; @@ -180,7 +180,7 @@ diff --git a/rsync.yo b/rsync.yo -S, --sparse handle sparse files efficiently + --preallocate posix_fallocate dest files before writing -n, --dry-run perform a trial run with no changes made - -W, --whole-file copy files whole (without rsync algorithm) + -W, --whole-file copy files whole (w/o delta-xfer algorithm) -x, --one-file-system don't cross filesystem boundaries @@ -1023,6 +1024,19 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs" filesystem. It doesn't seem to handle seeks over null regions diff --git a/slow-down.diff b/slow-down.diff index 55ba0bb..49376ad 100644 --- a/slow-down.diff +++ b/slow-down.diff @@ -38,7 +38,7 @@ diff --git a/flist.c b/flist.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -107,6 +107,7 @@ int size_only = 0; +@@ -108,6 +108,7 @@ int size_only = 0; int daemon_bwlimit = 0; int bwlimit = 0; int fuzzy_basis = 0; @@ -46,7 +46,7 @@ diff --git a/options.c b/options.c size_t bwlimit_writemax = 0; int ignore_existing = 0; int ignore_non_existing = 0; -@@ -418,6 +419,7 @@ void usage(enum logcode F) +@@ -419,6 +420,7 @@ void usage(enum logcode F) rprintf(F," --password-file=FILE read daemon-access password from FILE\n"); rprintf(F," --list-only list the files instead of copying them\n"); rprintf(F," --bwlimit=KBPS limit I/O bandwidth; KBytes per second\n"); @@ -54,7 +54,7 @@ diff --git a/options.c b/options.c rprintf(F," --write-batch=FILE write a batched update to FILE\n"); rprintf(F," --only-write-batch=FILE like --write-batch but w/o updating destination\n"); rprintf(F," --read-batch=FILE read a batched update from FILE\n"); -@@ -585,6 +587,7 @@ static struct poptOption long_options[] = { +@@ -586,6 +588,7 @@ static struct poptOption long_options[] = { {"itemize-changes", 'i', POPT_ARG_NONE, 0, 'i', 0, 0 }, {"no-itemize-changes",0, POPT_ARG_VAL, &itemize_changes, 0, 0, 0 }, {"no-i", 0, POPT_ARG_VAL, &itemize_changes, 0, 0, 0 }, diff --git a/slp.diff b/slp.diff index a09ebdf..276830a 100644 --- a/slp.diff +++ b/slp.diff @@ -39,7 +39,7 @@ diff --git a/Makefile.in b/Makefile.in + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(LIBSLP) $(OBJS): $(HEADERS) - + $(CHECK_OBJS): $(HEADERS) diff --git a/clientserver.c b/clientserver.c --- a/clientserver.c +++ b/clientserver.c @@ -126,7 +126,7 @@ diff --git a/loadparm.c b/loadparm.c diff --git a/main.c b/main.c --- a/main.c +++ b/main.c -@@ -1141,6 +1141,18 @@ static int start_client(int argc, char *argv[]) +@@ -1144,6 +1144,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); @@ -148,7 +148,7 @@ diff --git a/main.c b/main.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -222,6 +222,7 @@ static void print_rsync_version(enum logcode f) +@@ -223,6 +223,7 @@ static void print_rsync_version(enum logcode f) char const *links = "no "; char const *iconv = "no "; char const *ipv6 = "no "; @@ -156,7 +156,7 @@ diff --git a/options.c b/options.c STRUCT_STAT *dumstat; #if SUBPROTOCOL_VERSION != 0 -@@ -251,6 +252,9 @@ static void print_rsync_version(enum logcode f) +@@ -252,6 +253,9 @@ static void print_rsync_version(enum logcode f) #ifdef ICONV_OPTION iconv = ""; #endif @@ -166,7 +166,7 @@ diff --git a/options.c b/options.c rprintf(f, "%s version %s protocol version %d%s\n", RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol); -@@ -264,8 +268,8 @@ static void print_rsync_version(enum logcode f) +@@ -265,8 +269,8 @@ static void print_rsync_version(enum logcode f) (int)(sizeof (int64) * 8)); rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n", got_socketpair, hardlinks, links, ipv6, have_inplace); diff --git a/source-backup.diff b/source-backup.diff index 82ab782..8dc21d5 100644 --- a/source-backup.diff +++ b/source-backup.diff @@ -12,7 +12,7 @@ To use this patch, run these commands for a successful build: diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -31,6 +31,7 @@ extern struct filter_list_struct filter_list; +@@ -32,6 +32,7 @@ extern struct filter_list_struct filter_list; extern struct filter_list_struct server_filter_list; int make_backups = 0; @@ -20,7 +20,7 @@ diff --git a/options.c b/options.c /** * If 1, send the whole file as literal data rather than trying to -@@ -361,6 +362,7 @@ void usage(enum logcode F) +@@ -362,6 +363,7 @@ void usage(enum logcode F) rprintf(F," --existing skip creating new files on receiver\n"); rprintf(F," --ignore-existing skip updating files that already exist on receiver\n"); rprintf(F," --remove-source-files sender removes synchronized files (non-dirs)\n"); @@ -28,7 +28,7 @@ diff --git a/options.c b/options.c rprintf(F," --del an alias for --delete-during\n"); rprintf(F," --delete delete extraneous files from destination dirs\n"); rprintf(F," --delete-before receiver deletes before transfer, not during\n"); -@@ -588,6 +590,7 @@ static struct poptOption long_options[] = { +@@ -589,6 +591,7 @@ static struct poptOption long_options[] = { {"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 }, {"no-bwlimit", 0, POPT_ARG_VAL, &bwlimit, 0, 0, 0 }, {"backup", 'b', POPT_ARG_VAL, &make_backups, 1, 0, 0 }, @@ -36,7 +36,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 }, -@@ -1894,6 +1897,8 @@ void server_options(char **args, int *argc_p) +@@ -1902,6 +1905,8 @@ void server_options(char **args, int *argc_p) goto oom; args[ac++] = arg; } diff --git a/source-filter_dest-filter.diff b/source-filter_dest-filter.diff index 41aed86..a395b51 100644 --- a/source-filter_dest-filter.diff +++ b/source-filter_dest-filter.diff @@ -53,7 +53,7 @@ diff --git a/generator.c b/generator.c diff --git a/main.c b/main.c --- a/main.c +++ b/main.c -@@ -135,7 +135,7 @@ pid_t wait_process(pid_t pid, int *status_ptr, int flags) +@@ -137,7 +137,7 @@ pid_t wait_process(pid_t pid, int *status_ptr, int flags) } /* Wait for a process to exit, calling io_flush while waiting. */ @@ -65,7 +65,7 @@ diff --git a/main.c b/main.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -104,6 +104,7 @@ int keep_partial = 0; +@@ -105,6 +105,7 @@ int keep_partial = 0; int safe_symlinks = 0; int copy_unsafe_links = 0; int size_only = 0; @@ -73,7 +73,7 @@ diff --git a/options.c b/options.c int daemon_bwlimit = 0; int bwlimit = 0; int fuzzy_basis = 0; -@@ -161,6 +162,8 @@ char *logfile_name = NULL; +@@ -162,6 +163,8 @@ char *logfile_name = NULL; char *logfile_format = NULL; char *stdout_format = NULL; char *password_file = NULL; @@ -82,7 +82,7 @@ diff --git a/options.c b/options.c char *rsync_path = RSYNC_PATH; char *backup_dir = NULL; char backup_dir_buf[MAXPATHLEN]; -@@ -382,6 +385,7 @@ void usage(enum logcode F) +@@ -383,6 +386,7 @@ void usage(enum logcode F) rprintf(F," --contimeout=SECONDS set daemon connection timeout in seconds\n"); rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n"); rprintf(F," --size-only skip files that match in size\n"); @@ -90,7 +90,7 @@ diff --git a/options.c b/options.c rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n"); rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n"); rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n"); -@@ -421,6 +425,8 @@ void usage(enum logcode F) +@@ -422,6 +426,8 @@ void usage(enum logcode F) rprintf(F," --write-batch=FILE write a batched update to FILE\n"); rprintf(F," --only-write-batch=FILE like --write-batch but w/o updating destination\n"); rprintf(F," --read-batch=FILE read a batched update from FILE\n"); @@ -99,7 +99,7 @@ diff --git a/options.c b/options.c rprintf(F," --protocol=NUM force an older protocol version to be used\n"); #ifdef ICONV_OPTION rprintf(F," --iconv=CONVERT_SPEC request charset conversion of filenames\n"); -@@ -522,6 +528,7 @@ static struct poptOption long_options[] = { +@@ -523,6 +529,7 @@ static struct poptOption long_options[] = { {"chmod", 0, POPT_ARG_STRING, 0, OPT_CHMOD, 0, 0 }, {"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 }, {"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 }, @@ -107,7 +107,7 @@ diff --git a/options.c b/options.c {"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 }, {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 }, {"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 }, -@@ -622,6 +629,8 @@ static struct poptOption long_options[] = { +@@ -623,6 +630,8 @@ static struct poptOption long_options[] = { {"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 }, {"blocking-io", 0, POPT_ARG_VAL, &blocking_io, 1, 0, 0 }, {"no-blocking-io", 0, POPT_ARG_VAL, &blocking_io, 0, 0, 0 }, @@ -116,7 +116,7 @@ diff --git a/options.c b/options.c {"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 }, {"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 }, {"server", 0, POPT_ARG_NONE, 0, OPT_SERVER, 0, 0 }, -@@ -1579,6 +1588,16 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1585,6 +1594,16 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) } } @@ -133,7 +133,7 @@ diff --git a/options.c b/options.c if (files_from) { char *h, *p; int q; -@@ -1896,6 +1915,25 @@ void server_options(char **args, int *argc_p) +@@ -1904,6 +1923,25 @@ void server_options(char **args, int *argc_p) } } @@ -284,7 +284,7 @@ diff --git a/receiver.c b/receiver.c while (1) { cleanup_disable(); -@@ -671,6 +691,9 @@ int recv_files(int f_in, char *local_name) +@@ -673,6 +693,9 @@ int recv_files(int f_in, char *local_name) else if (!am_server && verbose && do_progress) rprintf(FINFO, "%s\n", fname); @@ -294,7 +294,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)); -@@ -685,6 +708,16 @@ int recv_files(int f_in, char *local_name) +@@ -687,6 +710,16 @@ int recv_files(int f_in, char *local_name) exit_cleanup(RERR_FILEIO); } @@ -414,7 +414,7 @@ diff --git a/sender.c b/sender.c if (verbose > 2) rprintf(FINFO, "send_files starting\n"); -@@ -284,6 +305,7 @@ void send_files(int f_in, int f_out) +@@ -285,6 +306,7 @@ void send_files(int f_in, int f_out) exit_cleanup(RERR_PROTOCOL); } @@ -422,7 +422,7 @@ diff --git a/sender.c b/sender.c fd = do_open(fname, O_RDONLY, 0); if (fd == -1) { if (errno == ENOENT) { -@@ -305,6 +327,33 @@ void send_files(int f_in, int f_out) +@@ -306,6 +328,33 @@ void send_files(int f_in, int f_out) continue; } @@ -456,7 +456,7 @@ diff --git a/sender.c b/sender.c /* map the local file */ if (do_fstat(fd, &st) != 0) { io_error |= IOERR_GENERAL; -@@ -355,6 +404,8 @@ void send_files(int f_in, int f_out) +@@ -356,6 +405,8 @@ void send_files(int f_in, int f_out) } } close(fd); diff --git a/stdout.diff b/stdout.diff new file mode 100644 index 0000000..f3ee065 --- /dev/null +++ b/stdout.diff @@ -0,0 +1,50 @@ +This patch adds a --stdout=line|unbuf option that lets the +user change the buffering of stdout. + +To use this patch, run these commands for a successful build: + + patch -p1