./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -1834,7 +1834,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1837,7 +1837,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)))
-@@ -1870,7 +1870,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1873,7 +1873,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto notify_others;
}
if (!(backupptr = get_backup_name(fname))) {
close(fd);
goto cleanup;
-@@ -1994,7 +1994,7 @@ int atomic_create(struct file_struct *file, char *fname, const char *slnk, const
+@@ -1997,7 +1997,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
-@@ -766,7 +766,8 @@ static struct poptOption long_options[] = {
+@@ -768,7 +768,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 },
-@@ -2687,6 +2688,10 @@ void server_options(char **args, int *argc_p)
+@@ -2682,6 +2683,10 @@ void server_options(char **args, int *argc_p)
}
if (am_sender) {
diff --git a/receiver.c b/receiver.c
--- a/receiver.c
+++ b/receiver.c
-@@ -420,7 +420,7 @@ static void handle_delayed_updates(char *local_name)
+@@ -426,7 +426,7 @@ static void handle_delayed_updates(char *local_name)
struct file_struct *file = cur_flist->files[ndx];
fname = local_name ? local_name : f_name(file, NULL);
if ((partialptr = partial_dir_fname(fname)) != NULL) {
continue;
if (DEBUG_GTE(RECV, 1)) {
rprintf(FINFO, "renaming %s to %s\n",
-@@ -739,7 +739,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -745,7 +745,7 @@ int recv_files(int f_in, int f_out, char *local_name)
} else {
/* Reminder: --inplace && --partial-dir are never
* enabled at the same time. */
--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
-@@ -860,6 +861,13 @@ your home directory (remove the '=' for that).
+@@ -861,6 +862,13 @@ your home directory (remove the '=' for that).
trailing inclusion/exclusion of `*`, the auto-added rule would never be
reached).
diff --git a/rsync.c b/rsync.c
--- a/rsync.c
+++ b/rsync.c
-@@ -721,7 +721,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -733,7 +733,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
goto do_set_file_attrs;
}
rprintf(FERROR, "backup filename too long\n");
return NULL;
-@@ -352,3 +364,13 @@ int make_backup(const char *fname, BOOL prefer_rename)
+@@ -353,3 +365,13 @@ int make_backup(const char *fname, BOOL prefer_rename)
rprintf(FINFO, "backed up %s to %s\n", fname, buf);
return ret;
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -157,10 +157,14 @@ int no_detach
+@@ -160,10 +160,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];
-@@ -173,7 +177,9 @@ char *password_file = NULL;
+@@ -176,7 +180,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;
-@@ -770,7 +776,9 @@ static struct poptOption long_options[] = {
+@@ -772,7 +778,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 },
-@@ -2187,6 +2195,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2194,6 +2202,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;
-@@ -2208,6 +2218,14 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2215,6 +2225,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)
-@@ -2219,6 +2237,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2226,6 +2244,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 */
-@@ -2255,6 +2287,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2262,6 +2294,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);
}
+ parse_filter_str(&filter_list, backup_dir_dels_buf, rule_template(0), 0);
+ }
- if (preserve_times) {
- preserve_times = PRESERVE_FILE_TIMES;
-@@ -2662,6 +2722,10 @@ void server_options(char **args, int *argc_p)
+ if (make_backups && !backup_dir)
+ omit_dir_times = -1; /* Implied, so avoid -O to sender. */
+@@ -2657,6 +2717,10 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--backup-dir";
args[ac++] = backup_dir;
}
/* Only send --suffix if it specifies a non-default value. */
if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) {
-@@ -2670,6 +2734,14 @@ void server_options(char **args, int *argc_p)
+@@ -2665,6 +2729,14 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/errcode.h b/errcode.h
--- a/errcode.h
+++ b/errcode.h
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
static void output_flist(struct file_list *flist);
void init_flist(void)
-@@ -324,6 +346,235 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -326,6 +348,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
-@@ -1201,7 +1452,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1203,7 +1454,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];
-@@ -1347,9 +1598,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1349,9 +1600,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
-@@ -1367,11 +1625,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1369,11 +1627,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))
-@@ -1460,8 +1715,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1462,8 +1717,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2673,7 +2934,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2680,7 +2941,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 */
-@@ -2918,7 +3179,7 @@ void flist_free(struct file_list *flist)
+@@ -2925,7 +3186,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;
-@@ -2969,7 +3230,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2976,7 +3237,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;
-@@ -2985,8 +3246,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2992,8 +3253,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);
-@@ -3008,7 +3269,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -3015,7 +3276,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
}
flist->high = prev_i;
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -52,6 +52,7 @@ extern int delete_after;
+@@ -54,6 +54,7 @@ extern int delete_after;
extern int missing_args;
extern int msgdone_cnt;
extern int ignore_errors;
extern int remove_source_files;
extern int delay_updates;
extern int update_only;
-@@ -612,7 +613,7 @@ static enum filetype get_file_type(mode_t mode)
+@@ -614,7 +615,7 @@ static enum filetype get_file_type(mode_t mode)
}
/* Perform our quick-check heuristic for determining if a file is unchanged. */
{
switch (ftype) {
case FT_REG:
-@@ -623,7 +624,10 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
+@@ -625,7 +626,10 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
* of the file mtime to determine whether to sync. */
if (always_checksum > 0) {
char sum[MAX_DIGEST_LEN];
return memcmp(sum, F_SUM(file), flist_csum_len) == 0;
}
-@@ -951,7 +955,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -953,7 +957,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
best_match = j;
match_level = 1;
}
continue;
if (match_level == 1) {
best_match = j;
-@@ -1210,7 +1214,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1212,7 +1216,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
* --ignore-non-existing, daemon exclude, or mkdir failure. */
static struct file_struct *skip_dir = NULL;
static struct file_list *fuzzy_dirlist[MAX_BASIS_DIRS+1];
struct file_struct *fuzzy_file = NULL;
int fd = -1, f_copy = -1;
stat_x sx, real_sx;
-@@ -1328,8 +1332,9 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1329,8 +1333,9 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fuzzy_dirlist[i] = NULL;
}
}
#ifdef SUPPORT_ACLS
if (!preserve_perms)
dflt_perms = default_perms_for_dir(dn);
-@@ -1337,6 +1342,24 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1338,6 +1343,24 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
parent_dirname = dn;
statret = link_stat(fname, &sx.st, keep_dirlinks && is_dir);
stat_errno = errno;
}
-@@ -1746,22 +1769,6 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1749,22 +1772,6 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
partialptr = NULL;
if (statret != 0 && fuzzy_basis) {
/* Sets fnamecmp_type to FNAMECMP_FUZZY or above. */
fuzzy_file = find_fuzzy(file, fuzzy_dirlist, &fnamecmp_type);
if (fuzzy_file) {
-@@ -1794,7 +1801,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1797,7 +1804,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
-@@ -117,6 +117,7 @@ size_t bwlimit_writemax = 0;
+@@ -120,6 +120,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;
-@@ -573,7 +574,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -575,7 +576,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_STOP_AFTER, OPT_STOP_AT,
OPT_REFUSED_BASE = 9000};
-@@ -729,6 +730,7 @@ static struct poptOption long_options[] = {
+@@ -731,6 +732,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 },
-@@ -1722,6 +1724,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1725,6 +1727,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);
-@@ -2052,6 +2071,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2059,6 +2078,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
#endif
--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
-@@ -702,6 +703,8 @@ your home directory (remove the '=' for that).
+@@ -703,6 +704,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
-@@ -712,6 +715,38 @@ your home directory (remove the '=' for that).
+@@ -713,6 +716,38 @@ your home directory (remove the '=' for that).
can be overridden using either the `--checksum-choice` (`--cc`) option or an
environment variable that is discussed in that option's section.
/* Some utility defines: */
#define F_IS_ACTIVE(f) (f)->basename[0]
#define F_IS_HLINKED(f) ((f)->flags & FLAG_HLINKED)
-@@ -1108,6 +1112,13 @@ typedef struct {
+@@ -1109,6 +1113,13 @@ typedef struct {
#define RELNAMECACHE_LEN (offsetof(relnamecache, fname))
#endif
} *csum_cache = NULL;
static struct file_list *flist_new(int flags, const char *msg);
-@@ -346,7 +355,79 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -348,7 +357,79 @@ static void flist_done_allocating(struct file_list *flist)
flist->pool_boundary = ptr;
}
{
int slot, slots = am_sender ? 1 : basis_dir_cnt + 1;
-@@ -357,6 +438,9 @@ void reset_checksum_cache()
+@@ -359,6 +440,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));
-@@ -367,6 +451,10 @@ void reset_checksum_cache()
+@@ -369,6 +453,10 @@ void reset_checksum_cache()
flist->low = 0;
flist->high = -1;
flist->next = NULL;
}
}
-@@ -374,7 +462,7 @@ void reset_checksum_cache()
+@@ -376,7 +464,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;
-@@ -391,7 +479,7 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -393,7 +481,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);
-@@ -400,7 +488,14 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -402,7 +490,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;
-@@ -429,10 +524,11 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -431,10 +526,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))
-@@ -453,7 +549,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -455,7 +551,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
-@@ -464,7 +560,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -466,7 +562,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;
-@@ -482,13 +585,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -484,13 +587,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
-@@ -538,24 +642,112 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -540,24 +644,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);
}
-@@ -567,12 +759,31 @@ void get_cached_checksum(int slot, const char *fname, struct file_struct *file,
+@@ -569,12 +761,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
-@@ -1553,6 +1764,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1555,6 +1766,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;
}
-@@ -1599,13 +1812,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1601,13 +1814,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' */
-@@ -1717,7 +1930,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1719,7 +1932,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)
-@@ -2109,6 +2322,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -2111,6 +2324,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". */
-@@ -2772,6 +2988,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2776,6 +2992,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
}
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -111,6 +111,7 @@ static int dir_tweaking;
+@@ -113,6 +113,7 @@ static int dir_tweaking;
static int symlink_timeset_failed_flags;
static int need_retouch_dir_times;
static int need_retouch_dir_perms;
static const char *solo_file = NULL;
/* Forward declarations. */
-@@ -1355,7 +1356,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1356,7 +1357,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
}
if (checksum_files) {
}
need_new_dirscan = 0;
}
-@@ -1543,6 +1545,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1544,6 +1546,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
else
change_local_filter_dir(fname, strlen(fname), F_DEPTH(file));
}
prior_dir_file = file;
goto cleanup;
}
-@@ -1807,6 +1810,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1810,6 +1813,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
-@@ -2303,6 +2308,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2306,6 +2311,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];
-@@ -2397,6 +2403,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2400,6 +2406,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
-@@ -1726,7 +1726,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1729,7 +1729,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
case OPT_SUMFILES:
arg = poptGetOptArg(pc);
diff --git a/receiver.c b/receiver.c
--- a/receiver.c
+++ b/receiver.c
-@@ -50,6 +50,7 @@ extern int sparse_files;
+@@ -51,6 +51,7 @@ extern int sparse_files;
extern int preallocate_files;
extern int keep_partial;
extern int checksum_seed;
extern int whole_file;
extern int inplace;
extern int inplace_partial;
-@@ -433,7 +434,7 @@ static void handle_delayed_updates(char *local_name)
+@@ -439,7 +440,7 @@ static void handle_delayed_updates(char *local_name)
"rename failed for %s (from %s)",
full_fname(fname), partialptr);
} else {
|| (preserve_hard_links && F_IS_HLINKED(file)))
send_msg_int(MSG_SUCCESS, ndx);
handle_partial_dir(partialptr, PDIR_DELETE);
-@@ -909,7 +910,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -921,7 +922,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
-@@ -726,9 +726,13 @@ your home directory (remove the '=' for that).
+@@ -727,9 +727,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
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -1114,6 +1114,8 @@ typedef struct {
+@@ -1115,6 +1115,8 @@ typedef struct {
#define CSF_ENABLE (1<<1)
#define CSF_LAX (1<<2)
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1368,7 +1368,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1370,7 +1370,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
#endif
if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -623,7 +623,8 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
+@@ -625,7 +625,8 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
* of the file mtime to determine whether to sync. */
if (always_checksum > 0) {
char sum[MAX_DIGEST_LEN];
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
-@@ -50,7 +50,7 @@ popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
+@@ -51,7 +51,7 @@ popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
popt/popthelp.o popt/poptparse.o
OBJS=$(OBJS1) $(OBJS2) $(OBJS3) @SIMD@ $(DAEMON_OBJ) $(LIBOBJ) @BUILD_ZLIB@ @BUILD_POPT@
# Programs we must have to run the test cases
CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
-@@ -158,7 +158,7 @@ getgroups$(EXEEXT): getgroups.o
+@@ -163,7 +163,7 @@ getgroups$(EXEEXT): getgroups.o
getfsdev$(EXEEXT): getfsdev.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -957,7 +957,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -959,7 +959,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
best_match = j;
match_level = 2;
}
best_match = j;
match_level = 3;
break;
-@@ -983,9 +983,16 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -985,9 +985,16 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
goto got_nothing_for_ya;
}
#ifdef SUPPORT_HARD_LINKS
if (atimes_ndx)
set_file_attrs(fname, file, sxp, NULL, 0);
if (preserve_hard_links && F_IS_HLINKED(file))
-@@ -1099,7 +1106,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1101,7 +1108,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
if (match_level == 3) {
#ifdef SUPPORT_HARD_LINKS
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -573,7 +573,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -575,7 +575,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_STOP_AFTER, OPT_STOP_AT,
OPT_REFUSED_BASE = 9000};
-@@ -733,6 +733,7 @@ static struct poptOption long_options[] = {
+@@ -735,6 +735,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 },
-@@ -986,6 +987,9 @@ static void set_refuse_options(void)
+@@ -989,6 +990,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
-@@ -1315,6 +1319,8 @@ char *alt_dest_opt(int type)
+@@ -1318,6 +1322,8 @@ char *alt_dest_opt(int type)
return "--copy-dest";
case LINK_DEST:
return "--link-dest";
default:
NOISY_DEATH("Unknown alt_dest_opt type");
}
-@@ -1685,6 +1691,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1688,6 +1694,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
want_dest_type = LINK_DEST;
goto set_dest_dir;
--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)
-@@ -2347,6 +2348,17 @@ your home directory (remove the '=' for that).
+@@ -2362,6 +2363,17 @@ your home directory (remove the '=' for that).
specified (or implied by `-a`). You can work-around this bug by avoiding
the `-o` option when sending to an old rsync.
diff --git a/t_stub.c b/t_stub.c
--- a/t_stub.c
+++ b/t_stub.c
-@@ -37,6 +37,7 @@ size_t max_alloc = 0; /* max_alloc is needed when combined with util2.o */
+@@ -39,6 +39,7 @@ size_t max_alloc = 0; /* max_alloc is needed when combined with util2.o */
char *partial_dir;
char *module_dir;
filter_rule_list daemon_filter_list;
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
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
-@@ -72,6 +72,8 @@ int delete_during = 0;
+@@ -75,6 +75,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;
-@@ -816,6 +818,8 @@ static struct poptOption long_options[] = {
+@@ -819,6 +821,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 },
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
extern int write_devices;
extern int preserve_specials;
extern int preserve_hard_links;
-@@ -1676,7 +1677,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1677,7 +1678,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
- if (ftype != FT_REG) {
+ if (ftype != FT_REG && (!copy_devices || ftype != FT_DEVICE)) {
- if (solo_file)
- fname = f_name(file, NULL);
- rprintf(FINFO, "skipping non-regular file \"%s\"\n", fname);
-@@ -1897,6 +1898,9 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+ if (INFO_GTE(NONREG, 1)) {
+ if (solo_file)
+ fname = f_name(file, NULL);
+@@ -1900,6 +1901,9 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fnamecmp_type = FNAMECMP_BACKUP;
}
int write_devices = 0;
int preserve_links = 0;
int preserve_hard_links = 0;
-@@ -652,6 +653,7 @@ static struct poptOption long_options[] = {
+@@ -654,6 +655,7 @@ static struct poptOption long_options[] = {
{"no-D", 0, POPT_ARG_NONE, 0, OPT_NO_D, 0, 0 },
{"devices", 0, POPT_ARG_VAL, &preserve_devices, 1, 0, 0 },
{"no-devices", 0, POPT_ARG_VAL, &preserve_devices, 0, 0, 0 },
{"write-devices", 0, POPT_ARG_VAL, &write_devices, 1, 0, 0 },
{"no-write-devices", 0, POPT_ARG_VAL, &write_devices, 0, 0, 0 },
{"specials", 0, POPT_ARG_VAL, &preserve_specials, 1, 0, 0 },
-@@ -942,6 +944,7 @@ static void set_refuse_options(void)
+@@ -945,6 +947,7 @@ static void set_refuse_options(void)
|| strcmp("iconv", longName) == 0
|| strcmp("no-iconv", longName) == 0
|| strcmp("checksum-seed", longName) == 0
|| strcmp("write-devices", longName) == 0 /* disable wild-match (it gets refused below) */
|| strcmp("log-format", longName) == 0 /* aka out-format (NOT log-file-format) */
|| strcmp("sender", longName) == 0
-@@ -953,6 +956,7 @@ static void set_refuse_options(void)
+@@ -956,6 +959,7 @@ static void set_refuse_options(void)
assert(list_end != NULL);
if (am_daemon) { /* Refused by default, but can be accepted via a negated exact match. */
parse_one_refuse_match(0, "write-devices", list_end);
}
-@@ -2856,6 +2860,9 @@ void server_options(char **args, int *argc_p)
+@@ -2858,6 +2862,9 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
diff --git a/rsync.c b/rsync.c
--- a/rsync.c
+++ b/rsync.c
-@@ -33,6 +33,7 @@ extern int preserve_xattrs;
- extern int preserve_perms;
- extern int preserve_executability;
- extern int preserve_times;
+@@ -46,6 +46,7 @@ extern int allow_8bit_chars;
+ extern int protocol_version;
+ extern int got_kill_signal;
+ extern int called_from_signal_handler;
+extern int copy_devices;
- extern int am_root;
- extern int am_server;
- extern int am_daemon;
-@@ -419,7 +420,8 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr, cha
+ extern int inc_recurse;
+ extern int inplace;
+ extern int flist_eof;
+@@ -420,7 +421,8 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr, cha
if (iflags & ITEM_TRANSFER) {
int i = ndx - cur_flist->ndx_start;
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -65,6 +65,7 @@ extern int append_mode;
+@@ -67,6 +67,7 @@ extern int append_mode;
extern int make_backups;
extern int csum_length;
extern int ignore_times;
extern int size_only;
extern OFF_T max_size;
extern OFF_T min_size;
-@@ -619,6 +620,9 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
+@@ -621,6 +622,9 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
if (st->st_size != F_LENGTH(file))
return 0;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -110,6 +110,7 @@ int safe_symlinks = 0;
+@@ -113,6 +113,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;
-@@ -679,6 +680,7 @@ static struct poptOption long_options[] = {
+@@ -681,6 +682,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 },
-@@ -2743,6 +2745,9 @@ void server_options(char **args, int *argc_p)
+@@ -2738,6 +2740,9 @@ void server_options(char **args, int *argc_p)
else if (missing_args == 1 && !am_sender)
args[ac++] = "--ignore-missing-args";
--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
-@@ -664,6 +665,14 @@ your home directory (remove the '=' for that).
+@@ -665,6 +666,14 @@ your home directory (remove the '=' for that).
after using another mirroring system which may not preserve timestamps
exactly.
./configure
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
+sbindir=@sbindir@
libdir=@libdir@/rsync
mandir=@mandir@
-
-@@ -33,7 +34,7 @@ SIMD_x86_64=simd-checksum-x86_64.o simd-checksum-avx2.o
+ with_rrsync=@with_rrsync@
+@@ -34,7 +35,7 @@ SIMD_x86_64=simd-checksum-x86_64.o simd-checksum-avx2.o
ASM_x86_64=lib/md5-asm-x86_64.o
GENFILES=configure.sh aclocal.m4 config.h.in rsync.1 rsync.1.html \
HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h itypes.h inums.h \
lib/pool_alloc.h lib/mdigest.h lib/md-defines.h
LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
-@@ -43,7 +44,7 @@ zlib_OBJS=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
+@@ -44,7 +45,7 @@ zlib_OBJS=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
util1.o util2.o main.o checksum.o match.o syscall.o log.o backup.o delete.o
OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
OBJS3=progress.o pipe.o @ASM@
DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
-@@ -75,10 +76,12 @@ install: all
+@@ -76,10 +77,12 @@ install: all
-$(MKDIR_P) $(DESTDIR)$(bindir)
$(INSTALLCMD) $(INSTALL_STRIP) -m 755 rsync$(EXEEXT) $(DESTDIR)$(bindir)
$(INSTALLCMD) -m 755 $(srcdir)/rsync-ssl $(DESTDIR)$(bindir)
if test -f rsync-ssl.1; then $(INSTALLMAN) -m 644 rsync-ssl.1 $(DESTDIR)$(mandir)/man1; fi
+ if test -f rsyncdb.1; then $(INSTALLMAN) -m 644 rsyncdb.1 $(DESTDIR)$(mandir)/man1; fi
if test -f rsyncd.conf.5; then $(INSTALLMAN) -m 644 rsyncd.conf.5 $(DESTDIR)$(mandir)/man5; fi
-
- install-ssl-daemon: stunnel-rsyncd.conf
-@@ -96,10 +99,13 @@ install-strip:
+ if test "$(with_rrsync)" = yes; then \
+ $(INSTALLCMD) -m 755 $(srcdir)/support/rrsync $(DESTDIR)$(bindir); \
+@@ -101,10 +104,13 @@ install-strip:
rsync$(EXEEXT): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
loadparm.o: default-dont-compress.h daemon-parm.h
flist.o: rounding.h
-@@ -110,6 +116,9 @@ default-cvsignore.h default-dont-compress.h: rsync.1.md define-from-md.awk
+@@ -115,6 +121,9 @@ default-cvsignore.h default-dont-compress.h: rsync.1.md define-from-md.awk
help-rsync.h help-rsyncd.h: rsync.1.md help-from-md.awk
$(AWK) -f $(srcdir)/help-from-md.awk -v hfile=$@ $(srcdir)/rsync.1.md
daemon-parm.h: daemon-parm.txt daemon-parm.awk
$(AWK) -f $(srcdir)/daemon-parm.awk $(srcdir)/daemon-parm.txt
-@@ -247,7 +256,7 @@ proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c daemon-parm.h
+@@ -252,7 +261,7 @@ proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c daemon-parm.h
$(AWK) -f $(srcdir)/mkproto.awk $(srcdir)/*.c $(srcdir)/lib/compat.c daemon-parm.h
.PHONY: man
--man: rsync.1 rsync-ssl.1 rsyncd.conf.5
-+man: rsync.1 rsync-ssl.1 rsyncd.conf.5 rsyncdb.1
+-man: rsync.1 rsync-ssl.1 rsyncd.conf.5 rrsync.1
++man: rsync.1 rsync-ssl.1 rsyncd.conf.5 rrsync.1 rsyncdb.1
rsync.1: rsync.1.md md2man version.h Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsync.1.md
-@@ -258,9 +267,12 @@ rsync-ssl.1: rsync-ssl.1.md md2man version.h Makefile
- rsyncd.conf.5: rsyncd.conf.5.md md2man version.h Makefile
- @$(srcdir)/maybe-make-man $(srcdir) rsyncd.conf.5.md
+@@ -266,9 +275,12 @@ rsyncd.conf.5: rsyncd.conf.5.md md2man version.h Makefile
+ rrsync.1: support/rrsync.1.md md2man Makefile
+ @$(srcdir)/maybe-make-man $(srcdir) support/rrsync.1.md
+rsyncdb.1: rsyncdb.1.md md2man NEWS.md Makefile
+ @$(srcdir)/maybe-make-man $(srcdir) rsyncdb.1.md
netdb.h malloc.h float.h limits.h iconv.h libcharset.h langinfo.h mcheck.h \
sys/acl.h acl/libacl.h attr/xattr.h sys/xattr.h sys/extattr.h dl.h \
popt.h popt/popt.h linux/falloc.h netinet/in_systm.h netgroup.h \
-@@ -1395,6 +1396,48 @@ if test x"$enable_acl_support" = x"no" -o x"$enable_xattr_support" = x"no" -o x"
+@@ -1402,6 +1403,48 @@ if test x"$enable_acl_support" = x"no" || test x"$enable_xattr_support" = x"no"
fi
fi
extern int eol_nulls;
extern int atimes_ndx;
extern int crtimes_ndx;
-@@ -1367,11 +1368,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1369,11 +1370,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))
-@@ -1460,8 +1458,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1462,8 +1460,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2145,6 +2147,9 @@ void send_extra_file_list(int f, int at_least)
+@@ -2147,6 +2149,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[])
-@@ -2168,6 +2173,13 @@ 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[])
| (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");
-@@ -2511,6 +2523,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2515,6 +2527,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
}
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -61,6 +61,7 @@ extern int ignore_non_existing;
+@@ -63,6 +63,7 @@ extern int ignore_non_existing;
extern int want_xattr_optim;
extern int modify_window;
extern int inplace;
extern int append_mode;
extern int make_backups;
extern int csum_length;
-@@ -624,6 +625,8 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
+@@ -626,6 +627,8 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
if (always_checksum > 0) {
char sum[MAX_DIGEST_LEN];
file_checksum(fn, st, sum);
return memcmp(sum, F_SUM(file), flist_csum_len) == 0;
}
-@@ -2265,6 +2268,13 @@ void generate_files(int f_out, const char *local_name)
+@@ -2268,6 +2271,13 @@ void generate_files(int f_out, const char *local_name)
: "enabled");
}
dflt_perms = (ACCESSPERMS & ~orig_umask);
do {
-@@ -2390,6 +2400,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2393,6 +2403,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
-@@ -83,6 +83,7 @@ int am_root = 0; /* 0 = normal, 1 = root, 2 = --super, -1 = --fake-super */
+@@ -86,6 +86,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 */
-@@ -96,6 +97,7 @@ int use_qsort = 0;
+@@ -99,6 +100,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 human_readable = 1;
-@@ -104,6 +106,9 @@ int mkpath_dest_arg = 0;
+@@ -107,6 +109,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;
-@@ -282,6 +287,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
+@@ -286,6 +291,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"),
-@@ -573,6 +579,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -575,6 +581,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_STOP_AFTER, OPT_STOP_AT,
-@@ -729,6 +736,10 @@ static struct poptOption long_options[] = {
+@@ -731,6 +738,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 },
-@@ -825,6 +836,9 @@ static struct poptOption long_options[] = {
+@@ -828,6 +839,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}
};
-@@ -853,6 +867,31 @@ static struct poptOption long_daemon_options[] = {
+@@ -856,6 +870,31 @@ static struct poptOption long_daemon_options[] = {
{0,0,0,0, 0, 0, 0}
};
static char err_buf[200];
-@@ -978,6 +1017,8 @@ static void set_refuse_options(void)
+@@ -981,6 +1020,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
-@@ -1285,6 +1326,102 @@ static void create_refuse_error(int which)
+@@ -1288,6 +1329,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
-@@ -1341,6 +1478,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1344,6 +1481,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
return 0;
}
set_refuse_options();
#ifdef ICONV_OPTION
-@@ -1459,6 +1602,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1462,6 +1605,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
-@@ -1531,6 +1680,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1534,6 +1683,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
preserve_devices = preserve_specials = 0;
break;
extern int am_root;
extern int am_server;
extern int inc_recurse;
-@@ -433,6 +435,11 @@ static void handle_delayed_updates(char *local_name)
+@@ -439,6 +441,11 @@ static void handle_delayed_updates(char *local_name)
"rename failed for %s (from %s)",
full_fname(fname), partialptr);
} else {
if (remove_source_files
|| (preserve_hard_links && F_IS_HLINKED(file)))
send_msg_int(MSG_SUCCESS, ndx);
-@@ -542,6 +549,9 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -548,6 +555,9 @@ int recv_files(int f_in, int f_out, char *local_name)
if (whole_file < 0)
whole_file = 0;
progress_init();
while (1) {
-@@ -881,6 +891,8 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -893,6 +903,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,
-@@ -894,6 +906,8 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -906,6 +918,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.c b/rsync.c
--- a/rsync.c
+++ b/rsync.c
-@@ -39,6 +39,7 @@ extern int am_daemon;
+@@ -41,6 +41,7 @@ extern int am_daemon;
extern int am_sender;
extern int am_receiver;
extern int am_generator;
extern int am_starting_up;
extern int allow_8bit_chars;
extern int protocol_version;
-@@ -807,6 +808,8 @@ struct file_list *flist_for_ndx(int ndx, const char *fatal_error_loc)
+@@ -819,6 +820,8 @@ struct file_list *flist_for_ndx(int ndx, const char *fatal_error_loc)
const char *who_am_i(void)
{
#define NDX_DONE -1
#define NDX_FLIST_EOF -2
#define NDX_DEL_STATS -3
-@@ -1433,7 +1437,8 @@ extern short info_levels[], debug_levels[];
+@@ -1431,7 +1435,8 @@ extern short info_levels[], debug_levels[];
#define DEBUG_CHDIR (DEBUG_BIND+1)
#define DEBUG_CONNECT (DEBUG_CHDIR+1)
#define DEBUG_CMD (DEBUG_CONNECT+1)
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -465,7 +465,9 @@ static int fattr_find(struct file_struct *f, char *fname)
+@@ -467,7 +467,9 @@ static int fattr_find(struct file_struct *f, char *fname)
continue;
}
}
diff = u_strcmp(fmid->basename, f->basename);
if (diff == 0) {
good_match = mid;
-@@ -1979,6 +1981,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1982,6 +1984,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
-@@ -734,7 +734,9 @@ static struct poptOption long_options[] = {
+@@ -736,7 +736,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 },
-@@ -2724,8 +2726,14 @@ void server_options(char **args, int *argc_p)
+@@ -2719,8 +2721,14 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";
--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
-@@ -2280,6 +2282,17 @@ your home directory (remove the '=' for that).
+@@ -2295,6 +2297,17 @@ your home directory (remove the '=' for that).
otential alternate-basis files will be removed as the transfer progresses.
This option conflicts with `--inplace` and `--append`.
a file that can't use it, while missing out on giving it to a file
that could use it.
-based-on: c8e7c4b3522034f194243093d45c7f9b0e67a95d
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/backup.c b/backup.c
--- a/backup.c
+++ b/backup.c
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -79,6 +79,7 @@ extern int always_checksum;
+@@ -81,6 +81,7 @@ extern int always_checksum;
extern int flist_csum_len;
extern char *partial_dir;
extern int alt_dest_type;
extern int whole_file;
extern int list_only;
extern int read_batch;
-@@ -97,11 +98,13 @@ extern char *tmpdir;
+@@ -99,11 +100,13 @@ extern char *tmpdir;
extern char *basis_dir[MAX_BASIS_DIRS+1];
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern filter_rule_list filter_list, daemon_filter_list;
static int deldelay_size = 0, deldelay_cnt = 0;
static char *deldelay_buf = NULL;
static int deldelay_fd = -1;
-@@ -266,14 +269,19 @@ static void do_delayed_deletions(char *delbuf)
+@@ -268,14 +271,19 @@ static void do_delayed_deletions(char *delbuf)
* all the --delete-WHEN options. Note that the fbuf pointer must point to a
* MAXPATHLEN buffer with the name of the directory in it (the functions we
* call will append names onto the end, but the old dir value will be restored
if (!fbuf) {
change_local_filter_dir(NULL, 0, 0);
-@@ -287,17 +295,22 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t fs_dev)
+@@ -289,17 +297,22 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t fs_dev)
maybe_send_keepalive(time(NULL), MSK_ALLOW_FLUSH);
if (io_error & IOERR_GENERAL && !ignore_errors) {
if (one_file_system) {
if (!dev_tbl)
dev_tbl = hashtable_create(16, HT_KEY64);
-@@ -313,6 +326,14 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t fs_dev)
+@@ -315,6 +328,14 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t fs_dev)
dirlist = get_dirlist(fbuf, dlen, 0);
/* If an item in dirlist is not found in flist, delete it
* from the filesystem. */
for (i = dirlist->used; i--; ) {
-@@ -325,6 +346,10 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t fs_dev)
+@@ -327,6 +348,10 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t fs_dev)
f_name(fp, NULL));
continue;
}
/* Here we want to match regardless of file type. Replacement
* of a file with one of another type is handled separately by
* a delete_item call with a DEL_MAKE_ROOM flag. */
-@@ -333,14 +358,19 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t fs_dev)
+@@ -335,14 +360,19 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t fs_dev)
if (!(fp->mode & S_IWUSR) && !am_root && fp->flags & FLAG_OWNED_BY_US)
flags |= DEL_NO_UID_WRITE;
f_name(fp, delbuf);
flist_free(dirlist);
}
-@@ -376,14 +406,125 @@ static void do_delete_pass(void)
+@@ -378,14 +408,125 @@ static void do_delete_pass(void)
|| !S_ISDIR(st.st_mode))
continue;
static inline int mtime_differs(STRUCT_STAT *stp, struct file_struct *file)
{
#ifdef ST_MTIME_NSEC
-@@ -1177,6 +1318,7 @@ static void list_file_entry(struct file_struct *f)
+@@ -1179,6 +1320,7 @@ static void list_file_entry(struct file_struct *f)
}
}
static int phase = 0;
static int dflt_perms;
-@@ -1314,7 +1456,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1315,7 +1457,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
&& do_stat(dn, &sx.st) < 0) {
if (dry_run)
goto parent_is_dry_missing;
rsyserr(FERROR_XFER, errno,
"recv_generator: mkdir %s failed",
full_fname(dn));
-@@ -1467,7 +1609,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1468,7 +1610,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
if (real_ret != 0 && do_mkdir(fname,file->mode|added_perms) < 0 && errno != EEXIST) {
if (!relative_paths || errno != ENOENT
|| (do_mkdir(fname, file->mode|added_perms) < 0 && errno != EEXIST)) {
rsyserr(FERROR_XFER, errno,
"recv_generator: mkdir %s failed",
-@@ -1515,9 +1657,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1516,9 +1658,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
else if (delete_during && f_out != -1 && !phase
&& !(file->flags & FLAG_MISSING_DIR)) {
change_local_filter_dir(fname, strlen(fname), F_DEPTH(file));
}
prior_dir_file = file;
-@@ -1783,8 +1928,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1786,8 +1931,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
#endif
rsyserr(FERROR_XFER, stat_errno, "recv_generator: failed to stat %s",
full_fname(fname));
goto cleanup;
-@@ -2248,6 +2399,12 @@ void generate_files(int f_out, const char *local_name)
+@@ -2251,6 +2402,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) {
-@@ -2256,7 +2413,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2259,7 +2416,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",
-@@ -2292,7 +2449,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2295,7 +2452,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));
}
-@@ -2339,7 +2496,21 @@ void generate_files(int f_out, const char *local_name)
+@@ -2342,7 +2499,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
-@@ -85,6 +85,7 @@ int am_server = 0;
+@@ -87,6 +87,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;
-@@ -734,6 +735,7 @@ static struct poptOption long_options[] = {
+@@ -735,6 +736,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 },
-@@ -2348,7 +2350,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2341,7 +2343,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
inplace = 1;
}
partial_dir = tmp_partialdir;
if (inplace) {
-@@ -2357,6 +2359,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2350,6 +2352,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;
}
-@@ -2723,6 +2726,8 @@ void server_options(char **args, int *argc_p)
+@@ -2716,6 +2719,8 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";
--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
-@@ -2264,6 +2265,22 @@ your home directory (remove the '=' for that).
+@@ -2278,6 +2279,22 @@ your home directory (remove the '=' for that).
fuzzy-match files, so either use `--delete-after` or specify some filename
exclusions if you need to prevent this.
diff --git a/util1.c b/util1.c
--- a/util1.c
+++ b/util1.c
-@@ -183,7 +183,7 @@ int set_times(const char *fname, STRUCT_STAT *stp)
+@@ -184,7 +184,7 @@ int set_times(const char *fname, STRUCT_STAT *stp)
/* Create any necessary directories in fname. Any missing directories are
* created with default permissions. Returns < 0 on error, or the number
* of directories created. */
{
char *end, *p;
int ret = 0;
-@@ -214,7 +214,7 @@ int make_path(char *fname, int flags)
+@@ -215,7 +215,7 @@ int make_path(char *fname, int flags)
else
errno = ENOTDIR;
}
ret++;
break;
}
-@@ -253,7 +253,7 @@ int make_path(char *fname, int flags)
+@@ -254,7 +254,7 @@ int make_path(char *fname, int flags)
p += strlen(p);
if (ret < 0) /* Skip mkdir on error, but keep restoring the path. */
continue;
ret = -ret - 1;
else
ret++;
-@@ -1175,6 +1175,32 @@ char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr)
+@@ -1176,6 +1176,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
-@@ -1268,7 +1294,7 @@ int handle_partial_dir(const char *fname, int create)
+@@ -1269,7 +1295,7 @@ int handle_partial_dir(const char *fname, int create)
}
statret = -1;
}
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
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;
-@@ -754,6 +755,8 @@ static struct poptOption long_options[] = {
+@@ -756,6 +757,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 },
--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
-@@ -3028,6 +3029,16 @@ your home directory (remove the '=' for that).
+@@ -3048,6 +3049,16 @@ your home directory (remove the '=' for that).
update algorithm that is even more atomic (it uses `--link-dest` and a
parallel hierarchy of files).
#ifndef S_BLKSIZE
# if defined hpux || defined __hpux__ || defined __hpux
# define S_BLKSIZE 1024
-@@ -95,7 +97,12 @@ int do_symlink(const char *lnk, const char *fname)
+@@ -95,7 +97,12 @@ int do_symlink(const char *lnk, const char *path)
* and write the lnk into it. */
if (am_root < 0) {
int ok, len = strlen(lnk);
-- int fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC, S_IWUSR|S_IRUSR);
+- int fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, S_IWUSR|S_IRUSR);
+ int flags = O_WRONLY|O_CREAT|O_TRUNC;
+
+ if (direct_io)
+ flags |= O_DIRECT;
+
-+ int fd = open(fname, flags, S_IWUSR|S_IRUSR);
++ int fd = open(path, flags, S_IWUSR|S_IRUSR);
if (fd < 0)
return -1;
ok = write(fd, lnk, len) == len;
return open(pathname, flags | O_BINARY, mode);
}
-@@ -664,6 +673,9 @@ int do_open_nofollow(const char *pathname, int flags)
+@@ -681,6 +690,9 @@ int do_open_nofollow(const char *pathname, int flags)
#endif
}
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -55,6 +55,7 @@ extern int ignore_errors;
+@@ -57,6 +57,7 @@ extern int ignore_errors;
extern int remove_source_files;
extern int delay_updates;
extern int update_only;
extern int human_readable;
extern int ignore_existing;
extern int ignore_non_existing;
-@@ -1710,6 +1711,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1713,6 +1714,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
fnamecmp_type = FNAMECMP_FNAME;
if (statret == 0 && !(stype == FT_REG || (write_devices && stype == FT_DEVICE))) {
-@@ -2154,6 +2161,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2157,6 +2164,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;
-@@ -2179,6 +2187,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2182,6 +2190,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
-@@ -62,6 +62,7 @@ int preserve_times = 0;
- int preserve_atimes = 0;
- int preserve_crtimes = 0;
+@@ -64,6 +64,7 @@ int preserve_crtimes = 0;
+ int omit_dir_times = 0;
+ int omit_link_times = 0;
int update_only = 0;
+int downdate_only = 0;
int open_noatime = 0;
int cvs_exclude = 0;
int dry_run = 0;
-@@ -683,6 +684,7 @@ static struct poptOption long_options[] = {
+@@ -685,6 +686,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 },
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
extern int delete_during;
extern int missing_args;
extern int eol_nulls;
-@@ -383,6 +384,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -385,6 +386,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
-@@ -426,6 +430,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -428,6 +432,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) {
-@@ -587,6 +599,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -589,6 +601,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)) {
-@@ -681,6 +697,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -683,6 +699,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
-@@ -797,6 +816,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -799,6 +818,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);
-@@ -869,6 +892,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -871,6 +894,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)
-@@ -1027,6 +1054,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -1029,6 +1056,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) {
-@@ -1428,6 +1459,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1430,6 +1461,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,8 +43,10 @@ extern int write_devices;
+@@ -43,10 +43,12 @@ extern int write_devices;
extern int preserve_specials;
extern int preserve_hard_links;
extern int preserve_executability;
+extern int preserve_fileflags;
extern int preserve_perms;
- extern int preserve_times;
+ extern int preserve_mtimes;
+ extern int omit_dir_times;
+ extern int omit_link_times;
+extern int force_change;
extern int delete_mode;
extern int delete_before;
extern int delete_during;
-@@ -484,6 +486,10 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
+@@ -486,6 +488,10 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
return 0;
if (perms_differ(file, sxp))
return 0;
if (ownership_differs(file, sxp))
return 0;
#ifdef SUPPORT_ACLS
-@@ -545,6 +551,11 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -547,6 +553,11 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
iflags |= ITEM_REPORT_OWNER;
if (gid_ndx && !(file->flags & FLAG_SKIP_GROUP) && sxp->st.st_gid != (gid_t)F_GROUP(file))
iflags |= ITEM_REPORT_GROUP;
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
if (!ACL_READY(*sxp))
-@@ -1450,6 +1461,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1451,6 +1462,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
if (!preserve_perms) { /* See comment in non-dir code below. */
file->mode = dest_mode(file->mode, sx.st.st_mode, dflt_perms, statret == 0);
}
if (statret != 0 && basis_dir[0] != NULL) {
int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &sx, itemizing, code);
if (j == -2) {
-@@ -1492,10 +1507,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1493,10 +1508,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
* readable and writable permissions during the time we are
* putting files within them. This is then restored to the
* former permissions after the transfer is done. */
rsyserr(FERROR_XFER, errno,
"failed to modify permissions on %s",
full_fname(fname));
-@@ -1530,6 +1550,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1531,6 +1551,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
int exists = statret == 0 && stype != FT_DIR;
file->mode = dest_mode(file->mode, sx.st.st_mode, dflt_perms, exists);
}
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links && F_HLINK_NOT_FIRST(file)
-@@ -2099,17 +2123,25 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -2102,17 +2126,25 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
continue;
fname = f_name(file, NULL);
if (fix_dir_perms)
int preserve_executability = 0;
int preserve_devices = 0;
int preserve_specials = 0;
-@@ -90,6 +91,7 @@ int numeric_ids = 0;
+@@ -93,6 +94,7 @@ int numeric_ids = 0;
int msgs2stderr = 2; /* Default: send errors to stderr for local & remote-shell transfers */
int allow_8bit_chars = 0;
int force_delete = 0;
int io_timeout = 0;
int prune_empty_dirs = 0;
int use_qsort = 0;
-@@ -614,6 +616,8 @@ static struct poptOption long_options[] = {
+@@ -616,6 +618,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 },
-@@ -711,6 +715,12 @@ static struct poptOption long_options[] = {
+@@ -713,6 +717,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 },
-@@ -998,6 +1008,14 @@ static void set_refuse_options(void)
+@@ -1001,6 +1011,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++) {
-@@ -2607,6 +2625,9 @@ void server_options(char **args, int *argc_p)
+@@ -2602,6 +2620,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;
-@@ -2715,6 +2736,16 @@ void server_options(char **args, int *argc_p)
+@@ -2710,6 +2731,16 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--delete-excluded";
if (force_delete)
args[ac++] = "--force";
--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
-@@ -718,6 +722,7 @@ your home directory (remove the '=' for that).
+@@ -719,6 +723,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` is specified, in which case `-r` is not implied.
-@@ -1082,7 +1087,7 @@ your home directory (remove the '=' for that).
+@@ -1087,7 +1092,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` for an analogous option for the receiving side.
-@@ -1268,6 +1273,29 @@ your home directory (remove the '=' for that).
+@@ -1273,6 +1278,29 @@ your home directory (remove the '=' for that).
those used by `--fake-super`) unless you repeat the option (e.g. `-XX`).
This "copy all xattrs" mode cannot be used with `--fake-super`.
0. `--chmod=CHMOD`
This option tells rsync to apply one or more comma-separated "chmod" modes
-@@ -1741,7 +1769,7 @@ your home directory (remove the '=' for that).
+@@ -1756,7 +1784,7 @@ your home directory (remove the '=' for that).
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 directory, it will only be
that, this option is independent of any other type of delete processing.
The missing source files are represented by special file-list entries which
-@@ -1752,15 +1780,16 @@ your home directory (remove the '=' for that).
+@@ -1767,15 +1795,16 @@ your home directory (remove the '=' for that).
Tells `--delete` to go ahead and delete files even when there are I/O
errors.
0. `--max-delete=NUM`
-@@ -2716,7 +2745,7 @@ your home directory (remove the '=' for that).
+@@ -2736,7 +2765,7 @@ your home directory (remove the '=' for that).
output of other verbose messages).
The "%i" escape has a cryptic output that is 11 letters long. The general
extern int preserve_perms;
+extern int preserve_fileflags;
extern int preserve_executability;
- extern int preserve_times;
- extern int am_root;
-@@ -467,6 +468,39 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms,
+ extern int preserve_mtimes;
+ extern int omit_dir_times;
+@@ -468,6 +469,39 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms,
return new_mode;
}
static int same_mtime(struct file_struct *file, STRUCT_STAT *st, int extra_accuracy)
{
#ifdef ST_MTIME_NSEC
-@@ -543,7 +577,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -544,7 +578,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
if (am_root >= 0) {
uid_t uid = change_uid ? (uid_t)F_OWNER(file) : sxp->st.st_uid;
gid_t gid = change_gid ? (gid_t)F_GROUP(file) : sxp->st.st_gid;
/* We shouldn't have attempted to change uid
* or gid unless have the privilege. */
rsyserr(FERROR_XFER, errno, "%s %s failed",
-@@ -642,7 +676,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -654,7 +688,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)) {
if (ret < 0) {
rsyserr(FERROR_XFER, errno,
"failed to set permissions on %s",
-@@ -654,6 +688,19 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -666,6 +700,19 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
}
#endif
if (INFO_GTE(NAME, 2) && flags & ATTRS_REPORT) {
if (updated)
rprintf(FCLIENT, "%s\n", fname);
-@@ -731,7 +778,8 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -743,7 +790,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,
/* move tmp file over real file */
if (DEBUG_GTE(RECV, 1))
-@@ -748,6 +796,10 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -760,6 +808,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. */
extern int inplace;
extern int preallocate_files;
extern int preserve_perms;
-@@ -81,7 +82,23 @@ int do_unlink(const char *fname)
+@@ -81,7 +82,23 @@ int do_unlink(const char *path)
{
if (dry_run) return 0;
RETURN_ERROR_IF_RO_OR_LO;
-- return unlink(fname);
-+ if (unlink(fname) == 0)
+- return unlink(path);
++ if (unlink(path) == 0)
+ return 0;
+#ifdef SUPPORT_FORCE_CHANGE
+ if (force_change && errno == EPERM) {
+ STRUCT_STAT st;
+
-+ if (x_lstat(fname, &st, NULL) == 0
-+ && make_mutable(fname, st.st_mode, st.st_flags, force_change) > 0) {
-+ if (unlink(fname) == 0)
++ if (x_lstat(path, &st, NULL) == 0
++ && make_mutable(path, st.st_mode, st.st_flags, force_change) > 0) {
++ if (unlink(path) == 0)
+ return 0;
-+ undo_make_mutable(fname, st.st_flags);
++ undo_make_mutable(path, st.st_flags);
+ }
+ /* TODO: handle immutable directories */
+ errno = EPERM;
{
static int switch_step = 0;
int code;
-@@ -260,17 +313,72 @@ int do_chmod(const char *path, mode_t mode)
+@@ -265,17 +318,72 @@ int do_chmod(const char *path, mode_t mode)
code = chmod(path, mode & CHMOD_BITS); /* DISCOURAGED FUNCTION */
break;
}
diff --git a/t_stub.c b/t_stub.c
--- a/t_stub.c
+++ b/t_stub.c
-@@ -28,6 +28,8 @@ int protect_args = 0;
+@@ -29,6 +29,8 @@ int protect_args = 0;
int module_id = -1;
int relative_paths = 0;
int module_dirlen = 0;
+int force_change = 0;
+int preserve_acls = 0;
- int preserve_times = 0;
+ int preserve_mtimes = 0;
int preserve_xattrs = 0;
int preserve_perms = 0;
-@@ -110,3 +112,23 @@ filter_rule_list daemon_filter_list;
+@@ -112,3 +114,23 @@ filter_rule_list daemon_filter_list;
{
return cst ? 0 : 0;
}
diff --git a/util1.c b/util1.c
--- a/util1.c
+++ b/util1.c
-@@ -33,6 +33,7 @@ extern int relative_paths;
- extern int preserve_times;
+@@ -35,6 +35,7 @@ extern int preserve_mtimes;
extern int preserve_xattrs;
+ extern int omit_link_times;
extern int preallocate_files;
+extern int force_change;
extern char *module_dir;
extern unsigned int module_dirlen;
extern char *partial_dir;
-@@ -115,6 +116,33 @@ void print_child_argv(const char *prefix, char **cmd)
+@@ -117,6 +118,33 @@ void print_child_argv(const char *prefix, char **cmd)
rprintf(FCLIENT, " (%d args)\n", cnt);
}
/* This returns 0 for success, 1 for a symlink if symlink time-setting
* is not possible, or -1 for any other error. */
int set_times(const char *fname, STRUCT_STAT *stp)
-@@ -142,6 +170,10 @@ int set_times(const char *fname, STRUCT_STAT *stp)
+@@ -144,6 +172,10 @@ int set_times(const char *fname, STRUCT_STAT *stp)
#include "case_N.h"
if (do_utimensat(fname, stp) == 0)
break;
if (errno != ENOSYS)
return -1;
switch_step++;
-@@ -151,6 +183,10 @@ int set_times(const char *fname, STRUCT_STAT *stp)
+@@ -153,6 +185,10 @@ int set_times(const char *fname, STRUCT_STAT *stp)
#include "case_N.h"
if (do_lutimes(fname, stp) == 0)
break;
if (errno != ENOSYS)
return -1;
switch_step++;
-@@ -172,6 +208,10 @@ int set_times(const char *fname, STRUCT_STAT *stp)
+@@ -174,6 +210,10 @@ int set_times(const char *fname, STRUCT_STAT *stp)
if (do_utime(fname, stp) == 0)
break;
#endif
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
#ifdef ICONV_OPTION
extern int filesfrom_convert;
-@@ -1229,7 +1230,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1231,7 +1232,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)
-@@ -1274,6 +1275,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1276,6 +1277,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) {
-@@ -1494,12 +1501,23 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1496,12 +1503,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) {
-@@ -2399,7 +2417,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2403,7 +2421,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) {
-@@ -2413,7 +2431,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2417,7 +2435,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
-@@ -1291,7 +1291,9 @@ your home directory (remove the '=' for that).
+@@ -1296,7 +1296,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` and `--executability` options for how the resulting
permission value can be applied to the files in the transfer.
-@@ -2652,6 +2654,10 @@ your home directory (remove the '=' for that).
- "`--usermap=*:foo --groupmap=*:bar`", only easier. If your shell complains
- about the wildcards, use `--protect-args` (`-s`).
+@@ -2672,6 +2674,10 @@ your home directory (remove the '=' for that).
+
+ If your shell complains about the wildcards, use `--protect-args` (`-s`).
+ To change ownership of files matching a pattern, use an include filter with
+ a `o` or `g` modifier, which take effect before uid/gid mapping and
0. `--timeout=SECONDS`
This option allows you to set a maximum I/O timeout in seconds. If no data
-@@ -3650,6 +3656,15 @@ The following modifiers are accepted after a "`+`" or "`-`":
+@@ -3676,6 +3682,15 @@ The following modifiers are accepted after a "`+`" or "`-`":
rules that exclude things 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
-@@ -3707,6 +3722,12 @@ The following modifiers are accepted after a merge or dir-merge rule:
+@@ -3733,6 +3748,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`).
#define XFLG_FATAL_ERRORS (1<<0)
#define XFLG_OLD_PREFIXES (1<<1)
-@@ -980,6 +983,8 @@ struct map_struct {
+@@ -981,6 +984,8 @@ struct map_struct {
int status; /* first errno from read errors */
};
#define NAME_IS_FILE (0) /* filter name as a file */
#define NAME_IS_DIR (1<<0) /* filter name as a dir */
#define NAME_IS_XATTR (1<<2) /* filter name as an xattr */
-@@ -1005,8 +1010,18 @@ struct map_struct {
+@@ -1006,8 +1011,18 @@ struct map_struct {
#define FILTRULE_CLEAR_LIST (1<<18)/* this item is the "!" token */
#define FILTRULE_PERISHABLE (1<<19)/* perishable if parent dir goes away */
#define FILTRULE_XATTR (1<<20)/* rule only applies to xattr names */
typedef struct filter_struct {
struct filter_struct *next;
-@@ -1016,6 +1031,11 @@ typedef struct filter_struct {
+@@ -1017,6 +1032,11 @@ typedef struct filter_struct {
int slash_cnt;
struct filter_list_struct *mergelist;
} u;
diff --git a/util1.c b/util1.c
--- a/util1.c
+++ b/util1.c
-@@ -889,6 +889,25 @@ size_t stringjoin(char *dest, size_t destsize, ...)
+@@ -898,6 +898,25 @@ size_t stringjoin(char *dest, size_t destsize, ...)
return ret;
}
extern int preserve_links;
extern int preserve_devices;
extern int write_devices;
-@@ -1795,6 +1796,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1798,6 +1799,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fname, fnamecmpbuf);
}
sx.st.st_size = F_LENGTH(fuzzy_file);
statret = 0;
fnamecmp = fnamecmpbuf;
}
-@@ -1962,6 +1971,18 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1965,6 +1974,18 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
if (read_batch)
goto cleanup;
int preserve_perms = 0;
int preserve_fileflags = 0;
int preserve_executability = 0;
-@@ -722,6 +723,10 @@ static struct poptOption long_options[] = {
+@@ -723,6 +724,10 @@ static struct poptOption long_options[] = {
{"no-force-change", 0, POPT_ARG_VAL, &force_change, 0, 0, 0 },
{"force-uchange", 0, POPT_ARG_VAL, &force_change, USR_IMMUTABLE, 0, 0 },
{"force-schange", 0, POPT_ARG_VAL, &force_change, SYS_IMMUTABLE, 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 },
-@@ -1018,6 +1023,10 @@ static void set_refuse_options(void)
+@@ -1019,6 +1024,10 @@ static void set_refuse_options(void)
parse_one_refuse_match(0, "force-uchange", list_end);
parse_one_refuse_match(0, "force-schange", list_end);
#endif
/* Now we use the descrip values to actually mark the options for refusal. */
for (op = long_options; op != list_end; op++) {
-@@ -2072,6 +2081,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2077,6 +2086,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
#endif
if (write_batch && read_batch) {
snprintf(err_buf, sizeof err_buf,
"--write-batch and --read-batch can not be used together\n");
-@@ -2630,6 +2648,11 @@ void server_options(char **args, int *argc_p)
+@@ -2623,6 +2641,11 @@ void server_options(char **args, int *argc_p)
if (preserve_fileflags)
args[ac++] = "--fileflags";
--owner, -o preserve owner (super-user only)
--group, -g preserve group
--devices preserve device files (super-user only)
-@@ -1297,6 +1299,47 @@ your home directory (remove the '=' for that).
+@@ -1301,6 +1303,47 @@ your home directory (remove the '=' for that).
receiving side. It does not try to affect user flags. This option
overrides `--force-change` and `--force-uchange`.
diff --git a/rsync.c b/rsync.c
--- a/rsync.c
+++ b/rsync.c
-@@ -606,8 +606,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -607,8 +607,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
#ifdef SUPPORT_XATTRS
if (am_root < 0)
set_stat_xattr(fname, file, new_mode);
+ }
#endif
- if (!preserve_times
-@@ -621,7 +627,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
- /* Don't set the creation date on the root folder of an HFS+ volume. */
- if (sxp->st.st_ino == 2 && S_ISDIR(sxp->st.st_mode))
- flags |= ATTRS_SKIP_CRTIME;
+ if ((omit_dir_times && S_ISDIR(sxp->st.st_mode))
+@@ -625,7 +631,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+ }
+ if (sxp != &sx2)
+ memcpy(&sx2.st, &sxp->st, sizeof sx2.st);
- if (!(flags & ATTRS_SKIP_MTIME) && !same_mtime(file, &sxp->st, flags & ATTRS_ACCURATE_TIME)) {
+ if (!(flags & ATTRS_SKIP_MTIME)
+#ifdef SUPPORT_HFS_COMPRESSION
sx2.st.st_mtime = file->modtime;
#ifdef ST_MTIME_NSEC
sx2.st.ST_MTIME_NSEC = F_MOD_NSEC_or_0(file);
-@@ -698,6 +708,16 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -710,6 +720,16 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
&& !set_fileflags(fname, fileflags))
goto cleanup;
updated = 1;
diff --git a/t_stub.c b/t_stub.c
--- a/t_stub.c
+++ b/t_stub.c
-@@ -35,6 +35,7 @@ int preserve_times = 0;
+@@ -35,6 +35,7 @@ int preserve_mtimes = 0;
int preserve_xattrs = 0;
int preserve_perms = 0;
int preserve_executability = 0;
+int preserve_hfs_compression = 0;
+ int omit_link_times = 0;
int open_noatime = 0;
size_t max_alloc = 0; /* max_alloc is needed when combined with util2.o */
- char *partial_dir;
diff --git a/xattrs.c b/xattrs.c
--- a/xattrs.c
+++ b/xattrs.c
- Make this code handle multibyte character encodings, and honor the
--iconv setting when converting case.
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
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;
-@@ -2591,7 +2592,8 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2598,7 +2599,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);
-@@ -3158,6 +3160,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -3165,6 +3167,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;
-@@ -3268,7 +3271,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -3275,7 +3278,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/ifuncs.h b/ifuncs.h
--- a/ifuncs.h
+++ b/ifuncs.h
-@@ -109,3 +109,38 @@ static inline char *my_strdup(const char *str, const char *file, int line)
+@@ -110,3 +110,38 @@ static inline char *my_strdup(const char *str, const char *file, int line)
memcpy(buf, str, len);
return buf;
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -122,6 +122,7 @@ OFF_T max_size = -1;
+@@ -125,6 +125,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;
-@@ -774,6 +775,8 @@ static struct poptOption long_options[] = {
+@@ -776,6 +777,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},
-@@ -2756,6 +2759,9 @@ void server_options(char **args, int *argc_p)
+@@ -2751,6 +2754,9 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
--address=ADDRESS bind address for outgoing socket to daemon
--port=PORT specify double-colon alternate port number
--sockopts=OPTIONS specify custom TCP options
-@@ -2211,6 +2212,12 @@ your home directory (remove the '=' for that).
+@@ -2226,6 +2227,12 @@ your home directory (remove the '=' for that).
> sudo rsync -aive lsh -M--copy-as=joe src/ lh:dest/
diff --git a/t_stub.c b/t_stub.c
--- a/t_stub.c
+++ b/t_stub.c
-@@ -33,6 +33,7 @@ int preserve_xattrs = 0;
- int preserve_perms = 0;
+@@ -35,6 +35,7 @@ int preserve_perms = 0;
int preserve_executability = 0;
+ int omit_link_times = 0;
int open_noatime = 0;
+int ignore_case = 0;
size_t max_alloc = 0; /* max_alloc is needed when combined with util2.o */
./configure
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
-@@ -44,7 +44,7 @@ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
+@@ -45,7 +45,7 @@ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
util1.o util2.o main.o checksum.o match.o syscall.o log.o backup.o delete.o
OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
usage.o fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
-@@ -931,6 +931,31 @@ if test x"$enable_iconv" != x"no"; then
+@@ -938,6 +938,31 @@ if test x"$enable_iconv" != x"no"; then
AC_DEFINE(UTF8_CHARSET, "UTF-8", [String to pass to iconv() for the UTF-8 charset.])
fi
./configure
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
-@@ -44,7 +44,7 @@ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
+@@ -45,7 +45,7 @@ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
util1.o util2.o main.o checksum.o match.o syscall.o log.o backup.o delete.o
OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
usage.o fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -164,6 +164,7 @@ char *backup_suffix = NULL;
+@@ -167,6 +167,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;
-@@ -221,7 +222,7 @@ static const char *debug_verbosity[] = {
+@@ -224,7 +225,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)
-@@ -291,6 +292,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
+@@ -295,6 +296,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)"),
-@@ -573,7 +575,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -575,7 +577,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_STOP_AFTER, OPT_STOP_AT,
OPT_REFUSED_BASE = 9000};
-@@ -733,6 +735,7 @@ static struct poptOption long_options[] = {
+@@ -735,6 +737,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 },
-@@ -972,6 +975,9 @@ static void set_refuse_options(void)
+@@ -975,6 +978,9 @@ static void set_refuse_options(void)
ref = cp + 1;
}
if (am_daemon) {
#ifdef ICONV_OPTION
if (!*lp_charset(module_id))
-@@ -1834,6 +1840,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1841,6 +1847,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
return 0;
#endif
case OPT_STOP_AFTER: {
long val;
arg = poptGetOptArg(pc);
-@@ -2186,6 +2206,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2193,6 +2213,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;
-@@ -2831,6 +2853,12 @@ void server_options(char **args, int *argc_p)
- } else if (inplace)
- args[ac++] = "--inplace";
+@@ -2833,6 +2855,12 @@ void server_options(char **args, int *argc_p)
+ args[ac++] = "--no-W";
+ }
+ if (link_by_hash_dir && am_sender) {
+ args[ac++] = "--link-by-hash";
--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)
-@@ -2347,6 +2348,50 @@ your home directory (remove the '=' for that).
+@@ -2362,6 +2363,50 @@ your home directory (remove the '=' for that).
specified (or implied by `-a`). You can work-around this bug by avoiding
the `-o` option when sending to an old rsync.
diff --git a/rsync.c b/rsync.c
--- a/rsync.c
+++ b/rsync.c
-@@ -50,6 +50,7 @@ extern int flist_eof;
+@@ -52,6 +52,7 @@ extern int flist_eof;
extern int file_old_total;
extern int keep_dirlinks;
extern int make_backups;
extern int sanitize_paths;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct chmod_mode_struct *daemon_chmod_modes;
-@@ -748,6 +749,10 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -760,6 +761,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/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -1442,7 +1442,8 @@ extern short info_levels[], debug_levels[];
+@@ -1440,7 +1440,8 @@ extern short info_levels[], debug_levels[];
#define DEBUG_FUZZY (DEBUG_FLIST+1)
#define DEBUG_GENR (DEBUG_FUZZY+1)
#define DEBUG_HASH (DEBUG_GENR+1)
fast fallback for the case where xxHash libraries are not available at
build time.
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
-@@ -29,14 +29,14 @@ SHELL=/bin/sh
+@@ -30,14 +30,14 @@ SHELL=/bin/sh
.SUFFIXES:
.SUFFIXES: .c .o
lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
zlib_OBJS=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o
-@@ -143,6 +143,9 @@ simd-checksum-x86_64.o: simd-checksum-x86_64.cpp
+@@ -148,6 +148,9 @@ simd-checksum-x86_64.o: simd-checksum-x86_64.cpp
simd-checksum-avx2.o: simd-checksum-avx2.S
@$(srcdir)/cmd-or-msg disable-asm $(CC) $(CFLAGS) --include=$(srcdir)/rsync.h -DAVX2_ASM -I. @NOEXECSTACK@ -c -o $@ $(srcdir)/simd-checksum-avx2.S
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -773,10 +773,12 @@ static int generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
+@@ -775,10 +775,12 @@ static int generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
if (append_mode > 0 && f_copy < 0)
return 0;
for (i = 0; i < sum.count; i++) {
int32 n1 = (int32)MIN(len, (OFF_T)sum.blength);
-@@ -794,7 +796,7 @@ static int generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
+@@ -796,7 +798,7 @@ static int generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
}
sum1 = get_checksum1(map, n1);
if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO,
-@@ -806,8 +808,10 @@ static int generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
+@@ -808,8 +810,10 @@ static int generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
write_buf(f_out, sum2, sum.s2length);
}
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -45,6 +45,7 @@ extern int preserve_hard_links;
- extern int preserve_executability;
- extern int preserve_perms;
- extern int preserve_times;
+@@ -47,6 +47,7 @@ extern int preserve_perms;
+ extern int preserve_mtimes;
+ extern int omit_dir_times;
+ extern int omit_link_times;
+extern int omit_dir_changes;
extern int delete_mode;
extern int delete_before;
extern int delete_during;
-@@ -504,6 +505,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -506,6 +507,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
const char *xname)
{
if (statret >= 0) { /* A from-dest-dir statret can == 1! */
+ int omit_changes = omit_dir_changes && S_ISDIR(sxp->st.st_mode);
- int keep_time = !preserve_times ? 0
- : S_ISDIR(file->mode) ? preserve_times & PRESERVE_DIR_TIMES
- : S_ISLNK(file->mode) ? preserve_times & PRESERVE_LINK_TIMES
-@@ -541,9 +543,9 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+ int keep_time = !preserve_mtimes ? 0
+ : S_ISDIR(file->mode) ? !omit_dir_times
+ : S_ISLNK(file->mode) ? !omit_link_times
+@@ -543,9 +545,9 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
} else if (preserve_executability
&& ((sxp->st.st_mode & 0111 ? 1 : 0) ^ (file->mode & 0111 ? 1 : 0)))
iflags |= ITEM_REPORT_PERMS;
iflags |= ITEM_REPORT_GROUP;
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
-@@ -1447,7 +1449,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1448,7 +1450,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
real_ret = statret;
if (file->flags & FLAG_DIR_CREATED)
statret = -1;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -73,6 +73,7 @@ int delete_before = 0;
+@@ -76,6 +76,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;
-@@ -638,6 +639,7 @@ static struct poptOption long_options[] = {
+@@ -640,6 +641,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 },
-@@ -2255,6 +2257,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2262,6 +2264,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
parse_filter_str(&filter_list, backup_dir_buf, rule_template(0), 0);
}
+ if (omit_dir_changes)
+ omit_dir_times = 1;
+
- if (preserve_times) {
- preserve_times = PRESERVE_FILE_TIMES;
- if (!omit_dir_times)
-@@ -2500,6 +2505,8 @@ void server_options(char **args, int *argc_p)
- argstr[x++] = 'O';
- if (omit_link_times)
- argstr[x++] = 'J';
-+ if (omit_dir_changes == 1)
+ if (make_backups && !backup_dir)
+ omit_dir_times = -1; /* Implied, so avoid -O to sender. */
+
+@@ -2718,6 +2723,8 @@ void server_options(char **args, int *argc_p)
+ args[ac++] = "--size-only";
+ if (do_stats)
+ args[ac++] = "--stats";
++ if (omit_dir_changes)
+ args[ac++] = "--omit-dir-changes";
- if (fuzzy_basis) {
- argstr[x++] = 'y';
- if (fuzzy_basis > 1)
+ } else {
+ if (skip_compress) {
+ if (asprintf(&arg, "--skip-compress=%s", skip_compress) < 0)
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
--sparse, -S turn sequences of nulls into sparse blocks
-@@ -1411,6 +1412,11 @@ your home directory (remove the '=' for that).
- This tells rsync to omit symlinks when it is preserving modification times
- (see `--times`).
+@@ -1426,6 +1427,11 @@ your home directory (remove the '=' for that).
+ This tells rsync to omit symlinks when it is preserving modification,
+ access, and create times.
+0. `--omit-dir-changes`
+
diff --git a/rsync.c b/rsync.c
--- a/rsync.c
+++ b/rsync.c
-@@ -33,6 +33,7 @@ extern int preserve_xattrs;
- extern int preserve_perms;
- extern int preserve_executability;
- extern int preserve_times;
+@@ -35,6 +35,7 @@ extern int preserve_executability;
+ extern int preserve_mtimes;
+ extern int omit_dir_times;
+ extern int omit_link_times;
+extern int omit_dir_changes;
extern int am_root;
extern int am_server;
extern int am_daemon;
-@@ -519,9 +520,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -520,9 +521,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
get_acl(fname, sxp);
#endif
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
extern uid_t our_uid;
extern struct stats stats;
extern char *filesfrom_host;
-@@ -1837,6 +1838,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1839,6 +1840,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
-@@ -113,6 +113,7 @@ int size_only = 0;
+@@ -116,6 +116,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;
-@@ -764,6 +765,7 @@ static struct poptOption long_options[] = {
+@@ -766,6 +767,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 },
+--slow-down=USECs sleep N usec while creating the filelist
--stop-after=MINS Stop rsync after MINS minutes have elapsed
--stop-at=y-m-dTh:m Stop rsync at the specified point in time
- --write-batch=FILE write a batched update to FILE
+ --fsync fsync every written file
TODO: the configure changes should abort if the user requests --enable-slp
and we can't honor that request.
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
-@@ -16,6 +16,8 @@ CXX=@CXX@
+@@ -17,6 +17,8 @@ CXX=@CXX@
CXXFLAGS=@CXXFLAGS@
EXEEXT=@EXEEXT@
LDFLAGS=@LDFLAGS@
LIBOBJDIR=lib/
INSTALLCMD=@INSTALL@
-@@ -45,7 +47,7 @@ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
+@@ -46,7 +48,7 @@ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
usage.o fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
OBJS3=progress.o pipe.o @ASM@
popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
popt/popthelp.o popt/poptparse.o
OBJS=$(OBJS1) $(OBJS2) $(OBJS3) @SIMD@ $(DAEMON_OBJ) $(LIBOBJ) @BUILD_ZLIB@ @BUILD_POPT@
-@@ -94,7 +96,7 @@ install-strip:
+@@ -99,7 +101,7 @@ install-strip:
$(MAKE) INSTALL_STRIP='-s' install
rsync$(EXEEXT): $(OBJS)
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
-@@ -999,6 +999,29 @@ if test $rsync_cv_can_hardlink_special = yes; then
+@@ -1006,6 +1006,29 @@ if test $rsync_cv_can_hardlink_special = yes; then
AC_DEFINE(CAN_HARDLINK_SPECIAL, 1, [Define to 1 if link() can hard-link special files.])
fi
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/syscall.c b/syscall.c
--- a/syscall.c
+++ b/syscall.c
-- Matt McCutchen <hashproduct@gmail.com>
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
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
-@@ -767,6 +768,7 @@ static struct poptOption long_options[] = {
+@@ -769,6 +770,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 },
-@@ -2729,6 +2731,8 @@ void server_options(char **args, int *argc_p)
+@@ -2724,6 +2726,8 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
--delete-before receiver deletes before xfer, not during
-@@ -1632,6 +1633,16 @@ your home directory (remove the '=' for that).
+@@ -1647,6 +1648,16 @@ 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.
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -65,6 +65,7 @@ extern int append_mode;
+@@ -67,6 +67,7 @@ extern int append_mode;
extern int make_backups;
extern int csum_length;
extern int ignore_times;
extern int size_only;
extern OFF_T max_size;
extern OFF_T min_size;
-@@ -616,7 +617,7 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
+@@ -618,7 +619,7 @@ int quick_check_ok(enum filetype ftype, const char *fn, struct file_struct *file
{
switch (ftype) {
case FT_REG:
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -110,6 +110,7 @@ int safe_symlinks = 0;
+@@ -113,6 +113,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;
-@@ -170,6 +171,8 @@ char *logfile_name = NULL;
+@@ -173,6 +174,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;
-@@ -679,6 +682,7 @@ static struct poptOption long_options[] = {
+@@ -681,6 +684,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 },
-@@ -813,6 +817,8 @@ static struct poptOption long_options[] = {
+@@ -816,6 +820,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 },
-@@ -2390,6 +2396,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2385,6 +2391,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
if (files_from) {
char *h, *p;
int q;
-@@ -2743,6 +2759,25 @@ void server_options(char **args, int *argc_p)
+@@ -2738,6 +2754,25 @@ void server_options(char **args, int *argc_p)
else if (missing_args == 1 && !am_sender)
args[ac++] = "--ignore-missing-args";
diff --git a/receiver.c b/receiver.c
--- a/receiver.c
+++ b/receiver.c
-@@ -60,6 +60,7 @@ extern BOOL want_progress_now;
+@@ -61,6 +61,7 @@ extern BOOL want_progress_now;
extern mode_t orig_umask;
extern struct stats stats;
extern char *tmpdir;
extern char *partial_dir;
extern char *basis_dir[MAX_BASIS_DIRS+1];
extern char sender_file_sum[MAX_DIGEST_LEN];
-@@ -522,6 +523,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -528,6 +529,7 @@ int recv_files(int f_in, int f_out, char *local_name)
char *fnametmp, fnametmpbuf[MAXPATHLEN];
char *fnamecmp, *partialptr;
char fnamecmpbuf[MAXPATHLEN];
uchar fnamecmp_type;
struct file_struct *file;
int itemizing = am_server ? logfile_format_has_i : stdout_format_has_i;
-@@ -532,6 +534,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -538,6 +540,7 @@ int recv_files(int f_in, int f_out, char *local_name)
const char *parent_dirname = "";
#endif
int ndx, recv_ok, one_inplace;
if (DEBUG_GTE(RECV, 1))
rprintf(FINFO, "recv_files(%d) starting\n", cur_flist->used);
-@@ -542,6 +545,23 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -548,6 +551,23 @@ int recv_files(int f_in, int f_out, char *local_name)
if (whole_file < 0)
whole_file = 0;
progress_init();
while (1) {
-@@ -856,6 +876,9 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -868,6 +888,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);
-@@ -871,6 +894,16 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -883,6 +906,16 @@ int recv_files(int f_in, int f_out, char *local_name)
exit_cleanup(RERR_FILEIO);
}
--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
-@@ -464,6 +465,8 @@ detailed description below for a complete description.
+@@ -465,6 +466,8 @@ detailed description below for a complete description.
--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)
-@@ -3293,6 +3296,36 @@ your home directory (remove the '=' for that).
+@@ -3319,6 +3322,36 @@ your home directory (remove the '=' for that).
`--write-batch`. If _FILE_ is `-`, the batch data will be read from
standard input. See the "BATCH MODE" section for details.
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
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
-@@ -76,6 +76,7 @@ int remove_source_files = 0;
+@@ -79,6 +79,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;
-@@ -692,6 +693,7 @@ static struct poptOption long_options[] = {
+@@ -694,6 +695,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 },
-@@ -2645,6 +2647,12 @@ void server_options(char **args, int *argc_p)
+@@ -2640,6 +2642,12 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
--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
-@@ -1483,6 +1484,18 @@ your home directory (remove the '=' for that).
+@@ -1498,6 +1499,18 @@ your home directory (remove the '=' for that).
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: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/NEWS.md b/NEWS.md
--- a/NEWS.md
+++ b/NEWS.md
-@@ -35,6 +35,9 @@
- where the INFO is one of "type change", "sum change" (requires `-c`), "file
- change" (based on the quick check), "attr change", or "uptodate".
+@@ -109,6 +109,9 @@
+
+ - Work around a glibc bug where lchmod() breaks in a chroot w/o /proc mounted.
+ - Try to support a client that sent a remote rsync a wacko stderr file handle
+ (such as an older File::RsyncP perl library).
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -88,6 +88,7 @@ int implied_dirs = 1;
+@@ -91,6 +91,7 @@ int implied_dirs = 1;
int missing_args = 0; /* 0 = FERROR_XFER, 1 = ignore, 2 = delete */
int numeric_ids = 0;
int msgs2stderr = 2; /* Default: send errors to stderr for local & remote-shell transfers */
int allow_8bit_chars = 0;
int force_delete = 0;
int io_timeout = 0;
-@@ -1875,6 +1876,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1882,6 +1883,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
"--stderr mode \"%s\" is not one of errors, all, or client\n", arg);
return 0;
}
break;
}
-@@ -1893,6 +1895,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1900,6 +1902,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
./configure (optional if already run)
make
-based-on: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
#define NORMAL_NAME 0
#define SLASH_ENDING_NAME 1
#define DOTDIR_NAME 2
-@@ -674,6 +677,23 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -676,6 +679,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;
-@@ -744,9 +764,13 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -746,9 +766,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);
-@@ -2531,6 +2555,15 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2535,6 +2559,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
-@@ -201,6 +201,7 @@ int logfile_format_has_i = 0;
+@@ -204,6 +204,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;
-@@ -797,6 +798,7 @@ static struct poptOption long_options[] = {
+@@ -800,6 +801,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 },
-@@ -2436,6 +2438,24 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2431,6 +2433,24 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
am_starting_up = 0;
return 1;
-@@ -2848,6 +2868,12 @@ void server_options(char **args, int *argc_p)
+@@ -2850,6 +2870,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
-@@ -466,6 +466,7 @@ detailed description below for a complete description.
+@@ -467,6 +467,7 @@ detailed description below for a complete description.
--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
-@@ -3335,6 +3336,25 @@ your home directory (remove the '=' for that).
+@@ -3361,6 +3362,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: 109dbc0b7535e8f8094802182f9067bfdc88dfc9
+based-on: 72adf49ba8cb81426e2b9799fbd43c6284b013a9
diff --git a/checksum.c b/checksum.c
--- a/checksum.c
+++ b/checksum.c