./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/acls.c b/acls.c
--- a/acls.c
+++ b/acls.c
static int calc_sacl_entries(const rsync_acl *racl)
{
/* A System ACL always gets user/group/other permission entries. */
-@@ -574,6 +587,96 @@ int get_acl(const char *fname, stat_x *sxp)
+@@ -580,6 +593,96 @@ int get_acl(const char *fname, stat_x *sxp)
return 0;
}
/* === Send functions === */
/* Send the ida list over the file descriptor. */
-@@ -649,6 +752,11 @@ static void send_rsync_acl(int f, rsync_acl *racl, SMB_ACL_TYPE_T type,
+@@ -655,6 +758,11 @@ static void send_rsync_acl(int f, rsync_acl *racl, SMB_ACL_TYPE_T type,
* This also frees the ACL data. */
void send_acl(int f, stat_x *sxp)
{
if (!sxp->acc_acl) {
sxp->acc_acl = create_racl();
rsync_acl_fake_perms(sxp->acc_acl, sxp->st.st_mode);
-@@ -666,6 +774,160 @@ void send_acl(int f, stat_x *sxp)
+@@ -672,6 +780,160 @@ void send_acl(int f, stat_x *sxp)
}
}
/* === Receive functions === */
static uint32 recv_acl_access(int f, uchar *name_follows_ptr)
-@@ -787,6 +1049,11 @@ static int recv_rsync_acl(int f, item_list *racl_list, SMB_ACL_TYPE_T type, mode
+@@ -793,6 +1055,11 @@ static int recv_rsync_acl(int f, item_list *racl_list, SMB_ACL_TYPE_T type, mode
/* Receive the ACL info the sender has included for this file-list entry. */
void receive_acl(int f, struct file_struct *file)
{
Fix a bug that could lose some bits when stripping some (supposedly)
superfluous ACL info.
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
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: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
extern int relative_paths;
extern int implied_dirs;
extern int ignore_perishable;
-@@ -404,7 +405,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -396,7 +397,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;
-@@ -504,6 +505,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -496,6 +497,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 != -1) {
-@@ -590,6 +598,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -582,6 +590,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);
-@@ -677,7 +687,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -669,7 +679,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;
-@@ -821,6 +831,16 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -813,6 +823,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);
-@@ -981,6 +1001,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -973,6 +993,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;
-@@ -1378,6 +1400,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1370,6 +1392,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
F_GROUP(file) = st.st_gid;
if (am_generator && st.st_uid == our_uid)
file->flags |= FLAG_OWNED_BY_US;
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -698,12 +700,14 @@ extern int file_extra_cnt;
+@@ -708,12 +710,14 @@ extern int file_extra_cnt;
extern int inc_recurse;
extern int uid_ndx;
extern int gid_ndx;
dit(bf(-O, --omit-dir-times)) This tells rsync to omit directories when
it is preserving modification times (see bf(--times)). If NFS is sharing
the directories on the receiving side, it is a good idea to use bf(-O).
-@@ -2019,7 +2026,10 @@ quote(itemization(
+@@ -2032,7 +2039,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/tls.c b/tls.c
--- a/tls.c
+++ b/tls.c
-@@ -118,6 +118,8 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst)
+@@ -110,6 +110,8 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst)
#endif
static void failed(char const *what, char const *where)
{
fprintf(stderr, PROGRAM ": %s %s: %s\n",
-@@ -125,12 +127,37 @@ static void failed(char const *what, char const *where)
+@@ -117,12 +119,37 @@ static void failed(char const *what, char const *where)
exit(1);
}
char linkbuf[4096];
if (do_lstat(fname, &buf) < 0)
-@@ -168,30 +195,17 @@ static void list_file(const char *fname)
+@@ -160,30 +187,17 @@ static void list_file(const char *fname)
}
permstring(permbuf, buf.st_mode);
/* TODO: Perhaps escape special characters in fname? */
-@@ -202,13 +216,14 @@ static void list_file(const char *fname)
+@@ -194,13 +208,14 @@ static void list_file(const char *fname)
(long)minor(buf.st_rdev));
} else
printf("%15s", do_big_num(buf.st_size, 1, NULL));
{"link-times", 'l', POPT_ARG_NONE, &link_times, 0, 0, 0 },
{"link-owner", 'L', POPT_ARG_NONE, &link_owner, 0, 0, 0 },
#ifdef SUPPORT_XATTRS
-@@ -227,6 +242,7 @@ static void tls_usage(int ret)
+@@ -219,6 +234,7 @@ static void tls_usage(int ret)
fprintf(F,"usage: " PROGRAM " [OPTIONS] FILE ...\n");
fprintf(F,"Trivial file listing program for portably checking rsync\n");
fprintf(F,"\nOptions:\n");
diff --git a/util.c b/util.c
--- a/util.c
+++ b/util.c
-@@ -125,20 +125,24 @@ NORETURN void overflow_exit(const char *str)
+@@ -127,20 +127,24 @@ NORETURN void overflow_exit(const char *str)
/* This returns 0 for success, 1 for a symlink if symlink time-setting
* is not possible, or -1 for any other error. */
break;
if (errno != ENOSYS)
return -1;
-@@ -148,7 +152,7 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -150,7 +154,7 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
#ifdef HAVE_LUTIMES
#include "case_N.h"
break;
if (errno != ENOSYS)
return -1;
-@@ -167,10 +171,10 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -169,10 +173,10 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
#include "case_N.h"
#ifdef HAVE_UTIMES
./configure (optional if already run)
make
-based-on: 591c224584c04e0d6f58ece969946bd5472f7c89
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/errcode.h b/errcode.h
--- a/errcode.h
+++ b/errcode.h
}
void write_del_stats(int f)
-@@ -1437,6 +1440,14 @@ RETSIGTYPE remember_children(UNUSED(int val))
+@@ -1442,6 +1445,14 @@ RETSIGTYPE remember_children(UNUSED(int val))
break;
}
}
}
#endif
#ifndef HAVE_SIGACTION
-@@ -1495,6 +1506,12 @@ static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig))
+@@ -1500,6 +1511,12 @@ static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig))
}
#endif
int main(int argc,char *argv[])
{
-@@ -1517,6 +1534,11 @@ int main(int argc,char *argv[])
+@@ -1522,6 +1539,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: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
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;
-@@ -880,6 +882,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -911,6 +913,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 uid_t our_uid;
extern struct stats stats;
extern char *filesfrom_host;
-@@ -94,6 +98,12 @@ extern iconv_t ic_send, ic_recv;
- #endif
+@@ -86,6 +90,20 @@ 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
++#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC)
++#define ST_MTIME_NSEC st_mtimensec
++#endif
++#endif
++
+#define RSYNCSUMS_FILE ".rsyncsums"
+#define RSYNCSUMS_LEN (sizeof RSYNCSUMS_FILE-1)
+
#define PTR_SIZE (sizeof (struct file_struct *))
int io_error;
-@@ -135,7 +145,11 @@ static char tmp_sum[MAX_DIGEST_LEN];
+@@ -127,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)
-@@ -350,6 +364,238 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -342,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
-@@ -1143,7 +1389,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1135,7 +1389,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];
-@@ -1289,9 +1535,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1281,9 +1535,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
-@@ -1309,11 +1562,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1301,11 +1562,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))
-@@ -1398,8 +1648,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1390,8 +1648,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2551,7 +2807,7 @@ struct file_list *recv_file_list(int f)
+@@ -2543,7 +2807,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 */
-@@ -2774,7 +3030,7 @@ void flist_free(struct file_list *flist)
+@@ -2766,7 +3030,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;
-@@ -2825,7 +3081,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2817,7 +3081,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;
-@@ -2841,8 +3097,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2833,8 +3097,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);
-@@ -2864,7 +3120,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2856,7 +3120,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
}
flist->high = prev_i;
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -761,6 +761,10 @@ extern int xattrs_ndx;
+@@ -771,6 +771,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)
-@@ -957,6 +961,13 @@ typedef struct {
+@@ -967,6 +971,13 @@ typedef struct {
char fname[1]; /* has variable size */
} relnamecache;
diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
--- a/rsyncd.conf.yo
+++ b/rsyncd.conf.yo
-@@ -317,6 +317,17 @@ locking on this file to ensure that the max connections limit is not
+@@ -323,6 +323,17 @@ locking on this file to ensure that the max connections limit is not
exceeded for the modules sharing the lock file.
The default is tt(/var/run/rsyncd.lock).
extern int inplace;
extern int allowed_lull;
extern int delay_updates;
-@@ -423,7 +424,7 @@ static void handle_delayed_updates(char *local_name)
+@@ -431,7 +432,7 @@ static void handle_delayed_updates(char *local_name)
"rename failed for %s (from %s)",
full_fname(fname), partialptr);
} else {
|| (preserve_hard_links && F_IS_HLINKED(file)))
send_msg_int(MSG_SUCCESS, ndx);
handle_partial_dir(partialptr, PDIR_DELETE);
-@@ -878,7 +879,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -886,7 +887,7 @@ int recv_files(int f_in, int f_out, char *local_name)
case 2:
break;
case 1:
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -963,6 +963,8 @@ typedef struct {
+@@ -973,6 +973,8 @@ typedef struct {
#define CSF_ENABLE (1<<1)
#define CSF_LAX (1<<2)
diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
--- a/rsyncd.conf.yo
+++ b/rsyncd.conf.yo
-@@ -320,13 +320,15 @@ The default is tt(/var/run/rsyncd.lock).
+@@ -326,13 +326,15 @@ The default is tt(/var/run/rsyncd.lock).
dit(bf(checksum files)) This parameter tells rsync to make use of any cached
checksum information it finds in per-directory .rsyncsums files when the
current transfer is using the bf(--checksum) option. The value can be set
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1310,7 +1310,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1302,7 +1302,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
#endif
if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
diff --git a/sender.c b/sender.c
--- a/sender.c
+++ b/sender.c
-@@ -342,6 +342,20 @@ void send_files(int f_in, int f_out)
+@@ -364,6 +364,20 @@ void send_files(int f_in, int f_out)
exit_cleanup(RERR_FILEIO);
}
extern int relative_paths;
extern int implied_dirs;
extern int ignore_perishable;
-@@ -405,7 +406,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -397,7 +398,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;
-@@ -516,6 +517,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -508,6 +509,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 != -1) {
-@@ -600,6 +608,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -592,6 +600,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
-@@ -693,7 +703,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -685,7 +695,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;
-@@ -842,6 +852,19 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -834,6 +844,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));
-@@ -1012,6 +1035,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -1004,6 +1027,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;
-@@ -1413,6 +1438,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_GROUP(file) = st.st_gid;
if (am_generator && st.st_uid == our_uid)
file->flags |= FLAG_OWNED_BY_US;
#define ITEM_REPORT_CHANGE (1<<1)
#define ITEM_REPORT_SIZE (1<<2) /* regular files only */
#define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */
-@@ -723,6 +725,7 @@ extern int file_extra_cnt;
+@@ -733,6 +735,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;
-@@ -730,6 +733,7 @@ extern int xattrs_ndx;
+@@ -740,6 +743,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)
-@@ -1009,6 +1013,7 @@ typedef struct {
+@@ -1019,6 +1023,7 @@ typedef struct {
typedef struct {
STRUCT_STAT st;
dit(bf(-O, --omit-dir-times)) This tells rsync to omit directories when
it is preserving modification times (see bf(--times)). If NFS is sharing
the directories on the receiving side, it is a good idea to use bf(-O).
-@@ -1992,7 +1996,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -2005,7 +2009,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.
-@@ -2051,6 +2055,8 @@ quote(itemization(
+@@ -2064,6 +2068,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/tls.c b/tls.c
--- a/tls.c
+++ b/tls.c
-@@ -118,6 +118,8 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst)
+@@ -110,6 +110,8 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst)
#endif
static void failed(char const *what, char const *where)
{
fprintf(stderr, PROGRAM ": %s %s: %s\n",
-@@ -125,16 +127,44 @@ static void failed(char const *what, char const *where)
+@@ -117,16 +119,44 @@ static void failed(char const *what, char const *where)
exit(1);
}
#ifdef SUPPORT_XATTRS
if (am_root < 0)
stat_xattr(fname, &buf);
-@@ -169,29 +199,11 @@ static void list_file(const char *fname)
+@@ -161,29 +191,11 @@ static void list_file(const char *fname)
permstring(permbuf, buf.st_mode);
/* TODO: Perhaps escape special characters in fname? */
-@@ -202,13 +214,14 @@ static void list_file(const char *fname)
+@@ -194,13 +206,14 @@ static void list_file(const char *fname)
(long)minor(buf.st_rdev));
} else
printf("%15s", do_big_num(buf.st_size, 1, NULL));
{"link-times", 'l', POPT_ARG_NONE, &link_times, 0, 0, 0 },
{"link-owner", 'L', POPT_ARG_NONE, &link_owner, 0, 0, 0 },
#ifdef SUPPORT_XATTRS
-@@ -227,6 +240,7 @@ static void tls_usage(int ret)
+@@ -219,6 +232,7 @@ static void tls_usage(int ret)
fprintf(F,"usage: " PROGRAM " [OPTIONS] FILE ...\n");
fprintf(F,"Trivial file listing program for portably checking rsync\n");
fprintf(F,"\nOptions:\n");
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
extern char *bind_address;
extern char *config_file;
extern char *logfile_format;
-@@ -672,6 +675,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -695,6 +698,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;
-@@ -868,6 +874,10 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -899,6 +905,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.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
-@@ -337,7 +337,7 @@ AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \
+@@ -337,6 +337,7 @@ AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \
+ unistd.h utime.h grp.h compat.h sys/param.h ctype.h sys/wait.h \
+ sys/ioctl.h sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h \
sys/un.h sys/attr.h mcheck.h arpa/inet.h arpa/nameser.h locale.h \
++ mysql/mysql.h sqlite3.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 \
-- popt.h popt/popt.h)
-+ popt.h popt/popt.h mysql/mysql.h sqlite3.h)
- AC_HEADER_MAJOR
-
- AC_CACHE_CHECK([if makedev takes 3 args],rsync_cv_MAKEDEV_TAKES_3_ARGS,[
-@@ -1060,6 +1060,29 @@ if test x"$enable_acl_support" = x"no" -o x"$enable_xattr_support" = x"no" -o x"
+ popt.h popt/popt.h linux/falloc.h)
+@@ -1062,6 +1063,29 @@ if test x"$enable_acl_support" = x"no" -o x"$enable_xattr_support" = x"no" -o x"
fi
fi
extern int eol_nulls;
extern int relative_paths;
extern int implied_dirs;
-@@ -1309,11 +1310,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1301,11 +1302,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))
-@@ -1398,8 +1396,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1390,8 +1388,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2080,6 +2082,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2072,6 +2074,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 char *shell_cmd;
extern char *batch_name;
extern char *password_file;
-@@ -1615,6 +1617,9 @@ int main(int argc,char *argv[])
+@@ -1620,6 +1622,9 @@ int main(int argc,char *argv[])
exit_cleanup(RERR_SYNTAX);
}
diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
--- a/rsyncd.conf.yo
+++ b/rsyncd.conf.yo
-@@ -306,6 +306,18 @@ is daemon. This setting has no effect if the "log file" setting is a
+@@ -312,6 +312,18 @@ is daemon. This setting has no effect if the "log file" setting is a
non-empty string (either set in the per-modules settings, or inherited
from the global settings).
--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
-@@ -1725,6 +1727,17 @@ the bf(--partial-dir) option, that directory will be used instead. These
+@@ -1738,6 +1740,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: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
extern int protocol_version;
extern int sanitize_paths;
extern int munge_symlinks;
-@@ -132,6 +133,8 @@ static int64 tmp_dev = -1, tmp_ino;
+@@ -124,6 +125,8 @@ static int64 tmp_dev = -1, tmp_ino;
#endif
static char tmp_sum[MAX_DIGEST_LEN];
static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
-@@ -299,6 +302,45 @@ static int is_excluded(const char *fname, int is_dir, int filter_level)
+@@ -291,6 +294,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);
-@@ -2553,6 +2595,25 @@ struct file_list *recv_file_list(int f)
+@@ -2545,6 +2587,25 @@ struct file_list *recv_file_list(int f)
flist_sort_and_clean(flist, relative_paths);
@@ -289,17 +300,22 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev)
maybe_send_keepalive(time(NULL), MSK_ALLOW_FLUSH);
- if (io_error && !ignore_errors) {
+ if (io_error & IOERR_GENERAL && !ignore_errors) {
- if (already_warned)
+ if (!already_warned) {
+ rprintf(FINFO,
--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
-@@ -1709,6 +1710,21 @@ Note that the use of the bf(--delete) option might get rid of any potential
+@@ -1722,6 +1723,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.
diff --git a/util.c b/util.c
--- a/util.c
+++ b/util.c
-@@ -1112,6 +1112,32 @@ char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr)
+@@ -1115,6 +1115,32 @@ char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr)
return path;
}
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
./configure
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
-@@ -591,7 +591,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
+@@ -593,7 +593,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
seteuid strerror putenv iconv_open locale_charset nl_langinfo getxattr \
extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
extern int delete_during;
extern int missing_args;
extern int eol_nulls;
-@@ -406,6 +407,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -398,6 +399,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
-@@ -449,6 +453,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -441,6 +445,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) {
-@@ -590,6 +602,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -582,6 +594,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);
-@@ -679,6 +695,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -671,6 +687,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
-@@ -783,6 +802,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -775,6 +794,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
modtime = first->modtime;
modtime_nsec = F_MOD_NSEC(first);
mode = first->mode;
if (preserve_uid)
uid = F_OWNER(first);
if (preserve_gid)
-@@ -824,6 +847,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -816,6 +839,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)
-@@ -975,6 +1002,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -967,6 +994,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) {
-@@ -1372,6 +1403,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1364,6 +1395,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
}
#endif
file->mode = st.st_mode;
if (statret != 0 && basis_dir[0] != NULL) {
int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &sx,
itemizing, code);
-@@ -1357,10 +1372,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1365,10 +1380,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. */
#define ITEM_BASIS_TYPE_FOLLOWS (1<<11)
#define ITEM_XNAME_FOLLOWS (1<<12)
#define ITEM_IS_NEW (1<<13)
-@@ -513,6 +516,28 @@ typedef unsigned int size_t;
+@@ -521,6 +524,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. */
-@@ -698,6 +723,7 @@ extern int file_extra_cnt;
+@@ -708,6 +733,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;
-@@ -739,6 +765,11 @@ extern int xattrs_ndx;
+@@ -749,6 +775,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
dit(bf(--chmod)) This option tells rsync to apply one or more
comma-separated "chmod" modes to the permission of the files in the
transfer. The resulting value is treated as though it were the permissions
-@@ -1364,12 +1392,13 @@ display as a "*missing" entry in the bf(--list-only) output.
+@@ -1377,12 +1405,13 @@ display as a "*missing" entry in the bf(--list-only) output.
dit(bf(--ignore-errors)) Tells bf(--delete) to go ahead and delete files
even when there are I/O errors.
bf(--recursive) option was also enabled.
dit(bf(--max-delete=NUM)) This tells rsync not to delete more than NUM
-@@ -1963,7 +1992,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -1976,7 +2005,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.
-@@ -2019,7 +2048,7 @@ quote(itemization(
+@@ -2032,7 +2061,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).
extern char *module_dir;
extern unsigned int module_dirlen;
extern char *partial_dir;
-@@ -123,9 +124,34 @@ NORETURN void overflow_exit(const char *str)
+@@ -125,9 +126,36 @@ NORETURN void overflow_exit(const char *str)
exit_cleanup(RERR_MALLOC);
}
+ }
+
+ if (fileflags != NO_FFLAGS && make_mutable(fname, mode, fileflags, force_change) > 0) {
-+ int save_force_change = force_change;
++ int ret, save_force_change = force_change;
+
+ force_change = 0; /* Make certain we can't come back here. */
+ ret = set_modtime(fname, modtime, mod_nsec, mode, fileflags);
+ force_change = save_force_change;
+
+ undo_make_mutable(fname, fileflags);
++
++ return ret;
+ }
+
+ errno = EPERM;
{
static int switch_step = 0;
-@@ -140,6 +166,11 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -142,6 +170,11 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
#include "case_N.h"
if (do_utimensat(fname, modtime, mod_nsec) == 0)
break;
if (errno != ENOSYS)
return -1;
switch_step++;
-@@ -150,6 +181,11 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -152,6 +185,11 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
#include "case_N.h"
if (do_lutimes(fname, modtime, mod_nsec) == 0)
break;
if (errno != ENOSYS)
return -1;
switch_step++;
-@@ -173,6 +209,13 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
+@@ -175,6 +213,13 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
if (do_utime(fname, modtime, mod_nsec) == 0)
break;
#endif
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
#ifdef ICONV_OPTION
extern int filesfrom_convert;
-@@ -282,7 +283,8 @@ static inline int path_is_daemon_excluded(char *path, int ignore_filename)
+@@ -274,7 +275,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. */
-@@ -291,6 +293,8 @@ static int is_excluded(const char *fname, int is_dir, int filter_level)
+@@ -283,6 +285,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
-@@ -1171,7 +1175,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1163,7 +1167,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)
-@@ -1216,6 +1220,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1208,6 +1212,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) {
-@@ -1418,12 +1428,23 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1410,12 +1420,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) {
-@@ -2305,7 +2326,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2297,7 +2318,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) {
-@@ -2319,7 +2340,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2311,7 +2332,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
} else
send_if_directory(f, flist, file, fbuf, len, flags);
} else
#define XFLG_FATAL_ERRORS (1<<0)
#define XFLG_OLD_PREFIXES (1<<1)
-@@ -843,6 +846,8 @@ struct map_struct {
+@@ -853,6 +856,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 "**" */
-@@ -863,8 +868,18 @@ struct map_struct {
+@@ -873,8 +878,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;
-@@ -874,6 +889,11 @@ typedef struct filter_struct {
+@@ -884,6 +899,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.
-@@ -1920,6 +1922,10 @@ be omitted, but if USER is empty, a leading colon must be supplied.
+@@ -1933,6 +1935,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.
-@@ -2767,6 +2773,15 @@ itemization(
+@@ -2780,6 +2786,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)
-@@ -2828,6 +2843,12 @@ itemization(
+@@ -2841,6 +2856,12 @@ itemization(
a rule prefix such as bf(hide)).
)
diff --git a/util.c b/util.c
--- a/util.c
+++ b/util.c
-@@ -840,6 +840,25 @@ size_t stringjoin(char *dest, size_t destsize, ...)
+@@ -842,6 +842,25 @@ size_t stringjoin(char *dest, size_t destsize, ...)
return ret;
}
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
extern int basis_dir_cnt;
extern int make_backups;
extern int cleanup_got_literal;
-@@ -384,6 +385,12 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -392,6 +393,12 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
if (sum_end(file_sum1) != checksum_len)
overflow_exit("checksum_len"); /* Impossible... */
extern int modify_window;
extern int relative_paths;
extern int preserve_times;
-@@ -406,6 +407,13 @@ int copy_file(const char *source, const char *dest, int ofd, mode_t mode)
+@@ -408,6 +409,13 @@ int copy_file(const char *source, const char *dest, int ofd, mode_t mode)
}
#endif
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1580,6 +1580,9 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1572,6 +1572,9 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
sx.st.st_mode = file->mode;
extern int preserve_links;
extern int preserve_devices;
extern int preserve_specials;
-@@ -1396,6 +1397,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1404,6 +1405,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
&& make_mutable(fname, file->mode, F_FFLAGS(file), force_change))
need_retouch_dir_perms = 1;
#endif
goto cleanup;
updated = 1;
+#ifdef SUPPORT_HFS_COMPRESSION
-+ int ret = set_modtime(fname, file->modtime, new_mode, fileflags);
++ int ret = set_modtime(fname, file->modtime, F_MOD_NSEC(file), new_mode, fileflags);
+ if (ret < 0) {
+ rsyserr(FERROR_XFER, errno, "failed to set times on %s",
+ full_fname(fname));
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -540,6 +540,17 @@ typedef unsigned int size_t;
+@@ -548,6 +548,17 @@ typedef unsigned int size_t;
#define ST_FLAGS(st) NO_FFLAGS
#endif
- Make this code handle multibyte character encodings, and honor the
--iconv setting when converting case.
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
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;
-@@ -3015,6 +3016,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -3007,6 +3008,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;
-@@ -3125,7 +3127,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -3117,7 +3119,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
if (type1 != type2)
return type1 == t_PATH ? 1 : -1;
}
--address=ADDRESS bind address for outgoing socket to daemon
--port=PORT specify double-colon alternate port number
--sockopts=OPTIONS specify custom TCP options
-@@ -1667,6 +1668,10 @@ default (with is overridden by both the environment and the command-line).
+@@ -1680,6 +1681,10 @@ default (with is overridden by both the environment and the command-line).
This option will eventually become a new default setting at some
as-yet-undetermined point in the future.
./configure
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
extern char *usermap, *groupmap;
extern char curr_dir[MAXPATHLEN];
-@@ -910,7 +911,7 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -902,7 +903,7 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
extra_len += EXTRA_LEN;
#endif
diff --git a/receiver.c b/receiver.c
--- a/receiver.c
+++ b/receiver.c
-@@ -217,11 +217,13 @@ int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file)
+@@ -225,11 +225,13 @@ int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file)
}
static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
int32 len;
OFF_T offset = 0;
OFF_T offset2;
-@@ -257,6 +259,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -265,6 +267,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
} else
mapbuf = NULL;
sum_init(checksum_seed);
if (append_mode > 0) {
-@@ -304,6 +309,8 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -312,6 +317,8 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
cleanup_got_literal = 1;
sum_update(data, i);
if (fd != -1 && write_file(fd,data,i) != i)
goto report_write_error;
-@@ -331,6 +338,8 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -339,6 +346,8 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
see_token(map, len);
sum_update(map, len);
}
if (updating_basis_or_equiv) {
-@@ -384,6 +393,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -392,6 +401,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
if (sum_end(file_sum1) != checksum_len)
overflow_exit("checksum_len"); /* Impossible... */
if (mapbuf)
unmap_file(mapbuf);
-@@ -398,7 +410,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -406,7 +418,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
static void discard_receive_data(int f_in, OFF_T length)
{
}
static void handle_delayed_updates(char *local_name)
-@@ -828,7 +840,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -836,7 +848,7 @@ int recv_files(int f_in, int f_out, char *local_name)
/* recv file data */
recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -899,6 +899,14 @@ struct stats {
+@@ -909,6 +909,14 @@ struct stats {
int xferred_files;
};
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
#ifdef HAVE_SIGACTION
static struct sigaction sigact;
-@@ -673,7 +675,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -696,7 +698,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;
/* For post-xfer exec, fork a new process to run the rsync
-@@ -747,6 +749,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];
+@@ -778,6 +780,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+ set_blocking(pre_exec_arg_fd);
+ set_blocking(pre_exec_error_fd);
}
+ if (*lp_name_converter(i)) {
+ int fds_to[2], fds_from[2];
}
#endif
-@@ -977,6 +1017,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -1014,6 +1054,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
return 0;
}
diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
--- a/rsyncd.conf.yo
+++ b/rsyncd.conf.yo
-@@ -188,10 +188,11 @@ if the module is not read-only).
+@@ -194,10 +194,11 @@ if the module is not read-only).
When this parameter is enabled, rsync will not attempt to map users and groups
by name (by default), but instead copy IDs as though bf(--numeric-ids) had
process in the chroot hierarchy will need to have access to the resources
used by these library functions (traditionally /etc/passwd and
/etc/group, but perhaps additional dynamic libraries as well).
-@@ -257,6 +258,27 @@ path elements that rsync believes will allow a symlink to escape the module's
+@@ -263,6 +264,27 @@ path elements that rsync believes will allow a symlink to escape the module's
hierarchy. There are tricky ways to work around this, though, so you had
better trust your users if you choose this combination of parameters.
extern gid_t our_gid;
extern char *usermap;
extern char *groupmap;
-@@ -94,8 +95,12 @@ static struct idlist *add_to_list(struct idlist **root, id_t id, const char *nam
+@@ -99,8 +100,12 @@ static struct idlist *add_to_list(struct idlist **root, id_t id, union name_or_i
/* turn a uid into a user name */
char *uid_to_user(uid_t uid)
{
return strdup(pass->pw_name);
return NULL;
}
-@@ -103,8 +108,12 @@ char *uid_to_user(uid_t uid)
+@@ -108,8 +113,12 @@ char *uid_to_user(uid_t uid)
/* turn a gid into a group name */
char *gid_to_group(gid_t gid)
{
return strdup(grp->gr_name);
return NULL;
}
-@@ -112,32 +121,54 @@ char *gid_to_group(gid_t gid)
+@@ -117,32 +126,54 @@ char *gid_to_group(gid_t gid)
/* Parse a user name or (optionally) a number into a uid */
int user_to_uid(const char *name, uid_t *uid_p, BOOL num_ok)
{
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/access.c b/access.c
--- a/access.c
+++ b/access.c
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
./configure
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
return -1;
}
-@@ -693,6 +740,10 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -716,6 +763,10 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
set_env_num("RSYNC_PID", (long)pid);
if (wait_process(pid, &status, 0) < 0)
status = -1;
set_env_num("RSYNC_RAW_STATUS", status);
if (WIFEXITED(status))
status = WEXITSTATUS(status);
-@@ -1034,6 +1085,9 @@ int start_daemon(int f_in, int f_out)
+@@ -1071,6 +1122,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, 0))
return -1;
-@@ -1045,6 +1099,20 @@ int start_daemon(int f_in, int f_out)
+@@ -1082,6 +1136,20 @@ int start_daemon(int f_in, int f_out)
return -1;
}
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
-@@ -318,6 +318,25 @@ if test x"$enable_locale" != x"no"; then
+@@ -320,6 +320,25 @@ if test x"$enable_locale" != x"no"; then
AC_DEFINE(CONFIG_LOCALE)
fi
#define SYMLINK_PREFIX "/rsyncd-munged/" /* This MUST have a trailing slash! */
#define SYMLINK_PREFIX_LEN ((int)sizeof SYMLINK_PREFIX - 1)
-@@ -600,6 +601,11 @@ typedef unsigned int size_t;
+@@ -608,6 +609,11 @@ typedef unsigned int size_t;
# define SIZEOF_INT64 SIZEOF_OFF_T
#endif
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
extern uid_t our_uid;
extern struct stats stats;
extern char *filesfrom_host;
-@@ -1759,6 +1760,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1751,6 +1752,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);
TODO: the configure changes should abort if the user requests --enable-slp
and we can't honor that request.
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
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
-@@ -1165,6 +1165,13 @@ int daemon_main(void)
+@@ -1202,6 +1202,13 @@ int daemon_main(void)
* address too. In fact, why not just do inet_ntop on the
* local address??? */
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
-@@ -721,6 +721,29 @@ if test $rsync_cv_can_hardlink_special = yes; then
+@@ -723,6 +723,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
enddit()
manpagesection(MODULE PARAMETERS)
-@@ -831,6 +840,7 @@ use chroot = yes
+@@ -842,6 +851,7 @@ use chroot = yes
max connections = 4
syslog facility = local5
pid file = /var/run/rsyncd.pid
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/syscall.c b/syscall.c
--- a/syscall.c
+++ b/syscall.c
-- Matt McCutchen <hashproduct@gmail.com>
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
--delete-before receiver deletes before xfer, not during
-@@ -1261,6 +1262,14 @@ dit(bf(--remove-source-files)) This tells rsync to remove from the sending
- side the files (meaning non-directories) that are a part of the transfer
- and have been successfully duplicated on the receiving side.
+@@ -1274,6 +1275,14 @@ bf(--exclude='*.new') for the rsync transfer).
+ Starting with 3.1.0, rsync will skip the sender-side removal (and output an
+ error) if the file's size or modify time has not stayed unchanged.
+dit(bf(--source-backup)) Makes the sender back up the source files it removes
+due to bf(--remove-source-files). This option is independent of
extern int inplace;
extern int batch_fd;
extern int write_batch;
-@@ -125,6 +126,7 @@ void successful_send(int ndx)
- char fname[MAXPATHLEN];
+@@ -127,6 +128,7 @@ void successful_send(int ndx)
struct file_struct *file;
struct file_list *flist;
+ STRUCT_STAT st;
+ int result;
if (!remove_source_files)
return;
-@@ -135,7 +137,11 @@ void successful_send(int ndx)
+@@ -151,7 +153,11 @@ void successful_send(int ndx)
return;
- f_name(file, fname);
+ }
-- if (do_unlink(fname) == 0) {
+- if (do_unlink(fname) < 0) {
+ if (make_source_backups)
+ result = !make_backup(fname, True);
+ else
+ result = do_unlink(fname);
-+ if (result == 0) {
- if (INFO_GTE(REMOVE, 1))
- rprintf(FINFO, "sender removed %s\n", fname);
- } else
++ if (result < 0) {
+ failed_op = "remove";
+ failed:
+ if (errno == ENOENT)
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
extern char *partial_dir;
extern char *basis_dir[MAX_BASIS_DIRS+1];
extern char sender_file_sum[MAX_DIGEST_LEN];
-@@ -522,6 +523,8 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -530,6 +531,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);
-@@ -529,6 +532,23 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -537,6 +540,23 @@ int recv_files(int f_in, int f_out, char *local_name)
if (delay_updates)
delayed_bits = bitbag_create(cur_flist->used + 1);
while (1) {
cleanup_disable();
-@@ -826,6 +846,9 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -834,6 +854,9 @@ int recv_files(int f_in, int f_out, char *local_name)
else if (!am_server && INFO_GTE(NAME, 1) && INFO_EQ(PROGRESS, 1))
rprintf(FINFO, "%s\n", fname);
/* recv file data */
recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
fname, fd2, F_LENGTH(file));
-@@ -840,6 +863,16 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -848,6 +871,16 @@ int recv_files(int f_in, int f_out, char *local_name)
exit_cleanup(RERR_FILEIO);
}
--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)
-@@ -2431,6 +2434,33 @@ file previously generated by bf(--write-batch).
+@@ -2444,6 +2447,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.
extern struct stats stats;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
-@@ -178,6 +179,26 @@ void send_files(int f_in, int f_out)
+@@ -200,6 +201,26 @@ void send_files(int f_in, int f_out)
int f_xfer = write_batch < 0 ? batch_fd : f_out;
int save_io_error = io_error;
int ndx, j;
if (DEBUG_GTE(SEND, 1))
rprintf(FINFO, "send_files starting\n");
-@@ -312,6 +333,7 @@ void send_files(int f_in, int f_out)
+@@ -334,6 +355,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) {
-@@ -333,6 +355,33 @@ void send_files(int f_in, int f_out)
+@@ -355,6 +377,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;
-@@ -383,6 +432,8 @@ void send_files(int f_in, int f_out)
+@@ -405,6 +454,8 @@ void send_files(int f_in, int f_out)
}
}
close(fd);
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/fileio.c b/fileio.c
--- a/fileio.c
+++ b/fileio.c
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
./configure (optional if already run)
make
-based-on: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/io.c b/io.c
--- a/io.c
+++ b/io.c
--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
-@@ -2405,6 +2407,19 @@ files can show up as being rapidly sent when the data is quickly buffered,
+@@ -2418,6 +2420,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.
diff --git a/util.c b/util.c
--- a/util.c
+++ b/util.c
-@@ -123,6 +123,133 @@ NORETURN void overflow_exit(const char *str)
+@@ -125,6 +125,133 @@ NORETURN void overflow_exit(const char *str)
exit_cleanup(RERR_MALLOC);
}
./configure (optional if already run)
make
-based-on: 591c224584c04e0d6f58ece969946bd5472f7c89
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
extern char curr_dir[MAXPATHLEN];
-@@ -107,6 +108,8 @@ int file_total = 0; /* total of all active items over all file-lists */
+@@ -99,6 +100,8 @@ int file_total = 0; /* total of all active items over all file-lists */
int file_old_total = 0; /* total of active items that will soon be gone */
int flist_eof = 0; /* all the file-lists are now known */
#define NORMAL_NAME 0
#define SLASH_ENDING_NAME 1
#define DOTDIR_NAME 2
-@@ -675,6 +678,23 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -667,6 +670,23 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
stats.total_size += F_LENGTH(file);
}
static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags)
{
static int64 modtime;
-@@ -740,9 +760,13 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -732,9 +752,13 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
outbuf.len = 0;
}
thisname[outbuf.len] = '\0';
if (*thisname)
clean_fname(thisname, 0);
-@@ -2439,6 +2463,15 @@ struct file_list *recv_file_list(int f)
+@@ -2431,6 +2455,15 @@ struct file_list *recv_file_list(int f)
parse_name_map(usermap, True);
if (groupmap)
parse_name_map(groupmap, False);
--checksum-seed=NUM set block/file checksum seed (advanced)
-4, --ipv4 prefer IPv4
-6, --ipv6 prefer IPv6
-@@ -2469,6 +2470,22 @@ daemon uses the charset specified in its "charset" configuration parameter
+@@ -2482,6 +2483,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: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
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: 28b519c93b6db30b6520d46f8cd65160213fddd2
+based-on: a59a7b242393699fedeb4f66911e3fc9b4fadd73
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
extern int preserve_xattrs;
extern int basis_dir_cnt;
extern int make_backups;
-@@ -217,7 +218,7 @@ int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file)
+@@ -225,7 +226,7 @@ int open_tmpfile(char *fnametmp, const char *fname, struct file_struct *file)
}
static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
{
static char file_sum1[MAX_DIGEST_LEN];
struct map_struct *mapbuf;
-@@ -267,7 +268,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -275,7 +276,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
if (append_mode == 2 && mapbuf) {
for (j = CHUNK_SIZE; j < sum.flength; j += CHUNK_SIZE) {
if (INFO_GTE(PROGRESS, 1))
sum_update(map_ptr(mapbuf, offset, CHUNK_SIZE),
CHUNK_SIZE);
offset = j;
-@@ -275,7 +276,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -283,7 +284,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
if (offset < sum.flength) {
int32 len = (int32)(sum.flength - offset);
if (INFO_GTE(PROGRESS, 1))
sum_update(map_ptr(mapbuf, offset, len), len);
}
}
-@@ -289,7 +290,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -297,7 +298,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
while ((i = recv_token(f_in, &data)) != 0) {
if (INFO_GTE(PROGRESS, 1))
if (allowed_lull)
maybe_send_keepalive(time(NULL), MSK_ALLOW_FLUSH | MSK_ACTIVE_RECEIVER);
-@@ -365,14 +366,14 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -373,14 +374,14 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
#ifdef PREALLOCATE_NEEDS_TRUNCATE
|| preallocated_len > offset
#endif
if (fd != -1 && offset > 0 && sparse_end(fd, offset) != 0) {
report_write_error:
-@@ -396,9 +397,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
+@@ -404,9 +405,9 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
}
}
static void handle_delayed_updates(char *local_name)
-@@ -654,7 +655,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -662,7 +663,7 @@ int recv_files(int f_in, int f_out, char *local_name)
"(Skipping batched update for%s \"%s\")\n",
redoing ? " resend of" : "",
fname);
file->flags |= FLAG_FILE_SENT;
continue;
}
-@@ -666,13 +667,13 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -674,13 +675,13 @@ int recv_files(int f_in, int f_out, char *local_name)
if (!do_xfers) { /* log the transfer */
log_item(FCLIENT, file, iflags, NULL);
if (read_batch)
continue;
}
-@@ -755,7 +756,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -763,7 +764,7 @@ int recv_files(int f_in, int f_out, char *local_name)
} else if (do_fstat(fd1,&st) != 0) {
rsyserr(FERROR_XFER, errno, "fstat %s failed",
full_fname(fnamecmp));
close(fd1);
if (inc_recurse)
send_msg_int(MSG_NO_SEND, ndx);
-@@ -770,18 +771,32 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -778,18 +779,32 @@ int recv_files(int f_in, int f_out, char *local_name)
*/
rprintf(FERROR_XFER, "recv_files: %s is a directory\n",
full_fname(fnamecmp));
/* If we're not preserving permissions, change the file-list's
* mode based on the local permissions and some heuristics. */
if (!preserve_perms) {
-@@ -812,7 +827,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -820,7 +835,7 @@ int recv_files(int f_in, int f_out, char *local_name)
}
if (fd2 == -1) {
if (fd1 != -1)
close(fd1);
if (inc_recurse)
-@@ -827,8 +842,7 @@ int recv_files(int f_in, int f_out, char *local_name)
+@@ -835,8 +850,7 @@ int recv_files(int f_in, int f_out, char *local_name)
rprintf(FINFO, "%s\n", fname);
/* recv file data */