From 963ca80882dea2131e78563fa59e3e0e7c70c195 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 11 Oct 2008 11:50:29 -0700 Subject: [PATCH] The patches for 3.0.5pre1. --- atimes.diff | 8 ++++---- backup-dir-dels.diff | 4 ++-- checksum-reading.diff | 6 +++--- checksum-updating.diff | 10 +++++----- copy-devices.diff | 8 ++++---- date-only.diff | 2 +- db.diff | 4 ++-- detect-renamed-lax.diff | 2 +- detect-renamed.diff | 8 ++++---- dparam.diff | 2 +- drop-cache.diff | 2 +- fileflags.diff | 18 +++++++++--------- fsync.diff | 4 ++-- ignore-case.diff | 2 +- link-by-hash.diff | 20 ++++++++++---------- log-checksum.diff | 6 +++--- munge-links.diff | 8 ++++---- nameconverter.diff | 10 +++++----- omit-dir-changes.diff | 2 +- openssl-support.diff | 14 +++++++------- preallocate.diff | 6 +++--- remote-option.diff | 14 +------------- slp.diff | 2 +- source-backup.diff | 2 +- source-filter_dest-filter.diff | 10 +++++----- sparse-block.diff | 2 +- time-limit.diff | 4 ++-- transliterate.diff | 2 +- usermap.diff | 2 +- 29 files changed, 86 insertions(+), 98 deletions(-) diff --git a/atimes.diff b/atimes.diff index b5a2aa8..fa03b3c 100644 --- a/atimes.diff +++ b/atimes.diff @@ -272,7 +272,7 @@ diff --git a/options.c b/options.c diff --git a/rsync.c b/rsync.c --- a/rsync.c +++ b/rsync.c -@@ -380,6 +380,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -383,6 +383,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; @@ -280,7 +280,7 @@ diff --git a/rsync.c b/rsync.c mode_t new_mode = file->mode; int inherit; -@@ -423,20 +424,38 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -426,20 +427,38 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, set_xattr(fname, file, fnamecmp, sxp); #endif @@ -323,7 +323,7 @@ diff --git a/rsync.c b/rsync.c } change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file); -@@ -570,7 +589,7 @@ int finish_transfer(const char *fname, const char *fnametmp, +@@ -573,7 +592,7 @@ int finish_transfer(const char *fname, const char *fnametmp, /* Change permissions before putting the file into place. */ set_file_attrs(fnametmp, file, NULL, fnamecmp, @@ -332,7 +332,7 @@ diff --git a/rsync.c b/rsync.c /* move tmp file over real file */ if (verbose > 2) -@@ -597,7 +616,7 @@ int finish_transfer(const char *fname, const char *fnametmp, +@@ -600,7 +619,7 @@ int finish_transfer(const char *fname, const char *fnametmp, do_set_file_attrs: set_file_attrs(fnametmp, file, NULL, fnamecmp, diff --git a/backup-dir-dels.diff b/backup-dir-dels.diff index 5dec308..5dcb76e 100644 --- a/backup-dir-dels.diff +++ b/backup-dir-dels.diff @@ -277,7 +277,7 @@ diff --git a/options.c b/options.c if (make_backups && !backup_dir) { omit_dir_times = 0; /* Implied, so avoid -O to sender. */ -@@ -1915,6 +1977,10 @@ void server_options(char **args, int *argc_p) +@@ -1916,6 +1978,10 @@ void server_options(char **args, int *argc_p) args[ac++] = "--backup-dir"; args[ac++] = backup_dir; } @@ -288,7 +288,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) { -@@ -1923,7 +1989,14 @@ void server_options(char **args, int *argc_p) +@@ -1924,7 +1990,14 @@ void server_options(char **args, int *argc_p) goto oom; args[ac++] = arg; } diff --git a/checksum-reading.diff b/checksum-reading.diff index 0b0492f..83c5d04 100644 --- a/checksum-reading.diff +++ b/checksum-reading.diff @@ -40,7 +40,7 @@ diff --git a/clientserver.c b/clientserver.c extern int io_timeout; extern int no_detach; extern int write_batch; -@@ -780,6 +782,9 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) +@@ -778,6 +780,9 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) } else if (am_root < 0) /* Treat --fake-super from client as --super. */ am_root = 2; @@ -541,7 +541,7 @@ diff --git a/generator.c b/generator.c diff --git a/hlink.c b/hlink.c --- a/hlink.c +++ b/hlink.c -@@ -386,7 +386,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname, +@@ -390,7 +390,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname, } break; } @@ -698,7 +698,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) -@@ -870,6 +874,13 @@ typedef struct { +@@ -879,6 +883,13 @@ typedef struct { char fname[1]; /* has variable size */ } relnamecache; diff --git a/checksum-updating.diff b/checksum-updating.diff index 567cac3..d8f98fc 100644 --- a/checksum-updating.diff +++ b/checksum-updating.diff @@ -498,7 +498,7 @@ diff --git a/generator.c b/generator.c } for (i = cur_flist->low; i <= cur_flist->high; i++) { struct file_struct *file = cur_flist->sorted[i]; -@@ -2332,6 +2338,9 @@ void generate_files(int f_out, const char *local_name) +@@ -2335,6 +2341,9 @@ void generate_files(int f_out, const char *local_name) wait_for_receiver(); } @@ -519,7 +519,7 @@ diff --git a/io.c b/io.c extern int protocol_version; extern int remove_source_files; extern int preserve_hard_links; -@@ -203,6 +204,9 @@ static void got_flist_entry_status(enum festatus status, const char *buf) +@@ -161,6 +162,9 @@ static void got_flist_entry_status(enum festatus status, const char *buf) flist_ndx_push(&hlink_list, ndx); flist->in_progress++; } @@ -574,7 +574,7 @@ diff --git a/receiver.c b/receiver.c extern int inplace; extern int delay_updates; extern mode_t orig_umask; -@@ -339,7 +340,7 @@ static void handle_delayed_updates(char *local_name) +@@ -340,7 +341,7 @@ static void handle_delayed_updates(char *local_name) "rename failed for %s (from %s)", full_fname(fname), partialptr); } else { @@ -583,7 +583,7 @@ diff --git a/receiver.c b/receiver.c || (preserve_hard_links && F_IS_HLINKED(file))) send_msg_int(MSG_SUCCESS, ndx); handle_partial_dir(partialptr, PDIR_DELETE); -@@ -723,7 +724,7 @@ int recv_files(int f_in, char *local_name) +@@ -755,7 +756,7 @@ int recv_files(int f_in, char *local_name) case 2: break; case 1: @@ -595,7 +595,7 @@ diff --git a/receiver.c b/receiver.c diff --git a/rsync.h b/rsync.h --- a/rsync.h +++ b/rsync.h -@@ -876,6 +876,8 @@ typedef struct { +@@ -885,6 +885,8 @@ typedef struct { #define CSF_ENABLE (1<<1) #define CSF_LAX (1<<2) diff --git a/copy-devices.diff b/copy-devices.diff index 7be9f6c..67b6168 100644 --- a/copy-devices.diff +++ b/copy-devices.diff @@ -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 }, -@@ -2061,6 +2064,9 @@ void server_options(char **args, int *argc_p) +@@ -2062,6 +2065,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; -@@ -326,7 +327,8 @@ int read_ndx_and_attrs(int f_in, int *iflag_ptr, uchar *type_ptr, +@@ -329,7 +330,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; @@ -93,8 +93,8 @@ diff --git a/sender.c b/sender.c exit_cleanup(RERR_PROTOCOL); } -+ /* On Matt's computer, st_size is falsely 0 for most devices. -+ * If this happens, try harder to determine the actual device size. */ ++ /* On Linux systems (at least), st_size is typically 0 for devices. ++ * If so, try to determine the actual device size. */ + if (IS_DEVICE(st.st_mode) && st.st_size == 0) { + OFF_T off = lseek(fd, 0, SEEK_END); + if (off == (OFF_T) -1) diff --git a/date-only.diff b/date-only.diff index 4821eef..3b126ba 100644 --- a/date-only.diff +++ b/date-only.diff @@ -62,7 +62,7 @@ diff --git a/options.c b/options.c {"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 }, {"no-one-file-system",'x',POPT_ARG_VAL, &one_file_system, 0, 0, 0 }, {"no-x", 'x', POPT_ARG_VAL, &one_file_system, 0, 0, 0 }, -@@ -1967,6 +1970,9 @@ void server_options(char **args, int *argc_p) +@@ -1968,6 +1971,9 @@ void server_options(char **args, int *argc_p) } } diff --git a/db.diff b/db.diff index cad9a8a..9850b64 100644 --- a/db.diff +++ b/db.diff @@ -123,7 +123,7 @@ diff --git a/clientserver.c b/clientserver.c extern char *bind_address; extern char *sockopts; extern char *config_file; -@@ -552,6 +555,9 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) +@@ -564,6 +567,9 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) log_init(1); @@ -133,7 +133,7 @@ diff --git a/clientserver.c b/clientserver.c #ifdef HAVE_PUTENV if (*lp_prexfer_exec(i) || *lp_postxfer_exec(i)) { char *modname, *modpath, *hostaddr, *hostname, *username; -@@ -768,6 +774,10 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) +@@ -766,6 +772,10 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) am_server = 1; /* Don't let someone try to be tricky. */ quiet = 0; diff --git a/detect-renamed-lax.diff b/detect-renamed-lax.diff index 6d621ca..be4b35a 100644 --- a/detect-renamed-lax.diff +++ b/detect-renamed-lax.diff @@ -79,7 +79,7 @@ diff --git a/options.c b/options.c {"fuzzy", 'y', POPT_ARG_VAL, &fuzzy_basis, 1, 0, 0 }, {"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 }, {"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 }, -@@ -1963,8 +1967,14 @@ void server_options(char **args, int *argc_p) +@@ -1964,8 +1968,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 a58066d..38ed46b 100644 --- a/detect-renamed.diff +++ b/detect-renamed.diff @@ -529,8 +529,8 @@ diff --git a/generator.c b/generator.c } else change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp)); } -@@ -2283,7 +2447,21 @@ void generate_files(int f_out, const char *local_name) - } while ((cur_flist = cur_flist->next) != NULL); +@@ -2286,7 +2450,21 @@ void generate_files(int f_out, const char *local_name) + write_ndx(f_out, NDX_DONE); if (delete_during) - delete_in_dir(NULL, NULL, &dev_zero); @@ -596,7 +596,7 @@ diff --git a/options.c b/options.c delay_updates ? "delay-updates" : "partial-dir"); return 0; } -@@ -1959,6 +1963,8 @@ void server_options(char **args, int *argc_p) +@@ -1960,6 +1964,8 @@ void server_options(char **args, int *argc_p) args[ac++] = "--super"; if (size_only) args[ac++] = "--size-only"; @@ -641,7 +641,7 @@ diff --git a/rsync.yo b/rsync.yo diff --git a/util.c b/util.c --- a/util.c +++ b/util.c -@@ -1129,6 +1129,32 @@ int handle_partial_dir(const char *fname, int create) +@@ -1157,6 +1157,32 @@ int handle_partial_dir(const char *fname, int create) return 1; } diff --git a/dparam.diff b/dparam.diff index 0185146..07ad97d 100644 --- a/dparam.diff +++ b/dparam.diff @@ -10,7 +10,7 @@ To use this patch, run these commands for a successful build: diff --git a/clientserver.c b/clientserver.c --- a/clientserver.c +++ b/clientserver.c -@@ -1043,6 +1043,7 @@ int daemon_main(void) +@@ -1041,6 +1041,7 @@ int daemon_main(void) fprintf(stderr, "Failed to parse config file: %s\n", config_file); exit_cleanup(RERR_SYNTAX); } diff --git a/drop-cache.diff b/drop-cache.diff index 8cdebe8..82d01ff 100644 --- a/drop-cache.diff +++ b/drop-cache.diff @@ -182,7 +182,7 @@ diff --git a/options.c b/options.c diff --git a/receiver.c b/receiver.c --- a/receiver.c +++ b/receiver.c -@@ -62,6 +62,10 @@ static int phase = 0, redoing = 0; +@@ -63,6 +63,10 @@ static flist_ndx_list batch_redo_list; /* We're either updating the basis file or an identical copy: */ static int updating_basis_or_equiv; diff --git a/fileflags.diff b/fileflags.diff index ecc2669..6ba3e57 100644 --- a/fileflags.diff +++ b/fileflags.diff @@ -416,7 +416,7 @@ diff --git a/options.c b/options.c {"ignore-errors", 0, POPT_ARG_VAL, &ignore_errors, 1, 0, 0 }, {"no-ignore-errors", 0, POPT_ARG_VAL, &ignore_errors, 0, 0, 0 }, {"max-delete", 0, POPT_ARG_INT, &max_delete, 0, 0, 0 }, -@@ -1866,6 +1892,9 @@ void server_options(char **args, int *argc_p) +@@ -1867,6 +1893,9 @@ void server_options(char **args, int *argc_p) if (xfer_dirs && !recurse && delete_mode && am_sender) args[ac++] = "--no-r"; @@ -426,7 +426,7 @@ diff --git a/options.c b/options.c if (do_compression && def_compress_level != Z_DEFAULT_COMPRESSION) { if (asprintf(&arg, "--compress-level=%d", def_compress_level) < 0) goto oom; -@@ -1953,6 +1982,16 @@ void server_options(char **args, int *argc_p) +@@ -1954,6 +1983,16 @@ void server_options(char **args, int *argc_p) args[ac++] = "--delete-excluded"; if (force_delete) args[ac++] = "--force"; @@ -454,7 +454,7 @@ diff --git a/rsync.c b/rsync.c extern int preserve_executability; extern int preserve_times; extern int am_root; -@@ -374,6 +375,39 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms, +@@ -377,6 +378,39 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms, return new_mode; } @@ -494,7 +494,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) { -@@ -427,7 +461,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -430,7 +464,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, flags |= ATTRS_SKIP_MTIME; if (!(flags & ATTRS_SKIP_MTIME) && cmp_time(sxp->st.st_mtime, file->modtime) != 0) { @@ -503,7 +503,7 @@ diff --git a/rsync.c b/rsync.c if (ret < 0) { rsyserr(FERROR_XFER, errno, "failed to set times on %s", full_fname(fname)); -@@ -463,7 +497,8 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -466,7 +500,8 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, if (am_root >= 0) { if (do_lchown(fname, change_uid ? (uid_t)F_OWNER(file) : sxp->st.st_uid, @@ -513,7 +513,7 @@ diff --git a/rsync.c b/rsync.c /* We shouldn't have attempted to change uid * or gid unless have the privilege. */ rsyserr(FERROR_XFER, errno, "%s %s failed", -@@ -495,7 +530,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -498,7 +533,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, #ifdef HAVE_CHMOD if (!BITS_EQUAL(sxp->st.st_mode, new_mode, CHMOD_BITS)) { @@ -522,7 +522,7 @@ diff --git a/rsync.c b/rsync.c if (ret < 0) { rsyserr(FERROR_XFER, errno, "failed to set permissions on %s", -@@ -507,6 +542,19 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -510,6 +545,19 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, } #endif @@ -542,7 +542,7 @@ diff --git a/rsync.c b/rsync.c if (verbose > 1 && flags & ATTRS_REPORT) { if (updated) rprintf(FCLIENT, "%s\n", fname); -@@ -570,7 +618,8 @@ int finish_transfer(const char *fname, const char *fnametmp, +@@ -573,7 +621,8 @@ int finish_transfer(const char *fname, const char *fnametmp, /* Change permissions before putting the file into place. */ set_file_attrs(fnametmp, file, NULL, fnamecmp, @@ -552,7 +552,7 @@ diff --git a/rsync.c b/rsync.c /* move tmp file over real file */ if (verbose > 2) -@@ -589,6 +638,10 @@ int finish_transfer(const char *fname, const char *fnametmp, +@@ -592,6 +641,10 @@ int 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 a52c8c5..abff7e7 100644 --- a/fsync.diff +++ b/fsync.diff @@ -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 }, -@@ -2017,6 +2020,9 @@ void server_options(char **args, int *argc_p) +@@ -2018,6 +2021,9 @@ void server_options(char **args, int *argc_p) args[ac++] = tmpdir; } @@ -55,7 +55,7 @@ diff --git a/receiver.c b/receiver.c extern int basis_dir_cnt; extern int make_backups; extern int cleanup_got_literal; -@@ -298,6 +299,12 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, +@@ -299,6 +300,12 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, exit_cleanup(RERR_FILEIO); } diff --git a/ignore-case.diff b/ignore-case.diff index 790e676..d8f7d55 100644 --- a/ignore-case.diff +++ b/ignore-case.diff @@ -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}, -@@ -1979,6 +1983,9 @@ void server_options(char **args, int *argc_p) +@@ -1980,6 +1984,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 5735941..16e80bc 100644 --- a/link-by-hash.diff +++ b/link-by-hash.diff @@ -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. */ -@@ -2036,6 +2054,11 @@ void server_options(char **args, int *argc_p) +@@ -2037,6 +2055,11 @@ void server_options(char **args, int *argc_p) } else if (inplace) args[ac++] = "--inplace"; @@ -458,7 +458,7 @@ diff --git a/options.c b/options.c diff --git a/receiver.c b/receiver.c --- a/receiver.c +++ b/receiver.c -@@ -162,12 +162,14 @@ int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file) +@@ -163,12 +163,14 @@ int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file) } static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, @@ -474,7 +474,7 @@ diff --git a/receiver.c b/receiver.c int32 len, sum_len; OFF_T offset = 0; OFF_T offset2; -@@ -187,6 +189,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, +@@ -188,6 +190,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, } else mapbuf = NULL; @@ -484,7 +484,7 @@ diff --git a/receiver.c b/receiver.c sum_init(checksum_seed); if (append_mode > 0) { -@@ -231,6 +236,8 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, +@@ -232,6 +237,8 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, cleanup_got_literal = 1; sum_update(data, i); @@ -493,7 +493,7 @@ diff --git a/receiver.c b/receiver.c if (fd != -1 && write_file(fd,data,i) != i) goto report_write_error; -@@ -257,6 +264,8 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, +@@ -258,6 +265,8 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, see_token(map, len); sum_update(map, len); @@ -502,7 +502,7 @@ diff --git a/receiver.c b/receiver.c } if (updating_basis_or_equiv) { -@@ -299,6 +308,8 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, +@@ -300,6 +309,8 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, } sum_len = sum_end(file_sum1); @@ -511,7 +511,7 @@ diff --git a/receiver.c b/receiver.c if (mapbuf) unmap_file(mapbuf); -@@ -314,7 +325,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, +@@ -315,7 +326,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, static void discard_receive_data(int f_in, OFF_T length) { @@ -520,7 +520,7 @@ diff --git a/receiver.c b/receiver.c } static void handle_delayed_updates(char *local_name) -@@ -676,7 +687,7 @@ int recv_files(int f_in, char *local_name) +@@ -705,7 +716,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 -@@ -575,8 +576,15 @@ int finish_transfer(const char *fname, const char *fnametmp, +@@ -578,8 +579,15 @@ int 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); @@ -575,7 +575,7 @@ diff --git a/rsync.h b/rsync.h + struct chmod_mode_struct; - #define EMPTY_ITEM_LIST {NULL, 0, 0} + struct flist_ndx_item { diff --git a/rsync.yo b/rsync.yo --- a/rsync.yo +++ b/rsync.yo diff --git a/log-checksum.diff b/log-checksum.diff index bbdf55a..38475b3 100644 --- a/log-checksum.diff +++ b/log-checksum.diff @@ -72,7 +72,7 @@ diff --git a/log.c b/log.c extern int gid_ndx; @@ -57,6 +59,7 @@ extern iconv_t ic_send, ic_recv; extern char curr_dir[]; - extern char *module_dir; + extern char *full_module_path; extern unsigned int module_dirlen; +extern char sender_file_sum[MAX_DIGEST_LEN]; @@ -239,7 +239,7 @@ diff --git a/receiver.c b/receiver.c extern struct file_list *cur_flist, *first_flist, *dir_flist; extern struct filter_list_struct daemon_filter_list; -@@ -165,10 +167,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, +@@ -166,10 +168,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, const char *fname, int fd, OFF_T total_size) { static char file_sum1[MAX_DIGEST_LEN]; @@ -251,7 +251,7 @@ diff --git a/receiver.c b/receiver.c OFF_T offset = 0; OFF_T offset2; char *data; -@@ -298,15 +299,16 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, +@@ -299,15 +300,16 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, exit_cleanup(RERR_FILEIO); } diff --git a/munge-links.diff b/munge-links.diff index cbbbfda..a914531 100644 --- a/munge-links.diff +++ b/munge-links.diff @@ -27,7 +27,7 @@ diff --git a/clientserver.c b/clientserver.c struct chmod_mode_struct *daemon_chmod_modes; /* module_dirlen is the length of the module_dir string when in daemon -@@ -406,6 +406,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) +@@ -418,6 +418,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) char *name = lp_name(i); int use_chroot = lp_use_chroot(i); int ret, pre_exec_fd = -1; @@ -35,7 +35,7 @@ diff --git a/clientserver.c b/clientserver.c pid_t pre_exec_pid = 0; char *request = NULL; -@@ -689,9 +690,11 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) +@@ -687,9 +688,11 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) munge_symlinks = !use_chroot || module_dirlen; if (munge_symlinks) { STRUCT_STAT st; @@ -50,7 +50,7 @@ diff --git a/clientserver.c b/clientserver.c io_printf(f_out, "@ERROR: daemon security issue -- contact admin\n", name); exit_cleanup(RERR_UNSUPPORTED); } -@@ -747,6 +750,8 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) +@@ -745,6 +748,8 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) read_args(f_in, name, line, sizeof line, rl_nulls, &argv, &argc, &request); orig_argv = argv; @@ -59,7 +59,7 @@ diff --git a/clientserver.c b/clientserver.c verbose = 0; /* future verbosity is controlled by client options */ ret = parse_arguments(&argc, (const char ***) &argv); if (protect_args && ret) { -@@ -758,6 +763,8 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) +@@ -756,6 +761,8 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) } else orig_early_argv = NULL; diff --git a/nameconverter.diff b/nameconverter.diff index ec57c81..f385cbf 100644 --- a/nameconverter.diff +++ b/nameconverter.diff @@ -31,15 +31,15 @@ diff --git a/clientserver.c b/clientserver.c struct chmod_mode_struct *daemon_chmod_modes; /* module_dirlen is the length of the module_dir string when in daemon -@@ -76,6 +77,7 @@ char *module_dir = NULL; - unsigned int module_dirlen = 0; +@@ -78,6 +79,7 @@ unsigned int module_dirlen = 0; + char *full_module_path; static int rl_nulls = 0; +static int namecvt_fd_req = -1, namecvt_fd_ans = -1; #ifdef HAVE_SIGACTION static struct sigaction sigact; -@@ -553,7 +555,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) +@@ -565,7 +567,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) log_init(1); #ifdef HAVE_PUTENV @@ -48,7 +48,7 @@ diff --git a/clientserver.c b/clientserver.c char *modname, *modpath, *hostaddr, *hostname, *username; int status; -@@ -649,6 +651,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) +@@ -653,6 +655,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) set_blocking(fds[1]); pre_exec_fd = fds[1]; } @@ -93,7 +93,7 @@ diff --git a/clientserver.c b/clientserver.c umask(0); } #endif -@@ -878,6 +918,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) +@@ -876,6 +916,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) return 0; } diff --git a/omit-dir-changes.diff b/omit-dir-changes.diff index 6d4ce6e..de6cba9 100644 --- a/omit-dir-changes.diff +++ b/omit-dir-changes.diff @@ -106,7 +106,7 @@ diff --git a/rsync.c b/rsync.c extern int am_root; extern int am_server; extern int am_sender; -@@ -439,9 +440,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -442,9 +443,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, file->flags |= FLAG_TIME_FAILED; } diff --git a/openssl-support.diff b/openssl-support.diff index f6bf1b6..5b54288 100644 --- a/openssl-support.diff +++ b/openssl-support.diff @@ -88,7 +88,7 @@ diff --git a/clientserver.c b/clientserver.c extern int rsync_port; extern int protect_args; extern int ignore_errors; -@@ -126,8 +129,18 @@ int start_socket_client(char *host, int remote_argc, char *remote_argv[], +@@ -128,8 +131,18 @@ int start_socket_client(char *host, int remote_argc, char *remote_argv[], #endif ret = start_inband_exchange(fd, fd, user, remote_argc, remote_argv); @@ -108,7 +108,7 @@ diff --git a/clientserver.c b/clientserver.c } static int exchange_protocols(int f_in, int f_out, char *buf, size_t bufsiz, int am_client) -@@ -270,6 +283,32 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char +@@ -272,6 +285,32 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char if (verbose > 1) print_child_argv("sending daemon args:", sargs); @@ -141,7 +141,7 @@ diff --git a/clientserver.c b/clientserver.c io_printf(f_out, "%.*s\n", modlen, modname); /* Old servers may just drop the connection here, -@@ -295,6 +334,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char +@@ -297,6 +336,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char * server to terminate the listing of modules. * We don't want to go on and transfer * anything; just exit. */ @@ -152,7 +152,7 @@ diff --git a/clientserver.c b/clientserver.c exit(0); } -@@ -302,6 +345,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char +@@ -304,6 +347,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char rprintf(FERROR, "%s\n", line); /* This is always fatal; the server will now * close the socket. */ @@ -163,7 +163,7 @@ diff --git a/clientserver.c b/clientserver.c return -1; } -@@ -935,6 +982,9 @@ int start_daemon(int f_in, int f_out) +@@ -933,6 +980,9 @@ int start_daemon(int f_in, int f_out) if (exchange_protocols(f_in, f_out, line, sizeof line, 0) < 0) return -1; @@ -173,7 +173,7 @@ diff --git a/clientserver.c b/clientserver.c line[0] = 0; if (!read_line_old(f_in, line, sizeof line)) return -1; -@@ -946,6 +996,20 @@ int start_daemon(int f_in, int f_out) +@@ -944,6 +994,20 @@ int start_daemon(int f_in, int f_out) return -1; } @@ -393,7 +393,7 @@ diff --git a/options.c b/options.c if (inplace) { #ifdef HAVE_FTRUNCATE if (partial_dir) { -@@ -2085,10 +2159,27 @@ char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr) +@@ -2086,10 +2160,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 f745892..0efcec4 100644 --- a/preallocate.diff +++ b/preallocate.diff @@ -139,7 +139,7 @@ diff --git a/options.c b/options.c {"inplace", 0, POPT_ARG_VAL, &inplace, 1, 0, 0 }, {"no-inplace", 0, POPT_ARG_VAL, &inplace, 0, 0, 0 }, {"append", 0, POPT_ARG_NONE, 0, OPT_APPEND, 0, 0 }, -@@ -2061,6 +2070,9 @@ void server_options(char **args, int *argc_p) +@@ -2062,6 +2071,9 @@ void server_options(char **args, int *argc_p) else if (remove_source_files) args[ac++] = "--remove-sent-files"; @@ -160,7 +160,7 @@ diff --git a/receiver.c b/receiver.c extern int keep_partial; extern int checksum_seed; extern int inplace; -@@ -174,6 +175,18 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, +@@ -175,6 +176,18 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, char *data; int32 i; char *map = NULL; @@ -179,7 +179,7 @@ diff --git a/receiver.c b/receiver.c read_sum_head(f_in, &sum); -@@ -284,8 +297,18 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, +@@ -285,8 +298,18 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, goto report_write_error; #ifdef HAVE_FTRUNCATE diff --git a/remote-option.diff b/remote-option.diff index 35efdbf..80c9575 100644 --- a/remote-option.diff +++ b/remote-option.diff @@ -68,19 +68,7 @@ diff --git a/options.c b/options.c case OPT_WRITE_BATCH: /* batch_name is already set */ write_batch = 1; -@@ -1840,6 +1866,11 @@ void server_options(char **args, int *argc_p) - - argstr[x] = '\0'; - -+ if (x > (int)sizeof argstr) { /* Not possible... */ -+ rprintf(FERROR, "argstr overflow in server_options().\n"); -+ exit_cleanup(RERR_MALLOC); -+ } -+ - args[ac++] = argstr; - - #ifdef ICONV_OPTION -@@ -2061,6 +2092,16 @@ void server_options(char **args, int *argc_p) +@@ -2062,6 +2088,16 @@ void server_options(char **args, int *argc_p) else if (remove_source_files) args[ac++] = "--remove-sent-files"; diff --git a/slp.diff b/slp.diff index 24c001c..e4678ce 100644 --- a/slp.diff +++ b/slp.diff @@ -43,7 +43,7 @@ diff --git a/Makefile.in b/Makefile.in diff --git a/clientserver.c b/clientserver.c --- a/clientserver.c +++ b/clientserver.c -@@ -1062,6 +1062,13 @@ int daemon_main(void) +@@ -1060,6 +1060,13 @@ int daemon_main(void) * address too. In fact, why not just do inet_ntop on the * local address??? */ diff --git a/source-backup.diff b/source-backup.diff index 37b9abe..58cae93 100644 --- a/source-backup.diff +++ b/source-backup.diff @@ -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 }, -@@ -1965,6 +1968,8 @@ void server_options(char **args, int *argc_p) +@@ -1966,6 +1969,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 f8fcff2..a080ccc 100644 --- a/source-filter_dest-filter.diff +++ b/source-filter_dest-filter.diff @@ -133,7 +133,7 @@ diff --git a/options.c b/options.c if (files_from) { char *h, *p; int q; -@@ -1967,6 +1986,25 @@ void server_options(char **args, int *argc_p) +@@ -1968,6 +1987,25 @@ void server_options(char **args, int *argc_p) } } @@ -251,7 +251,7 @@ diff --git a/receiver.c b/receiver.c extern char *partial_dir; extern char *basis_dir[]; extern struct file_list *cur_flist, *first_flist, *dir_flist; -@@ -395,6 +396,8 @@ int recv_files(int f_in, char *local_name) +@@ -430,6 +431,8 @@ int recv_files(int f_in, char *local_name) const char *parent_dirname = ""; #endif int ndx, recv_ok; @@ -260,7 +260,7 @@ diff --git a/receiver.c b/receiver.c if (verbose > 2) rprintf(FINFO, "recv_files(%d) starting\n", cur_flist->used); -@@ -402,6 +405,23 @@ int recv_files(int f_in, char *local_name) +@@ -437,6 +440,23 @@ int recv_files(int f_in, char *local_name) if (delay_updates) delayed_bits = bitbag_create(cur_flist->used + 1); @@ -284,7 +284,7 @@ diff --git a/receiver.c b/receiver.c while (1) { cleanup_disable(); -@@ -674,6 +694,9 @@ int recv_files(int f_in, char *local_name) +@@ -703,6 +723,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)); -@@ -688,6 +711,16 @@ int recv_files(int f_in, char *local_name) +@@ -717,6 +740,16 @@ int recv_files(int f_in, char *local_name) exit_cleanup(RERR_FILEIO); } diff --git a/sparse-block.diff b/sparse-block.diff index 39bacb0..aa11420 100644 --- a/sparse-block.diff +++ b/sparse-block.diff @@ -65,7 +65,7 @@ diff --git a/options.c b/options.c {"inplace", 0, POPT_ARG_VAL, &inplace, 1, 0, 0 }, {"no-inplace", 0, POPT_ARG_VAL, &inplace, 0, 0, 0 }, {"append", 0, POPT_ARG_NONE, 0, OPT_APPEND, 0, 0 }, -@@ -1899,6 +1902,12 @@ void server_options(char **args, int *argc_p) +@@ -1900,6 +1903,12 @@ void server_options(char **args, int *argc_p) args[ac++] = arg; } diff --git a/time-limit.diff b/time-limit.diff index 20daa74..b29d8e7 100644 --- a/time-limit.diff +++ b/time-limit.diff @@ -20,7 +20,7 @@ diff --git a/io.c b/io.c extern struct file_list *cur_flist; #ifdef ICONV_OPTION extern int filesfrom_convert; -@@ -219,16 +220,24 @@ static void check_timeout(void) +@@ -182,16 +183,24 @@ static void check_timeout(void) { time_t t; @@ -123,7 +123,7 @@ diff --git a/options.c b/options.c default: /* A large opt value means that set_refuse_options() * turned this option off. */ -@@ -1911,6 +1946,15 @@ void server_options(char **args, int *argc_p) +@@ -1912,6 +1947,15 @@ void server_options(char **args, int *argc_p) args[ac++] = arg; } diff --git a/transliterate.diff b/transliterate.diff index 0ecfb6c..88a62f7 100644 --- a/transliterate.diff +++ b/transliterate.diff @@ -121,7 +121,7 @@ diff --git a/options.c b/options.c am_starting_up = 0; return 1; -@@ -2061,6 +2090,12 @@ void server_options(char **args, int *argc_p) +@@ -2062,6 +2091,12 @@ void server_options(char **args, int *argc_p) else if (remove_source_files) args[ac++] = "--remove-sent-files"; diff --git a/usermap.diff b/usermap.diff index 477d59f..73f1de0 100644 --- a/usermap.diff +++ b/usermap.diff @@ -136,7 +136,7 @@ diff --git a/options.c b/options.c case OPT_HELP: usage(FINFO); exit_cleanup(0); -@@ -2005,6 +2050,18 @@ void server_options(char **args, int *argc_p) +@@ -2006,6 +2051,18 @@ void server_options(char **args, int *argc_p) args[ac++] = "--use-qsort"; if (am_sender) { -- 2.34.1