./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -1837,7 +1837,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1843,7 +1843,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto notify_others;
if (read_batch || whole_file) {
if (!(backupptr = get_backup_name(fname)))
goto cleanup;
if (!(back_file = make_file(fname, NULL, NULL, 0, NO_FILTERS)))
-@@ -1873,7 +1873,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1879,7 +1879,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto notify_others;
}
- if (inplace && make_backups > 0 && fnamecmp_type == FNAMECMP_FNAME) {
+ if (inplace && make_backups > 1 && fnamecmp_type == FNAMECMP_FNAME) {
if (!(backupptr = get_backup_name(fname))) {
- close(fd);
goto cleanup;
-@@ -1997,7 +1997,7 @@ int atomic_create(struct file_struct *file, char *fname, const char *slnk, const
+ }
+@@ -1999,7 +1999,7 @@ int atomic_create(struct file_struct *file, char *fname, const char *slnk, const
skip_atomic = 0;
if (del_for_flag) {
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -770,7 +770,8 @@ static struct poptOption long_options[] = {
+@@ -772,7 +772,8 @@ static struct poptOption long_options[] = {
{"no-i", 0, POPT_ARG_VAL, &itemize_changes, 0, 0, 0 },
{"bwlimit", 0, POPT_ARG_STRING, &bwlimit_arg, OPT_BWLIMIT, 0, 0 },
{"no-bwlimit", 0, POPT_ARG_VAL, &bwlimit, 0, 0, 0 },
{"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 },
-@@ -2756,6 +2757,10 @@ void server_options(char **args, int *argc_p)
+@@ -2760,6 +2761,10 @@ void server_options(char **args, int *argc_p)
args[ac++] = safe_arg("--compress-choice", compress_choice);
if (am_sender) {
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -348,6 +348,7 @@ has its own detailed description later in this man page.
+@@ -348,6 +348,7 @@ has its own detailed description later in this manpage.
--relative, -R use relative path names
--no-implied-dirs don't send implied dirs with --relative
--backup, -b make backups (see --suffix & --backup-dir)
--backup-dir=DIR make backups into hierarchy based in DIR
--suffix=SUFFIX backup suffix (default ~ w/o --backup-dir)
--update, -u skip files that are newer on the receiver
-@@ -913,6 +914,13 @@ your home directory (remove the '=' for that).
+@@ -914,6 +915,13 @@ your home directory (remove the '=' for that).
rules specify a trailing inclusion/exclusion of `*`, the auto-added rule
would never be reached).
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -162,10 +162,14 @@ int no_detach
+@@ -163,10 +163,14 @@ int no_detach
int write_batch = 0;
int read_batch = 0;
int backup_dir_len = 0;
char *tmpdir = NULL;
char *partial_dir = NULL;
char *basis_dir[MAX_BASIS_DIRS+1];
-@@ -178,7 +182,9 @@ char *password_file = NULL;
+@@ -179,7 +183,9 @@ char *password_file = NULL;
char *early_input_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
char *sockopts = NULL;
char *usermap = NULL;
char *groupmap = NULL;
-@@ -774,7 +780,9 @@ static struct poptOption long_options[] = {
+@@ -776,7 +782,9 @@ static struct poptOption long_options[] = {
{"backup-deleted", 0, 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 },
{"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 },
-@@ -2224,6 +2232,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2228,6 +2236,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
tmpdir = sanitize_path(NULL, tmpdir, NULL, 0, SP_DEFAULT);
if (backup_dir)
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, SP_DEFAULT);
}
if (daemon_filter_list.head && !am_sender) {
filter_rule_list *elp = &daemon_filter_list;
-@@ -2245,6 +2255,14 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2249,6 +2259,14 @@ int parse_arguments(int *argc_p, const char ***argv_p)
if (check_filter(elp, FLOG, dir, 1) < 0)
goto options_rejected;
}
}
if (!backup_suffix)
-@@ -2256,6 +2274,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2260,6 +2278,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
backup_suffix);
return 0;
}
if (backup_dir) {
size_t len;
make_backups = 1; /* --backup-dir implies --backup */
-@@ -2292,6 +2324,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2296,6 +2328,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
"P *%s", backup_suffix);
parse_filter_str(&filter_list, backup_dir_buf, rule_template(0), 0);
}
if (make_backups && !backup_dir)
omit_dir_times = -1; /* Implied, so avoid -O to sender. */
-@@ -2741,11 +2801,20 @@ void server_options(char **args, int *argc_p)
+@@ -2745,11 +2805,20 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--backup-dir";
args[ac++] = safe_arg("", backup_dir);
}
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -350,7 +350,9 @@ has its own detailed description later in this man page.
+@@ -350,7 +350,9 @@ has its own detailed description later in this manpage.
--backup, -b make backups (see --suffix & --backup-dir)
--backup-deleted make backups only of deleted files
--backup-dir=DIR make backups into hierarchy based in DIR
--update, -u skip files that are newer on the receiver
--inplace update destination files in-place
--append append data onto shorter files
-@@ -935,6 +937,11 @@ your home directory (remove the '=' for that).
+@@ -936,6 +938,11 @@ your home directory (remove the '=' for that).
daemon is the receiver, the backup dir cannot go outside the module's path
hierarchy, so take extra care not to delete it or copy into it.
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/errcode.h b/errcode.h
--- a/errcode.h
+++ b/errcode.h
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
extern int checksum_type;
extern int module_id;
extern int ignore_errors;
-@@ -62,6 +64,7 @@ extern int implied_dirs;
+@@ -63,6 +65,7 @@ extern int implied_dirs;
extern int ignore_perishable;
extern int non_perishable_cnt;
extern int prune_empty_dirs;
extern int copy_links;
extern int copy_unsafe_links;
extern int protocol_version;
-@@ -73,6 +76,7 @@ extern int sender_symlink_iconv;
+@@ -74,6 +77,7 @@ extern int sender_symlink_iconv;
extern int output_needs_newline;
extern int sender_keeps_checksum;
extern int unsort_ndx;
extern uid_t our_uid;
extern struct stats stats;
extern char *filesfrom_host;
-@@ -90,6 +94,20 @@ extern int filesfrom_convert;
+@@ -91,6 +95,20 @@ extern int filesfrom_convert;
extern iconv_t ic_send, ic_recv;
#endif
#define PTR_SIZE (sizeof (struct file_struct *))
int io_error;
-@@ -134,8 +152,12 @@ static char empty_sum[MAX_DIGEST_LEN];
+@@ -135,8 +153,12 @@ static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
static int show_filelist_progress;
static void output_flist(struct file_list *flist);
void init_flist(void)
-@@ -326,6 +348,235 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -327,6 +349,235 @@ static void flist_done_allocating(struct file_list *flist)
flist->pool_boundary = ptr;
}
/* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
* F_PATHNAME(), or (2) "NULL, dir, dirlen" to chdir() to the supplied dir,
* with dir == NULL taken to be the starting directory, and dirlen < 0
-@@ -1203,7 +1454,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1216,7 +1467,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
STRUCT_STAT *stp, int flags, int filter_level)
{
static char *lastdir;
struct file_struct *file;
char thisname[MAXPATHLEN];
char linkname[MAXPATHLEN];
-@@ -1349,9 +1600,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1362,9 +1613,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(lastdir, thisname, len);
lastdir[len] = '\0';
lastdir_len = len;
basename_len = strlen(basename) + 1; /* count the '\0' */
#ifdef SUPPORT_LINKS
-@@ -1369,11 +1627,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1394,11 +1652,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
extra_len += EXTRA_LEN;
#endif
#if EXTRA_ROUNDING > 0
if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
-@@ -1462,8 +1717,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1487,8 +1742,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2680,7 +2941,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2705,7 +2966,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
/* The --relative option sends paths with a leading slash, so we need
* to specify the strip_root option here. We rejected leading slashes
* for a non-relative transfer in recv_file_entry(). */
if (protocol_version < 30) {
/* Recv the io_error flag */
-@@ -2925,7 +3186,7 @@ void flist_free(struct file_list *flist)
+@@ -2950,7 +3211,7 @@ void flist_free(struct file_list *flist)
/* This routine ensures we don't have any duplicate names in our file list.
* duplicate names can cause corruption because of the pipelining. */
{
char fbuf[MAXPATHLEN];
int i, prev_i;
-@@ -2976,7 +3237,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -3001,7 +3262,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
/* If one is a dir and the other is not, we want to
* keep the dir because it might have contents in the
* list. Otherwise keep the first one. */
struct file_struct *fp = flist->sorted[j];
if (!S_ISDIR(fp->mode))
keep = i, drop = j;
-@@ -2992,8 +3253,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -3017,8 +3278,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
} else
keep = j, drop = i;
rprintf(FINFO,
"removing duplicate name %s from file list (%d)\n",
f_name(file, fbuf), drop + flist->ndx_start);
-@@ -3015,7 +3276,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -3040,7 +3301,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
}
flist->high = prev_i;
/* Sets fnamecmp_type to FNAMECMP_FUZZY or above. */
fuzzy_file = find_fuzzy(file, fuzzy_dirlist, &fnamecmp_type);
if (fuzzy_file) {
-@@ -1797,7 +1804,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1803,7 +1810,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
;
else if (fnamecmp_type >= FNAMECMP_FUZZY)
;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -122,6 +122,7 @@ size_t bwlimit_writemax = 0;
+@@ -123,6 +123,7 @@ size_t bwlimit_writemax = 0;
int ignore_existing = 0;
int ignore_non_existing = 0;
int need_messages_from_generator = 0;
int max_delete = INT_MIN;
OFF_T max_size = -1;
OFF_T min_size = -1;
-@@ -577,7 +578,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -578,7 +579,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, OPT_BLOCK_SIZE,
OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS, OPT_OLD_ARGS,
OPT_STOP_AFTER, OPT_STOP_AT,
OPT_REFUSED_BASE = 9000};
-@@ -733,6 +734,7 @@ static struct poptOption long_options[] = {
+@@ -735,6 +736,7 @@ static struct poptOption long_options[] = {
{"no-c", 0, POPT_ARG_VAL, &always_checksum, 0, 0, 0 },
{"checksum-choice", 0, POPT_ARG_STRING, &checksum_choice, 0, 0, 0 },
{"cc", 0, POPT_ARG_STRING, &checksum_choice, 0, 0, 0 },
{"block-size", 'B', POPT_ARG_STRING, 0, OPT_BLOCK_SIZE, 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 },
-@@ -1736,6 +1738,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1740,6 +1742,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
break;
case OPT_INFO:
arg = poptGetOptArg(pc);
parse_output_words(info_words, info_levels, arg, USER_PRIORITY);
-@@ -2089,6 +2108,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2093,6 +2112,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
#endif
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -342,6 +342,7 @@ has its own detailed description later in this man page.
+@@ -342,6 +342,7 @@ has its own detailed description later in this manpage.
--quiet, -q suppress non-error messages
--no-motd suppress daemon-mode MOTD
--checksum, -c skip based on checksum, not mod-time & size
--archive, -a archive mode is -rlptgoD (no -A,-X,-U,-N,-H)
--no-OPTION turn off an implied OPTION (e.g. --no-D)
--recursive, -r recurse into directories
-@@ -721,6 +722,8 @@ your home directory (remove the '=' for that).
+@@ -722,6 +723,8 @@ your home directory (remove the '=' for that).
file that has the same size as the corresponding sender's file: files with
either a changed size or a changed checksum are selected for transfer.
Note that rsync always verifies that each _transferred_ file was correctly
reconstructed on the receiving side by checking a whole-file checksum that
is generated as the file is transferred, but that automatic
-@@ -732,6 +735,38 @@ your home directory (remove the '=' for that).
+@@ -733,6 +736,38 @@ your home directory (remove the '=' for that).
option or an environment variable that is discussed in that option's
section.
extern int am_root;
extern int am_server;
extern int am_daemon;
-@@ -110,6 +111,9 @@ extern iconv_t ic_send, ic_recv;
+@@ -111,6 +112,9 @@ extern iconv_t ic_send, ic_recv;
#define PTR_SIZE (sizeof (struct file_struct *))
int io_error;
int flist_csum_len;
dev_t filesystem_dev; /* used to implement -x */
-@@ -152,8 +156,13 @@ static char empty_sum[MAX_DIGEST_LEN];
+@@ -153,8 +157,13 @@ static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
static int show_filelist_progress;
} *csum_cache = NULL;
static struct file_list *flist_new(int flags, const char *msg);
-@@ -348,7 +357,79 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -349,7 +358,79 @@ static void flist_done_allocating(struct file_list *flist)
flist->pool_boundary = ptr;
}
{
int slot, slots = am_sender ? 1 : basis_dir_cnt + 1;
-@@ -359,6 +440,9 @@ void reset_checksum_cache()
+@@ -360,6 +441,9 @@ void reset_checksum_cache()
struct file_list *flist = csum_cache[slot].flist;
if (flist) {
/* Reset the pool memory and empty the file-list array. */
pool_free_old(flist->file_pool,
pool_boundary(flist->file_pool, 0));
-@@ -369,6 +453,10 @@ void reset_checksum_cache()
+@@ -370,6 +454,10 @@ void reset_checksum_cache()
flist->low = 0;
flist->high = -1;
flist->next = NULL;
}
}
-@@ -376,7 +464,7 @@ void reset_checksum_cache()
+@@ -377,7 +465,7 @@ void reset_checksum_cache()
static int add_checksum(struct file_list *flist, const char *dirname,
const char *basename, int basename_len, OFF_T file_length,
time_t mtime, uint32 ctime, uint32 inode,
{
struct file_struct *file;
int alloc_len, extra_len;
-@@ -393,7 +481,7 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -394,7 +482,7 @@ static int add_checksum(struct file_list *flist, const char *dirname,
if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
extra_len = (extra_len | (EXTRA_ROUNDING * EXTRA_LEN)) + EXTRA_LEN;
#endif
bp = pool_alloc(flist->file_pool, alloc_len, "add_checksum");
memset(bp, 0, extra_len + FILE_STRUCT_LEN);
-@@ -402,7 +490,14 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -403,7 +491,14 @@ static int add_checksum(struct file_list *flist, const char *dirname,
bp += FILE_STRUCT_LEN;
memcpy(bp, basename, basename_len);
file->mode = S_IFREG;
file->modtime = mtime;
file->len32 = (uint32)file_length;
-@@ -431,10 +526,11 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -432,10 +527,11 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
char line[MAXPATHLEN+1024], fbuf[MAXPATHLEN], sum[MAX_DIGEST_LEN];
FILE *fp;
char *cp;
int dlen = dirname ? strlcpy(fbuf, dirname, sizeof fbuf) : 0;
if (dlen >= (int)(sizeof fbuf - 1 - RSYNCSUMS_LEN))
-@@ -455,7 +551,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -456,7 +552,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
while (fgets(line, sizeof line, fp)) {
cp = line;
if (checksum_type == 5) {
if (*cp == '=')
while (*++cp == '=') {}
else
-@@ -466,7 +562,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -467,7 +563,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
}
if (*cp == '=') {
} else {
for (i = 0; i < flist_csum_len*2; i++, cp++) {
int x;
-@@ -484,13 +587,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -485,13 +588,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
else
sum[i/2] = x << 4;
}
if (*cp == '=')
while (*++cp == '=') {}
else
-@@ -540,24 +644,112 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -541,24 +645,112 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
continue;
strlcpy(fbuf+dlen, cp, sizeof fbuf - dlen);
read_checksums(slot, flist, file->dirname);
}
-@@ -569,12 +761,31 @@ void get_cached_checksum(int slot, const char *fname, struct file_struct *file,
+@@ -570,12 +762,31 @@ void get_cached_checksum(int slot, const char *fname, struct file_struct *file,
&& (checksum_files & CSF_LAX
|| (F_CTIME(fp) == (uint32)stp->st_ctime
&& F_INODE(fp) == (uint32)stp->st_ino))) {
}
/* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
-@@ -1555,6 +1766,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1568,6 +1779,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++;
return NULL;
}
-@@ -1601,13 +1814,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1614,13 +1827,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
lastdir[len] = '\0';
lastdir_len = len;
if (checksum_files && am_sender && flist)
}
}
basename_len = strlen(basename) + 1; /* count the '\0' */
-@@ -1719,7 +1932,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1744,7 +1957,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
if (flist && checksum_files)
else
file_checksum(thisname, &st, tmp_sum);
if (sender_keeps_checksum)
-@@ -2111,6 +2324,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -2136,6 +2349,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
closedir(d);
if (f >= 0 && recurse && !divert_dirs) {
int i, end = flist->used - 1;
/* send_if_directory() bumps flist->used, so use "end". */
-@@ -2776,6 +2992,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2801,6 +3017,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
}
prior_dir_file = file;
goto cleanup;
}
-@@ -1810,6 +1813,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1816,6 +1819,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
handle_partial_dir(partialptr, PDIR_DELETE);
}
set_file_attrs(fname, file, &sx, NULL, maybe_ATTRS_REPORT | maybe_ATTRS_ACCURATE_TIME);
if (itemizing)
itemize(fnamecmp, file, ndx, statret, &sx, 0, 0, NULL);
#ifdef SUPPORT_HARD_LINKS
-@@ -2306,6 +2311,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2308,6 +2313,7 @@ void generate_files(int f_out, const char *local_name)
} else
change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));
}
}
for (i = cur_flist->low; i <= cur_flist->high; i++) {
struct file_struct *file = cur_flist->sorted[i];
-@@ -2400,6 +2406,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2402,6 +2408,9 @@ void generate_files(int f_out, const char *local_name)
wait_for_receiver();
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -1740,7 +1740,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1744,7 +1744,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
case OPT_SUMFILES:
arg = poptGetOptArg(pc);
|| (preserve_hard_links && F_IS_HLINKED(file)))
send_msg_int(MSG_SUCCESS, ndx);
handle_partial_dir(partialptr, PDIR_DELETE);
-@@ -921,7 +922,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -923,7 +924,7 @@ int recv_files(int f_in, int f_out, char *local_name)
case 2:
break;
case 1:
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -746,9 +746,13 @@ your home directory (remove the '=' for that).
+@@ -747,9 +747,13 @@ your home directory (remove the '=' for that).
The MODE value is either "lax", for relaxed checking (which compares size
and mtime), "strict" (which also compares ctime and inode), or "none" to
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1370,7 +1370,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1395,7 +1395,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
#endif
if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -577,7 +577,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -578,7 +578,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, OPT_BLOCK_SIZE,
OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS, OPT_OLD_ARGS,
OPT_STOP_AFTER, OPT_STOP_AT,
OPT_REFUSED_BASE = 9000};
-@@ -737,6 +737,7 @@ static struct poptOption long_options[] = {
+@@ -739,6 +739,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 },
{"fuzzy", 'y', POPT_ARG_NONE, 0, 'y', 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -993,6 +994,9 @@ static void set_refuse_options(void)
+@@ -997,6 +998,9 @@ static void set_refuse_options(void)
#ifndef SUPPORT_HARD_LINKS
parse_one_refuse_match(0, "link-dest", list_end);
#endif
#ifndef HAVE_MKTIME
parse_one_refuse_match(0, "stop-at", list_end);
#endif
-@@ -1322,6 +1326,8 @@ char *alt_dest_opt(int type)
+@@ -1326,6 +1330,8 @@ char *alt_dest_opt(int type)
return "--copy-dest";
case LINK_DEST:
return "--link-dest";
default:
NOISY_DEATH("Unknown alt_dest_opt type");
}
-@@ -1699,6 +1705,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1703,6 +1709,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
want_dest_type = LINK_DEST;
goto set_dest_dir;
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -429,6 +429,7 @@ has its own detailed description later in this man page.
+@@ -430,6 +430,7 @@ has its own detailed description later in this manpage.
--compare-dest=DIR also compare destination files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
--compress, -z compress file data during the transfer
--compress-choice=STR choose the compression algorithm (aka --zc)
--compress-level=NUM explicitly set compression level (aka --zl)
-@@ -2523,6 +2524,18 @@ your home directory (remove the '=' for that).
+@@ -2532,6 +2533,18 @@ your home directory (remove the '=' for that).
this bug by avoiding the `-o` option (or using `--no-o`) when sending to an
old rsync.
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/daemon-parm.txt b/daemon-parm.txt
--- a/daemon-parm.txt
+++ b/daemon-parm.txt
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -75,6 +75,8 @@ int delete_during = 0;
+@@ -76,6 +76,8 @@ int delete_during = 0;
int delete_before = 0;
int delete_after = 0;
int delete_excluded = 0;
int remove_source_files = 0;
int one_file_system = 0;
int protocol_version = PROTOCOL_VERSION;
-@@ -823,6 +825,8 @@ static struct poptOption long_options[] = {
+@@ -825,6 +827,8 @@ static struct poptOption long_options[] = {
{"outbuf", 0, POPT_ARG_STRING, &outbuf_mode, 0, 0, 0 },
{"remote-option", 'M', POPT_ARG_STRING, 0, 'M', 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -449,6 +449,8 @@ has its own detailed description later in this man page.
+@@ -450,6 +450,8 @@ has its own detailed description later in this manpage.
--address=ADDRESS bind address for outgoing socket to daemon
--port=PORT specify double-colon alternate port number
--sockopts=OPTIONS specify custom TCP options
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -115,6 +115,7 @@ int safe_symlinks = 0;
+@@ -116,6 +116,7 @@ int safe_symlinks = 0;
int copy_unsafe_links = 0;
int munge_symlinks = 0;
int size_only = 0;
int daemon_bwlimit = 0;
int bwlimit = 0;
int fuzzy_basis = 0;
-@@ -683,6 +684,7 @@ static struct poptOption long_options[] = {
+@@ -685,6 +686,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 },
{"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 },
{"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
-@@ -2803,6 +2805,9 @@ void server_options(char **args, int *argc_p)
+@@ -2807,6 +2809,9 @@ void server_options(char **args, int *argc_p)
else if (missing_args == 1 && !am_sender)
args[ac++] = "--ignore-missing-args";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -423,6 +423,7 @@ has its own detailed description later in this man page.
+@@ -424,6 +424,7 @@ has its own detailed description later in this manpage.
--contimeout=SECONDS set daemon connection timeout in seconds
--ignore-times, -I don't skip files that match size and time
--size-only skip files that match in size
--modify-window=NUM, -@ set the accuracy for mod-time comparisons
--temp-dir=DIR, -T create temporary files in directory DIR
--fuzzy, -y find similar file for basis if no dest file
-@@ -683,6 +684,14 @@ your home directory (remove the '=' for that).
+@@ -684,6 +685,14 @@ your home directory (remove the '=' for that).
after using another mirroring system which may not preserve timestamps
exactly.
./configure
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
-@@ -32,6 +32,7 @@ aclocal.m4
+@@ -33,6 +33,7 @@ aclocal.m4
/gists
/gmon.out
/rsync
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -54,6 +54,7 @@ extern int preserve_devices;
+@@ -55,6 +55,7 @@ extern int preserve_devices;
extern int preserve_specials;
extern int delete_during;
extern int missing_args;
extern int eol_nulls;
extern int atimes_ndx;
extern int crtimes_ndx;
-@@ -1369,11 +1370,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1394,11 +1395,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
extra_len += EXTRA_LEN;
#endif
#if EXTRA_ROUNDING > 0
if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
-@@ -1462,8 +1460,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1487,8 +1485,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2147,6 +2149,9 @@ void send_extra_file_list(int f, int at_least)
+@@ -2172,6 +2174,9 @@ void send_extra_file_list(int f, int at_least)
finish:
if (io_error != save_io_error && protocol_version == 30 && !ignore_errors)
send_msg_int(MSG_IO_ERROR, io_error);
}
struct file_list *send_file_list(int f, int argc, char *argv[])
-@@ -2170,6 +2175,13 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2195,6 +2200,13 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
| (eol_nulls || reading_remotely ? RL_EOL_NULLS : 0);
int implied_dot_dir = 0;
rprintf(FLOG, "building file list\n");
if (show_filelist_progress)
start_filelist_progress("building file list");
-@@ -2515,6 +2527,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2540,6 +2552,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
}
return memcmp(sum, F_SUM(file), flist_csum_len) == 0;
}
-@@ -2268,6 +2271,13 @@ void generate_files(int f_out, const char *local_name)
+@@ -2270,6 +2273,13 @@ void generate_files(int f_out, const char *local_name)
: "enabled");
}
dflt_perms = (ACCESSPERMS & ~orig_umask);
do {
-@@ -2393,6 +2403,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2395,6 +2405,9 @@ void generate_files(int f_out, const char *local_name)
wait_for_receiver();
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -86,6 +86,7 @@ int am_root = 0; /* 0 = normal, 1 = root, 2 = --super, -1 = --fake-super */
+@@ -87,6 +87,7 @@ int am_root = 0; /* 0 = normal, 1 = root, 2 = --super, -1 = --fake-super */
int am_server = 0;
int am_sender = 0;
int am_starting_up = 1;
int relative_paths = -1;
int implied_dirs = 1;
int missing_args = 0; /* 0 = FERROR_XFER, 1 = ignore, 2 = delete */
-@@ -100,6 +101,7 @@ int use_qsort = 0;
+@@ -101,6 +102,7 @@ int use_qsort = 0;
char *files_from = NULL;
int filesfrom_fd = -1;
char *filesfrom_host = NULL;
int eol_nulls = 0;
int protect_args = -1;
int old_style_args = -1;
-@@ -109,6 +111,9 @@ int mkpath_dest_arg = 0;
+@@ -110,6 +112,9 @@ int mkpath_dest_arg = 0;
int allow_inc_recurse = 1;
int xfer_dirs = -1;
int am_daemon = 0;
int connect_timeout = 0;
int keep_partial = 0;
int safe_symlinks = 0;
-@@ -288,6 +293,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
+@@ -289,6 +294,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
DEBUG_WORD(CHDIR, W_CLI|W_SRV, "Debug when the current directory changes"),
DEBUG_WORD(CONNECT, W_CLI, "Debug connection events (levels 1-2)"),
DEBUG_WORD(CMD, W_CLI, "Debug commands+options that are issued (levels 1-2)"),
DEBUG_WORD(DEL, W_REC, "Debug delete actions (levels 1-3)"),
DEBUG_WORD(DELTASUM, W_SND|W_REC, "Debug delta-transfer checksumming (levels 1-4)"),
DEBUG_WORD(DUP, W_REC, "Debug weeding of duplicate names"),
-@@ -577,6 +583,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -578,6 +584,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, OPT_BLOCK_SIZE,
OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT, OPT_STDERR,
OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS, OPT_OLD_ARGS,
OPT_STOP_AFTER, OPT_STOP_AT,
-@@ -733,6 +740,10 @@ static struct poptOption long_options[] = {
+@@ -735,6 +742,10 @@ static struct poptOption long_options[] = {
{"no-c", 0, POPT_ARG_VAL, &always_checksum, 0, 0, 0 },
{"checksum-choice", 0, POPT_ARG_STRING, &checksum_choice, 0, 0, 0 },
{"cc", 0, POPT_ARG_STRING, &checksum_choice, 0, 0, 0 },
{"block-size", 'B', POPT_ARG_STRING, 0, OPT_BLOCK_SIZE, 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 },
-@@ -832,6 +843,9 @@ static struct poptOption long_options[] = {
+@@ -834,6 +845,9 @@ static struct poptOption long_options[] = {
{"dparam", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
{"detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
{"no-detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
{0,0,0,0, 0, 0, 0}
};
-@@ -860,6 +874,31 @@ static struct poptOption long_daemon_options[] = {
+@@ -862,6 +876,31 @@ static struct poptOption long_daemon_options[] = {
{0,0,0,0, 0, 0, 0}
};
static char err_buf[200];
-@@ -985,6 +1024,8 @@ static void set_refuse_options(void)
+@@ -989,6 +1028,8 @@ static void set_refuse_options(void)
parse_one_refuse_match(0, "iconv", list_end);
#endif
parse_one_refuse_match(0, "log-file*", list_end);
}
#ifndef SUPPORT_ATIMES
-@@ -1292,6 +1333,102 @@ static void create_refuse_error(int which)
+@@ -1296,6 +1337,102 @@ static void create_refuse_error(int which)
snprintf(err_buf + n, sizeof err_buf - n, " (-%c)\n", op->shortName);
}
/* This is used to make sure that --daemon & --server cannot be aliased to
* something else. These options have always disabled popt aliases for the
* parsing of a daemon or server command-line, but we have to make sure that
-@@ -1348,6 +1485,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1352,6 +1489,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
return 0;
}
set_refuse_options();
#ifdef ICONV_OPTION
-@@ -1466,6 +1609,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1470,6 +1613,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
am_daemon = 1;
return 1;
case OPT_MODIFY_WINDOW:
/* The value has already been set by popt, but
* we need to remember that we're using a
-@@ -1538,6 +1687,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1542,6 +1691,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
preserve_devices = preserve_specials = 0;
break;
progress_init();
while (1) {
-@@ -893,6 +903,8 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -895,6 +905,8 @@ int recv_files(int f_in, int f_out, char *local_name)
do_unlink(partialptr);
handle_partial_dir(partialptr, PDIR_DELETE);
}
} else if (keep_partial && partialptr && (!one_inplace || delay_updates)) {
if (!handle_partial_dir(partialptr, PDIR_CREATE)) {
rprintf(FERROR,
-@@ -906,6 +918,8 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -908,6 +920,8 @@ int recv_files(int f_in, int f_out, char *local_name)
recv_ok = -1;
else if (delay_updates && recv_ok) {
bitbag_set_bit(delayed_bits, ndx);
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -389,6 +389,9 @@ has its own detailed description later in this man page.
+@@ -390,6 +390,9 @@ has its own detailed description later in this manpage.
--dry-run, -n perform a trial run with no changes made
--whole-file, -W copy files whole (w/o delta-xfer algorithm)
--checksum-choice=STR choose the checksum algorithm (aka --cc)
#ifndef USE_ROLL_SIMD
@@ -261,6 +271,14 @@ void daemon_usage(enum logcode F)
- rprintf(F,"daemon-specific rsync options. See also the rsyncd.conf(5) man page.\n");
+ rprintf(F,"daemon-specific rsync options. See also the rsyncd.conf(5) manpage.\n");
}
+void dbonly_usage(enum logcode F)
diff = u_strcmp(fmid->basename, f->basename);
if (diff == 0) {
good_match = mid;
-@@ -1982,6 +1984,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1988,6 +1990,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fnamecmp = partialptr;
fnamecmp_type = FNAMECMP_PARTIAL_DIR;
statret = 0;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -738,7 +738,9 @@ static struct poptOption long_options[] = {
+@@ -740,7 +740,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 },
{"fuzzy", 'y', POPT_ARG_NONE, 0, 'y', 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -2789,8 +2791,14 @@ void server_options(char **args, int *argc_p)
+@@ -2793,8 +2795,14 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -427,6 +427,8 @@ has its own detailed description later in this man page.
+@@ -428,6 +428,8 @@ has its own detailed description later in this manpage.
--temp-dir=DIR, -T create temporary files in directory DIR
--fuzzy, -y find similar file for basis if no dest file
--detect-renamed try to find renamed files to speed the xfer
--compare-dest=DIR also compare destination files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
-@@ -2455,6 +2457,20 @@ your home directory (remove the '=' for that).
+@@ -2464,6 +2466,20 @@ your home directory (remove the '=' for that).
otential alternate-basis files will be removed as the transfer progresses.
This option conflicts with [`--inplace`](#opt) and [`--append`](#opt).
a file that can't use it, while missing out on giving it to a file
that could use it.
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/backup.c b/backup.c
--- a/backup.c
+++ b/backup.c
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -64,6 +64,7 @@ extern int non_perishable_cnt;
+@@ -65,6 +65,7 @@ extern int non_perishable_cnt;
extern int prune_empty_dirs;
extern int copy_links;
extern int copy_unsafe_links;
extern int protocol_version;
extern int sanitize_paths;
extern int munge_symlinks;
-@@ -130,6 +131,8 @@ static int64 tmp_dev = -1, tmp_ino;
+@@ -131,6 +132,8 @@ static int64 tmp_dev = -1, tmp_ino;
#endif
static char tmp_sum[MAX_DIGEST_LEN];
static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
static int show_filelist_progress;
-@@ -277,6 +280,45 @@ static inline int is_excluded(const char *fname, int is_dir, int filter_level)
+@@ -278,6 +281,45 @@ static inline int is_excluded(const char *fname, int is_dir, int filter_level)
return name_is_excluded(fname, is_dir ? NAME_IS_DIR : NAME_IS_FILE, filter_level);
}
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len, int flags);
-@@ -2682,6 +2724,23 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2707,6 +2749,23 @@ struct file_list *recv_file_list(int f, int dir_ndx)
* for a non-relative transfer in recv_file_entry(). */
flist_sort_and_clean(flist, relative_paths);
rsyserr(FERROR_XFER, stat_errno, "recv_generator: failed to stat %s",
full_fname(fname));
goto cleanup;
-@@ -2251,6 +2402,12 @@ void generate_files(int f_out, const char *local_name)
+@@ -2253,6 +2404,12 @@ void generate_files(int f_out, const char *local_name)
if (DEBUG_GTE(GENR, 1))
rprintf(FINFO, "generator starting pid=%d\n", (int)getpid());
if (delete_before && !solo_file && cur_flist->used > 0)
do_delete_pass();
if (delete_during == 2) {
-@@ -2259,7 +2416,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2261,7 +2418,7 @@ void generate_files(int f_out, const char *local_name)
}
info_levels[INFO_FLIST] = info_levels[INFO_PROGRESS] = 0;
whole_file = 0;
if (DEBUG_GTE(FLIST, 1)) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -2295,7 +2452,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2297,7 +2454,7 @@ void generate_files(int f_out, const char *local_name)
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
} else
dirdev = MAKEDEV(0, 0);
} else
change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));
}
-@@ -2342,7 +2499,21 @@ void generate_files(int f_out, const char *local_name)
+@@ -2344,7 +2501,21 @@ void generate_files(int f_out, const char *local_name)
} while ((cur_flist = cur_flist->next) != NULL);
if (delete_during)
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -87,6 +87,7 @@ int am_server = 0;
+@@ -88,6 +88,7 @@ int am_server = 0;
int am_sender = 0;
int am_starting_up = 1;
int relative_paths = -1;
int implied_dirs = 1;
int missing_args = 0; /* 0 = FERROR_XFER, 1 = ignore, 2 = delete */
int numeric_ids = 0;
-@@ -737,6 +738,7 @@ static struct poptOption long_options[] = {
+@@ -739,6 +740,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 },
{"fuzzy", 'y', POPT_ARG_NONE, 0, 'y', 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -2371,7 +2373,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2375,7 +2377,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
inplace = 1;
}
partial_dir = tmp_partialdir;
if (inplace) {
-@@ -2380,6 +2382,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2384,6 +2386,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
snprintf(err_buf, sizeof err_buf,
"--%s cannot be used with --%s\n",
append_mode ? "append" : "inplace",
delay_updates ? "delay-updates" : "partial-dir");
return 0;
}
-@@ -2786,6 +2789,8 @@ void server_options(char **args, int *argc_p)
+@@ -2790,6 +2793,8 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -426,6 +426,7 @@ has its own detailed description later in this man page.
+@@ -427,6 +427,7 @@ has its own detailed description later in this manpage.
--modify-window=NUM, -@ set the accuracy for mod-time comparisons
--temp-dir=DIR, -T create temporary files in directory DIR
--fuzzy, -y find similar file for basis if no dest file
--compare-dest=DIR also compare destination files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
-@@ -2438,6 +2439,22 @@ your home directory (remove the '=' for that).
+@@ -2447,6 +2448,22 @@ your home directory (remove the '=' for that).
potential fuzzy-match files, so either use [`--delete-after`](#opt) or
specify some filename exclusions if you need to prevent this.
ret = -ret - 1;
else
ret++;
-@@ -1176,6 +1176,32 @@ char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr)
+@@ -1197,6 +1197,32 @@ char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr)
return path;
}
/**
* Return a quoted string with the full pathname of the indicated filename.
* The string " (in MODNAME)" may also be appended. The returned pointer
-@@ -1269,7 +1295,7 @@ int handle_partial_dir(const char *fname, int create)
+@@ -1290,7 +1316,7 @@ int handle_partial_dir(const char *fname, int create)
}
statret = -1;
}
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
extern int module_id;
extern int local_server;
extern int sanitize_paths;
-@@ -758,6 +759,8 @@ static struct poptOption long_options[] = {
+@@ -760,6 +761,8 @@ static struct poptOption long_options[] = {
{"partial-dir", 0, POPT_ARG_STRING, &partial_dir, 0, 0, 0 },
{"delay-updates", 0, POPT_ARG_VAL, &delay_updates, 1, 0, 0 },
{"no-delay-updates", 0, POPT_ARG_VAL, &delay_updates, 0, 0, 0 },
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -414,6 +414,7 @@ has its own detailed description later in this man page.
+@@ -415,6 +415,7 @@ has its own detailed description later in this manpage.
--partial keep partially transferred files
--partial-dir=DIR put a partially transferred file into DIR
--delay-updates put all updated files into place at end
--prune-empty-dirs, -m prune empty directory chains from file-list
--numeric-ids don't map uid/gid values by user/group name
--usermap=STRING custom username mapping
-@@ -3238,6 +3239,17 @@ your home directory (remove the '=' for that).
+@@ -3247,6 +3248,17 @@ your home directory (remove the '=' for that).
update algorithm that is even more atomic (it uses [`--link-dest`](#opt)
and a parallel hierarchy of files).
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
fnamecmp_type = FNAMECMP_FNAME;
if (statret == 0 && !(stype == FT_REG || (write_devices && stype == FT_DEVICE))) {
-@@ -2157,6 +2164,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2159,6 +2166,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
ignore_existing = -ignore_existing;
ignore_non_existing = -ignore_non_existing;
update_only = -update_only;
always_checksum = -always_checksum;
size_only = -size_only;
append_mode = -append_mode;
-@@ -2182,6 +2190,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2184,6 +2192,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
ignore_existing = -ignore_existing;
ignore_non_existing = -ignore_non_existing;
update_only = -update_only;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -64,6 +64,7 @@ int preserve_crtimes = 0;
+@@ -65,6 +65,7 @@ int preserve_crtimes = 0;
int omit_dir_times = 0;
int omit_link_times = 0;
int update_only = 0;
int open_noatime = 0;
int cvs_exclude = 0;
int dry_run = 0;
-@@ -687,6 +688,7 @@ static struct poptOption long_options[] = {
+@@ -689,6 +690,7 @@ static struct poptOption long_options[] = {
{"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 },
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -351,6 +351,7 @@ has its own detailed description later in this man page.
+@@ -351,6 +351,7 @@ has its own detailed description later in this manpage.
--backup-dir=DIR make backups into hierarchy based in DIR
--suffix=SUFFIX backup suffix (default ~ w/o --backup-dir)
--update, -u skip files that are newer on the receiver
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -52,6 +52,7 @@ extern int preserve_links;
+@@ -53,6 +53,7 @@ extern int preserve_links;
extern int preserve_hard_links;
extern int preserve_devices;
extern int preserve_specials;
extern int delete_during;
extern int missing_args;
extern int eol_nulls;
-@@ -385,6 +386,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -386,6 +387,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
static time_t crtime;
#endif
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -428,6 +432,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -429,6 +433,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
xflags |= XMIT_SAME_MODE;
else
mode = file->mode;
if (preserve_devices && IS_DEVICE(mode)) {
if (protocol_version < 28) {
-@@ -589,6 +601,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -590,6 +602,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
#endif
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (atimes_ndx && !S_ISDIR(mode) && !(xflags & XMIT_SAME_ATIME))
write_varlong(f, atime, 4);
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
-@@ -683,6 +699,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -684,6 +700,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
static time_t crtime;
#endif
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -799,6 +818,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -801,6 +820,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
#ifdef SUPPORT_CRTIMES
if (crtimes_ndx)
crtime = F_CRTIME(first);
#endif
if (preserve_uid)
uid = F_OWNER(first);
-@@ -871,6 +894,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -874,6 +897,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
if (chmod_modes && !S_ISLNK(mode) && mode)
mode = tweak_mode(mode, chmod_modes);
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
-@@ -1029,6 +1056,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -1042,6 +1069,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
}
#endif
file->mode = mode;
if (preserve_uid)
F_OWNER(file) = uid;
if (preserve_gid) {
-@@ -1430,6 +1461,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1455,6 +1486,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
}
#endif
file->mode = st.st_mode;
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -43,10 +43,12 @@ extern int write_devices;
+@@ -43,10 +43,12 @@ extern int preserve_devices;
extern int preserve_specials;
extern int preserve_hard_links;
extern int preserve_executability;
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links && F_HLINK_NOT_FIRST(file)
-@@ -2102,17 +2126,25 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -2104,17 +2128,25 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
continue;
fname = f_name(file, NULL);
if (fix_dir_perms)
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -53,6 +53,7 @@ int preserve_hard_links = 0;
+@@ -54,6 +54,7 @@ int preserve_hard_links = 0;
int preserve_acls = 0;
int preserve_xattrs = 0;
int preserve_perms = 0;
int preserve_executability = 0;
int preserve_devices = 0;
int preserve_specials = 0;
-@@ -94,6 +95,7 @@ int msgs2stderr = 2; /* Default: send errors to stderr for local & remote-shell
+@@ -95,6 +96,7 @@ int msgs2stderr = 2; /* Default: send errors to stderr for local & remote-shell
int saw_stderr_opt = 0;
int allow_8bit_chars = 0;
int force_delete = 0;
int io_timeout = 0;
int prune_empty_dirs = 0;
int use_qsort = 0;
-@@ -618,6 +620,8 @@ static struct poptOption long_options[] = {
+@@ -619,6 +621,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 },
{"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 },
-@@ -715,6 +719,12 @@ static struct poptOption long_options[] = {
+@@ -717,6 +721,12 @@ static struct poptOption long_options[] = {
{"remove-source-files",0,POPT_ARG_VAL, &remove_source_files, 1, 0, 0 },
{"force", 0, POPT_ARG_VAL, &force_delete, 1, 0, 0 },
{"no-force", 0, POPT_ARG_VAL, &force_delete, 0, 0, 0 },
{"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 },
-@@ -1005,6 +1015,14 @@ static void set_refuse_options(void)
+@@ -1009,6 +1019,14 @@ static void set_refuse_options(void)
#ifndef SUPPORT_CRTIMES
parse_one_refuse_match(0, "crtimes", list_end);
#endif
/* Now we use the descrip values to actually mark the options for refusal. */
for (op = long_options; op != list_end; op++) {
-@@ -2685,6 +2703,9 @@ void server_options(char **args, int *argc_p)
+@@ -2689,6 +2707,9 @@ void server_options(char **args, int *argc_p)
if (xfer_dirs && !recurse && delete_mode && am_sender)
args[ac++] = "--no-r";
if (do_compression && do_compression_level != CLVL_NOT_SPECIFIED) {
if (asprintf(&arg, "--compress-level=%d", do_compression_level) < 0)
goto oom;
-@@ -2780,6 +2801,16 @@ void server_options(char **args, int *argc_p)
+@@ -2784,6 +2805,16 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--delete-excluded";
if (force_delete)
args[ac++] = "--force";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -366,6 +366,7 @@ has its own detailed description later in this man page.
+@@ -366,6 +366,7 @@ has its own detailed description later in this manpage.
--keep-dirlinks, -K treat symlinked dir on receiver as dir
--hard-links, -H preserve hard links
--perms, -p preserve permissions
--executability, -E preserve executability
--chmod=CHMOD affect file and/or directory permissions
--acls, -A preserve ACLs (implies --perms)
-@@ -406,7 +407,10 @@ has its own detailed description later in this man page.
+@@ -407,7 +408,10 @@ has its own detailed description later in this manpage.
--ignore-missing-args ignore missing source args without error
--delete-missing-args delete missing source args from destination
--ignore-errors delete even if there are I/O errors
--max-delete=NUM don't delete more than NUM files
--max-size=SIZE don't transfer any file larger than SIZE
--min-size=SIZE don't transfer any file smaller than SIZE
-@@ -738,6 +742,7 @@ your home directory (remove the '=' for that).
+@@ -739,6 +743,7 @@ your home directory (remove the '=' for that).
recursion and want to preserve almost everything. Be aware that it does
**not** include preserving ACLs (`-A`), xattrs (`-X`), atimes (`-U`),
crtimes (`-N`), nor the finding and preserving of hardlinks (`-H`).
The only exception to the above equivalence is when [`--files-from`](#opt)
is specified, in which case [`-r`](#opt) is not implied.
-@@ -1198,7 +1203,7 @@ your home directory (remove the '=' for that).
+@@ -1199,7 +1204,7 @@ your home directory (remove the '=' for that).
Without this option, if the sending side has replaced a directory with a
symlink to a directory, the receiving side will delete anything that is in
the way of the new symlink, including a directory hierarchy (as long as
See also [`--keep-dirlinks`](#opt) for an analogous option for the
receiving side.
-@@ -1393,6 +1398,37 @@ your home directory (remove the '=' for that).
+@@ -1394,6 +1399,37 @@ your home directory (remove the '=' for that).
those used by [`--fake-super`](#opt)) unless you repeat the option (e.g. `-XX`).
This "copy all xattrs" mode cannot be used with [`--fake-super`](#opt).
0. `--chmod=CHMOD`
This option tells rsync to apply one or more comma-separated "chmod" modes
-@@ -1888,8 +1924,8 @@ your home directory (remove the '=' for that).
+@@ -1897,8 +1933,8 @@ your home directory (remove the '=' for that).
[`--ignore-missing-args`](#opt) option a step farther: each missing arg
will become a deletion request of the corresponding destination file on the
receiving side (should it exist). If the destination file is a non-empty
independent of any other type of delete processing.
The missing source files are represented by special file-list entries which
-@@ -1900,14 +1936,14 @@ your home directory (remove the '=' for that).
+@@ -1909,14 +1945,14 @@ your home directory (remove the '=' for that).
Tells [`--delete`](#opt) to go ahead and delete files even when there are
I/O errors.
[`--recursive`](#opt) option was also enabled.
0. `--max-delete=NUM`
-@@ -2904,7 +2940,7 @@ your home directory (remove the '=' for that).
+@@ -2913,7 +2949,7 @@ your home directory (remove the '=' for that).
also turns on the output of other verbose messages).
The "%i" escape has a cryptic output that is 11 letters long. The general
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -84,6 +84,7 @@ extern struct chmod_mode_struct *chmod_modes;
+@@ -85,6 +85,7 @@ extern struct chmod_mode_struct *chmod_modes;
extern filter_rule_list filter_list;
extern filter_rule_list daemon_filter_list;
#ifdef ICONV_OPTION
extern int filesfrom_convert;
-@@ -1231,7 +1232,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1244,7 +1245,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
} else if (readlink_stat(thisname, &st, linkname) != 0) {
int save_errno = errno;
/* See if file is excluded before reporting an error. */
&& (is_excluded(thisname, 0, filter_level)
|| is_excluded(thisname, 1, filter_level))) {
if (ignore_perishable && save_errno != ENOENT)
-@@ -1276,6 +1277,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1289,6 +1290,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
if (filter_level == NO_FILTERS)
goto skip_filters;
if (S_ISDIR(st.st_mode)) {
if (!xfer_dirs) {
-@@ -1496,12 +1503,23 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1521,12 +1528,23 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
int flags, int filter_level)
{
struct file_struct *file;
file->mode = tweak_mode(file->mode, chmod_modes);
if (f >= 0) {
-@@ -2403,7 +2421,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2428,7 +2446,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
struct file_struct *file;
file = send_file_name(f, flist, fbuf, &st,
FLAG_TOP_DIR | FLAG_CONTENT_DIR | flags,
if (!file)
continue;
if (inc_recurse) {
-@@ -2417,7 +2435,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2442,7 +2460,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
} else
send_if_directory(f, flist, file, fbuf, len, flags);
} else
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -1416,7 +1416,9 @@ your home directory (remove the '=' for that).
+@@ -1417,7 +1417,9 @@ your home directory (remove the '=' for that).
> --chmod=D2775,F664
It is also legal to specify multiple `--chmod` options, as each additional
See the [`--perms`](#opt) and [`--executability`](#opt) options for how the
resulting permission value can be applied to the files in the transfer.
-@@ -2838,6 +2840,10 @@ your home directory (remove the '=' for that).
+@@ -2847,6 +2849,10 @@ your home directory (remove the '=' for that).
avoid a complaint about wildcard characters, but a modern rsync handles
this automatically.
0. `--timeout=SECONDS`
This option allows you to set a maximum I/O timeout in seconds. If no data
-@@ -3901,6 +3907,15 @@ The following modifiers are accepted after a "`+`" or "`-`":
+@@ -3910,6 +3916,15 @@ The following modifiers are accepted after a "`+`" or "`-`":
like "CVS" and "`*.o`" are marked as perishable, and will not prevent a
directory that was removed on the source from being deleted on the
destination.
- An `x` indicates that a rule affects xattr names in xattr copy/delete
operations (and is thus ignored when matching file/dir names). If no
xattr-matching rules are specified, a default xattr filtering rule is used
-@@ -3958,6 +3973,12 @@ The following modifiers are accepted after a merge or dir-merge rule:
+@@ -3967,6 +3982,12 @@ The following modifiers are accepted after a merge or dir-merge rule:
rules in the file must not specify sides (via a modifier or a rule prefix
such as `hide`).
diff --git a/util1.c b/util1.c
--- a/util1.c
+++ b/util1.c
-@@ -898,6 +898,25 @@ size_t stringjoin(char *dest, size_t destsize, ...)
+@@ -919,6 +919,25 @@ size_t stringjoin(char *dest, size_t destsize, ...)
return ret;
}
- Make this code handle multibyte character encodings, and honor the
--iconv setting when converting case.
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
extern int ignore_errors;
extern int numeric_ids;
extern int quiet;
-@@ -2598,7 +2599,8 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2623,7 +2624,8 @@ struct file_list *recv_file_list(int f, int dir_ndx)
cur_dir++;
if (cur_dir != good_dirname) {
const char *d = dir_ndx >= 0 ? f_name(dir_flist->files[dir_ndx], NULL) : empty_dir;
rprintf(FERROR,
"ABORTING due to invalid path from sender: %s/%s\n",
cur_dir, file->basename);
-@@ -3165,6 +3167,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -3190,6 +3192,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
{
int dif;
const uchar *c1, *c2;
enum fnc_state state1, state2;
enum fnc_type type1, type2;
enum fnc_type t_path = protocol_version >= 29 ? t_PATH : t_ITEM;
-@@ -3275,7 +3278,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -3300,7 +3303,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
if (type1 != type2)
return type1 == t_PATH ? 1 : -1;
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -127,6 +127,7 @@ OFF_T max_size = -1;
+@@ -128,6 +128,7 @@ OFF_T max_size = -1;
OFF_T min_size = -1;
int ignore_errors = 0;
int modify_window = 0;
int blocking_io = -1;
int checksum_seed = 0;
int inplace = 0;
-@@ -778,6 +779,8 @@ static struct poptOption long_options[] = {
+@@ -780,6 +781,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 },
{"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},
-@@ -2816,6 +2819,9 @@ void server_options(char **args, int *argc_p)
+@@ -2820,6 +2823,9 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -446,6 +446,7 @@ has its own detailed description later in this man page.
+@@ -447,6 +447,7 @@ has its own detailed description later in this manpage.
--old-args disable the modern arg-protection idiom
--protect-args, -s no space-splitting; wildcard chars only
--copy-as=USER[:GROUP] specify user & optional group for the copy
--address=ADDRESS bind address for outgoing socket to daemon
--port=PORT specify double-colon alternate port number
--sockopts=OPTIONS specify custom TCP options
-@@ -2386,6 +2387,12 @@ your home directory (remove the '=' for that).
+@@ -2395,6 +2396,12 @@ your home directory (remove the '=' for that).
> sudo rsync -aive lsh -M--copy-as=joe src/ lh:dest/
./configure
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
./configure
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -169,6 +169,7 @@ char *backup_suffix = NULL;
+@@ -170,6 +170,7 @@ char *backup_suffix = NULL;
char *tmpdir = NULL;
char *partial_dir = NULL;
char *basis_dir[MAX_BASIS_DIRS+1];
char *config_file = NULL;
char *shell_cmd = NULL;
char *logfile_name = NULL;
-@@ -226,7 +227,7 @@ static const char *debug_verbosity[] = {
+@@ -227,7 +228,7 @@ static const char *debug_verbosity[] = {
/*2*/ "BIND,CMD,CONNECT,DEL,DELTASUM,DUP,FILTER,FLIST,ICONV",
/*3*/ "ACL,BACKUP,CONNECT2,DELTASUM2,DEL2,EXIT,FILTER2,FLIST2,FUZZY,GENR,OWN,RECV,SEND,TIME",
/*4*/ "CMD2,DELTASUM3,DEL3,EXIT2,FLIST3,ICONV2,OWN2,PROTO,TIME2",
};
#define MAX_VERBOSITY ((int)(sizeof debug_verbosity / sizeof debug_verbosity[0]) - 1)
-@@ -297,6 +298,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
+@@ -298,6 +299,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
DEBUG_WORD(FUZZY, W_REC, "Debug fuzzy scoring (levels 1-2)"),
DEBUG_WORD(GENR, W_REC, "Debug generator functions"),
DEBUG_WORD(HASH, W_SND|W_REC, "Debug hashtable code"),
DEBUG_WORD(HLINK, W_SND|W_REC, "Debug hard-link actions (levels 1-3)"),
DEBUG_WORD(ICONV, W_CLI|W_SRV, "Debug iconv character conversions (levels 1-2)"),
DEBUG_WORD(IO, W_CLI|W_SRV, "Debug I/O routines (levels 1-4)"),
-@@ -577,7 +579,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -578,7 +580,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, OPT_BLOCK_SIZE,
OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS, OPT_OLD_ARGS,
OPT_STOP_AFTER, OPT_STOP_AT,
OPT_REFUSED_BASE = 9000};
-@@ -737,6 +739,7 @@ static struct poptOption long_options[] = {
+@@ -739,6 +741,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 },
{"fuzzy", 'y', POPT_ARG_NONE, 0, 'y', 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -979,6 +982,9 @@ static void set_refuse_options(void)
+@@ -983,6 +986,9 @@ static void set_refuse_options(void)
ref = cp + 1;
}
if (am_daemon) {
#ifdef ICONV_OPTION
if (!*lp_charset(module_id))
-@@ -1852,6 +1858,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1856,6 +1862,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
return 0;
#endif
case OPT_STOP_AFTER: {
long val;
arg = poptGetOptArg(pc);
-@@ -2223,6 +2243,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2227,6 +2247,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
tmpdir = sanitize_path(NULL, tmpdir, NULL, 0, SP_DEFAULT);
if (backup_dir)
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, SP_DEFAULT);
}
if (daemon_filter_list.head && !am_sender) {
filter_rule_list *elp = &daemon_filter_list;
-@@ -2892,6 +2914,12 @@ void server_options(char **args, int *argc_p)
+@@ -2896,6 +2918,12 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--no-W";
}
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -429,6 +429,7 @@ has its own detailed description later in this man page.
+@@ -430,6 +430,7 @@ has its own detailed description later in this manpage.
--compare-dest=DIR also compare destination files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
--compress, -z compress file data during the transfer
--compress-choice=STR choose the compression algorithm (aka --zc)
--compress-level=NUM explicitly set compression level (aka --zl)
-@@ -2523,6 +2524,50 @@ your home directory (remove the '=' for that).
+@@ -2532,6 +2533,50 @@ your home directory (remove the '=' for that).
this bug by avoiding the `-o` option (or using `--no-o`) when sending to an
old rsync.
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -76,6 +76,7 @@ int delete_before = 0;
+@@ -77,6 +77,7 @@ int delete_before = 0;
int delete_after = 0;
int delete_excluded = 0;
int remove_source_files = 0;
int one_file_system = 0;
int protocol_version = PROTOCOL_VERSION;
int sparse_files = 0;
-@@ -642,6 +643,7 @@ static struct poptOption long_options[] = {
+@@ -643,6 +644,7 @@ static struct poptOption long_options[] = {
{"omit-link-times", 'J', POPT_ARG_VAL, &omit_link_times, 1, 0, 0 },
{"no-omit-link-times",0, POPT_ARG_VAL, &omit_link_times, 0, 0, 0 },
{"no-J", 0, POPT_ARG_VAL, &omit_link_times, 0, 0, 0 },
{"modify-window", '@', 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 },
-@@ -2292,6 +2294,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2296,6 +2298,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
parse_filter_str(&filter_list, backup_dir_buf, rule_template(0), 0);
}
if (make_backups && !backup_dir)
omit_dir_times = -1; /* Implied, so avoid -O to sender. */
-@@ -2788,6 +2793,8 @@ void server_options(char **args, int *argc_p)
+@@ -2792,6 +2797,8 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--size-only";
if (do_stats)
args[ac++] = "--stats";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -381,6 +381,7 @@ has its own detailed description later in this man page.
+@@ -383,6 +383,7 @@ has its own detailed description later in this manpage.
--crtimes, -N preserve create times (newness)
--omit-dir-times, -O omit directories from --times
--omit-link-times, -J omit symlinks from --times
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
--sparse, -S turn sequences of nulls into sparse blocks
-@@ -1540,6 +1541,11 @@ your home directory (remove the '=' for that).
+@@ -1549,6 +1550,11 @@ your home directory (remove the '=' for that).
This tells rsync to omit symlinks when it is preserving modification,
access, and create times.
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -73,6 +73,7 @@ extern int sender_symlink_iconv;
+@@ -74,6 +74,7 @@ extern int sender_symlink_iconv;
extern int output_needs_newline;
extern int sender_keeps_checksum;
extern int unsort_ndx;
extern uid_t our_uid;
extern struct stats stats;
extern char *filesfrom_host;
-@@ -1839,6 +1840,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1864,6 +1865,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
}
send_file_name(f, flist, fbuf, NULL, flags, filter_level);
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -118,6 +118,7 @@ int size_only = 0;
+@@ -119,6 +119,7 @@ int size_only = 0;
int daemon_bwlimit = 0;
int bwlimit = 0;
int fuzzy_basis = 0;
size_t bwlimit_writemax = 0;
int ignore_existing = 0;
int ignore_non_existing = 0;
-@@ -768,6 +769,7 @@ static struct poptOption long_options[] = {
+@@ -770,6 +771,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/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -465,6 +465,7 @@ has its own detailed description later in this man page.
+@@ -466,6 +466,7 @@ has its own detailed description later in this manpage.
--early-input=FILE use FILE for daemon's early exec input
--list-only list the files instead of copying them
--bwlimit=RATE limit socket I/O bandwidth
TODO: the configure changes should abort if the user requests --enable-slp
and we can't honor that request.
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
## MODULE PARAMETERS
After the global parameters you should define a number of modules, each module
-@@ -1175,6 +1190,7 @@ A more sophisticated example would be:
+@@ -1176,6 +1191,7 @@ A more sophisticated example would be:
> max connections = 4
> syslog facility = local5
> pid file = /var/run/rsyncd.pid
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/syscall.c b/syscall.c
--- a/syscall.c
+++ b/syscall.c
-- Matt McCutchen <hashproduct@gmail.com>
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
/**
* If 1, send the whole file as literal data rather than trying to
-@@ -771,6 +772,7 @@ static struct poptOption long_options[] = {
+@@ -773,6 +774,7 @@ static struct poptOption long_options[] = {
{"bwlimit", 0, POPT_ARG_STRING, &bwlimit_arg, OPT_BWLIMIT, 0, 0 },
{"no-bwlimit", 0, POPT_ARG_VAL, &bwlimit, 0, 0, 0 },
{"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 },
{"suffix", 0, POPT_ARG_STRING, &backup_suffix, 0, 0, 0 },
-@@ -2791,6 +2793,8 @@ void server_options(char **args, int *argc_p)
+@@ -2795,6 +2797,8 @@ void server_options(char **args, int *argc_p)
} else {
if (skip_compress)
args[ac++] = safe_arg("--skip-compress", skip_compress);
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -396,6 +396,7 @@ has its own detailed description later in this man page.
+@@ -397,6 +397,7 @@ has its own detailed description later in this manpage.
--existing skip creating new files on receiver
--ignore-existing skip updating files that exist on receiver
--remove-source-files sender removes synchronized files (non-dir)
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
--delete-before receiver deletes before xfer, not during
-@@ -1774,6 +1775,17 @@ your home directory (remove the '=' for that).
+@@ -1783,6 +1784,17 @@ your home directory (remove the '=' for that).
Starting with 3.1.0, rsync will skip the sender-side removal (and output an
error) if the file's size or modify time has not stayed unchanged.
diff --git a/sender.c b/sender.c
--- a/sender.c
+++ b/sender.c
-@@ -42,6 +42,7 @@ extern int protocol_version;
+@@ -43,6 +43,7 @@ extern int protocol_version;
extern int remove_source_files;
extern int updating_basis_file;
extern int make_backups;
extern int inplace;
extern int inplace_partial;
extern int batch_fd;
-@@ -128,6 +129,7 @@ void successful_send(int ndx)
+@@ -129,6 +130,7 @@ void successful_send(int ndx)
struct file_struct *file;
struct file_list *flist;
STRUCT_STAT st;
if (!remove_source_files)
return;
-@@ -152,7 +154,11 @@ void successful_send(int ndx)
+@@ -153,7 +155,11 @@ void successful_send(int ndx)
return;
}
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -115,6 +115,7 @@ int safe_symlinks = 0;
+@@ -116,6 +116,7 @@ int safe_symlinks = 0;
int copy_unsafe_links = 0;
int munge_symlinks = 0;
int size_only = 0;
int daemon_bwlimit = 0;
int bwlimit = 0;
int fuzzy_basis = 0;
-@@ -175,6 +176,8 @@ char *logfile_name = NULL;
+@@ -176,6 +177,8 @@ char *logfile_name = NULL;
char *logfile_format = NULL;
char *stdout_format = NULL;
char *password_file = NULL;
char *early_input_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
-@@ -683,6 +686,7 @@ static struct poptOption long_options[] = {
+@@ -685,6 +688,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 },
{"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 },
{"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
-@@ -820,6 +824,8 @@ static struct poptOption long_options[] = {
+@@ -822,6 +826,8 @@ static struct poptOption long_options[] = {
{"early-input", 0, POPT_ARG_STRING, &early_input_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 },
{"outbuf", 0, POPT_ARG_STRING, &outbuf_mode, 0, 0, 0 },
{"remote-option", 'M', POPT_ARG_STRING, 0, 'M', 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
-@@ -2415,6 +2421,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2419,6 +2425,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
if (files_from) {
char *h, *p;
int q;
-@@ -2803,6 +2819,25 @@ void server_options(char **args, int *argc_p)
+@@ -2807,6 +2823,25 @@ void server_options(char **args, int *argc_p)
else if (missing_args == 1 && !am_sender)
args[ac++] = "--ignore-missing-args";
progress_init();
while (1) {
-@@ -868,6 +888,9 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -870,6 +890,9 @@ int recv_files(int f_in, int f_out, char *local_name)
else if (!am_server && INFO_GTE(NAME, 1) && INFO_EQ(PROGRESS, 1))
rprintf(FINFO, "%s\n", fname);
/* recv file data */
recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size, fname, fd2, file, inplace || one_inplace);
-@@ -883,6 +906,16 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -885,6 +908,16 @@ int recv_files(int f_in, int f_out, char *local_name)
exit_cleanup(RERR_FILEIO);
}
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -423,6 +423,7 @@ has its own detailed description later in this man page.
+@@ -424,6 +424,7 @@ has its own detailed description later in this manpage.
--contimeout=SECONDS set daemon connection timeout in seconds
--ignore-times, -I don't skip files that match size and time
--size-only skip files that match in size
--modify-window=NUM, -@ set the accuracy for mod-time comparisons
--temp-dir=DIR, -T create temporary files in directory DIR
--fuzzy, -y find similar file for basis if no dest file
-@@ -471,6 +472,8 @@ has its own detailed description later in this man page.
+@@ -472,6 +473,8 @@ has its own detailed description later in this manpage.
--write-batch=FILE write a batched update to FILE
--only-write-batch=FILE like --write-batch but w/o updating dest
--read-batch=FILE read a batched update from FILE
--protocol=NUM force an older protocol version to be used
--iconv=CONVERT_SPEC request charset conversion of filenames
--checksum-seed=NUM set block/file checksum seed (advanced)
-@@ -3516,6 +3519,36 @@ your home directory (remove the '=' for that).
+@@ -3525,6 +3528,36 @@ your home directory (remove the '=' for that).
[`--write-batch`](#opt). If _FILE_ is `-`, the batch data will be read
from standard input. See the "BATCH MODE" section for details.
extern int do_xfers;
extern int am_server;
-@@ -48,6 +49,7 @@ extern int batch_fd;
+@@ -49,6 +50,7 @@ extern int batch_fd;
extern int write_batch;
extern int file_old_total;
extern BOOL want_progress_now;
extern struct stats stats;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
-@@ -201,6 +203,26 @@ void send_files(int f_in, int f_out)
+@@ -202,6 +204,26 @@ void send_files(int f_in, int f_out)
int f_xfer = write_batch < 0 ? batch_fd : f_out;
int save_io_error = io_error;
int ndx, j;
if (DEBUG_GTE(SEND, 1))
rprintf(FINFO, "send_files starting\n");
-@@ -338,6 +360,7 @@ void send_files(int f_in, int f_out)
+@@ -339,6 +361,7 @@ void send_files(int f_in, int f_out)
exit_cleanup(RERR_PROTOCOL);
}
fd = do_open(fname, O_RDONLY, 0);
if (fd == -1) {
if (errno == ENOENT) {
-@@ -357,6 +380,33 @@ void send_files(int f_in, int f_out)
+@@ -358,6 +381,33 @@ void send_files(int f_in, int f_out)
continue;
}
/* map the local file */
if (do_fstat(fd, &st) != 0) {
io_error |= IOERR_GENERAL;
-@@ -418,6 +468,8 @@ void send_files(int f_in, int f_out)
+@@ -428,6 +478,8 @@ void send_files(int f_in, int f_out)
}
}
close(fd);
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/fileio.c b/fileio.c
--- a/fileio.c
+++ b/fileio.c
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -79,6 +79,7 @@ int remove_source_files = 0;
+@@ -80,6 +80,7 @@ int remove_source_files = 0;
int one_file_system = 0;
int protocol_version = PROTOCOL_VERSION;
int sparse_files = 0;
int preallocate_files = 0;
int do_compression = 0;
int do_compression_level = CLVL_NOT_SPECIFIED;
-@@ -696,6 +697,7 @@ static struct poptOption long_options[] = {
+@@ -698,6 +699,7 @@ static struct poptOption long_options[] = {
{"sparse", 'S', POPT_ARG_VAL, &sparse_files, 1, 0, 0 },
{"no-sparse", 0, POPT_ARG_VAL, &sparse_files, 0, 0, 0 },
{"no-S", 0, POPT_ARG_VAL, &sparse_files, 0, 0, 0 },
{"preallocate", 0, POPT_ARG_NONE, &preallocate_files, 0, 0, 0},
{"inplace", 0, POPT_ARG_VAL, &inplace, 1, 0, 0 },
{"no-inplace", 0, POPT_ARG_VAL, &inplace, 0, 0, 0 },
-@@ -2723,6 +2725,12 @@ void server_options(char **args, int *argc_p)
+@@ -2727,6 +2729,12 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -384,6 +384,7 @@ has its own detailed description later in this man page.
+@@ -386,6 +386,7 @@ has its own detailed description later in this manpage.
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
--sparse, -S turn sequences of nulls into sparse blocks
+--sparse-block=SIZE set block size used to handle sparse files
--preallocate allocate dest files before writing them
- --write-devices write to devices as files (implies --inplace)
--dry-run, -n perform a trial run with no changes made
-@@ -1614,6 +1615,18 @@ your home directory (remove the '=' for that).
+ --whole-file, -W copy files whole (w/o delta-xfer algorithm)
+@@ -1623,6 +1624,18 @@ your home directory (remove the '=' for that).
(as opposed to allocated sequences of null bytes) if the kernel version and
filesystem type support creating holes in the allocated data.
./configure (optional if already run)
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -77,6 +77,7 @@ extern uid_t our_uid;
+@@ -78,6 +78,7 @@ extern uid_t our_uid;
extern struct stats stats;
extern char *filesfrom_host;
extern char *usermap, *groupmap;
extern char curr_dir[MAXPATHLEN];
-@@ -104,6 +105,8 @@ int file_old_total = 0; /* total of active items that will soon be gone */
+@@ -105,6 +106,8 @@ int file_old_total = 0; /* total of active items that will soon be gone */
int flist_eof = 0; /* all the file-lists are now known */
int xfer_flags_as_varint = 0;
#define NORMAL_NAME 0
#define SLASH_ENDING_NAME 1
#define DOTDIR_NAME 2
-@@ -676,6 +679,23 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -677,6 +680,23 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
stats.total_size += F_LENGTH(file);
}
static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags)
{
static int64 modtime, atime;
-@@ -746,9 +766,13 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -748,9 +768,13 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
outbuf.len = 0;
}
thisname[outbuf.len] = '\0';
if (*thisname
&& (clean_fname(thisname, CFN_REFUSE_DOT_DOT_DIRS) < 0 || (!relative_paths && *thisname == '/'))) {
rprintf(FERROR, "ABORTING due to unsafe pathname from sender: %s\n", thisname);
-@@ -2535,6 +2559,15 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2560,6 +2584,15 @@ struct file_list *recv_file_list(int f, int dir_ndx)
parse_name_map(usermap, True);
if (groupmap)
parse_name_map(groupmap, False);
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -206,6 +206,7 @@ int logfile_format_has_i = 0;
+@@ -207,6 +207,7 @@ int logfile_format_has_i = 0;
int logfile_format_has_o_or_i = 0;
int always_checksum = 0;
int list_only = 0;
#define MAX_BATCH_NAME_LEN 256 /* Must be less than MAXPATHLEN-13 */
char *batch_name = NULL;
-@@ -804,6 +805,7 @@ static struct poptOption long_options[] = {
+@@ -806,6 +807,7 @@ static struct poptOption long_options[] = {
{"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
{"iconv", 0, POPT_ARG_STRING, &iconv_opt, 0, 0, 0 },
{"no-iconv", 0, POPT_ARG_NONE, 0, OPT_NO_ICONV, 0, 0 },
{"ipv4", '4', POPT_ARG_VAL, &default_af_hint, AF_INET, 0, 0 },
{"ipv6", '6', POPT_ARG_VAL, &default_af_hint, AF_INET6, 0, 0 },
{"8-bit-output", '8', POPT_ARG_VAL, &allow_8bit_chars, 1, 0, 0 },
-@@ -2461,6 +2463,24 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2465,6 +2467,24 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
am_starting_up = 0;
return 1;
-@@ -2909,6 +2929,12 @@ void server_options(char **args, int *argc_p)
+@@ -2913,6 +2933,12 @@ void server_options(char **args, int *argc_p)
if (relative_paths && !implied_dirs && (!am_sender || protocol_version >= 30))
args[ac++] = "--no-implied-dirs";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -473,6 +473,7 @@ has its own detailed description later in this man page.
+@@ -474,6 +474,7 @@ has its own detailed description later in this manpage.
--read-batch=FILE read a batched update from FILE
--protocol=NUM force an older protocol version to be used
--iconv=CONVERT_SPEC request charset conversion of filenames
--checksum-seed=NUM set block/file checksum seed (advanced)
--ipv4, -4 prefer IPv4
--ipv6, -6 prefer IPv6
-@@ -3558,6 +3559,25 @@ your home directory (remove the '=' for that).
+@@ -3567,6 +3568,25 @@ your home directory (remove the '=' for that).
free to specify just the local charset for a daemon transfer (e.g.
`--iconv=utf8`).
patch -p1 <patches/xxh3-safety-check.diff
make
-based-on: 55b2a06812e39f15f52e92b979600cb82be210cb
+based-on: d821e4cbfbc66848cdf91a336af26fdb89dd9a8f
diff --git a/checksum.c b/checksum.c
--- a/checksum.c
+++ b/checksum.c