./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/acls.c b/acls.c
--- a/acls.c
+++ b/acls.c
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -192,13 +192,6 @@ void setup_protocol(int f_out,int f_in)
+@@ -189,13 +189,6 @@ void setup_protocol(int f_out,int f_in)
if (protocol_version < 30) {
if (append_mode == 1)
append_mode = 2;
Fix a bug that could lose some bits when stripping some (supposedly)
superfluous ACL info.
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/lib/sysacls.c b/lib/sysacls.c
--- a/lib/sysacls.c
+++ b/lib/sysacls.c
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -45,6 +45,7 @@ extern int protocol_version;
+@@ -43,6 +43,7 @@ extern int protocol_version;
extern int protect_args;
extern int preserve_uid;
extern int preserve_gid;
extern int preserve_acls;
extern int preserve_xattrs;
extern int need_messages_from_generator;
-@@ -62,7 +63,7 @@ extern char *iconv_opt;
+@@ -60,7 +61,7 @@ extern char *iconv_opt;
#endif
/* These index values are for the file-list's extra-attribute array. */
int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
int sender_symlink_iconv = 0; /* sender should convert symlink content */
-@@ -139,6 +140,8 @@ void setup_protocol(int f_out,int f_in)
+@@ -136,6 +137,8 @@ void setup_protocol(int f_out,int f_in)
uid_ndx = ++file_extra_cnt;
if (preserve_gid)
gid_ndx = ++file_extra_cnt;
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -55,6 +55,7 @@ extern int missing_args;
+@@ -54,6 +54,7 @@ extern int missing_args;
extern int uid_ndx;
extern int gid_ndx;
extern int eol_nulls;
extern int relative_paths;
extern int implied_dirs;
extern int file_extra_cnt;
-@@ -405,7 +406,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -404,7 +405,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
#endif
int ndx, int first_ndx)
{
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
-@@ -505,6 +506,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -504,6 +505,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
modtime = file->modtime;
if (NSEC_BUMP(file) && protocol_version >= 31)
xflags |= XMIT_MOD_NSEC;
#ifdef SUPPORT_HARD_LINKS
if (tmp_dev != 0) {
-@@ -591,6 +599,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -590,6 +598,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
write_varint(f, F_MOD_NSEC(file));
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -676,7 +686,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -675,7 +685,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags)
{
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
-@@ -820,6 +830,16 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -819,6 +829,16 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
modtime_nsec = 0;
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
if (chmod_modes && !S_ISLNK(mode) && mode)
mode = tweak_mode(mode, chmod_modes);
-@@ -980,6 +1000,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -979,6 +999,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
F_GROUP(file) = gid;
file->flags |= gid_flags;
}
if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
-@@ -1375,6 +1397,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1374,6 +1396,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
F_OWNER(file) = st.st_uid;
if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
F_GROUP(file) = st.st_gid;
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -456,6 +456,9 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -455,6 +455,9 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
: iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE) && !(iflags & ITEM_MATCHED)
&& (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
iflags |= ITEM_REPORT_TIME;
#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
if (S_ISLNK(file->mode)) {
;
-@@ -826,6 +829,8 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -825,6 +828,8 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
if (link_dest) {
if (!hard_link_one(file, fname, cmpbuf, 1))
goto try_a_copy;
if (preserve_hard_links && F_IS_HLINKED(file))
finish_hard_link(file, fname, ndx, &sxp->st, itemizing, code, j);
if (!maybe_ATTRS_REPORT && (INFO_GTE(NAME, 2) || stdout_format_has_i > 1)) {
-@@ -1018,6 +1023,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1017,6 +1022,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
static void list_file_entry(struct file_struct *f)
{
char permbuf[PERMSTRING_SIZE];
int64 len;
int colwidth = human_readable ? 14 : 11;
-@@ -1033,10 +1039,11 @@ static void list_file_entry(struct file_struct *f)
+@@ -1032,10 +1038,11 @@ static void list_file_entry(struct file_struct *f)
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
} else
#endif
if (missing_args == 2 && f->mode == 0) {
-@@ -1044,9 +1051,11 @@ static void list_file_entry(struct file_struct *f)
+@@ -1043,9 +1050,11 @@ static void list_file_entry(struct file_struct *f)
colwidth + 31, "*missing",
f_name(f, NULL));
} else {
}
}
-@@ -1923,7 +1932,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -1925,7 +1934,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
STRUCT_STAT st;
if (link_stat(fname, &st, 0) == 0
&& cmp_time(st.st_mtime, file->modtime) != 0)
diff --git a/ifuncs.h b/ifuncs.h
--- a/ifuncs.h
+++ b/ifuncs.h
-@@ -35,6 +35,28 @@ realloc_xbuf(xbuf *xb, size_t sz)
- xb->size = sz;
+@@ -43,6 +43,28 @@ free_xbuf(xbuf *xb)
+ memset(xb, 0, sizeof (xbuf));
}
+static inline time_t
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
-@@ -715,7 +715,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
+@@ -733,7 +733,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
c[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
c[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
c[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
{"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 1, 0, 0 },
{"no-omit-dir-times",0, POPT_ARG_VAL, &omit_dir_times, 0, 0, 0 },
{"no-O", 0, POPT_ARG_VAL, &omit_dir_times, 0, 0, 0 },
-@@ -2307,6 +2312,8 @@ void server_options(char **args, int *argc_p)
+@@ -2326,6 +2331,8 @@ void server_options(char **args, int *argc_p)
argstr[x++] = 'D';
if (preserve_times)
argstr[x++] = 't';
diff --git a/rsync.c b/rsync.c
--- a/rsync.c
+++ b/rsync.c
-@@ -434,6 +434,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -451,6 +451,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
int updated = 0;
stat_x sx2;
int change_uid, change_gid;
mode_t new_mode = file->mode;
int inherit;
-@@ -472,20 +473,38 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -489,20 +490,38 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
set_xattr(fname, file, fnamecmp, sxp);
#endif
}
change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
-@@ -622,7 +641,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -639,7 +658,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
/* Change permissions before putting the file into place. */
set_file_attrs(fnametmp, file, NULL, fnamecmp,
/* move tmp file over real file */
if (DEBUG_GTE(RECV, 1))
-@@ -649,7 +668,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -666,7 +685,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
do_set_file_attrs:
set_file_attrs(fnametmp, file, NULL, fnamecmp,
/* These flags are used in the live flist data. */
-@@ -158,6 +159,7 @@
+@@ -160,6 +161,7 @@
#define ATTRS_REPORT (1<<0)
#define ATTRS_SKIP_MTIME (1<<1)
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -660,12 +662,14 @@ extern int file_extra_cnt;
+@@ -664,12 +666,14 @@ extern int file_extra_cnt;
extern int inc_recurse;
extern int uid_ndx;
extern int gid_ndx;
dit(bf(--super)) This tells the receiving side to attempt super-user
activities even if the receiving rsync wasn't run by the super-user. These
activities include: preserving users via the bf(--owner) option, preserving
-@@ -1930,7 +1937,10 @@ quote(itemization(
+@@ -1931,7 +1938,10 @@ quote(itemization(
sender's value (requires bf(--owner) and super-user privileges).
it() A bf(g) means the group is different and is being updated to the
sender's value (requires bf(--group) and the authority to set the group).
diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
--- a/testsuite/rsync.fns
+++ b/testsuite/rsync.fns
-@@ -215,6 +215,10 @@ checkit() {
+@@ -214,6 +214,10 @@ checkit() {
# We can just write everything to stdout/stderr, because the
# wrapper hides it unless there is a problem.
echo "Running: \"$1\""
eval "$1"
status=$?
-@@ -222,10 +226,13 @@ checkit() {
+@@ -221,10 +225,13 @@ checkit() {
failed="YES";
fi
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/backup.c b/backup.c
--- a/backup.c
+++ b/backup.c
{"list-only", 0, POPT_ARG_VAL, &list_only, 2, 0, 0 },
{"read-batch", 0, POPT_ARG_STRING, &batch_name, OPT_READ_BATCH, 0, 0 },
{"write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_WRITE_BATCH, 0, 0 },
-@@ -1972,6 +1982,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1991,6 +2001,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;
-@@ -1993,6 +2005,14 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2012,6 +2024,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)
-@@ -2004,6 +2024,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2023,6 +2043,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
backup_suffix);
return 0;
}
if (backup_dir) {
while (*backup_dir == '.' && backup_dir[1] == '/')
backup_dir += 2;
-@@ -2037,6 +2071,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2056,6 +2090,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
"P *%s", backup_suffix);
parse_filter_str(&filter_list, backup_dir_buf, rule_template(0), 0);
}
if (make_backups && !backup_dir) {
omit_dir_times = 0; /* Implied, so avoid -O to sender. */
-@@ -2450,6 +2512,10 @@ void server_options(char **args, int *argc_p)
+@@ -2469,6 +2531,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) {
-@@ -2458,7 +2524,14 @@ void server_options(char **args, int *argc_p)
+@@ -2477,7 +2543,14 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/errcode.h b/errcode.h
--- a/errcode.h
+++ b/errcode.h
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
-@@ -88,6 +88,7 @@ struct {
+@@ -93,6 +93,7 @@ struct {
{ RERR_TERMINATED , "sibling process terminated abnormally" },
{ RERR_SIGNAL1 , "received SIGUSR1" },
{ RERR_SIGNAL , "received SIGINT, SIGTERM, or SIGHUP" },
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -175,8 +175,11 @@ static void wait_process_with_flush(pid_t pid, int *exit_code_ptr)
+@@ -176,8 +176,11 @@ static void wait_process_with_flush(pid_t pid, int *exit_code_ptr)
*exit_code_ptr = RERR_TERMINATED;
else
*exit_code_ptr = RERR_WAITCHILD;
}
void write_del_stats(int f)
-@@ -1407,6 +1410,14 @@ RETSIGTYPE remember_children(UNUSED(int val))
+@@ -1416,6 +1419,14 @@ RETSIGTYPE remember_children(UNUSED(int val))
break;
}
}
}
#endif
#ifndef HAVE_SIGACTION
-@@ -1465,6 +1476,12 @@ static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig))
+@@ -1474,6 +1485,12 @@ static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig))
}
#endif
int main(int argc,char *argv[])
{
-@@ -1487,6 +1504,11 @@ int main(int argc,char *argv[])
+@@ -1496,6 +1513,11 @@ int main(int argc,char *argv[])
SIGACTMASK(SIGFPE, rsync_panic_handler);
SIGACTMASK(SIGABRT, rsync_panic_handler);
SIGACTMASK(SIGBUS, rsync_panic_handler);
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/checksum.c b/checksum.c
--- a/checksum.c
+++ b/checksum.c
extern int io_timeout;
extern int no_detach;
extern int write_batch;
-@@ -871,6 +873,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -874,6 +876,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
} else if (am_root < 0) /* Treat --fake-super from client as --super. */
am_root = 2;
extern int module_id;
extern int ignore_errors;
extern int numeric_ids;
-@@ -61,6 +63,7 @@ extern int file_extra_cnt;
+@@ -60,6 +62,7 @@ extern int file_extra_cnt;
extern int ignore_perishable;
extern int non_perishable_cnt;
extern int prune_empty_dirs;
extern int copy_links;
extern int copy_unsafe_links;
extern int protocol_version;
-@@ -71,6 +74,7 @@ extern int sender_symlink_iconv;
+@@ -70,6 +73,7 @@ extern int sender_symlink_iconv;
extern int output_needs_newline;
extern int sender_keeps_checksum;
extern int unsort_ndx;
extern struct stats stats;
extern char *filesfrom_host;
extern char *usermap, *groupmap;
-@@ -95,6 +99,12 @@ extern iconv_t ic_send, ic_recv;
+@@ -94,6 +98,12 @@ extern iconv_t ic_send, ic_recv;
#endif
#endif
#define PTR_SIZE (sizeof (struct file_struct *))
int io_error;
-@@ -136,7 +146,11 @@ static char tmp_sum[MAX_DIGEST_LEN];
+@@ -135,7 +145,11 @@ static char tmp_sum[MAX_DIGEST_LEN];
static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
static void output_flist(struct file_list *flist);
void init_flist(void)
-@@ -351,6 +365,238 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -350,6 +364,238 @@ 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
-@@ -1142,7 +1388,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1141,7 +1387,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];
-@@ -1288,9 +1534,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1287,9 +1533,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
-@@ -1308,11 +1561,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1307,11 +1560,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))
-@@ -1395,8 +1645,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1394,8 +1644,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2518,7 +2774,7 @@ struct file_list *recv_file_list(int f)
+@@ -2527,7 +2783,7 @@ struct file_list *recv_file_list(int f)
rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
}
if (protocol_version < 30) {
/* Recv the io_error flag */
-@@ -2741,7 +2997,7 @@ void flist_free(struct file_list *flist)
+@@ -2750,7 +3006,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;
-@@ -2792,7 +3048,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2801,7 +3057,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;
-@@ -2808,8 +3064,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2817,8 +3073,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);
-@@ -2831,7 +3087,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2840,7 +3096,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
}
flist->high = prev_i;
extern int remove_source_files;
extern int delay_updates;
extern int update_only;
-@@ -523,7 +524,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -522,7 +523,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
/* Perform our quick-check heuristic for determining if a file is unchanged. */
{
if (st->st_size != F_LENGTH(file))
return 0;
-@@ -532,7 +533,10 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
+@@ -531,7 +532,10 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
of the file time to determine whether to sync */
if (always_checksum > 0 && S_ISREG(st->st_mode)) {
char sum[MAX_DIGEST_LEN];
return memcmp(sum, F_SUM(file), checksum_len) == 0;
}
-@@ -796,7 +800,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -795,7 +799,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
match_level = 1;
/* FALL THROUGH */
case 1:
continue;
best_match = j;
match_level = 2;
-@@ -1082,7 +1086,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1081,7 +1085,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 = NULL;
struct file_struct *fuzzy_file = NULL;
int fd = -1, f_copy = -1;
stat_x sx, real_sx;
-@@ -1166,8 +1170,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1165,8 +1169,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
flist_free(fuzzy_dirlist);
fuzzy_dirlist = NULL;
}
#ifdef SUPPORT_ACLS
if (!preserve_perms)
dflt_perms = default_perms_for_dir(dn);
-@@ -1175,10 +1179,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1174,10 +1178,15 @@ 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);
-@@ -1601,7 +1610,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1600,7 +1609,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
;
else if (fnamecmp_type == FNAMECMP_FUZZY)
;
diff --git a/hlink.c b/hlink.c
--- a/hlink.c
+++ b/hlink.c
-@@ -410,7 +410,7 @@ int hard_link_check(struct file_struct *file, int ndx, char *fname,
+@@ -409,7 +409,7 @@ int hard_link_check(struct file_struct *file, int ndx, char *fname,
}
break;
}
rprintf(F," -a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)\n");
rprintf(F," --no-OPTION turn off an implied OPTION (e.g. --no-D)\n");
rprintf(F," -r, --recursive recurse into directories\n");
-@@ -799,7 +801,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -798,7 +800,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+ OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST, OPT_HELP,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
- OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG,
-- OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN,
-+ OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_SUMFILES,
+- OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG,
++ OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, OPT_SUMFILES,
+ OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT,
OPT_SERVER, OPT_REFUSED_BASE = 9000};
- static struct poptOption long_options[] = {
@@ -934,6 +936,7 @@ static struct poptOption long_options[] = {
{"checksum", 'c', POPT_ARG_VAL, &always_checksum, 1, 0, 0 },
{"no-checksum", 0, POPT_ARG_VAL, &always_checksum, 0, 0, 0 },
{"block-size", 'B', POPT_ARG_LONG, &block_size, 0, 0, 0 },
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
-@@ -1632,6 +1635,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1651,6 +1654,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);
-@@ -1832,6 +1852,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1851,6 +1871,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
#endif
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -723,6 +723,10 @@ extern int xattrs_ndx;
+@@ -727,6 +727,10 @@ extern int xattrs_ndx;
#define F_SUM(f) ((char*)OPT_EXTRA(f, START_BUMP(f) + HLINK_BUMP(f) \
+ SUM_EXTRA_CNT - 1))
/* Some utility defines: */
#define F_IS_ACTIVE(f) (f)->basename[0]
#define F_IS_HLINKED(f) ((f)->flags & FLAG_HLINKED)
-@@ -911,6 +915,13 @@ typedef struct {
+@@ -923,6 +927,13 @@ typedef struct {
char fname[1]; /* has variable size */
} relnamecache;
extern int am_root;
extern int am_server;
extern int am_daemon;
-@@ -107,6 +108,9 @@ extern iconv_t ic_send, ic_recv;
+@@ -106,6 +107,9 @@ extern iconv_t ic_send, ic_recv;
#define PTR_SIZE (sizeof (struct file_struct *))
int io_error;
int checksum_len;
dev_t filesystem_dev; /* used to implement -x */
-@@ -146,8 +150,13 @@ static char tmp_sum[MAX_DIGEST_LEN];
+@@ -145,8 +149,13 @@ static char tmp_sum[MAX_DIGEST_LEN];
static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
} *csum_cache = NULL;
static void flist_sort_and_clean(struct file_list *flist, int flags);
-@@ -365,7 +374,79 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -364,7 +373,79 @@ static void flist_done_allocating(struct file_list *flist)
flist->pool_boundary = ptr;
}
{
int slot, slots = am_sender ? 1 : basis_dir_cnt + 1;
-@@ -379,6 +460,9 @@ void reset_checksum_cache()
+@@ -378,6 +459,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));
-@@ -389,6 +473,10 @@ void reset_checksum_cache()
+@@ -388,6 +472,10 @@ void reset_checksum_cache()
flist->low = 0;
flist->high = -1;
flist->next = NULL;
}
}
-@@ -396,7 +484,7 @@ void reset_checksum_cache()
+@@ -395,7 +483,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;
-@@ -413,7 +501,7 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -412,7 +500,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);
-@@ -422,7 +510,14 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -421,7 +509,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;
-@@ -451,10 +546,11 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -450,10 +545,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))
-@@ -475,7 +571,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -474,7 +570,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
while (fgets(line, sizeof line, fp)) {
cp = line;
if (protocol_version >= 30) {
if (*cp == '=')
while (*++cp == '=') {}
else
-@@ -486,7 +582,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -485,7 +581,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
}
if (*cp == '=') {
} else {
for (i = 0; i < checksum_len*2; i++, cp++) {
int x;
-@@ -504,13 +607,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -503,13 +606,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
-@@ -560,24 +664,112 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -559,24 +663,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);
}
-@@ -589,12 +781,31 @@ void get_cached_checksum(int slot, const char *fname, struct file_struct *file,
+@@ -588,12 +780,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
-@@ -1489,6 +1700,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1488,6 +1699,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;
}
-@@ -1535,13 +1748,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1534,13 +1747,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' */
-@@ -1647,7 +1860,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1646,7 +1859,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.st_size, tmp_sum);
if (sender_keeps_checksum)
-@@ -2020,6 +2233,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -2019,6 +2232,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". */
-@@ -2643,6 +2859,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2652,6 +2868,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
-@@ -112,6 +112,7 @@ static int dir_tweaking;
+@@ -111,6 +111,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;
enum nonregtype {
-@@ -534,7 +535,7 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st, int slot
+@@ -533,7 +534,7 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st, int slot
if (always_checksum > 0 && S_ISREG(st->st_mode)) {
char sum[MAX_DIGEST_LEN];
if (checksum_files && slot >= 0)
else
file_checksum(fn, st->st_size, sum);
return memcmp(sum, F_SUM(file), checksum_len) == 0;
-@@ -1185,7 +1186,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1184,7 +1185,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fuzzy_dirlist = get_dirlist(fnamecmpbuf, -1, 1);
}
if (checksum_files) {
}
need_new_dirscan = 0;
}
-@@ -1343,6 +1345,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1342,6 +1344,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
else
change_local_filter_dir(fname, strlen(fname), F_DEPTH(file));
}
goto cleanup;
}
-@@ -1616,6 +1619,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1615,6 +1618,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);
if (itemizing)
itemize(fnamecmp, file, ndx, statret, &sx, 0, 0, NULL);
#ifdef SUPPORT_HARD_LINKS
-@@ -2120,6 +2125,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2122,6 +2127,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];
-@@ -2214,6 +2220,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2216,6 +2222,9 @@ void generate_files(int f_out, const char *local_name)
wait_for_receiver();
}
extern int protocol_version;
extern int remove_source_files;
extern int preserve_hard_links;
-@@ -875,6 +876,9 @@ static void got_flist_entry_status(enum festatus status, int ndx)
+@@ -987,6 +988,9 @@ static void got_flist_entry_status(enum festatus status, int ndx)
flist_ndx_push(&hlink_list, ndx);
flist->in_progress++;
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -1637,7 +1637,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1656,7 +1656,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
case OPT_SUMFILES:
arg = poptGetOptArg(pc);
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -917,6 +917,8 @@ typedef struct {
+@@ -929,6 +929,8 @@ typedef struct {
#define CSF_ENABLE (1<<1)
#define CSF_LAX (1<<2)
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1309,7 +1309,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1308,7 +1308,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
-@@ -532,7 +532,8 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
+@@ -531,7 +531,8 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
of the file time to determine whether to sync */
if (always_checksum > 0 && S_ISREG(st->st_mode)) {
char sum[MAX_DIGEST_LEN];
To use this patch, run these commands for a successful build:
patch -p1 <patches/copy-devices.diff
+ ./prepare-source
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
extern int preserve_specials;
extern int preserve_hard_links;
extern int preserve_executability;
-@@ -1496,7 +1497,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1495,7 +1496,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
{"specials", 0, POPT_ARG_VAL, &preserve_specials, 1, 0, 0 },
{"no-specials", 0, POPT_ARG_VAL, &preserve_specials, 0, 0, 0 },
{"links", 'l', POPT_ARG_VAL, &preserve_links, 1, 0, 0 },
-@@ -2627,6 +2630,9 @@ void server_options(char **args, int *argc_p)
+@@ -2646,6 +2649,9 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
extern int am_root;
extern int am_server;
extern int am_sender;
-@@ -380,7 +381,8 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr,
+@@ -397,7 +398,8 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr,
if (iflags & ITEM_TRANSFER) {
int i = ndx - cur_flist->ndx_start;
diff --git a/sender.c b/sender.c
--- a/sender.c
+++ b/sender.c
-@@ -336,6 +336,20 @@ void send_files(int f_in, int f_out)
- exit_cleanup(RERR_PROTOCOL);
+@@ -340,6 +340,20 @@ void send_files(int f_in, int f_out)
+ exit_cleanup(RERR_FILEIO);
}
+ /* On Matt's computer, st_size is falsely 0 for most devices.
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -46,6 +46,7 @@ extern int force_change;
+@@ -44,6 +44,7 @@ extern int force_change;
extern int protect_args;
extern int preserve_uid;
extern int preserve_gid;
extern int preserve_fileflags;
extern int preserve_acls;
extern int preserve_xattrs;
-@@ -64,7 +65,7 @@ extern char *iconv_opt;
+@@ -62,7 +63,7 @@ extern char *iconv_opt;
#endif
/* These index values are for the file-list's extra-attribute array. */
int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
int sender_symlink_iconv = 0; /* sender should convert symlink content */
-@@ -141,6 +142,8 @@ void setup_protocol(int f_out,int f_in)
+@@ -138,6 +139,8 @@ void setup_protocol(int f_out,int f_in)
uid_ndx = ++file_extra_cnt;
if (preserve_gid)
gid_ndx = ++file_extra_cnt;
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -56,6 +56,7 @@ extern int missing_args;
+@@ -55,6 +55,7 @@ extern int missing_args;
extern int uid_ndx;
extern int gid_ndx;
extern int eol_nulls;
extern int relative_paths;
extern int implied_dirs;
extern int file_extra_cnt;
-@@ -406,7 +407,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -405,7 +406,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
#endif
int ndx, int first_ndx)
{
static mode_t mode;
#ifdef SUPPORT_FILEFLAGS
static uint32 fileflags;
-@@ -517,6 +518,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -516,6 +517,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
modtime = file->modtime;
if (NSEC_BUMP(file) && protocol_version >= 31)
xflags |= XMIT_MOD_NSEC;
#ifdef SUPPORT_HARD_LINKS
if (tmp_dev != 0) {
-@@ -601,6 +609,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -600,6 +608,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
}
if (xflags & XMIT_MOD_NSEC)
write_varint(f, F_MOD_NSEC(file));
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
#ifdef SUPPORT_FILEFLAGS
-@@ -692,7 +702,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -691,7 +701,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags)
{
static mode_t mode;
#ifdef SUPPORT_FILEFLAGS
static uint32 fileflags;
-@@ -837,6 +847,19 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -836,6 +846,19 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
modtime_nsec = read_varint(f);
else
modtime_nsec = 0;
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
-@@ -1007,6 +1030,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -1006,6 +1029,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
F_GROUP(file) = gid;
file->flags |= gid_flags;
}
if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
-@@ -1406,6 +1431,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1405,6 +1430,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
F_OWNER(file) = st.st_uid;
if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
F_GROUP(file) = st.st_gid;
extern int preserve_hard_links;
extern int preserve_executability;
extern int preserve_fileflags;
-@@ -420,6 +421,13 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
+@@ -419,6 +420,13 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
if (gid_ndx && !(file->flags & FLAG_SKIP_GROUP) && sxp->st.st_gid != (gid_t)F_GROUP(file))
return 0;
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
if (!ACL_READY(*sxp))
-@@ -463,6 +471,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -462,6 +470,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
: iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE) && !(iflags & ITEM_MATCHED)
&& (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
iflags |= ITEM_REPORT_TIME;
#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
if (S_ISLNK(file->mode)) {
;
-@@ -1030,6 +1044,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1029,6 +1043,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
static void list_file_entry(struct file_struct *f)
{
char permbuf[PERMSTRING_SIZE];
int64 len;
int colwidth = human_readable ? 14 : 11;
-@@ -1045,10 +1060,11 @@ static void list_file_entry(struct file_struct *f)
+@@ -1044,10 +1059,11 @@ static void list_file_entry(struct file_struct *f)
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
} else
#endif
if (missing_args == 2 && f->mode == 0) {
-@@ -1056,9 +1072,11 @@ static void list_file_entry(struct file_struct *f)
+@@ -1055,9 +1071,11 @@ static void list_file_entry(struct file_struct *f)
colwidth + 31, "*missing",
f_name(f, NULL));
} else {
}
}
-@@ -1149,6 +1167,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1148,6 +1166,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
return;
}
}
diff --git a/ifuncs.h b/ifuncs.h
--- a/ifuncs.h
+++ b/ifuncs.h
-@@ -35,6 +35,28 @@ realloc_xbuf(xbuf *xb, size_t sz)
- xb->size = sz;
+@@ -43,6 +43,28 @@ free_xbuf(xbuf *xb)
+ memset(xb, 0, sizeof (xbuf));
}
+static inline time_t
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
-@@ -718,7 +718,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
+@@ -736,7 +736,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
c[8] = !(iflags & ITEM_REPORT_FFLAGS) ? '.' : 'f';
c[9] = !(iflags & ITEM_REPORT_ACL) ? '.' : 'a';
c[10] = !(iflags & ITEM_REPORT_XATTR) ? '.' : 'x';
{"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 1, 0, 0 },
{"no-omit-dir-times",0, POPT_ARG_VAL, &omit_dir_times, 0, 0, 0 },
{"no-O", 0, POPT_ARG_VAL, &omit_dir_times, 0, 0, 0 },
-@@ -2333,6 +2338,8 @@ void server_options(char **args, int *argc_p)
+@@ -2352,6 +2357,8 @@ void server_options(char **args, int *argc_p)
argstr[x++] = 'D';
if (preserve_times)
argstr[x++] = 't';
diff --git a/rsync.c b/rsync.c
--- a/rsync.c
+++ b/rsync.c
-@@ -521,6 +521,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -538,6 +538,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
else
file->flags |= FLAG_TIME_FAILED;
}
change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
change_gid = gid_ndx && !(file->flags & FLAG_SKIP_GROUP)
-@@ -671,7 +679,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -688,7 +696,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
/* Change permissions before putting the file into place. */
set_file_attrs(fnametmp, file, NULL, fnamecmp,
ATTRS_DELAY_IMMUTABLE
/* move tmp file over real file */
if (DEBUG_GTE(RECV, 1))
-@@ -702,7 +710,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -719,7 +727,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
do_set_file_attrs:
set_file_attrs(fnametmp, file, NULL, fnamecmp,
/* These flags are used in the live flist data. */
-@@ -160,6 +161,7 @@
+@@ -162,6 +163,7 @@
#define ATTRS_REPORT (1<<0)
#define ATTRS_SKIP_MTIME (1<<1)
#define ATTRS_DELAY_IMMUTABLE (1<<2)
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -176,7 +178,7 @@
+@@ -178,7 +180,7 @@
#define FNAMECMP_FUZZY 0x83
/* For use by the itemize_changes code */
#define ITEM_REPORT_CHANGE (1<<1)
#define ITEM_REPORT_SIZE (1<<2) /* regular files only */
#define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */
-@@ -685,6 +687,7 @@ extern int file_extra_cnt;
+@@ -689,6 +691,7 @@ extern int file_extra_cnt;
extern int inc_recurse;
extern int uid_ndx;
extern int gid_ndx;
extern int fileflags_ndx;
extern int acls_ndx;
extern int xattrs_ndx;
-@@ -692,6 +695,7 @@ extern int xattrs_ndx;
+@@ -696,6 +699,7 @@ extern int xattrs_ndx;
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
#define EXTRA_LEN (sizeof (union file_extras))
#define PTR_EXTRA_CNT ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN)
#define DEV_EXTRA_CNT 2
#define DIRNODE_EXTRA_CNT 3
#define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN)
-@@ -963,6 +967,7 @@ typedef struct {
+@@ -975,6 +979,7 @@ typedef struct {
typedef struct {
STRUCT_STAT st;
dit(bf(--super)) This tells the receiving side to attempt super-user
activities even if the receiving rsync wasn't run by the super-user. These
activities include: preserving users via the bf(--owner) option, preserving
-@@ -1903,7 +1907,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -1904,7 +1908,7 @@ with older versions of rsync, but that also turns on the output of other
verbose messages).
The "%i" escape has a cryptic output that is 11 letters long. The general
type of update being done, bf(X) is replaced by the file-type, and the
other letters represent attributes that may be output if they are being
modified.
-@@ -1962,6 +1966,8 @@ quote(itemization(
+@@ -1963,6 +1967,8 @@ quote(itemization(
it() The bf(f) means that the fileflags information changed.
it() The bf(a) means that the ACL information changed.
it() The bf(x) means that the extended attribute information changed.
diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
--- a/testsuite/rsync.fns
+++ b/testsuite/rsync.fns
-@@ -24,9 +24,9 @@ todir="$tmpdir/to"
+@@ -23,9 +23,9 @@ todir="$tmpdir/to"
chkdir="$tmpdir/chk"
# For itemized output:
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -155,6 +155,7 @@
+@@ -157,6 +157,7 @@
#define XFLG_ANCHORED2ABS (1<<2) /* leading slash indicates absolute */
#define XFLG_ABS_IF_SLASH (1<<3) /* leading or interior slash is absolute */
#define XFLG_DIR2WILD3 (1<<4) /* dir/ match gets trailing *** added */
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/access.c b/access.c
--- a/access.c
+++ b/access.c
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
extern int size_only;
extern OFF_T max_size;
extern OFF_T min_size;
-@@ -525,6 +526,9 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -524,6 +525,9 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
/* Perform our quick-check heuristic for determining if a file is unchanged. */
int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
{
{"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 },
{"no-one-file-system",'x',POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"no-x", 'x', POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
-@@ -2511,6 +2514,9 @@ void server_options(char **args, int *argc_p)
+@@ -2530,6 +2533,9 @@ void server_options(char **args, int *argc_p)
else if (missing_args == 1 && !am_sender)
args[ac++] = "--ignore-missing-args";
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
diff --git a/cleanup.c b/cleanup.c
--- a/cleanup.c
+++ b/cleanup.c
-@@ -25,6 +25,7 @@
- extern int am_server;
- extern int am_daemon;
+@@ -27,6 +27,7 @@ extern int am_daemon;
+ extern int am_sender;
+ extern int am_generator;
extern int io_error;
+extern int use_db;
extern int keep_partial;
extern int got_xfer_error;
- extern int output_needs_newline;
-@@ -130,6 +131,12 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
+ extern int protocol_version;
+@@ -139,6 +140,12 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
/* FALLTHROUGH */
#include "case_N.h"
extern char *bind_address;
extern char *config_file;
extern char *logfile_format;
-@@ -668,6 +671,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -667,6 +670,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
log_init(1);
#ifdef HAVE_PUTENV
if (*lp_prexfer_exec(i) || *lp_postxfer_exec(i)) {
int status;
-@@ -859,6 +865,10 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -862,6 +868,10 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
am_server = 1; /* Don't let someone try to be tricky. */
quiet = 0;
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
-@@ -322,7 +322,7 @@ AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \
+@@ -331,7 +331,7 @@ AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \
sys/un.h sys/attr.h mcheck.h arpa/inet.h arpa/nameser.h locale.h \
netdb.h malloc.h float.h limits.h iconv.h libcharset.h langinfo.h \
sys/acl.h acl/libacl.h attr/xattr.h sys/xattr.h sys/extattr.h \
AC_HEADER_MAJOR
AC_CACHE_CHECK([if makedev takes 3 args],rsync_cv_MAKEDEV_TAKES_3_ARGS,[
-@@ -1004,6 +1004,29 @@ if test x"$enable_acl_support" = x"no" -o x"$enable_xattr_support" = x"no" -o x"
+@@ -1013,6 +1013,29 @@ if test x"$enable_acl_support" = x"no" -o x"$enable_xattr_support" = x"no" -o x"
fi
fi
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -54,6 +54,7 @@ extern int preserve_specials;
+@@ -53,6 +53,7 @@ extern int preserve_specials;
extern int missing_args;
extern int uid_ndx;
extern int gid_ndx;
extern int eol_nulls;
extern int relative_paths;
extern int implied_dirs;
-@@ -1308,11 +1309,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1307,11 +1308,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))
-@@ -1395,8 +1393,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1394,8 +1392,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2061,6 +2063,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2060,6 +2062,9 @@ 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;
extern int append_mode;
extern int make_backups;
extern int csum_length;
-@@ -532,7 +533,8 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
+@@ -531,7 +532,8 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
of the file time to determine whether to sync */
if (always_checksum > 0 && S_ISREG(st->st_mode)) {
char sum[MAX_DIGEST_LEN];
return memcmp(sum, F_SUM(file), checksum_len) == 0;
}
-@@ -2074,6 +2076,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2076,6 +2078,9 @@ void generate_files(int f_out, const char *local_name)
: "enabled");
}
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -50,6 +50,7 @@ extern int copy_unsafe_links;
+@@ -51,6 +51,7 @@ extern int copy_unsafe_links;
extern int keep_dirlinks;
extern int preserve_hard_links;
extern int protocol_version;
extern int file_total;
extern int recurse;
extern int xfer_dirs;
-@@ -79,6 +80,7 @@ extern char *filesfrom_host;
+@@ -80,6 +81,7 @@ extern char *filesfrom_host;
extern char *partial_dir;
extern char *dest_option;
extern char *rsync_path;
extern char *shell_cmd;
extern char *batch_name;
extern char *password_file;
-@@ -1584,6 +1586,9 @@ int main(int argc,char *argv[])
+@@ -1593,6 +1595,9 @@ int main(int argc,char *argv[])
exit_cleanup(RERR_SYNTAX);
}
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -470,7 +470,9 @@ static int fattr_find(struct file_struct *f, char *fname)
+@@ -469,7 +469,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;
-@@ -1785,6 +1787,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1784,6 +1786,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fnamecmp = partialptr;
fnamecmp_type = FNAMECMP_PARTIAL_DIR;
statret = 0;
{"fuzzy", 'y', POPT_ARG_VAL, &fuzzy_basis, 1, 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -2498,8 +2502,14 @@ void server_options(char **args, int *argc_p)
+@@ -2517,8 +2521,14 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";
--compare-dest=DIR also compare received files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
-@@ -1641,6 +1643,17 @@ the bf(--partial-dir) option, that directory will be used instead. These
+@@ -1642,6 +1644,17 @@ the bf(--partial-dir) option, that directory will be used instead. These
potential alternate-basis files will be removed as the transfer progresses.
This option conflicts with bf(--inplace) and bf(--append).
a file that can't use it, while missing out on giving it to a file
that could use it.
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -42,6 +42,7 @@ extern int checksum_seed;
+@@ -40,6 +40,7 @@ extern int checksum_seed;
extern int basis_dir_cnt;
extern int prune_empty_dirs;
extern int protocol_version;
extern int protect_args;
extern int preserve_uid;
extern int preserve_gid;
-@@ -122,6 +123,7 @@ void set_allow_inc_recurse(void)
+@@ -119,6 +120,7 @@ void set_allow_inc_recurse(void)
allow_inc_recurse = 0;
else if (!am_sender
&& (delete_before || delete_after
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -63,6 +63,7 @@ extern int non_perishable_cnt;
+@@ -62,6 +62,7 @@ extern int non_perishable_cnt;
extern int prune_empty_dirs;
extern int copy_links;
extern int copy_unsafe_links;
extern int protocol_version;
extern int sanitize_paths;
extern int munge_symlinks;
-@@ -133,6 +134,8 @@ static int64 tmp_dev, tmp_ino;
+@@ -132,6 +133,8 @@ static int64 tmp_dev, tmp_ino;
#endif
static char tmp_sum[MAX_DIGEST_LEN];
static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
-@@ -300,6 +303,45 @@ static int is_excluded(const char *fname, int is_dir, int filter_level)
+@@ -299,6 +302,45 @@ static int is_excluded(const char *fname, int is_dir, int filter_level)
return 0;
}
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len, int flags);
-@@ -2520,6 +2562,25 @@ struct file_list *recv_file_list(int f)
+@@ -2529,6 +2571,25 @@ struct file_list *recv_file_list(int f)
flist_sort_and_clean(flist, relative_paths);
extern int whole_file;
extern int list_only;
extern int read_batch;
-@@ -99,10 +100,12 @@ extern char *tmpdir;
+@@ -98,10 +99,12 @@ 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;
-@@ -182,6 +185,8 @@ static int remember_delete(struct file_struct *file, const char *fname, int flag
+@@ -181,6 +184,8 @@ static int remember_delete(struct file_struct *file, const char *fname, int flag
if (!flush_delete_delay())
return 0;
}
return 1;
}
-@@ -273,13 +278,18 @@ static void do_delayed_deletions(char *delbuf)
+@@ -272,13 +277,18 @@ 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
int save_uid_ndx = uid_ndx;
if (!fbuf) {
-@@ -294,17 +304,22 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev)
+@@ -293,17 +303,22 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev)
maybe_send_keepalive();
if (io_error && !ignore_errors) {
if (one_file_system) {
if (file->flags & FLAG_TOP_DIR)
filesystem_dev = *fs_dev;
-@@ -317,6 +332,14 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev)
+@@ -316,6 +331,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--; ) {
-@@ -329,6 +352,10 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev)
+@@ -328,6 +351,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. */
-@@ -337,14 +364,19 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev)
+@@ -336,14 +363,19 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev)
if (!(fp->mode & S_IWUSR) && !am_root && (uid_t)F_OWNER(fp) == our_uid)
flags |= DEL_NO_UID_WRITE;
f_name(fp, delbuf);
flist_free(dirlist);
if (!save_uid_ndx) {
-@@ -382,14 +414,122 @@ static void do_delete_pass(void)
+@@ -381,14 +413,122 @@ static void do_delete_pass(void)
|| !S_ISDIR(st.st_mode))
continue;
int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
{
#ifndef CAN_SET_SYMLINK_TIMES
-@@ -1050,6 +1190,7 @@ static void list_file_entry(struct file_struct *f)
+@@ -1049,6 +1189,7 @@ static void list_file_entry(struct file_struct *f)
}
}
static int phase = 0;
static int dflt_perms;
-@@ -1329,9 +1470,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1328,9 +1469,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));
}
goto cleanup;
-@@ -1590,8 +1734,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1589,8 +1733,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;
-@@ -2055,6 +2205,12 @@ void generate_files(int f_out, const char *local_name)
+@@ -2057,6 +2207,12 @@ void generate_files(int f_out, const char *local_name)
if (DEBUG_GTE(GENR, 1))
rprintf(FINFO, "generator starting pid=%ld\n", (long)getpid());
if (delete_before && !solo_file && cur_flist->used > 0)
do_delete_pass();
if (delete_during == 2) {
-@@ -2065,7 +2221,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2067,7 +2223,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",
-@@ -2107,7 +2263,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2109,7 +2265,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));
}
-@@ -2154,7 +2310,21 @@ void generate_files(int f_out, const char *local_name)
+@@ -2156,7 +2312,21 @@ void generate_files(int f_out, const char *local_name)
} while ((cur_flist = cur_flist->next) != NULL);
if (delete_during)
{"fuzzy", 'y', POPT_ARG_VAL, &fuzzy_basis, 1, 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -2123,7 +2126,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2142,7 +2145,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
inplace = 1;
}
partial_dir = tmp_partialdir;
if (inplace) {
-@@ -2132,6 +2135,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2151,6 +2154,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;
}
-@@ -2494,6 +2498,8 @@ void server_options(char **args, int *argc_p)
+@@ -2513,6 +2517,8 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -242,7 +242,7 @@ enum msgcode {
+@@ -246,7 +246,7 @@ enum msgcode {
#define NDX_DEL_STATS -3
#define NDX_FLIST_OFFSET -101
#define DEL_NO_UID_WRITE (1<<0) /* file/dir has our uid w/o write perm */
#define DEL_RECURSE (1<<1) /* if dir, delete all contents */
#define DEL_DIR_IS_EMPTY (1<<2) /* internal delete_FUNCTIONS use only */
-@@ -252,6 +252,7 @@ enum msgcode {
+@@ -256,6 +256,7 @@ enum msgcode {
#define DEL_FOR_DEVICE (1<<6) /* making room for a replacement device */
#define DEL_FOR_SPECIAL (1<<7) /* making room for a replacement special */
#define DEL_FOR_BACKUP (1<<8) /* the delete is for a backup operation */
--compare-dest=DIR also compare received files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
-@@ -1625,6 +1626,21 @@ Note that the use of the bf(--delete) option might get rid of any potential
+@@ -1626,6 +1627,21 @@ Note that the use of the bf(--delete) option might get rid of any potential
fuzzy-match files, so either use bf(--delete-after) or specify some
filename exclusions if you need to prevent this.
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
extern int human_readable;
extern int ignore_existing;
extern int ignore_non_existing;
-@@ -1531,6 +1532,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1530,6 +1531,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
fnamecmp = fname;
fnamecmp_type = FNAMECMP_FNAME;
-@@ -1961,6 +1969,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -1963,6 +1971,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;
-@@ -1986,6 +1995,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -1988,6 +1997,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;
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/checksum.c b/checksum.c
--- a/checksum.c
+++ b/checksum.c
diff --git a/cleanup.c b/cleanup.c
--- a/cleanup.c
+++ b/cleanup.c
-@@ -47,7 +47,13 @@ void close_all(void)
+@@ -50,7 +50,13 @@ void close_all(void)
int fd;
int ret;
STRUCT_STAT st;
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
-@@ -574,7 +574,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
+@@ -583,7 +583,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
- strerror putenv iconv_open locale_charset nl_langinfo getxattr \
+ seteuid strerror putenv iconv_open locale_charset nl_langinfo getxattr \
extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
- initgroups utimensat)
+ initgroups utimensat posix_fadvise64)
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -113,6 +113,10 @@ static int need_retouch_dir_times;
+@@ -112,6 +112,10 @@ static int need_retouch_dir_times;
static int need_retouch_dir_perms;
static const char *solo_file = NULL;
{"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 },
{"ignore-non-existing",0,POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 },
{"ignore-existing", 0, POPT_ARG_NONE, &ignore_existing, 0, 0, 0 },
-@@ -2253,6 +2260,11 @@ void server_options(char **args, int *argc_p)
+@@ -2272,6 +2279,11 @@ void server_options(char **args, int *argc_p)
if (!am_sender)
args[ac++] = "--sender";
diff --git a/sender.c b/sender.c
--- a/sender.c
+++ b/sender.c
-@@ -47,6 +47,10 @@ extern struct file_list *cur_flist, *first_flist, *dir_flist;
+@@ -48,6 +48,10 @@ extern struct file_list *cur_flist, *first_flist, *dir_flist;
BOOL extra_flist_sending_enabled;
./configure
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -42,9 +42,11 @@ extern int checksum_seed;
+@@ -40,9 +40,11 @@ extern int checksum_seed;
extern int basis_dir_cnt;
extern int prune_empty_dirs;
extern int protocol_version;
extern int preserve_acls;
extern int preserve_xattrs;
extern int need_messages_from_generator;
-@@ -62,7 +64,7 @@ extern char *iconv_opt;
+@@ -60,7 +62,7 @@ extern char *iconv_opt;
#endif
/* These index values are for the file-list's extra-attribute array. */
int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
int sender_symlink_iconv = 0; /* sender should convert symlink content */
-@@ -139,6 +141,8 @@ void setup_protocol(int f_out,int f_in)
+@@ -136,6 +138,8 @@ void setup_protocol(int f_out,int f_in)
uid_ndx = ++file_extra_cnt;
if (preserve_gid)
gid_ndx = ++file_extra_cnt;
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
-@@ -574,7 +574,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
+@@ -583,7 +583,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
- strerror putenv iconv_open locale_charset nl_langinfo getxattr \
+ seteuid strerror putenv iconv_open locale_charset nl_langinfo getxattr \
extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
- initgroups utimensat)
+ initgroups utimensat chflags)
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -51,6 +51,7 @@ extern int preserve_links;
+@@ -50,6 +50,7 @@ extern int preserve_links;
extern int preserve_hard_links;
extern int preserve_devices;
extern int preserve_specials;
extern int missing_args;
extern int uid_ndx;
extern int gid_ndx;
-@@ -407,6 +408,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -406,6 +407,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
{
static time_t modtime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -450,6 +454,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -449,6 +453,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) {
-@@ -591,6 +603,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -590,6 +602,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
write_varint(f, F_MOD_NSEC(file));
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -678,6 +694,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -677,6 +693,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
{
static int64 modtime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -823,6 +842,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -822,6 +841,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)
-@@ -974,6 +997,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -973,6 +996,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) {
-@@ -1371,6 +1398,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1370,6 +1397,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
}
#endif
file->mode = st.st_mode;
extern int uid_ndx;
extern int gid_ndx;
extern int delete_mode;
-@@ -407,6 +409,11 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
+@@ -406,6 +408,11 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
&& ((sxp->st.st_mode & 0111 ? 1 : 0) ^ (file->mode & 0111 ? 1 : 0)))
return 0;
if (am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file))
return 0;
-@@ -472,6 +479,11 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -471,6 +478,11 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
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))
-@@ -1266,6 +1278,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1265,6 +1277,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
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);
-@@ -1306,10 +1322,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1305,10 +1321,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
/* We need to ensure that the dirs in the transfer have writable
* permissions during the time we are putting files within them.
* This is then fixed after the transfer is done. */
rsyserr(FERROR_XFER, errno,
"failed to modify permissions on %s",
full_fname(fname));
-@@ -1344,6 +1365,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1343,6 +1364,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
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)
-@@ -1918,13 +1943,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -1920,13 +1945,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
continue;
fname = f_name(file, NULL);
- if (!(file->mode & S_IWUSR))
+ if (fix_dir_perms)
- do_chmod(fname, file->mode);
+ do_chmod(fname, file->mode, 0);
if (need_retouch_dir_times) {
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
-@@ -715,7 +715,7 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
+@@ -733,7 +733,7 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
c[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
c[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
c[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
{"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 },
-@@ -2401,6 +2427,9 @@ void server_options(char **args, int *argc_p)
+@@ -2420,6 +2446,9 @@ void server_options(char **args, int *argc_p)
if (xfer_dirs && !recurse && delete_mode && am_sender)
args[ac++] = "--no-r";
if (do_compression && def_compress_level != Z_DEFAULT_COMPRESSION) {
if (asprintf(&arg, "--compress-level=%d", def_compress_level) < 0)
goto oom;
-@@ -2488,6 +2517,16 @@ void server_options(char **args, int *argc_p)
+@@ -2507,6 +2536,16 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--delete-excluded";
if (force_delete)
args[ac++] = "--force";
extern int preserve_executability;
extern int preserve_times;
extern int am_root;
-@@ -428,6 +429,39 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms,
+@@ -445,6 +446,39 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms,
return new_mode;
}
int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
const char *fnamecmp, int flags)
{
-@@ -476,7 +510,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -493,7 +527,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
flags |= ATTRS_SKIP_MTIME;
if (!(flags & ATTRS_SKIP_MTIME)
&& cmp_time(sxp->st.st_mtime, file->modtime) != 0) {
if (ret < 0) {
rsyserr(FERROR_XFER, errno, "failed to set times on %s",
full_fname(fname));
-@@ -512,7 +546,8 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -529,7 +563,8 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
if (am_root >= 0) {
if (do_lchown(fname,
change_uid ? (uid_t)F_OWNER(file) : sxp->st.st_uid,
/* We shouldn't have attempted to change uid
* or gid unless have the privilege. */
rsyserr(FERROR_XFER, errno, "%s %s failed",
-@@ -546,7 +581,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -563,7 +598,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",
-@@ -558,6 +593,19 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -575,6 +610,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);
-@@ -622,7 +670,8 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -639,7 +687,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))
-@@ -641,6 +690,10 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -658,6 +707,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. */
/* These flags are used in the live flist data. */
-@@ -158,6 +159,7 @@
+@@ -160,6 +161,7 @@
#define ATTRS_REPORT (1<<0)
#define ATTRS_SKIP_MTIME (1<<1)
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -184,6 +186,7 @@
+@@ -186,6 +188,7 @@
#define ITEM_REPORT_GROUP (1<<6)
#define ITEM_REPORT_ACL (1<<7)
#define ITEM_REPORT_XATTR (1<<8)
#define ITEM_BASIS_TYPE_FOLLOWS (1<<11)
#define ITEM_XNAME_FOLLOWS (1<<12)
#define ITEM_IS_NEW (1<<13)
-@@ -490,6 +493,28 @@ typedef unsigned int size_t;
+@@ -494,6 +497,28 @@ typedef unsigned int size_t;
#endif
#endif
/* Find a variable that is either exactly 32-bits or longer.
* If some code depends on 32-bit truncation, it will need to
* take special action in a "#if SIZEOF_INT32 > 4" section. */
-@@ -660,6 +685,7 @@ extern int file_extra_cnt;
+@@ -664,6 +689,7 @@ extern int file_extra_cnt;
extern int inc_recurse;
extern int uid_ndx;
extern int gid_ndx;
extern int acls_ndx;
extern int xattrs_ndx;
-@@ -701,6 +727,11 @@ extern int xattrs_ndx;
+@@ -705,6 +731,11 @@ extern int xattrs_ndx;
/* When the associated option is on, all entries will have these present: */
#define F_OWNER(f) REQ_EXTRA(f, uid_ndx)->unum
#define F_GROUP(f) REQ_EXTRA(f, gid_ndx)->unum
bf(--recursive) option was also enabled.
dit(bf(--max-delete=NUM)) This tells rsync not to delete more than NUM
-@@ -1874,7 +1903,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -1875,7 +1904,7 @@ with older versions of rsync, but that also turns on the output of other
verbose messages).
The "%i" escape has a cryptic output that is 11 letters long. The general
type of update being done, bf(X) is replaced by the file-type, and the
other letters represent attributes that may be output if they are being
modified.
-@@ -1930,7 +1959,7 @@ quote(itemization(
+@@ -1931,7 +1960,7 @@ quote(itemization(
sender's value (requires bf(--owner) and super-user privileges).
it() A bf(g) means the group is different and is being updated to the
sender's value (requires bf(--group) and the authority to set the group).
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -81,6 +81,7 @@ extern struct chmod_mode_struct *chmod_modes;
+@@ -80,6 +80,7 @@ extern struct chmod_mode_struct *chmod_modes;
extern filter_rule_list filter_list;
extern filter_rule_list daemon_filter_list;
#ifdef ICONV_OPTION
extern int filesfrom_convert;
-@@ -283,7 +284,8 @@ static inline int path_is_daemon_excluded(char *path, int ignore_filename)
+@@ -282,7 +283,8 @@ static inline int path_is_daemon_excluded(char *path, int ignore_filename)
/* This function is used to check if a file should be included/excluded
* from the list of files based on its name and type etc. The value of
static int is_excluded(const char *fname, int is_dir, int filter_level)
{
#if 0 /* This currently never happens, so avoid a useless compare. */
-@@ -292,6 +294,8 @@ static int is_excluded(const char *fname, int is_dir, int filter_level)
+@@ -291,6 +293,8 @@ static int is_excluded(const char *fname, int is_dir, int filter_level)
#endif
if (is_daemon_excluded(fname, is_dir))
return 1;
if (filter_level != ALL_FILTERS)
return 0;
if (filter_list.head
-@@ -1170,7 +1174,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1169,7 +1173,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)
-@@ -1215,6 +1219,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1214,6 +1218,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) {
-@@ -1415,12 +1425,23 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1414,12 +1424,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) {
-@@ -2280,7 +2301,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2285,7 +2306,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) {
-@@ -2294,7 +2315,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2299,7 +2320,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
} else
send_if_directory(f, flist, file, fbuf, len, flags);
} else
+ send_file_name(f, flist, fbuf, &st, flags, ALL_FILTERS_NO_EXCLUDE);
}
- gettimeofday(&end_tv, NULL);
+ if (reenable_multiplex >= 0)
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -149,6 +149,9 @@
+@@ -151,6 +151,9 @@
#define NO_FILTERS 0
#define SERVER_FILTERS 1
#define ALL_FILTERS 2
#define XFLG_FATAL_ERRORS (1<<0)
#define XFLG_OLD_PREFIXES (1<<1)
-@@ -805,6 +808,8 @@ struct map_struct {
+@@ -809,6 +812,8 @@ struct map_struct {
int status; /* first errno from read errors */
};
#define FILTRULE_WILD (1<<0) /* pattern has '*', '[', and/or '?' */
#define FILTRULE_WILD2 (1<<1) /* pattern has '**' */
#define FILTRULE_WILD2_PREFIX (1<<2) /* pattern starts with "**" */
-@@ -825,8 +830,18 @@ struct map_struct {
+@@ -829,8 +834,18 @@ struct map_struct {
#define FILTRULE_RECEIVER_SIDE (1<<17)/* rule applies to the receiving side */
#define FILTRULE_CLEAR_LIST (1<<18)/* this item is the "!" token */
#define FILTRULE_PERISHABLE (1<<19)/* perishable if parent dir goes away */
typedef struct filter_struct {
struct filter_struct *next;
-@@ -836,6 +851,11 @@ typedef struct filter_struct {
+@@ -840,6 +855,11 @@ typedef struct filter_struct {
int slash_cnt;
struct filter_list_struct *mergelist;
} u;
See the bf(--perms) and bf(--executability) options for how the resulting
permission value can be applied to the files in the transfer.
-@@ -1831,6 +1833,10 @@ be omitted, but if USER is empty, a leading colon must be supplied.
+@@ -1832,6 +1834,10 @@ be omitted, but if USER is empty, a leading colon must be supplied.
If you specify "--chown=foo:bar, this is exactly the same as specifying
"--usermap=*:foo --groupmap=*:bar", only easier.
dit(bf(--timeout=TIMEOUT)) This option allows you to set a maximum I/O
timeout in seconds. If no data is transferred for the specified time
then rsync will exit. The default is 0, which means no timeout.
-@@ -2643,6 +2649,15 @@ itemization(
+@@ -2657,6 +2663,15 @@ itemization(
option's default 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.
)
manpagesection(MERGE-FILE FILTER RULES)
-@@ -2704,6 +2719,12 @@ itemization(
+@@ -2718,6 +2733,12 @@ itemization(
a rule prefix such as bf(hide)).
)
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
{"rsh", 'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 },
{"rsync-path", 0, POPT_ARG_STRING, &rsync_path, 0, 0, 0 },
{"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
-@@ -2573,6 +2576,9 @@ void server_options(char **args, int *argc_p)
+@@ -2592,6 +2595,9 @@ void server_options(char **args, int *argc_p)
args[ac++] = tmpdir;
}
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/authenticate.c b/authenticate.c
--- a/authenticate.c
+++ b/authenticate.c
+ if (group_match >= 0)
+ break;
+#else
-+ rprintf(FLOG, "This computer doesn't support getgrouplist(), so no @group authorization is possible.\n");
++ rprintf(FLOG, "your computer doesn't support getgrouplist(), so no @group authorization is possible.\n");
+#endif
+ }
}
diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
-@@ -546,6 +546,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -545,6 +545,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
return -1;
}
auth_user = auth_server(f_in, f_out, i, host, addr, "@RSYNCD: AUTHREQD ");
if (!auth_user) {
-@@ -556,9 +557,6 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -555,9 +556,6 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
module_id = i;
+
+verb( auth users = joe:deny @guest:deny admin:rw @rsync:ro susan )
+
-+In the auth above, user joe will be denied access no matter what. Any user
++In the above rule, user joe will be denied access no matter what. Any user
+that is in the group "guest" is also denied access. The user "admin" gets
+access in read/write mode, even if the admin user is in group rsync (because
+the admin user-matching rule is before the rsync group-matching rule).
- Make this code handle multibyte character encodings, and honor the
--iconv setting when converting case.
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
extern int ignore_errors;
extern int numeric_ids;
extern int recurse;
-@@ -2982,6 +2983,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -2991,6 +2992,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;
-@@ -3092,7 +3094,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -3101,7 +3103,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
-@@ -77,3 +77,38 @@ init_stat_x(stat_x *sx_p)
+@@ -85,3 +85,38 @@ init_stat_x(stat_x *sx_p)
sx_p->xattr = NULL;
#endif
}
{"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},
-@@ -2523,6 +2527,9 @@ void server_options(char **args, int *argc_p)
+@@ -2542,6 +2546,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
-@@ -1583,6 +1584,10 @@ If you use this option with bf(--iconv), the args will also be translated
+@@ -1584,6 +1585,10 @@ side will also be translated
from the local to the remote character-set. The translation happens before
wild-cards are expanded. See also the bf(--files-from) option.
./configure
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -73,6 +73,7 @@ extern int sender_keeps_checksum;
+@@ -72,6 +72,7 @@ extern int sender_keeps_checksum;
extern int unsort_ndx;
extern struct stats stats;
extern char *filesfrom_host;
extern char *usermap, *groupmap;
extern char curr_dir[MAXPATHLEN];
-@@ -909,7 +910,7 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -908,7 +909,7 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
extra_len += EXTRA_LEN;
#endif
rprintf(F," -z, --compress compress file data during the transfer\n");
rprintf(F," --compress-level=NUM explicitly set compression level\n");
rprintf(F," --skip-compress=LIST skip compressing files with a suffix in LIST\n");
-@@ -799,7 +801,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -798,7 +800,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+ OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST, OPT_HELP,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
- OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG,
-- OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN,
-+ OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_LINK_BY_HASH,
+- OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG,
++ OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, OPT_LINK_BY_HASH,
+ OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT,
OPT_SERVER, OPT_REFUSED_BASE = 9000};
- static struct poptOption long_options[] = {
@@ -938,6 +940,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 },
{"fuzzy", 'y', POPT_ARG_VAL, &fuzzy_basis, 1, 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -1744,6 +1747,21 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1763,6 +1766,21 @@ int parse_arguments(int *argc_p, const char ***argv_p)
return 0;
#endif
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -2602,6 +2620,11 @@ void server_options(char **args, int *argc_p)
+@@ -2621,6 +2639,11 @@ void server_options(char **args, int *argc_p)
} else if (inplace)
args[ac++] = "--inplace";
- fname, fd2, F_LENGTH(file));
+ fname, fd2, F_LENGTH(file), F_SUM(file));
- log_item(log_code, file, &initial_stats, iflags, NULL);
+ log_item(log_code, file, iflags, NULL);
diff --git a/rsync.c b/rsync.c
--- a/rsync.c
+++ b/rsync.c
-@@ -49,6 +49,7 @@ extern int file_old_total;
- extern int msgs2stderr;
+@@ -48,6 +48,7 @@ extern int flist_eof;
+ extern int file_old_total;
extern int keep_dirlinks;
extern int make_backups;
+extern char *link_by_hash_dir;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct chmod_mode_struct *daemon_chmod_modes;
#ifdef ICONV_OPTION
-@@ -627,8 +628,15 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -644,8 +645,15 @@ int finish_transfer(const char *fname, const char *fnametmp,
/* move tmp file over real file */
if (DEBUG_GTE(RECV, 1))
rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -861,6 +861,14 @@ struct stats {
+@@ -865,6 +865,14 @@ struct stats {
int xferred_files;
};
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
-@@ -67,6 +67,7 @@ extern iconv_t ic_send, ic_recv;
+@@ -66,6 +66,7 @@ extern iconv_t ic_send, ic_recv;
char *auth_user;
int read_only = 0;
int module_id = -1;
struct chmod_mode_struct *daemon_chmod_modes;
/* module_dirlen is the length of the module_dir string when in daemon
-@@ -78,6 +79,7 @@ unsigned int module_dirlen = 0;
+@@ -77,6 +78,7 @@ unsigned int module_dirlen = 0;
char *full_module_path;
static int rl_nulls = 0;
#ifdef HAVE_SIGACTION
static struct sigaction sigact;
-@@ -669,7 +671,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -668,7 +670,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
log_init(1);
#ifdef HAVE_PUTENV
int status;
umask(orig_umask);
-@@ -741,6 +743,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -740,6 +742,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
set_blocking(fds[1]);
pre_exec_fd = fds[1];
}
umask(0);
}
#endif
-@@ -968,6 +1008,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -971,6 +1011,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
return 0;
}
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/access.c b/access.c
--- a/access.c
+++ b/access.c
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
extern int uid_ndx;
extern int gid_ndx;
extern int delete_mode;
-@@ -438,6 +439,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -437,6 +438,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 keep_time = !preserve_times ? 0
: S_ISDIR(file->mode) ? preserve_times > 1 :
#ifdef CAN_SET_SYMLINK_TIMES
-@@ -467,10 +469,11 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -466,10 +468,11 @@ 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)) {
-@@ -1262,7 +1265,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1261,7 +1264,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
real_sx = sx;
if (file->flags & FLAG_DIR_CREATED)
statret = -1;
{"modify-window", 0, POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
{"super", 0, POPT_ARG_VAL, &am_root, 2, 0, 0 },
{"no-super", 0, POPT_ARG_VAL, &am_root, 0, 0, 0 },
-@@ -2038,6 +2041,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2057,6 +2060,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
parse_filter_str(&filter_list, backup_dir_buf, rule_template(0), 0);
}
if (make_backups && !backup_dir) {
omit_dir_times = 0; /* Implied, so avoid -O to sender. */
if (preserve_times > 1)
-@@ -2281,6 +2286,8 @@ void server_options(char **args, int *argc_p)
+@@ -2300,6 +2305,8 @@ void server_options(char **args, int *argc_p)
argstr[x++] = 'm';
if (omit_dir_times)
argstr[x++] = 'O';
extern int am_root;
extern int am_server;
extern int am_sender;
-@@ -488,9 +489,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -505,9 +506,11 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
file->flags |= FLAG_TIME_FAILED;
}
./configure
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
diff --git a/cleanup.c b/cleanup.c
--- a/cleanup.c
+++ b/cleanup.c
-@@ -25,6 +25,9 @@
- extern int am_server;
- extern int am_daemon;
+@@ -27,6 +27,9 @@ extern int am_daemon;
+ extern int am_sender;
+ extern int am_generator;
extern int io_error;
+#ifdef HAVE_OPENSSL
+extern int use_ssl;
+#endif
extern int keep_partial;
extern int got_xfer_error;
- extern int output_needs_newline;
-@@ -127,6 +130,14 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
+ extern int protocol_version;
+@@ -136,6 +139,14 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
code, file, line);
}
extern int rsync_port;
extern int protect_args;
extern int ignore_errors;
-@@ -134,8 +137,18 @@ int start_socket_client(char *host, int remote_argc, char *remote_argv[],
+@@ -133,8 +136,18 @@ int start_socket_client(char *host, int remote_argc, char *remote_argv[],
#endif
ret = start_inband_exchange(fd, fd, user, remote_argc, remote_argv);
}
static int exchange_protocols(int f_in, int f_out, char *buf, size_t bufsiz, int am_client)
-@@ -278,6 +291,32 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
+@@ -277,6 +290,32 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
if (DEBUG_GTE(CMD, 1))
print_child_argv("sending daemon args:", sargs);
io_printf(f_out, "%.*s\n", modlen, modname);
/* Old servers may just drop the connection here,
-@@ -303,6 +342,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
+@@ -302,6 +341,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
* server to terminate the listing of modules.
* We don't want to go on and transfer
* anything; just exit. */
exit(0);
}
-@@ -310,6 +353,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
+@@ -309,6 +352,10 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
rprintf(FERROR, "%s\n", line);
/* This is always fatal; the server will now
* close the socket. */
return -1;
}
-@@ -1025,6 +1072,9 @@ int start_daemon(int f_in, int f_out)
+@@ -1028,6 +1075,9 @@ int start_daemon(int f_in, int f_out)
if (exchange_protocols(f_in, f_out, line, sizeof line, 0) < 0)
return -1;
line[0] = 0;
if (!read_line_old(f_in, line, sizeof line))
return -1;
-@@ -1036,6 +1086,20 @@ int start_daemon(int f_in, int f_out)
+@@ -1039,6 +1089,20 @@ int start_daemon(int f_in, int f_out)
return -1;
}
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
-@@ -303,6 +303,21 @@ if test x"$enable_locale" != x"no"; then
+@@ -312,6 +312,21 @@ if test x"$enable_locale" != x"no"; then
AC_DEFINE(CONFIG_LOCALE)
fi
rprintf(F," --version print version number\n");
rprintf(F,"(-h) --help show this help (-h works with no other options)\n");
-@@ -799,7 +818,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -798,7 +817,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+ OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST, OPT_HELP,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
- OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG,
-- OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN,
-+ OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_USE_SSL,
+- OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG,
++ OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, OPT_USE_SSL,
+ OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT,
OPT_SERVER, OPT_REFUSED_BASE = 9000};
- static struct poptOption long_options[] = {
@@ -1013,6 +1032,13 @@ static struct poptOption long_options[] = {
{"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 },
{"server", 0, POPT_ARG_NONE, 0, OPT_SERVER, 0, 0 },
*argv_p = argv = poptGetArgs(pc);
*argc_p = argc = count_args(argv);
am_starting_up = 0;
-@@ -1744,6 +1801,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1763,6 +1820,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
return 0;
#endif
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -2126,6 +2189,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2145,6 +2208,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
if (delay_updates && !partial_dir)
partial_dir = tmp_partialdir;
if (inplace) {
#ifdef HAVE_FTRUNCATE
if (partial_dir) {
-@@ -2716,9 +2790,18 @@ char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
+@@ -2735,9 +2809,18 @@ char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
{
char *path;
#define SYMLINK_PREFIX "/rsyncd-munged/" /* This MUST have a trailing slash! */
#define SYMLINK_PREFIX_LEN ((int)sizeof SYMLINK_PREFIX - 1)
-@@ -577,6 +578,11 @@ typedef unsigned int size_t;
+@@ -581,6 +582,11 @@ typedef unsigned int size_t;
# define SIZEOF_INT64 SIZEOF_OFF_T
#endif
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
./configure
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -34,6 +34,7 @@ extern int inplace;
+@@ -32,6 +32,7 @@ extern int inplace;
extern int recurse;
extern int use_qsort;
extern int allow_inc_recurse;
extern int append_mode;
extern int fuzzy_basis;
extern int read_batch;
-@@ -189,6 +190,15 @@ void setup_protocol(int f_out,int f_in)
+@@ -186,6 +187,15 @@ void setup_protocol(int f_out,int f_in)
if (read_batch)
check_batch_flags();
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
-@@ -574,13 +574,40 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
+@@ -583,13 +583,40 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
- strerror putenv iconv_open locale_charset nl_langinfo getxattr \
+ seteuid strerror putenv iconv_open locale_charset nl_langinfo getxattr \
extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
- initgroups utimensat)
+ initgroups utimensat fallocate posix_fallocate)
{"inplace", 0, POPT_ARG_VAL, &inplace, 1, 0, 0 },
{"no-inplace", 0, POPT_ARG_VAL, &inplace, 0, 0, 0 },
{"append", 0, POPT_ARG_NONE, 0, OPT_APPEND, 0, 0 },
-@@ -2627,6 +2636,9 @@ void server_options(char **args, int *argc_p)
+@@ -2646,6 +2655,9 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -642,6 +642,13 @@ struct ht_int64_node {
+@@ -646,6 +646,13 @@ struct ht_int64_node {
#define ACLS_NEED_MASK 1
#endif
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -71,6 +71,7 @@ extern int sender_symlink_iconv;
+@@ -70,6 +70,7 @@ extern int sender_symlink_iconv;
extern int output_needs_newline;
extern int sender_keeps_checksum;
extern int unsort_ndx;
extern struct stats stats;
extern char *filesfrom_host;
extern char *usermap, *groupmap;
-@@ -1753,6 +1754,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1752,6 +1753,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);
@@ -776,6 +777,7 @@ void usage(enum logcode F)
rprintf(F," --password-file=FILE read daemon-access password from FILE\n");
rprintf(F," --list-only list the files instead of copying them\n");
- rprintf(F," --bwlimit=KBPS limit I/O bandwidth; KBytes per second\n");
+ rprintf(F," --bwlimit=RATE limit socket I/O bandwidth\n");
+ rprintf(F," --slow-down=USECs sleep N usec while creating the filelist\n");
rprintf(F," --write-batch=FILE write a batched update to FILE\n");
rprintf(F," --only-write-batch=FILE like --write-batch but w/o updating destination\n");
{"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", 0, POPT_ARG_LONG, &sleep_asec, 0, 0, 0 },
- {"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 },
+ {"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 },
TODO: the configure changes should abort if the user requests --enable-slp
and we can't honor that request.
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
-@@ -1156,6 +1156,13 @@ int daemon_main(void)
+@@ -1159,6 +1159,13 @@ int daemon_main(void)
* address too. In fact, why not just do inet_ntop on the
* local address??? */
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
-@@ -668,6 +668,29 @@ if test $rsync_cv_can_hardlink_special = yes; then
+@@ -677,6 +677,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
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -1213,6 +1213,18 @@ static int start_client(int argc, char *argv[])
+@@ -1222,6 +1222,18 @@ static int start_client(int argc, char *argv[])
if (!read_batch) { /* for read_batch, NO source is specified */
char *path = check_for_hostspec(argv[0], &shell_machine, &rsync_port);
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -197,6 +197,10 @@
+@@ -199,6 +199,10 @@
#define SIGNIFICANT_ITEM_FLAGS (~(\
ITEM_BASIS_TYPE_FOLLOWS | ITEM_XNAME_FOLLOWS | ITEM_LOCAL_CHANGE))
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/syscall.c b/syscall.c
--- a/syscall.c
+++ b/syscall.c
-- Matt McCutchen <hashproduct@gmail.com>
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
rprintf(F," --delete delete extraneous files from destination dirs\n");
rprintf(F," --delete-before receiver deletes before transfer, not during\n");
@@ -967,6 +969,7 @@ static struct poptOption long_options[] = {
- {"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 },
+ {"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 },
+ {"source-backup", 0, POPT_ARG_NONE, &make_source_backups, 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 },
-@@ -2502,6 +2505,8 @@ void server_options(char **args, int *argc_p)
+@@ -2521,6 +2524,8 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}
extern int inplace;
extern int batch_fd;
extern int write_batch;
-@@ -124,6 +125,7 @@ void successful_send(int ndx)
+@@ -125,6 +126,7 @@ void successful_send(int ndx)
char fname[MAXPATHLEN];
struct file_struct *file;
struct file_list *flist;
if (!remove_source_files)
return;
-@@ -134,7 +136,11 @@ void successful_send(int ndx)
+@@ -135,7 +137,11 @@ void successful_send(int ndx)
return;
f_name(file, fname);
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
extern int size_only;
extern OFF_T max_size;
extern OFF_T min_size;
-@@ -525,7 +526,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -524,7 +525,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
/* Perform our quick-check heuristic for determining if a file is unchanged. */
int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
{
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -148,7 +148,7 @@ pid_t wait_process(pid_t pid, int *status_ptr, int flags)
+@@ -149,7 +149,7 @@ pid_t wait_process(pid_t pid, int *status_ptr, int flags)
}
/* Wait for a process to exit, calling io_flush while waiting. */
{"remote-option", 'M', POPT_ARG_STRING, 0, 'M', 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
{"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 },
-@@ -2167,6 +2176,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2186,6 +2195,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
if (files_from) {
char *h, *p;
int q;
-@@ -2511,6 +2530,25 @@ void server_options(char **args, int *argc_p)
+@@ -2530,6 +2549,25 @@ void server_options(char **args, int *argc_p)
else if (missing_args == 1 && !am_sender)
args[ac++] = "--ignore-missing-args";
extern char *partial_dir;
extern char *basis_dir[MAX_BASIS_DIRS+1];
extern char sender_file_sum[MAX_DIGEST_LEN];
-@@ -476,6 +477,8 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -475,6 +476,8 @@ int recv_files(int f_in, int f_out, char *local_name)
const char *parent_dirname = "";
#endif
int ndx, recv_ok;
if (DEBUG_GTE(RECV, 1))
rprintf(FINFO, "recv_files(%d) starting\n", cur_flist->used);
-@@ -483,6 +486,23 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -482,6 +485,23 @@ int recv_files(int f_in, int f_out, char *local_name)
if (delay_updates)
delayed_bits = bitbag_create(cur_flist->used + 1);
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -141,6 +141,7 @@
+@@ -143,6 +143,7 @@
#define IOERR_DEL_LIMIT (1<<2)
#define MAX_ARGS 1000
--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)
-@@ -2306,6 +2309,33 @@ file previously generated by bf(--write-batch).
+@@ -2321,6 +2324,33 @@ file previously generated by bf(--write-batch).
If em(FILE) is bf(-), the batch data will be read from standard input.
See the "BATCH MODE" section for details.
diff --git a/sender.c b/sender.c
--- a/sender.c
+++ b/sender.c
-@@ -42,6 +42,7 @@ extern int make_backups;
- extern int inplace;
+@@ -43,6 +43,7 @@ extern int inplace;
extern int batch_fd;
extern int write_batch;
+ extern int file_old_total;
+extern char *source_filter;
extern struct stats stats;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
if (DEBUG_GTE(SEND, 1))
rprintf(FINFO, "send_files starting\n");
-@@ -306,6 +327,7 @@ void send_files(int f_in, int f_out)
+@@ -310,6 +331,7 @@ void send_files(int f_in, int f_out)
exit_cleanup(RERR_PROTOCOL);
}
fd = do_open(fname, O_RDONLY, 0);
if (fd == -1) {
if (errno == ENOENT) {
-@@ -327,6 +349,33 @@ void send_files(int f_in, int f_out)
+@@ -331,6 +353,33 @@ void send_files(int f_in, int f_out)
continue;
}
/* map the local file */
if (do_fstat(fd, &st) != 0) {
io_error |= IOERR_GENERAL;
-@@ -377,6 +426,8 @@ void send_files(int f_in, int f_out)
+@@ -381,6 +430,8 @@ void send_files(int f_in, int f_out)
}
}
close(fd);
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/fileio.c b/fileio.c
--- a/fileio.c
+++ b/fileio.c
{"inplace", 0, POPT_ARG_VAL, &inplace, 1, 0, 0 },
{"no-inplace", 0, POPT_ARG_VAL, &inplace, 0, 0, 0 },
{"append", 0, POPT_ARG_NONE, 0, OPT_APPEND, 0, 0 },
-@@ -2434,6 +2437,12 @@ void server_options(char **args, int *argc_p)
+@@ -2453,6 +2456,12 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
static int refused_inplace, refused_no_iconv;
static BOOL usermap_via_chown, groupmap_via_chown;
+static char *stdout_buffering;
- static char *max_size_arg, *min_size_arg;
+ static char *bwlimit_arg, *max_size_arg, *min_size_arg;
static char tmp_partialdir[] = ".~tmp~";
@@ -776,6 +777,7 @@ void usage(enum logcode F)
rprintf(F," --password-file=FILE read daemon-access password from FILE\n");
rprintf(F," --list-only list the files instead of copying them\n");
- rprintf(F," --bwlimit=KBPS limit I/O bandwidth; KBytes per second\n");
+ rprintf(F," --bwlimit=RATE limit socket I/O bandwidth\n");
+ rprintf(F," --stdout=line|unbuf change buffering of stdout\n");
rprintf(F," --write-batch=FILE write a batched update to FILE\n");
rprintf(F," --only-write-batch=FILE like --write-batch but w/o updating destination\n");
{"remote-option", 'M', POPT_ARG_STRING, 0, 'M', 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
{"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 },
-@@ -1759,6 +1762,13 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1778,6 +1781,13 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/io.c b/io.c
--- a/io.c
+++ b/io.c
extern struct file_list *cur_flist;
#ifdef ICONV_OPTION
extern int filesfrom_convert;
-@@ -137,16 +138,24 @@ static void check_timeout(void)
+@@ -154,16 +155,24 @@ static void check_timeout(void)
{
time_t t;
@@ -776,6 +777,8 @@ void usage(enum logcode F)
rprintf(F," --password-file=FILE read daemon-access password from FILE\n");
rprintf(F," --list-only list the files instead of copying them\n");
- rprintf(F," --bwlimit=KBPS limit I/O bandwidth; KBytes per second\n");
+ rprintf(F," --bwlimit=RATE limit socket I/O bandwidth\n");
+ rprintf(F," --stop-at=y-m-dTh:m Stop rsync at year-month-dayThour:minute\n");
+ rprintf(F," --time-limit=MINS Stop rsync after MINS minutes have elapsed\n");
rprintf(F," --write-batch=FILE write a batched update to FILE\n");
rprintf(F," --only-write-batch=FILE like --write-batch but w/o updating destination\n");
rprintf(F," --read-batch=FILE read a batched update from FILE\n");
-@@ -799,7 +802,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
- OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
+@@ -800,6 +803,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
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_USERMAP, OPT_GROUPMAP, OPT_CHOWN,
-+ OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_STOP_AT, OPT_TIME_LIMIT,
+ OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT,
++ OPT_STOP_AT, OPT_TIME_LIMIT,
OPT_SERVER, OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -989,6 +992,8 @@ static struct poptOption long_options[] = {
+@@ -989,6 +993,8 @@ static struct poptOption long_options[] = {
{"no-timeout", 0, POPT_ARG_VAL, &io_timeout, 0, 0, 0 },
{"contimeout", 0, POPT_ARG_INT, &connect_timeout, 0, 0, 0 },
{"no-contimeout", 0, POPT_ARG_VAL, &connect_timeout, 0, 0, 0 },
{"rsh", 'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 },
{"rsync-path", 0, POPT_ARG_STRING, &rsync_path, 0, 0, 0 },
{"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
-@@ -1744,6 +1749,36 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1763,6 +1769,36 @@ int parse_arguments(int *argc_p, const char ***argv_p)
return 0;
#endif
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -2446,6 +2481,15 @@ void server_options(char **args, int *argc_p)
+@@ -2465,6 +2501,15 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
@@ -431,6 +431,8 @@ to the detailed description below for a complete description. verb(
--password-file=FILE read daemon-access password from FILE
--list-only list the files instead of copying them
- --bwlimit=KBPS limit I/O bandwidth; KBytes per second
+ --bwlimit=RATE limit socket I/O bandwidth
+ --stop-at=y-m-dTh:m Stop rsync at year-month-dayThour:minute
+ --time-limit=MINS Stop rsync after MINS minutes have elapsed
--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
-@@ -2280,6 +2282,19 @@ transfer was too fast, it will wait before sending the next data block. The
- result is an average transfer rate equaling the specified limit. A value
- of zero specifies no limit.
+@@ -2295,6 +2297,19 @@ files can show up as being rapidly sent when the data is quickly buffered,
+ while other can show up as very slow when the flushing of the output buffer
+ occurs. This may be fixed in a future version.
+dit(bf(--stop-at=y-m-dTh:m)) This option allows you to specify at what
+time to stop rsync, in year-month-dayThour:minute numeric format (e.g.
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -87,6 +87,9 @@ extern int filesfrom_convert;
+@@ -86,6 +86,9 @@ extern int filesfrom_convert;
extern iconv_t ic_send, ic_recv;
#endif
#ifdef HAVE_UTIMENSAT
#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
#define ST_MTIME_NSEC st_mtim.tv_nsec
-@@ -674,6 +677,24 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -673,6 +676,24 @@ 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;
-@@ -742,6 +763,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -741,6 +762,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
}
#endif
{"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 },
-@@ -2213,6 +2217,31 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2232,6 +2236,31 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
am_starting_up = 0;
return 1;
-@@ -2627,6 +2656,12 @@ void server_options(char **args, int *argc_p)
+@@ -2646,6 +2675,12 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
--checksum-seed=NUM set block/file checksum seed (advanced)
-4, --ipv4 prefer IPv4
-6, --ipv6 prefer IPv6
-@@ -2344,6 +2345,22 @@ daemon uses the charset specified in its "charset" configuration parameter
+@@ -2359,6 +2360,22 @@ daemon uses the charset specified in its "charset" configuration parameter
regardless of the remote charset you actually pass. Thus, you may feel free to
specify just the local charset for a daemon transfer (e.g. bf(--iconv=utf8)).
./configure (optional if already run)
make
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/syscall.c b/syscall.c
--- a/syscall.c
+++ b/syscall.c
This patch has not yet been tested by me (Wayne), but was provided
Darryl Dixon. Thanks!
-based-on: 3b8f8192227b14e708bf535072485e50f4362270
+based-on: 24079e988fc31af4eba56cd2701fdc5a4154980d
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
extern int preserve_specials;
extern int preserve_hard_links;
extern int preserve_executability;
-@@ -1534,7 +1535,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1533,7 +1534,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fnamecmp = fname;
fnamecmp_type = FNAMECMP_FNAME;
{"specials", 0, POPT_ARG_VAL, &preserve_specials, 1, 0, 0 },
{"no-specials", 0, POPT_ARG_VAL, &preserve_specials, 0, 0, 0 },
{"links", 'l', POPT_ARG_VAL, &preserve_links, 1, 0, 0 },
-@@ -1744,6 +1747,11 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1763,6 +1766,11 @@ int parse_arguments(int *argc_p, const char ***argv_p)
return 0;
#endif
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -2627,6 +2635,9 @@ void server_options(char **args, int *argc_p)
+@@ -2646,6 +2654,9 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -192,13 +192,6 @@ void setup_protocol(int f_out,int f_in)
+@@ -189,13 +189,6 @@ void setup_protocol(int f_out,int f_in)
if (protocol_version < 30) {
if (append_mode == 1)
append_mode = 2;
+
if (F_XATTR(file) < 0) {
rprintf(FERROR, "recv_xattr_request: internal data error!\n");
- exit_cleanup(RERR_STREAMIO);
+ exit_cleanup(RERR_PROTOCOL);
@@ -649,7 +666,22 @@ void receive_xattr(int f, struct file_struct *file)
#else
int need_sort = 1;