./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
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)
+@@ -193,13 +193,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: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
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: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -45,6 +45,7 @@ extern int protocol_version;
+@@ -46,6 +46,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;
+@@ -63,7 +64,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)
+@@ -140,6 +141,8 @@ void setup_protocol(int f_out,int f_in)
uid_ndx = ++file_extra_cnt;
if (preserve_gid)
gid_ndx = ++file_extra_cnt;
+ }
#ifdef SUPPORT_HARD_LINKS
- if (tmp_dev != 0) {
+ if (tmp_dev != -1) {
@@ -549,6 +557,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
}
if (!(xflags & XMIT_SAME_MODE))
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -633,7 +643,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -635,7 +645,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
static struct file_struct *recv_file_entry(struct file_list *flist,
int xflags, int f)
{
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
-@@ -766,6 +776,16 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -768,6 +778,16 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
}
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
-@@ -916,6 +936,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -918,6 +938,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
F_GROUP(file) = gid;
file->flags |= gid_flags;
}
if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
-@@ -1288,6 +1310,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1290,6 +1312,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;
#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
if (S_ISLNK(file->mode)) {
;
-@@ -1018,6 +1022,8 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -1024,6 +1028,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 && (verbose > 1 || stdout_format_has_i > 1)) {
-@@ -1203,6 +1209,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1209,6 +1215,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];
double len;
if (!F_IS_ACTIVE(f)) {
-@@ -1217,14 +1224,16 @@ static void list_file_entry(struct file_struct *f)
+@@ -1223,14 +1230,16 @@ static void list_file_entry(struct file_struct *f)
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
f_name(f, NULL));
}
}
-@@ -2066,7 +2075,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -2075,7 +2084,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)
int update_only = 0;
int cvs_exclude = 0;
int dry_run = 0;
-@@ -353,6 +354,7 @@ void usage(enum logcode F)
+@@ -352,6 +353,7 @@ void usage(enum logcode F)
rprintf(F," -D same as --devices --specials\n");
rprintf(F," -t, --times preserve modification times\n");
rprintf(F," -O, --omit-dir-times omit directories from --times\n");
rprintf(F," --super receiver attempts super-user activities\n");
#ifdef SUPPORT_XATTRS
rprintf(F," --fake-super store/recover privileged attrs using xattrs\n");
-@@ -490,6 +492,9 @@ static struct poptOption long_options[] = {
+@@ -489,6 +491,9 @@ static struct poptOption long_options[] = {
{"times", 't', POPT_ARG_VAL, &preserve_times, 2, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"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 },
-@@ -1779,6 +1784,8 @@ void server_options(char **args, int *argc_p)
+@@ -1778,6 +1783,8 @@ void server_options(char **args, int *argc_p)
argstr[x++] = 'D';
if (preserve_times)
argstr[x++] = 't';
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -633,12 +635,14 @@ extern int file_extra_cnt;
+@@ -635,12 +637,14 @@ extern int file_extra_cnt;
extern int inc_recurse;
extern int uid_ndx;
extern int gid_ndx;
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
-@@ -1011,6 +1012,12 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
+@@ -1047,6 +1048,12 @@ 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).
This option is inferred if you use bf(--backup) without bf(--backup-dir).
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
-@@ -1744,7 +1751,10 @@ quote(itemization(
+@@ -1780,7 +1787,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).
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/backup.c b/backup.c
--- a/backup.c
+++ b/backup.c
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -149,10 +149,14 @@ int no_detach
+@@ -148,10 +148,14 @@ int no_detach
int write_batch = 0;
int read_batch = 0;
int backup_dir_len = 0;
char *tmpdir = NULL;
char *partial_dir = NULL;
char *basis_dir[MAX_BASIS_DIRS+1];
-@@ -164,7 +168,9 @@ char *stdout_format = NULL;
+@@ -163,7 +167,9 @@ char *stdout_format = NULL;
char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
char *sockopts = NULL;
int rsync_port = 0;
int compare_dest = 0;
-@@ -325,6 +331,8 @@ void usage(enum logcode F)
+@@ -324,6 +330,8 @@ void usage(enum logcode F)
rprintf(F," -b, --backup make backups (see --suffix & --backup-dir)\n");
rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n");
rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
rprintf(F," -u, --update skip files that are newer on the receiver\n");
rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
rprintf(F," --append append data onto shorter files\n");
-@@ -609,7 +617,9 @@ static struct poptOption long_options[] = {
+@@ -608,7 +616,9 @@ static struct poptOption long_options[] = {
{"backup", 'b', POPT_ARG_VAL, &make_backups, 1, 0, 0 },
{"no-backup", 0, POPT_ARG_VAL, &make_backups, 0, 0, 0 },
{"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
{"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 },
-@@ -1459,6 +1469,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1458,6 +1468,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) {
struct filter_list_struct *elp = &daemon_filter_list;
-@@ -1480,6 +1492,14 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1479,6 +1491,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)
-@@ -1491,6 +1511,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1490,6 +1510,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
backup_suffix);
return 0;
}
if (backup_dir) {
backup_dir_len = strlcpy(backup_dir_buf, backup_dir, sizeof backup_dir_buf);
backup_dir_remainder = sizeof backup_dir_buf - backup_dir_len;
-@@ -1514,6 +1548,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1513,6 +1547,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
"P *%s", backup_suffix);
parse_rule(&filter_list, backup_dir_buf, 0, 0);
}
if (make_backups && !backup_dir) {
omit_dir_times = 0; /* Implied, so avoid -O to sender. */
-@@ -1923,6 +1985,10 @@ void server_options(char **args, int *argc_p)
+@@ -1922,6 +1984,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) {
-@@ -1931,7 +1997,14 @@ void server_options(char **args, int *argc_p)
+@@ -1930,7 +1996,14 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/errcode.h b/errcode.h
--- a/errcode.h
+++ b/errcode.h
}
/* This function gets called from all 3 processes. We want the client side
-@@ -1317,6 +1320,14 @@ RETSIGTYPE remember_children(UNUSED(int val))
+@@ -1321,6 +1324,14 @@ RETSIGTYPE remember_children(UNUSED(int val))
break;
}
}
}
#endif
#ifndef HAVE_SIGACTION
-@@ -1375,6 +1386,12 @@ static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig))
+@@ -1379,6 +1390,12 @@ static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig))
}
#endif
int main(int argc,char *argv[])
{
-@@ -1397,6 +1414,11 @@ int main(int argc,char *argv[])
+@@ -1401,6 +1418,11 @@ int main(int argc,char *argv[])
SIGACTMASK(SIGFPE, rsync_panic_handler);
SIGACTMASK(SIGABRT, rsync_panic_handler);
SIGACTMASK(SIGBUS, rsync_panic_handler);
diff --git a/socket.c b/socket.c
--- a/socket.c
+++ b/socket.c
-@@ -518,7 +518,17 @@ int is_a_socket(int fd)
+@@ -503,7 +503,17 @@ int is_a_socket(int fd)
static RETSIGTYPE sigchld_handler(UNUSED(int val))
{
#ifdef WNOHANG
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/checksum.c b/checksum.c
--- a/checksum.c
+++ b/checksum.c
-@@ -100,7 +100,7 @@ void get_checksum2(char *buf, int32 len, char *sum)
+@@ -98,7 +98,7 @@ void get_checksum2(char *buf, int32 len, char *sum)
}
}
extern int io_timeout;
extern int no_detach;
extern int write_batch;
-@@ -781,6 +783,9 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -786,6 +788,9 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
} else if (am_root < 0) /* Treat --fake-super from client as --super. */
am_root = 2;
/* 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
-@@ -1078,7 +1323,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1080,7 +1325,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];
-@@ -1217,9 +1462,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1219,9 +1464,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
-@@ -1297,14 +1549,18 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1299,14 +1551,18 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
if (basename_len == 0+1) {
if (!pool)
unmake_file(file);
-@@ -2297,7 +2553,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2301,7 +2557,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
* file-list to check if this is a 1-file xfer. */
send_extra_file_list(f, 1);
}
return flist;
}
-@@ -2415,7 +2672,7 @@ struct file_list *recv_file_list(int f)
+@@ -2419,7 +2676,7 @@ struct file_list *recv_file_list(int f)
else if (f >= 0)
recv_id_list(f, flist);
if (protocol_version < 30) {
/* Recv the io_error flag */
-@@ -2635,7 +2892,7 @@ void flist_free(struct file_list *flist)
+@@ -2639,7 +2896,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;
-@@ -2686,7 +2943,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2690,7 +2947,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;
-@@ -2702,8 +2959,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2706,8 +2963,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);
-@@ -2725,7 +2982,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2729,7 +2986,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
}
flist->high = prev_i;
return memcmp(sum, F_SUM(file), checksum_len) == 0;
}
-@@ -988,7 +992,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -994,7 +998,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;
-@@ -1261,7 +1265,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1267,7 +1271,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;
-@@ -1350,8 +1354,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1356,8 +1360,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);
-@@ -1359,10 +1363,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1365,10 +1369,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);
-@@ -1800,7 +1809,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1809,7 +1818,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
-@@ -394,7 +394,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname,
+@@ -395,7 +395,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname,
}
break;
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -112,6 +112,7 @@ size_t bwlimit_writemax = 0;
+@@ -111,6 +111,7 @@ size_t bwlimit_writemax = 0;
int ignore_existing = 0;
int ignore_non_existing = 0;
int need_messages_from_generator = 0;
int max_delete = INT_MIN;
OFF_T max_size = 0;
OFF_T min_size = 0;
-@@ -317,6 +318,7 @@ void usage(enum logcode F)
+@@ -316,6 +317,7 @@ void usage(enum logcode F)
rprintf(F," -q, --quiet suppress non-error messages\n");
rprintf(F," --no-motd suppress daemon-mode MOTD (see manpage caveat)\n");
rprintf(F," -c, --checksum skip based on checksum, not mod-time & size\n");
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");
-@@ -446,7 +448,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -445,7 +447,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_SERVER, OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -574,6 +576,7 @@ static struct poptOption long_options[] = {
+@@ -573,6 +575,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 },
{"no-c", 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 },
-@@ -1228,6 +1231,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1227,6 +1230,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
break;
case OPT_HELP:
usage(FINFO);
exit_cleanup(0);
-@@ -1332,6 +1352,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1331,6 +1351,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
-@@ -693,6 +693,10 @@ extern int xattrs_ndx;
+@@ -695,6 +695,10 @@ extern int xattrs_ndx;
#define F_SUM(f) ((char*)OPT_EXTRA(f, LEN64_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)
-@@ -880,6 +884,13 @@ typedef struct {
+@@ -882,6 +886,13 @@ typedef struct {
char fname[1]; /* has variable size */
} relnamecache;
}
/* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
-@@ -1417,6 +1628,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1419,6 +1630,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;
}
-@@ -1463,13 +1676,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1465,13 +1678,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' */
-@@ -1556,7 +1769,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1558,7 +1771,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);
}
-@@ -1933,6 +2146,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1937,6 +2150,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". */
-@@ -2556,6 +2772,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2560,6 +2776,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
} else
flist_eof = 1;
else
file_checksum(fn, st->st_size, sum);
return memcmp(sum, F_SUM(file), checksum_len) == 0;
-@@ -1369,7 +1370,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1375,7 +1376,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;
}
-@@ -1519,6 +1521,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1525,6 +1527,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;
}
-@@ -1815,6 +1818,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1824,6 +1827,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
-@@ -2258,6 +2263,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2267,6 +2272,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];
-@@ -2342,6 +2348,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2351,6 +2357,9 @@ void generate_files(int f_out, const char *local_name)
wait_for_receiver();
}
diff --git a/io.c b/io.c
--- a/io.c
+++ b/io.c
-@@ -50,6 +50,7 @@ extern int read_batch;
- extern int csum_length;
+@@ -49,6 +49,7 @@ extern int read_batch;
+ extern int compat_flags;
extern int protect_args;
extern int checksum_seed;
+extern int checksum_files;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -1233,7 +1233,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1232,7 +1232,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
-@@ -886,6 +886,8 @@ typedef struct {
+@@ -888,6 +888,8 @@ typedef struct {
#define CSF_ENABLE (1<<1)
#define CSF_LAX (1<<2)
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1297,7 +1297,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1299,7 +1299,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
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;
-@@ -1695,7 +1696,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1704,7 +1705,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
int preserve_links = 0;
int preserve_hard_links = 0;
int preserve_acls = 0;
-@@ -349,6 +350,7 @@ void usage(enum logcode F)
+@@ -348,6 +349,7 @@ void usage(enum logcode F)
rprintf(F," -o, --owner preserve owner (super-user only)\n");
rprintf(F," -g, --group preserve group\n");
rprintf(F," --devices preserve device files (super-user only)\n");
rprintf(F," --specials preserve special files\n");
rprintf(F," -D same as --devices --specials\n");
rprintf(F," -t, --times preserve modification times\n");
-@@ -507,6 +509,7 @@ static struct poptOption long_options[] = {
+@@ -506,6 +508,7 @@ static struct poptOption long_options[] = {
{"no-D", 0, POPT_ARG_NONE, 0, OPT_NO_D, 0, 0 },
{"devices", 0, POPT_ARG_VAL, &preserve_devices, 1, 0, 0 },
{"no-devices", 0, POPT_ARG_VAL, &preserve_devices, 0, 0, 0 },
{"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 },
-@@ -2069,6 +2072,9 @@ void server_options(char **args, int *argc_p)
+@@ -2068,6 +2071,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
-@@ -46,6 +46,7 @@ extern int force_change;
+@@ -47,6 +47,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;
+@@ -65,7 +66,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)
+@@ -142,6 +143,8 @@ void setup_protocol(int f_out,int f_in)
uid_ndx = ++file_extra_cnt;
if (preserve_gid)
gid_ndx = ++file_extra_cnt;
+ }
#ifdef SUPPORT_HARD_LINKS
- if (tmp_dev != 0) {
+ if (tmp_dev != -1) {
@@ -559,6 +567,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
else
write_int(f, modtime);
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
#ifdef SUPPORT_FILEFLAGS
-@@ -649,7 +659,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -651,7 +661,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
static struct file_struct *recv_file_entry(struct file_list *flist,
int xflags, int f)
{
static mode_t mode;
#ifdef SUPPORT_FILEFLAGS
static uint32 fileflags;
-@@ -755,6 +765,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -757,6 +767,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
uid = F_OWNER(first);
if (preserve_gid)
gid = F_GROUP(first);
if (preserve_devices && IS_DEVICE(mode)) {
uint32 *devp = F_RDEV_P(first);
rdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
-@@ -783,6 +795,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -785,6 +797,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
} else
modtime = read_int(f);
}
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
-@@ -943,6 +968,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -945,6 +970,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
F_GROUP(file) = gid;
file->flags |= gid_flags;
}
if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
-@@ -1319,6 +1346,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1321,6 +1348,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;
#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
if (S_ISLNK(file->mode)) {
;
-@@ -1225,7 +1240,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1231,7 +1246,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
static void list_file_entry(struct file_struct *f)
{
double len;
if (!F_IS_ACTIVE(f)) {
-@@ -1236,19 +1251,24 @@ static void list_file_entry(struct file_struct *f)
+@@ -1242,19 +1257,24 @@ static void list_file_entry(struct file_struct *f)
permstring(permbuf, f->mode);
len = F_LENGTH(f);
}
}
-@@ -1339,6 +1359,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1351,6 +1371,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
return;
}
}
+ sx.crtime = 0;
- #ifdef SUPPORT_ACLS
- sx.acc_acl = sx.def_acl = NULL;
+ if (dry_run > 1 || (dry_missing_dir && is_below(file, dry_missing_dir))) {
+ parent_is_dry_missing:
diff --git a/hlink.c b/hlink.c
--- a/hlink.c
+++ b/hlink.c
-@@ -370,6 +370,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname,
+@@ -371,6 +371,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname,
char cmpbuf[MAXPATHLEN];
stat_x alt_sx;
int j = 0;
#ifdef SUPPORT_ACLS
alt_sx.acc_acl = alt_sx.def_acl = NULL;
#endif
-@@ -498,6 +499,7 @@ void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx,
+@@ -499,6 +500,7 @@ void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx,
} else
our_name = fname;
int update_only = 0;
int cvs_exclude = 0;
int dry_run = 0;
-@@ -362,6 +363,7 @@ void usage(enum logcode F)
+@@ -361,6 +362,7 @@ void usage(enum logcode F)
rprintf(F," -D same as --devices --specials\n");
rprintf(F," -t, --times preserve modification times\n");
rprintf(F," -O, --omit-dir-times omit directories from --times\n");
rprintf(F," --super receiver attempts super-user activities\n");
#ifdef SUPPORT_XATTRS
rprintf(F," --fake-super store/recover privileged attrs using xattrs\n");
-@@ -508,6 +510,9 @@ static struct poptOption long_options[] = {
+@@ -507,6 +509,9 @@ static struct poptOption long_options[] = {
{"times", 't', POPT_ARG_VAL, &preserve_times, 2, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"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 },
-@@ -1805,6 +1810,8 @@ void server_options(char **args, int *argc_p)
+@@ -1804,6 +1809,8 @@ void server_options(char **args, int *argc_p)
argstr[x++] = 'D';
if (preserve_times)
argstr[x++] = 't';
#define ITEM_REPORT_CHANGE (1<<1)
#define ITEM_REPORT_SIZE (1<<2) /* regular files only */
#define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */
-@@ -658,6 +660,7 @@ extern int file_extra_cnt;
+@@ -660,6 +662,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;
-@@ -665,6 +668,7 @@ extern int xattrs_ndx;
+@@ -667,6 +670,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)
-@@ -932,6 +936,7 @@ typedef struct {
+@@ -934,6 +938,7 @@ typedef struct {
typedef struct {
STRUCT_STAT st;
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
-@@ -1039,6 +1040,9 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
+@@ -1075,6 +1076,9 @@ 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).
This option is inferred if you use bf(--backup) without bf(--backup-dir).
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
-@@ -1717,7 +1721,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -1753,7 +1757,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.
-@@ -1776,6 +1780,8 @@ quote(itemization(
+@@ -1812,6 +1816,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.
#define RETURN_ERROR_IF(x,e) \
do { \
if (x) { \
-@@ -394,3 +402,33 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
+@@ -400,3 +408,33 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
return lseek(fd, offset, whence);
#endif
}
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/access.c b/access.c
--- a/access.c
+++ b/access.c
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -105,6 +105,7 @@ int keep_partial = 0;
+@@ -104,6 +104,7 @@ int keep_partial = 0;
int safe_symlinks = 0;
int copy_unsafe_links = 0;
int size_only = 0;
int daemon_bwlimit = 0;
int bwlimit = 0;
int fuzzy_basis = 0;
-@@ -388,6 +389,7 @@ void usage(enum logcode F)
+@@ -387,6 +388,7 @@ void usage(enum logcode F)
rprintf(F," --contimeout=SECONDS set daemon connection timeout in seconds\n");
rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n");
rprintf(F," --size-only skip files that match in size\n");
rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n");
rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n");
rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n");
-@@ -530,6 +532,7 @@ static struct poptOption long_options[] = {
+@@ -529,6 +531,7 @@ static struct poptOption long_options[] = {
{"chmod", 0, POPT_ARG_STRING, 0, OPT_CHMOD, 0, 0 },
{"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 },
{"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 },
+ {"date-only", 0, POPT_ARG_NONE, &date_only, 0, 0, 0 },
{"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 },
-@@ -1975,6 +1978,9 @@ void server_options(char **args, int *argc_p)
+ {"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
+ {"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
+@@ -1974,6 +1977,9 @@ void server_options(char **args, int *argc_p)
}
}
extern int protocol_version;
+extern int use_db;
- int csum_length = SHORT_SUM_LENGTH; /* initial value */
-
-@@ -100,10 +101,10 @@ void get_checksum2(char *buf, int32 len, char *sum)
+ /*
+ a simple 32 bit checksum that can be upadted from either end
+@@ -98,10 +99,10 @@ void get_checksum2(char *buf, int32 len, char *sum)
}
}
md_context m;
int32 remainder;
int fd;
-@@ -114,7 +115,7 @@ void file_checksum(char *fname, char *sum, OFF_T size)
+@@ -112,7 +113,7 @@ void file_checksum(char *fname, char *sum, OFF_T size)
if (fd == -1)
return;
if (protocol_version >= 30) {
md5_begin(&m);
-@@ -148,6 +149,9 @@ void file_checksum(char *fname, char *sum, OFF_T size)
+@@ -146,6 +147,9 @@ void file_checksum(char *fname, char *sum, OFF_T size)
mdfour_result(&m, (uchar *)sum);
}
extern char *bind_address;
extern char *config_file;
extern char *logfile_format;
-@@ -562,6 +565,9 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -567,6 +570,9 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
log_init(1);
#ifdef HAVE_PUTENV
if (*lp_prexfer_exec(i) || *lp_postxfer_exec(i)) {
char *modname, *modpath, *hostaddr, *hostname, *username;
-@@ -769,6 +775,10 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -774,6 +780,10 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
am_server = 1; /* Don't let someone try to be tricky. */
quiet = 0;
if (lp_ignore_errors(module_id))
ignore_errors = 1;
if (write_batch < 0)
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
@@ -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 \
extern int eol_nulls;
extern int relative_paths;
extern int implied_dirs;
-@@ -1297,14 +1298,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1299,14 +1300,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
if (basename_len == 0+1) {
if (!pool)
unmake_file(file);
-@@ -1985,6 +1988,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -1989,6 +1992,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;
return memcmp(sum, F_SUM(file), checksum_len) == 0;
}
-@@ -2218,6 +2220,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2227,6 +2229,9 @@ void generate_files(int f_out, const char *local_name)
* notice that and let us know via the message pipe (or its closing). */
ignore_timeout = 1;
extern int xfer_dirs;
@@ -72,6 +73,7 @@ extern char *partial_dir;
extern char *dest_option;
- extern char *basis_dir[];
+ extern char *basis_dir[MAX_BASIS_DIRS+1];
extern char *rsync_path;
+extern char *db_config;
extern char *shell_cmd;
extern char *batch_name;
extern char *password_file;
-@@ -1493,6 +1495,9 @@ int main(int argc,char *argv[])
+@@ -1497,6 +1499,9 @@ int main(int argc,char *argv[])
exit_cleanup(RERR_SYNTAX);
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -91,6 +91,7 @@ int use_qsort = 0;
+@@ -90,6 +90,7 @@ int use_qsort = 0;
char *files_from = NULL;
int filesfrom_fd = -1;
char *filesfrom_host = NULL;
int eol_nulls = 0;
int protect_args = 0;
int human_readable = 0;
-@@ -228,6 +229,7 @@ static void print_rsync_version(enum logcode f)
+@@ -227,6 +228,7 @@ static void print_rsync_version(enum logcode f)
char const *links = "no ";
char const *iconv = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
#if SUBPROTOCOL_VERSION != 0
-@@ -261,6 +263,11 @@ static void print_rsync_version(enum logcode f)
+@@ -260,6 +262,11 @@ static void print_rsync_version(enum logcode f)
#if defined HAVE_LUTIMES && defined HAVE_UTIMES
symtimes = "";
#endif
rprintf(f, "%s version %s protocol version %d%s\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol);
-@@ -274,8 +281,8 @@ static void print_rsync_version(enum logcode f)
+@@ -273,8 +280,8 @@ static void print_rsync_version(enum logcode f)
(int)(sizeof (int64) * 8));
rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
got_socketpair, hardlinks, links, ipv6, have_inplace);
#ifdef MAINTAINER_MODE
rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
-@@ -321,6 +328,7 @@ void usage(enum logcode F)
+@@ -320,6 +327,7 @@ void usage(enum logcode F)
rprintf(F," -q, --quiet suppress non-error messages\n");
rprintf(F," --no-motd suppress daemon-mode MOTD (see manpage caveat)\n");
rprintf(F," -c, --checksum skip based on checksum, not mod-time & size\n");
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");
-@@ -579,6 +587,7 @@ static struct poptOption long_options[] = {
+@@ -578,6 +586,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 },
{"no-c", 0, POPT_ARG_VAL, &always_checksum, 0, 0, 0 },
diff = u_strcmp(fmid->basename, f->basename);
if (diff == 0) {
good_match = mid;
-@@ -1992,6 +1994,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -2001,6 +2003,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fnamecmp = partialptr;
fnamecmp_type = FNAMECMP_PARTIAL_DIR;
statret = 0;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -393,6 +393,8 @@ void usage(enum logcode F)
+@@ -392,6 +392,8 @@ void usage(enum logcode F)
rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n");
rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n");
rprintf(F," --detect-renamed try to find renamed files to speed up the transfer\n");
rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n");
rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n");
rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n");
-@@ -580,7 +582,9 @@ static struct poptOption long_options[] = {
+@@ -579,7 +581,9 @@ static struct poptOption long_options[] = {
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
{"fuzzy", 'y', POPT_ARG_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 },
-@@ -1971,8 +1975,14 @@ void server_options(char **args, int *argc_p)
+@@ -1970,8 +1974,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
-@@ -1528,6 +1530,17 @@ the bf(--partial-dir) option, that directory will be used instead. These
+@@ -1564,6 +1566,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: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -42,6 +42,7 @@ extern int checksum_seed;
+@@ -43,6 +43,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)
+@@ -123,6 +124,7 @@ void set_allow_inc_recurse(void)
allow_inc_recurse = 0;
else if (!am_sender
&& (delete_before || delete_after
extern int protocol_version;
extern int sanitize_paths;
extern int munge_symlinks;
-@@ -122,6 +123,8 @@ static int64 tmp_dev, tmp_ino;
+@@ -122,6 +123,8 @@ static int64 tmp_dev = -1, tmp_ino;
#endif
static char tmp_sum[MAX_DIGEST_LEN];
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len, int flags);
-@@ -2417,6 +2459,25 @@ struct file_list *recv_file_list(int f)
+@@ -2421,6 +2463,25 @@ struct file_list *recv_file_list(int f)
flist_sort_and_clean(flist, relative_paths);
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -80,6 +80,7 @@ extern char *basis_dir[];
+@@ -80,6 +80,7 @@ extern char *basis_dir[MAX_BASIS_DIRS+1];
extern int compare_dest;
extern int copy_dest;
extern int link_dest;
if (do_progress && !am_server)
rprintf(FINFO, " \r");
-@@ -1229,6 +1377,7 @@ static void list_file_entry(struct file_struct *f)
+@@ -1235,6 +1383,7 @@ static void list_file_entry(struct file_struct *f)
}
}
static int phase = 0;
static int dflt_perms;
-@@ -1505,9 +1654,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1511,9 +1660,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;
-@@ -1789,8 +1941,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1798,8 +1950,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;
-@@ -2193,6 +2351,12 @@ void generate_files(int f_out, const char *local_name)
+@@ -2202,6 +2360,12 @@ void generate_files(int f_out, const char *local_name)
if (verbose > 2)
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) {
-@@ -2203,7 +2367,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2212,7 +2376,7 @@ void generate_files(int f_out, const char *local_name)
}
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -2245,7 +2409,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2254,7 +2418,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));
}
-@@ -2292,7 +2456,21 @@ void generate_files(int f_out, const char *local_name)
+@@ -2301,7 +2465,21 @@ void generate_files(int f_out, const char *local_name)
} while ((cur_flist = cur_flist->next) != NULL);
if (delete_during)
int numeric_ids = 0;
int allow_8bit_chars = 0;
int force_delete = 0;
-@@ -391,6 +392,7 @@ void usage(enum logcode F)
+@@ -390,6 +391,7 @@ void usage(enum logcode F)
rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n");
rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n");
rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n");
rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n");
rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n");
rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n");
-@@ -578,6 +580,7 @@ static struct poptOption long_options[] = {
+@@ -577,6 +579,7 @@ static struct poptOption long_options[] = {
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
{"fuzzy", 'y', POPT_ARG_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 },
-@@ -1596,7 +1599,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1595,7 +1598,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
inplace = 1;
}
partial_dir = tmp_partialdir;
if (inplace) {
-@@ -1605,6 +1608,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1604,6 +1607,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;
}
-@@ -1967,6 +1971,8 @@ void server_options(char **args, int *argc_p)
+@@ -1966,6 +1970,8 @@ 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
-@@ -1512,6 +1513,21 @@ Note that the use of the bf(--delete) option might get rid of any potential
+@@ -1548,6 +1549,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: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
extern int ignore_existing;
extern int ignore_non_existing;
extern int inplace;
-@@ -1730,6 +1731,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1739,6 +1740,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
fnamecmp = fname;
fnamecmp_type = FNAMECMP_FNAME;
-@@ -2104,6 +2112,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2113,6 +2121,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;
-@@ -2129,6 +2138,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2138,6 +2147,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;
int cvs_exclude = 0;
int dry_run = 0;
int do_xfers = 1;
-@@ -326,6 +327,7 @@ void usage(enum logcode F)
+@@ -325,6 +326,7 @@ void usage(enum logcode F)
rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n");
rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
rprintf(F," -u, --update skip files that are newer on the receiver\n");
rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
rprintf(F," --append append data onto shorter files\n");
rprintf(F," --append-verify like --append, but with old data in file checksum\n");
-@@ -534,6 +536,7 @@ static struct poptOption long_options[] = {
- {"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 },
+@@ -533,6 +535,7 @@ static struct poptOption long_options[] = {
+ {"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
+ {"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 },
+ {"downdate", 'w', POPT_ARG_NONE, &downdate_only, 0, 0, 0 },
{"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 },
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
-@@ -1047,6 +1047,7 @@ int daemon_main(void)
+@@ -1052,6 +1052,7 @@ int daemon_main(void)
fprintf(stderr, "Failed to parse config file: %s\n", config_file);
exit_cleanup(RERR_SYNTAX);
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -123,6 +123,7 @@ int inplace = 0;
+@@ -122,6 +122,7 @@ int inplace = 0;
int delay_updates = 0;
long block_size = 0; /* "long" because popt can't set an int32. */
char *skip_compress = NULL;
/** Network address family. **/
int default_af_hint
-@@ -652,6 +653,7 @@ static struct poptOption long_options[] = {
+@@ -651,6 +652,7 @@ static struct poptOption long_options[] = {
/* All the following options switch us into daemon-mode option-parsing. */
{"config", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
{"daemon", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
{"detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
{"no-detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
{0,0,0,0, 0, 0, 0}
-@@ -666,6 +668,7 @@ static void daemon_usage(enum logcode F)
+@@ -665,6 +667,7 @@ static void daemon_usage(enum logcode F)
rprintf(F," --address=ADDRESS bind to the specified address\n");
rprintf(F," --bwlimit=KBPS limit I/O bandwidth; KBytes per second\n");
rprintf(F," --config=FILE specify alternate rsyncd.conf file\n");
rprintf(F," --no-detach do not detach from the parent\n");
rprintf(F," --port=PORT listen on alternate port number\n");
rprintf(F," --log-file=FILE override the \"log file\" setting\n");
-@@ -687,6 +690,7 @@ static struct poptOption long_daemon_options[] = {
+@@ -686,6 +689,7 @@ static struct poptOption long_daemon_options[] = {
{"bwlimit", 0, POPT_ARG_INT, &daemon_bwlimit, 0, 0, 0 },
{"config", 0, POPT_ARG_STRING, &config_file, 0, 0, 0 },
{"daemon", 0, POPT_ARG_NONE, &daemon_opt, 0, 0, 0 },
{"ipv4", '4', POPT_ARG_VAL, &default_af_hint, AF_INET, 0, 0 },
{"ipv6", '6', POPT_ARG_VAL, &default_af_hint, AF_INET6, 0, 0 },
{"detach", 0, POPT_ARG_VAL, &no_detach, 0, 0, 0 },
-@@ -970,11 +974,24 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -969,11 +973,24 @@ int parse_arguments(int *argc_p, const char ***argv_p)
pc = poptGetContext(RSYNC_NAME, argc, argv,
long_daemon_options, 0);
while ((opt = poptGetNextOpt(pc)) != -1) {
case 'v':
verbose++;
break;
-@@ -988,6 +1005,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -987,6 +1004,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
--no-detach do not detach from the parent
--port=PORT listen on alternate port number
--log-file=FILE override the "log file" setting
-@@ -2176,6 +2177,14 @@ The default is /etc/rsyncd.conf unless the daemon is running over
+@@ -2212,6 +2213,14 @@ The default is /etc/rsyncd.conf unless the daemon is running over
a remote shell program and the remote user is not the super-user; in that case
the default is rsyncd.conf in the current directory (typically $HOME).
* pass --drop-cache on to the remote server
* make test works now
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/checksum.c b/checksum.c
--- a/checksum.c
+++ b/checksum.c
-@@ -26,6 +26,10 @@ extern int protocol_version;
-
- int csum_length = SHORT_SUM_LENGTH; /* initial value */
+@@ -24,6 +24,10 @@
+ extern int checksum_seed;
+ extern int protocol_version;
+#ifdef HAVE_POSIX_FADVISE64
+#define close(fd) fadv_close(fd)
max_fd = sysconf(_SC_OPEN_MAX) - 1;
for (fd = max_fd; fd >= 0; fd--) {
if ((ret = do_fstat(fd, &st)) == 0) {
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
@@ -568,6 +568,7 @@ AC_FUNC_ALLOCA
AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
fchmod fstat ftruncate strchr readlink link utime utimes lutimes strftime \
int cvs_exclude = 0;
int dry_run = 0;
int do_xfers = 1;
-@@ -326,6 +327,9 @@ void usage(enum logcode F)
+@@ -325,6 +326,9 @@ void usage(enum logcode F)
rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n");
rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
rprintf(F," -u, --update skip files that are newer on the receiver\n");
rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
rprintf(F," --append append data onto shorter files\n");
rprintf(F," --append-verify like --append, but with old data in file checksum\n");
-@@ -534,6 +538,9 @@ static struct poptOption long_options[] = {
- {"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 },
+@@ -533,6 +537,9 @@ static struct poptOption long_options[] = {
+ {"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
+ {"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 },
+#ifdef HAVE_POSIX_FADVISE64
+ {"drop-cache", 0, POPT_ARG_NONE, &drop_cache, 0, 0, 0 },
{"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 },
-@@ -1725,6 +1732,11 @@ void server_options(char **args, int *argc_p)
+@@ -1724,6 +1731,11 @@ void server_options(char **args, int *argc_p)
if (!am_sender)
args[ac++] = "--sender";
-n, --dry-run perform a trial run with no changes made
-W, --whole-file copy files whole (w/o delta-xfer algorithm)
-x, --one-file-system don't cross filesystem boundaries
-@@ -1060,6 +1061,10 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
+@@ -1096,6 +1097,10 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
filesystem. It seems to have problems seeking over null regions,
and ends up corrupting the files.
./configure
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
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;
+@@ -43,9 +43,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;
+@@ -63,7 +65,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)
+@@ -140,6 +142,8 @@ void setup_protocol(int f_out,int f_in)
uid_ndx = ++file_extra_cnt;
if (preserve_gid)
gid_ndx = ++file_extra_cnt;
if (preserve_acls && !am_sender)
acls_ndx = ++file_extra_cnt;
if (preserve_xattrs)
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
@@ -567,6 +567,7 @@ AC_FUNC_UTIME_NULL
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -635,6 +651,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -637,6 +653,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
{
static int64 modtime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -769,6 +788,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -771,6 +790,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
-@@ -910,6 +933,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -912,6 +935,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
}
#endif
file->mode = mode;
if (preserve_uid)
F_OWNER(file) = uid;
if (preserve_gid) {
-@@ -1284,6 +1311,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1286,6 +1313,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
}
#endif
file->mode = st.st_mode;
if (uid_ndx) /* Check uid_ndx instead of preserve_uid for del support */
F_OWNER(file) = st.st_uid;
if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
-@@ -1427,6 +1458,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1429,6 +1460,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
if (!ACL_READY(*sxp))
-@@ -1442,6 +1465,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1448,6 +1471,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);
-@@ -1482,10 +1509,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1488,10 +1515,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));
-@@ -1520,6 +1552,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1526,6 +1558,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)
-@@ -2061,13 +2097,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -2070,13 +2106,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
continue;
fname = f_name(file, NULL);
if (fix_dir_perms)
int force_delete = 0;
+int force_change = 0;
int io_timeout = 0;
- int allowed_lull = 0;
int prune_empty_dirs = 0;
-@@ -224,6 +226,7 @@ static void print_rsync_version(enum logcode f)
+ int use_qsort = 0;
+@@ -223,6 +225,7 @@ static void print_rsync_version(enum logcode f)
char const *links = "no ";
char const *iconv = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
#if SUBPROTOCOL_VERSION != 0
-@@ -257,6 +260,9 @@ static void print_rsync_version(enum logcode f)
+@@ -256,6 +259,9 @@ static void print_rsync_version(enum logcode f)
#if defined HAVE_LUTIMES && defined HAVE_UTIMES
symtimes = "";
#endif
rprintf(f, "%s version %s protocol version %d%s\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol);
-@@ -270,8 +276,8 @@ static void print_rsync_version(enum logcode f)
+@@ -269,8 +275,8 @@ static void print_rsync_version(enum logcode f)
(int)(sizeof (int64) * 8));
rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
got_socketpair, hardlinks, links, ipv6, have_inplace);
#ifdef MAINTAINER_MODE
rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
-@@ -338,6 +344,9 @@ void usage(enum logcode F)
+@@ -337,6 +343,9 @@ void usage(enum logcode F)
rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
rprintf(F," -H, --hard-links preserve hard links\n");
rprintf(F," -p, --perms preserve permissions\n");
rprintf(F," -E, --executability preserve the file's executability\n");
rprintf(F," --chmod=CHMOD affect file and/or directory permissions\n");
#ifdef SUPPORT_ACLS
-@@ -375,7 +384,12 @@ void usage(enum logcode F)
+@@ -374,7 +383,12 @@ void usage(enum logcode F)
rprintf(F," --delete-after receiver deletes after transfer, not during\n");
rprintf(F," --delete-excluded also delete excluded files from destination dirs\n");
rprintf(F," --ignore-errors delete even if there are I/O errors\n");
rprintf(F," --max-delete=NUM don't delete more than NUM files\n");
rprintf(F," --max-size=SIZE don't transfer any file larger than SIZE\n");
rprintf(F," --min-size=SIZE don't transfer any file smaller than SIZE\n");
-@@ -480,6 +494,10 @@ static struct poptOption long_options[] = {
+@@ -479,6 +493,10 @@ static struct poptOption long_options[] = {
{"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 },
{"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"executability", 'E', POPT_ARG_NONE, &preserve_executability, 0, 0, 0 },
{"acls", 'A', POPT_ARG_NONE, 0, 'A', 0, 0 },
{"no-acls", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 },
-@@ -558,6 +576,14 @@ static struct poptOption long_options[] = {
+@@ -557,6 +575,14 @@ static struct poptOption long_options[] = {
{"remove-source-files",0,POPT_ARG_VAL, &remove_source_files, 1, 0, 0 },
{"force", 0, POPT_ARG_VAL, &force_delete, 1, 0, 0 },
{"no-force", 0, POPT_ARG_VAL, &force_delete, 0, 0, 0 },
{"ignore-errors", 0, POPT_ARG_VAL, &ignore_errors, 1, 0, 0 },
{"no-ignore-errors", 0, POPT_ARG_VAL, &ignore_errors, 0, 0, 0 },
{"max-delete", 0, POPT_ARG_INT, &max_delete, 0, 0, 0 },
-@@ -1874,6 +1900,9 @@ void server_options(char **args, int *argc_p)
+@@ -1873,6 +1899,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;
-@@ -1961,6 +1990,16 @@ void server_options(char **args, int *argc_p)
+@@ -1960,6 +1989,16 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--delete-excluded";
if (force_delete)
args[ac++] = "--force";
#define ITEM_BASIS_TYPE_FOLLOWS (1<<11)
#define ITEM_XNAME_FOLLOWS (1<<12)
#define ITEM_IS_NEW (1<<13)
-@@ -463,6 +466,28 @@ typedef unsigned int size_t;
+@@ -465,6 +468,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. */
-@@ -633,6 +658,7 @@ extern int file_extra_cnt;
+@@ -635,6 +660,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;
-@@ -670,6 +696,11 @@ extern int xattrs_ndx;
+@@ -672,6 +698,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(--no-OPTION) You may turn off one or more implied options by prefixing
the option name with "no-". Not all options may be prefixed with a "no-":
-@@ -809,7 +814,7 @@ they would be using bf(--copy-links).
+@@ -824,7 +829,7 @@ they would be using bf(--copy-links).
Without this option, if the sending side has replaced a directory with a
symlink to a directory, the receiving side will delete anything that is in
the way of the new symlink, including a directory hierarchy (as long as
See also bf(--keep-dirlinks) for an analogous option for the receiving
side.
-@@ -946,6 +951,29 @@ super-user copies all namespaces except system.*. A normal user only copies
- the user.* namespace. To be able to backup and restore non-user namespaces as
- a normal user, see the bf(--fake-super) option.
+@@ -982,6 +987,29 @@ Note that this option does not copy rsyncs special xattr values (e.g. those
+ used by bf(--fake-super)) unless you repeat the option (e.g. -XX). This
+ "copy all xattrs" mode cannot be used with bf(--fake-super).
+dit(bf(--fileflags)) This option causes rsync to update the file-flags to be
+the same as the source files and directories (if your OS supports the
dit(bf(--chmod)) This option tells rsync to apply one or more
comma-separated "chmod" strings to the permission of the files in the
transfer. The resulting value is treated as though it were the permissions
-@@ -1217,12 +1245,13 @@ See bf(--delete) (which is implied) for more details on file-deletion.
+@@ -1253,12 +1281,13 @@ See bf(--delete) (which is implied) for more details on file-deletion.
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
-@@ -1688,7 +1717,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -1724,7 +1753,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.
-@@ -1744,7 +1773,7 @@ quote(itemization(
+@@ -1780,7 +1809,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).
{
int code;
if (dry_run) return 0;
-@@ -168,17 +223,74 @@ int do_chmod(const char *path, mode_t mode)
- #endif
+@@ -170,17 +225,78 @@ int do_chmod(const char *path, mode_t mode)
} else
code = chmod(path, mode & CHMOD_BITS); /* DISCOURAGED FUNCTION */
+ #endif /* !HAVE_LCHMOD */
+#ifdef SUPPORT_FORCE_CHANGE
+ if (code < 0 && force_change && errno == EPERM && !S_ISLNK(mode)) {
+ if (fileflags == NO_FFLAGS) {
+ }
+ if (fileflags != NO_FFLAGS
+ && make_mutable(path, mode, fileflags, force_change) > 0) {
++#ifdef HAVE_LCHMOD
++ code = lchmod(path, mode & CHMOD_BITS);
++#else
+ code = chmod(path, mode & CHMOD_BITS);
++#endif
+ undo_make_mutable(path, fileflags);
+ if (code == 0)
+ return 0;
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
int preserve_links = 0;
int preserve_hard_links = 0;
int preserve_acls = 0;
-@@ -383,6 +384,7 @@ void usage(enum logcode F)
+@@ -382,6 +383,7 @@ void usage(enum logcode F)
rprintf(F," --partial-dir=DIR put a partially transferred file into DIR\n");
rprintf(F," --delay-updates put all updated files into place at transfer's end\n");
rprintf(F," -m, --prune-empty-dirs prune empty directory chains from the file-list\n");
rprintf(F," --numeric-ids don't map uid/gid values by user/group name\n");
rprintf(F," --timeout=SECONDS set I/O timeout in seconds\n");
rprintf(F," --contimeout=SECONDS set daemon connection timeout in seconds\n");
-@@ -626,6 +628,7 @@ static struct poptOption long_options[] = {
+@@ -625,6 +627,7 @@ 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 },
-@@ -2025,6 +2028,9 @@ void server_options(char **args, int *argc_p)
+@@ -2024,6 +2027,9 @@ void server_options(char **args, int *argc_p)
args[ac++] = tmpdir;
}
- Make this code handle multibyte character encodings, and honor the
--iconv setting when converting case.
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
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;
-@@ -2876,6 +2877,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -2880,6 +2881,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;
-@@ -2986,7 +2988,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -2990,7 +2992,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
if (type1 != type2)
return type1 == t_PATH ? 1 : -1;
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -117,6 +117,7 @@ OFF_T max_size = 0;
+@@ -116,6 +116,7 @@ OFF_T max_size = 0;
OFF_T min_size = 0;
int ignore_errors = 0;
int modify_window = 0;
int blocking_io = -1;
int checksum_seed = 0;
int inplace = 0;
-@@ -408,6 +409,7 @@ void usage(enum logcode F)
+@@ -407,6 +408,7 @@ void usage(enum logcode F)
rprintf(F," --files-from=FILE read list of source-file names from FILE\n");
rprintf(F," -0, --from0 all *-from/filter files are delimited by 0s\n");
rprintf(F," -s, --protect-args no space-splitting; only wildcard special-chars\n");
rprintf(F," --address=ADDRESS bind address for outgoing socket to daemon\n");
rprintf(F," --port=PORT specify double-colon alternate port number\n");
rprintf(F," --sockopts=OPTIONS specify custom TCP options\n");
-@@ -614,6 +616,8 @@ static struct poptOption long_options[] = {
+@@ -613,6 +615,8 @@ static struct poptOption long_options[] = {
{"read-batch", 0, POPT_ARG_STRING, &batch_name, OPT_READ_BATCH, 0, 0 },
{"write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_WRITE_BATCH, 0, 0 },
{"only-write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_ONLY_WRITE_BATCH, 0, 0 },
{"files-from", 0, POPT_ARG_STRING, &files_from, 0, 0, 0 },
{"from0", '0', POPT_ARG_VAL, &eol_nulls, 1, 0, 0},
{"no-from0", 0, POPT_ARG_VAL, &eol_nulls, 0, 0, 0},
-@@ -1987,6 +1991,9 @@ void server_options(char **args, int *argc_p)
+@@ -1986,6 +1990,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
-@@ -1470,6 +1471,10 @@ side will also be translated
+@@ -1506,6 +1507,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: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
extern char curr_dir[MAXPATHLEN];
-@@ -855,7 +856,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -857,7 +858,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
extra_len += EXTRA_LEN;
#endif
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -156,6 +156,7 @@ char *backup_suffix = NULL;
+@@ -155,6 +155,7 @@ char *backup_suffix = NULL;
char *tmpdir = NULL;
char *partial_dir = NULL;
char *basis_dir[MAX_BASIS_DIRS+1];
char *config_file = NULL;
char *shell_cmd = NULL;
char *logfile_name = NULL;
-@@ -394,6 +395,7 @@ void usage(enum logcode F)
+@@ -393,6 +394,7 @@ void usage(enum logcode F)
rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n");
rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n");
rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n");
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");
-@@ -446,7 +448,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -445,7 +447,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_SERVER, OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -578,6 +580,7 @@ static struct poptOption long_options[] = {
+@@ -577,6 +579,7 @@ static struct poptOption long_options[] = {
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
{"fuzzy", 'y', POPT_ARG_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 },
-@@ -1260,6 +1263,21 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1259,6 +1262,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. */
-@@ -2044,6 +2062,11 @@ void server_options(char **args, int *argc_p)
+@@ -2043,6 +2061,11 @@ void server_options(char **args, int *argc_p)
} else if (inplace)
args[ac++] = "--inplace";
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -831,6 +831,14 @@ struct stats {
+@@ -833,6 +833,14 @@ struct stats {
int num_transferred_files;
};
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
extern int unsort_ndx;
extern struct stats stats;
extern char *filesfrom_host;
-@@ -1233,6 +1234,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1235,6 +1236,12 @@ 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))
extra_len = (extra_len | (EXTRA_ROUNDING * EXTRA_LEN)) + EXTRA_LEN;
-@@ -1297,9 +1304,6 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1299,9 +1306,6 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
if (am_sender)
F_PATHNAME(file) = pathname;
else if (!pool)
-@@ -1311,6 +1315,9 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1313,6 +1317,9 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
extern int preserve_times;
extern int uid_ndx;
extern int gid_ndx;
-@@ -57,6 +59,7 @@ extern iconv_t ic_send, ic_recv;
- extern char curr_dir[];
+@@ -57,6 +59,7 @@ extern iconv_t ic_recv;
+ extern char curr_dir[MAXPATHLEN];
extern char *full_module_path;
extern unsigned int module_dirlen;
+extern char sender_file_sum[MAX_DIGEST_LEN];
/* There's probably never more than at most 2 outstanding child processes,
* but set it higher, just in case. */
-@@ -1006,6 +1010,12 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
+@@ -1010,6 +1014,12 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
if (am_sender) {
keep_dirlinks = 0; /* Must be disabled on the sender. */
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -1530,7 +1530,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1529,7 +1529,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
else if (log_format_has(stdout_format, 'i'))
stdout_format_has_i = itemize_changes | 1;
if (!log_format_has(stdout_format, 'b')
@@ -54,6 +55,7 @@ extern struct stats stats;
extern char *tmpdir;
extern char *partial_dir;
- extern char *basis_dir[];
+ extern char *basis_dir[MAX_BASIS_DIRS+1];
+extern char sender_file_sum[MAX_DIGEST_LEN];
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct filter_list_struct daemon_filter_list;
pid_t pre_exec_pid = 0;
char *request = NULL;
-@@ -686,9 +687,11 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -691,9 +692,11 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
munge_symlinks = !use_chroot || module_dirlen;
if (munge_symlinks) {
STRUCT_STAT st;
io_printf(f_out, "@ERROR: daemon security issue -- contact admin\n", name);
exit_cleanup(RERR_UNSUPPORTED);
}
-@@ -748,6 +751,8 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -753,6 +756,8 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
read_args(f_in, name, line, sizeof line, rl_nulls, &argv, &argc, &request);
orig_argv = argv;
verbose = 0; /* future verbosity is controlled by client options */
ret = parse_arguments(&argc, (const char ***) &argv);
if (protect_args && ret) {
-@@ -759,6 +764,8 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -764,6 +769,8 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
} else
orig_early_argv = NULL;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -104,6 +104,7 @@ int connect_timeout = 0;
+@@ -103,6 +103,7 @@ int connect_timeout = 0;
int keep_partial = 0;
int safe_symlinks = 0;
int copy_unsafe_links = 0;
int size_only = 0;
int daemon_bwlimit = 0;
int bwlimit = 0;
-@@ -338,6 +339,7 @@ void usage(enum logcode F)
+@@ -337,6 +338,7 @@ void usage(enum logcode F)
rprintf(F," -L, --copy-links transform symlink into referent file/dir\n");
rprintf(F," --copy-unsafe-links only \"unsafe\" symlinks are transformed\n");
rprintf(F," --safe-links ignore symlinks that point outside the source tree\n");
rprintf(F," -k, --copy-dirlinks transform symlink to a dir into referent dir\n");
rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
rprintf(F," -H, --hard-links preserve hard links\n");
-@@ -520,6 +522,8 @@ static struct poptOption long_options[] = {
+@@ -519,6 +521,8 @@ static struct poptOption long_options[] = {
{"copy-links", 'L', POPT_ARG_NONE, ©_links, 0, 0, 0 },
{"copy-unsafe-links",0, POPT_ARG_NONE, ©_unsafe_links, 0, 0, 0 },
{"safe-links", 0, POPT_ARG_NONE, &safe_symlinks, 0, 0, 0 },
{"copy-dirlinks", 'k', POPT_ARG_NONE, ©_dirlinks, 0, 0, 0 },
{"keep-dirlinks", 'K', POPT_ARG_NONE, &keep_dirlinks, 0, 0, 0 },
{"hard-links", 'H', POPT_ARG_NONE, 0, 'H', 0, 0 },
-@@ -1477,6 +1481,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1476,6 +1480,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
need_messages_from_generator = 1;
}
-k, --copy-dirlinks transform symlink to dir into referent dir
-K, --keep-dirlinks treat symlinked dir on receiver as dir
-H, --hard-links preserve hard links
-@@ -802,6 +803,25 @@ which point outside the copied tree. All absolute symlinks are
+@@ -817,6 +818,25 @@ which point outside the copied tree. All absolute symlinks are
also ignored. Using this option in conjunction with bf(--relative) may
give unexpected results.
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
#ifdef HAVE_SIGACTION
static struct sigaction sigact;
-@@ -563,7 +565,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -568,7 +570,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
log_init(1);
#ifdef HAVE_PUTENV
char *modname, *modpath, *hostaddr, *hostname, *username;
int status;
-@@ -652,6 +654,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -657,6 +659,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
set_blocking(fds[1]);
pre_exec_fd = fds[1];
}
umask(0);
}
#endif
-@@ -879,6 +919,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -884,6 +924,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
return 0;
}
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/access.c b/access.c
--- a/access.c
+++ b/access.c
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
iflags |= ITEM_REPORT_GROUP;
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
-@@ -1438,7 +1441,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1444,7 +1447,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
real_sx = sx;
if (file->flags & FLAG_DIR_CREATED)
statret = -1;
int update_only = 0;
int cvs_exclude = 0;
int dry_run = 0;
-@@ -353,6 +354,7 @@ void usage(enum logcode F)
+@@ -352,6 +353,7 @@ void usage(enum logcode F)
rprintf(F," -D same as --devices --specials\n");
rprintf(F," -t, --times preserve modification times\n");
rprintf(F," -O, --omit-dir-times omit directories from --times\n");
rprintf(F," --super receiver attempts super-user activities\n");
#ifdef SUPPORT_XATTRS
rprintf(F," --fake-super store/recover privileged attrs using xattrs\n");
-@@ -493,6 +495,7 @@ static struct poptOption long_options[] = {
+@@ -492,6 +494,7 @@ static struct poptOption long_options[] = {
{"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 },
{"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 },
-@@ -1515,6 +1518,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1514,6 +1517,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
parse_rule(&filter_list, backup_dir_buf, 0, 0);
}
if (make_backups && !backup_dir) {
omit_dir_times = 0; /* Implied, so avoid -O to sender. */
if (preserve_times > 1)
-@@ -1753,6 +1758,8 @@ void server_options(char **args, int *argc_p)
+@@ -1752,6 +1757,8 @@ void server_options(char **args, int *argc_p)
argstr[x++] = 'm';
if (omit_dir_times)
argstr[x++] = 'O';
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
-@@ -1011,6 +1012,10 @@ it is preserving modification times (see bf(--times)). If NFS is sharing
+@@ -1047,6 +1048,10 @@ 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).
This option is inferred if you use bf(--backup) without bf(--backup-dir).
./configure
make
-based-on: 11f4f34ed96eafd0ff9e1d5813e5476790a4b6e9
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
return -1;
}
-@@ -590,10 +637,17 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -595,10 +642,17 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
return -1;
}
if (pid) {
if (asprintf(&p, "RSYNC_RAW_STATUS=%d", status) > 0)
putenv(p);
if (WIFEXITED(status))
-@@ -936,6 +990,9 @@ int start_daemon(int f_in, int f_out)
+@@ -941,6 +995,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;
-@@ -947,6 +1004,20 @@ int start_daemon(int f_in, int f_out)
+@@ -952,6 +1009,20 @@ int start_daemon(int f_in, int f_out)
return -1;
}
if (*line == '#') {
/* it's some sort of command that I don't understand */
io_printf(f_out, "@ERROR: Unknown command '%s'\n", line);
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
@@ -312,6 +312,25 @@ if test x"$enable_locale" != x"no"; then
AC_DEFINE(CONFIG_LOCALE)
fi
/* Wait for a process to exit, calling io_flush while waiting. */
static void wait_process_with_flush(pid_t pid, int *exit_code_ptr)
{
-@@ -717,6 +766,11 @@ static void do_server_sender(int f_in, int f_out, int argc, char *argv[])
+@@ -721,6 +770,11 @@ static void do_server_sender(int f_in, int f_out, int argc, char *argv[])
argv[0] = ".";
}
flist = send_file_list(f_out,argc,argv);
if (!flist || flist->used == 0)
exit_cleanup(0);
-@@ -818,6 +872,10 @@ static int do_recv(int f_in, int f_out, char *local_name)
+@@ -822,6 +876,10 @@ static int do_recv(int f_in, int f_out, char *local_name)
close(f_in);
io_start_buffering_out(f_out);
set_msg_fd_in(error_pipe[0]);
io_start_buffering_in(error_pipe[0]);
-@@ -1012,6 +1070,10 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
+@@ -1016,6 +1074,10 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
io_start_buffering_out(f_out);
if (!filesfrom_host)
set_msg_fd_in(f_in);
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -184,6 +184,14 @@ int logfile_format_has_o_or_i = 0;
+@@ -183,6 +183,14 @@ int logfile_format_has_o_or_i = 0;
int always_checksum = 0;
int list_only = 0;
#define MAX_BATCH_NAME_LEN 256 /* Must be less than MAXPATHLEN-13 */
char *batch_name = NULL;
-@@ -224,6 +232,7 @@ static void print_rsync_version(enum logcode f)
+@@ -223,6 +231,7 @@ static void print_rsync_version(enum logcode f)
char const *links = "no ";
char const *iconv = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
#if SUBPROTOCOL_VERSION != 0
-@@ -257,6 +266,9 @@ static void print_rsync_version(enum logcode f)
+@@ -256,6 +265,9 @@ static void print_rsync_version(enum logcode f)
#if defined HAVE_LUTIMES && defined HAVE_UTIMES
symtimes = "";
#endif
rprintf(f, "%s version %s protocol version %d%s\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol);
-@@ -270,8 +282,8 @@ static void print_rsync_version(enum logcode f)
+@@ -269,8 +281,8 @@ static void print_rsync_version(enum logcode f)
(int)(sizeof (int64) * 8));
rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
got_socketpair, hardlinks, links, ipv6, have_inplace);
#ifdef MAINTAINER_MODE
rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
-@@ -433,6 +445,13 @@ void usage(enum logcode F)
+@@ -432,6 +444,13 @@ void usage(enum logcode F)
#endif
rprintf(F," -4, --ipv4 prefer IPv4\n");
rprintf(F," -6, --ipv6 prefer IPv6\n");
rprintf(F," --version print version number\n");
rprintf(F,"(-h) --help show this help (-h works with no other options)\n");
-@@ -446,7 +465,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -445,7 +464,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_SERVER, OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -649,6 +668,13 @@ static struct poptOption long_options[] = {
+@@ -648,6 +667,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 },
{"sender", 0, POPT_ARG_NONE, 0, OPT_SENDER, 0, 0 },
/* All the following options switch us into daemon-mode option-parsing. */
{"config", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
{"daemon", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
-@@ -674,6 +700,13 @@ static void daemon_usage(enum logcode F)
+@@ -673,6 +699,13 @@ static void daemon_usage(enum logcode F)
rprintf(F," -v, --verbose increase verbosity\n");
rprintf(F," -4, --ipv4 prefer IPv4\n");
rprintf(F," -6, --ipv6 prefer IPv6\n");
rprintf(F," --help show this help screen\n");
rprintf(F,"\n");
-@@ -698,6 +731,13 @@ static struct poptOption long_daemon_options[] = {
+@@ -697,6 +730,13 @@ static struct poptOption long_daemon_options[] = {
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
{"server", 0, POPT_ARG_NONE, &am_server, 0, 0, 0 },
{"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
{"verbose", 'v', POPT_ARG_NONE, 0, 'v', 0, 0 },
{"no-verbose", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 },
{"no-v", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 },
-@@ -979,6 +1019,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -978,6 +1018,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
verbose++;
break;
default:
rprintf(FERROR,
"rsync: %s: %s (in daemon mode)\n",
-@@ -1002,6 +1048,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1001,6 +1047,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
exit_cleanup(RERR_SYNTAX);
}
*argv_p = argv = poptGetArgs(pc);
*argc_p = argc = count_args(argv);
am_starting_up = 0;
-@@ -1260,6 +1317,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1259,6 +1316,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. */
-@@ -1599,6 +1662,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1598,6 +1661,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) {
-@@ -2147,9 +2221,26 @@ static char *parse_hostspec(char *str, char **path_start_ptr, int *port_ptr)
+@@ -2146,9 +2220,26 @@ static char *parse_hostspec(char *str, char **path_start_ptr, int *port_ptr)
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)
-@@ -550,6 +551,11 @@ typedef unsigned int size_t;
+@@ -552,6 +553,11 @@ typedef unsigned int size_t;
# define SIZEOF_INT64 SIZEOF_OFF_T
#endif
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1427,6 +1427,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1429,6 +1429,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
./configure
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -34,6 +34,7 @@ extern int inplace;
+@@ -35,6 +35,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,14 @@ void setup_protocol(int f_out,int f_in)
+@@ -190,6 +191,14 @@ void setup_protocol(int f_out,int f_in)
if (read_batch)
check_batch_flags();
if (protocol_version < 30) {
if (append_mode == 1)
append_mode = 2;
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
@@ -570,6 +570,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
memmove lchown vsnprintf snprintf vasprintf asprintf setsid strpbrk \
strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \
int do_compression = 0;
int def_compress_level = Z_DEFAULT_COMPRESSION;
int am_root = 0; /* 0 = normal, 1 = root, 2 = --super, -1 = --fake-super */
-@@ -224,6 +225,7 @@ static void print_rsync_version(enum logcode f)
+@@ -223,6 +224,7 @@ static void print_rsync_version(enum logcode f)
char const *links = "no ";
char const *iconv = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
#if SUBPROTOCOL_VERSION != 0
-@@ -257,6 +259,9 @@ static void print_rsync_version(enum logcode f)
+@@ -256,6 +258,9 @@ static void print_rsync_version(enum logcode f)
#if defined HAVE_LUTIMES && defined HAVE_UTIMES
symtimes = "";
#endif
rprintf(f, "%s version %s protocol version %d%s\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol);
-@@ -270,8 +275,8 @@ static void print_rsync_version(enum logcode f)
+@@ -269,8 +274,8 @@ static void print_rsync_version(enum logcode f)
(int)(sizeof (int64) * 8));
rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
got_socketpair, hardlinks, links, ipv6, have_inplace);
#ifdef MAINTAINER_MODE
rprintf(f, "Panic Action: \"%s\"\n", get_panic_action());
-@@ -358,6 +363,11 @@ void usage(enum logcode F)
+@@ -357,6 +362,11 @@ void usage(enum logcode F)
rprintf(F," --fake-super store/recover privileged attrs using xattrs\n");
#endif
rprintf(F," -S, --sparse handle sparse files efficiently\n");
rprintf(F," -n, --dry-run perform a trial run with no changes made\n");
rprintf(F," -W, --whole-file copy files whole (without delta-xfer algorithm)\n");
rprintf(F," -x, --one-file-system don't cross filesystem boundaries\n");
-@@ -542,6 +552,7 @@ static struct poptOption long_options[] = {
+@@ -541,6 +551,7 @@ static struct poptOption long_options[] = {
{"sparse", 'S', POPT_ARG_VAL, &sparse_files, 1, 0, 0 },
{"no-sparse", 0, POPT_ARG_VAL, &sparse_files, 0, 0, 0 },
{"no-S", 0, POPT_ARG_VAL, &sparse_files, 0, 0, 0 },
{"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 },
-@@ -2069,6 +2080,9 @@ void server_options(char **args, int *argc_p)
+@@ -2068,6 +2079,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
-@@ -615,6 +615,21 @@ struct ht_int64_node {
+@@ -617,6 +617,21 @@ struct ht_int64_node {
#define ACLS_NEED_MASK 1
#endif
-n, --dry-run perform a trial run with no changes made
-W, --whole-file copy files whole (w/o delta-xfer algorithm)
-x, --one-file-system don't cross filesystem boundaries
-@@ -1060,6 +1061,17 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
+@@ -1096,6 +1097,17 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
filesystem. It seems to have problems seeking over null regions,
and ends up corrupting the files.
extern int dry_run;
extern int am_root;
extern int read_only;
-@@ -282,3 +286,25 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
+@@ -284,3 +288,25 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
return lseek(fd, offset, whence);
#endif
}
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -173,6 +173,10 @@ int link_dest = 0;
+@@ -172,6 +172,10 @@ int link_dest = 0;
int basis_dir_cnt = 0;
char *dest_option = NULL;
int verbose = 0;
int quiet = 0;
int output_motd = 1;
-@@ -387,6 +391,7 @@ void usage(enum logcode F)
+@@ -386,6 +390,7 @@ void usage(enum logcode F)
rprintf(F," --timeout=SECONDS set I/O timeout in seconds\n");
rprintf(F," --contimeout=SECONDS set daemon connection timeout in seconds\n");
rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n");
rprintf(F," --size-only skip files that match in size\n");
rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n");
rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n");
-@@ -645,6 +650,7 @@ static struct poptOption long_options[] = {
+@@ -644,6 +649,7 @@ static struct poptOption long_options[] = {
{"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 },
{"blocking-io", 0, POPT_ARG_VAL, &blocking_io, 1, 0, 0 },
{"no-blocking-io", 0, POPT_ARG_VAL, &blocking_io, 0, 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
{"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 },
{"server", 0, POPT_ARG_NONE, 0, OPT_SERVER, 0, 0 },
-@@ -1140,6 +1146,26 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1139,6 +1145,26 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
break;
case OPT_WRITE_BATCH:
/* batch_name is already set */
write_batch = 1;
-@@ -2069,6 +2095,16 @@ void server_options(char **args, int *argc_p)
+@@ -2068,6 +2094,16 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
--out-format=FORMAT output updates using the specified FORMAT
--log-file=FILE log what we're doing to the specified FILE
--log-file-format=FMT log updates using the specified FMT
-@@ -1037,16 +1038,16 @@ This is a good way to backup data without using a super-user, and to store
+@@ -1073,16 +1074,16 @@ This is a good way to backup data without using a super-user, and to store
ACLs from incompatible systems.
The bf(--fake-super) option only affects the side where the option is used.
This option is overridden by both bf(--super) and bf(--no-super).
-@@ -1312,6 +1313,36 @@ machine for use with the bf(--relative) option. For instance:
+@@ -1348,6 +1349,36 @@ machine for use with the bf(--relative) option. For instance:
quote(tt( rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/))
dit(bf(-C, --cvs-exclude)) This is a useful shorthand for excluding a
broad range of files that you often don't want to transfer between
systems. It uses a similar algorithm to CVS to determine if
-@@ -1789,7 +1820,7 @@ option if you wish to override this.
+@@ -1825,7 +1856,7 @@ option if you wish to override this.
Here's a example command that requests the remote side to log what is
happening:
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
extern struct stats stats;
extern char *filesfrom_host;
-@@ -1666,6 +1667,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1670,6 +1671,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
}
send_file_name(f, flist, fbuf, NULL, flags, filter_level);
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -108,6 +108,7 @@ int size_only = 0;
+@@ -107,6 +107,7 @@ int size_only = 0;
int daemon_bwlimit = 0;
int bwlimit = 0;
int fuzzy_basis = 0;
size_t bwlimit_writemax = 0;
int ignore_existing = 0;
int ignore_non_existing = 0;
-@@ -424,6 +425,7 @@ void usage(enum logcode F)
+@@ -423,6 +424,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," --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");
-@@ -604,6 +606,7 @@ static struct poptOption long_options[] = {
+@@ -603,6 +605,7 @@ static struct poptOption long_options[] = {
{"itemize-changes", 'i', POPT_ARG_NONE, 0, 'i', 0, 0 },
{"no-itemize-changes",0, POPT_ARG_VAL, &itemize_changes, 0, 0, 0 },
{"no-i", 0, POPT_ARG_VAL, &itemize_changes, 0, 0, 0 },
TODO: the configure changes should abort if the user requests --enable-slp
and we can't honor that request.
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
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
-@@ -1066,6 +1066,13 @@ int daemon_main(void)
+@@ -1071,6 +1071,13 @@ int daemon_main(void)
* address too. In fact, why not just do inet_ntop on the
* local address??? */
start_accept_loop(rsync_port, start_daemon);
return -1;
}
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
@@ -665,6 +665,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
-@@ -1123,6 +1123,18 @@ static int start_client(int argc, char *argv[])
+@@ -1127,6 +1127,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/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -224,6 +224,7 @@ static void print_rsync_version(enum logcode f)
+@@ -223,6 +223,7 @@ static void print_rsync_version(enum logcode f)
char const *links = "no ";
char const *iconv = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
#if SUBPROTOCOL_VERSION != 0
-@@ -257,6 +258,9 @@ static void print_rsync_version(enum logcode f)
+@@ -256,6 +257,9 @@ static void print_rsync_version(enum logcode f)
#if defined HAVE_LUTIMES && defined HAVE_UTIMES
symtimes = "";
#endif
rprintf(f, "%s version %s protocol version %d%s\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol);
-@@ -270,8 +274,8 @@ static void print_rsync_version(enum logcode f)
+@@ -269,8 +273,8 @@ static void print_rsync_version(enum logcode f)
(int)(sizeof (int64) * 8));
rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n",
got_socketpair, hardlinks, links, ipv6, have_inplace);
diff --git a/socket.c b/socket.c
--- a/socket.c
+++ b/socket.c
-@@ -530,6 +530,16 @@ void start_accept_loop(int port, int (*fn)(int, int))
+@@ -515,6 +515,16 @@ void start_accept_loop(int port, int (*fn)(int, int))
{
fd_set deffds;
int *sp, maxfd, i;
#ifdef HAVE_SIGACTION
sigact.sa_flags = SA_NOCLDSTOP;
-@@ -558,14 +568,25 @@ void start_accept_loop(int port, int (*fn)(int, int))
+@@ -543,14 +553,25 @@ void start_accept_loop(int port, int (*fn)(int, int))
maxfd = sp[i];
}
/* close log file before the potentially very long select so
* file can be trimmed by another process instead of growing
-@@ -578,7 +599,18 @@ void start_accept_loop(int port, int (*fn)(int, int))
+@@ -563,7 +584,18 @@ void start_accept_loop(int port, int (*fn)(int, int))
fds = deffds;
#endif
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/syscall.c b/syscall.c
--- a/syscall.c
+++ b/syscall.c
-- Matt McCutchen <hashproduct@gmail.com>
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
/**
* If 1, send the whole file as literal data rather than trying to
-@@ -367,6 +368,7 @@ void usage(enum logcode F)
+@@ -366,6 +367,7 @@ void usage(enum logcode F)
rprintf(F," --existing skip creating new files on receiver\n");
rprintf(F," --ignore-existing skip updating files that already exist on receiver\n");
rprintf(F," --remove-source-files sender removes synchronized files (non-dirs)\n");
rprintf(F," --del an alias for --delete-during\n");
rprintf(F," --delete delete extraneous files from destination dirs\n");
rprintf(F," --delete-before receiver deletes before transfer, not during\n");
-@@ -607,6 +609,7 @@ static struct poptOption long_options[] = {
+@@ -606,6 +608,7 @@ static struct poptOption long_options[] = {
{"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 },
{"no-bwlimit", 0, POPT_ARG_VAL, &bwlimit, 0, 0, 0 },
{"backup", 'b', POPT_ARG_VAL, &make_backups, 1, 0, 0 },
{"no-backup", 0, POPT_ARG_VAL, &make_backups, 0, 0, 0 },
{"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
{"suffix", 0, POPT_ARG_STRING, &backup_suffix, 0, 0, 0 },
-@@ -1973,6 +1976,8 @@ void server_options(char **args, int *argc_p)
+@@ -1972,6 +1975,8 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
--delete-before receiver deletes before transfer (default)
-@@ -1131,6 +1132,14 @@ dit(bf(--remove-source-files)) This tells rsync to remove from the sending
+@@ -1167,6 +1168,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.
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -105,6 +105,7 @@ int keep_partial = 0;
+@@ -104,6 +104,7 @@ int keep_partial = 0;
int safe_symlinks = 0;
int copy_unsafe_links = 0;
int size_only = 0;
int daemon_bwlimit = 0;
int bwlimit = 0;
int fuzzy_basis = 0;
-@@ -162,6 +163,8 @@ char *logfile_name = NULL;
+@@ -161,6 +162,8 @@ char *logfile_name = NULL;
char *logfile_format = NULL;
char *stdout_format = NULL;
char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
char backup_dir_buf[MAXPATHLEN];
-@@ -388,6 +391,7 @@ void usage(enum logcode F)
+@@ -387,6 +390,7 @@ void usage(enum logcode F)
rprintf(F," --contimeout=SECONDS set daemon connection timeout in seconds\n");
rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n");
rprintf(F," --size-only skip files that match in size\n");
rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n");
rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n");
rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n");
-@@ -427,6 +431,8 @@ void usage(enum logcode F)
+@@ -426,6 +430,8 @@ void usage(enum logcode F)
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");
rprintf(F," --protocol=NUM force an older protocol version to be used\n");
#ifdef ICONV_OPTION
rprintf(F," --iconv=CONVERT_SPEC request charset conversion of filenames\n");
-@@ -530,6 +536,7 @@ static struct poptOption long_options[] = {
+@@ -529,6 +535,7 @@ static struct poptOption long_options[] = {
{"chmod", 0, POPT_ARG_STRING, 0, OPT_CHMOD, 0, 0 },
{"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 },
{"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 },
+ {"times-only", 0, POPT_ARG_NONE, ×_only , 0, 0, 0 },
{"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 },
-@@ -645,6 +652,8 @@ static struct poptOption long_options[] = {
+ {"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
+ {"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
+@@ -644,6 +651,8 @@ static struct poptOption long_options[] = {
{"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 },
{"blocking-io", 0, POPT_ARG_VAL, &blocking_io, 1, 0, 0 },
{"no-blocking-io", 0, POPT_ARG_VAL, &blocking_io, 0, 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
{"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 },
{"server", 0, POPT_ARG_NONE, 0, OPT_SERVER, 0, 0 },
-@@ -1640,6 +1649,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1639,6 +1648,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
if (files_from) {
char *h, *p;
int q;
-@@ -1975,6 +1994,25 @@ void server_options(char **args, int *argc_p)
+@@ -1974,6 +1993,25 @@ void server_options(char **args, int *argc_p)
}
}
extern char *tmpdir;
+extern char *dest_filter;
extern char *partial_dir;
- extern char *basis_dir[];
+ extern char *basis_dir[MAX_BASIS_DIRS+1];
extern struct file_list *cur_flist, *first_flist, *dir_flist;
@@ -441,6 +442,8 @@ int recv_files(int f_in, char *local_name)
const char *parent_dirname = "";
--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)
-@@ -2084,6 +2087,33 @@ file previously generated by bf(--write-batch).
+@@ -2120,6 +2123,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.
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/fileio.c b/fileio.c
--- a/fileio.c
+++ b/fileio.c
int do_compression = 0;
int def_compress_level = Z_DEFAULT_COMPRESSION;
int am_root = 0; /* 0 = normal, 1 = root, 2 = --super, -1 = --fake-super */
-@@ -358,6 +359,7 @@ void usage(enum logcode F)
+@@ -357,6 +358,7 @@ void usage(enum logcode F)
rprintf(F," --fake-super store/recover privileged attrs using xattrs\n");
#endif
rprintf(F," -S, --sparse handle sparse files efficiently\n");
rprintf(F," -n, --dry-run perform a trial run with no changes made\n");
rprintf(F," -W, --whole-file copy files whole (without delta-xfer algorithm)\n");
rprintf(F," -x, --one-file-system don't cross filesystem boundaries\n");
-@@ -542,6 +544,7 @@ static struct poptOption long_options[] = {
+@@ -541,6 +543,7 @@ static struct poptOption long_options[] = {
{"sparse", 'S', POPT_ARG_VAL, &sparse_files, 1, 0, 0 },
{"no-sparse", 0, POPT_ARG_VAL, &sparse_files, 0, 0, 0 },
{"no-S", 0, POPT_ARG_VAL, &sparse_files, 0, 0, 0 },
{"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 },
-@@ -1907,6 +1910,12 @@ void server_options(char **args, int *argc_p)
+@@ -1906,6 +1909,12 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
-n, --dry-run perform a trial run with no changes made
-W, --whole-file copy files whole (w/o delta-xfer algorithm)
-x, --one-file-system don't cross filesystem boundaries
-@@ -1060,6 +1061,15 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
+@@ -1096,6 +1097,15 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
filesystem. It seems to have problems seeking over null regions,
and ends up corrupting the files.
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -203,6 +203,7 @@ static int refused_delete, refused_archive_part, refused_compress;
+@@ -202,6 +202,7 @@ static int refused_delete, refused_archive_part, refused_compress;
static int refused_partial, refused_progress, refused_delete_before;
static int refused_delete_during;
static int refused_inplace, refused_no_iconv;
static char *max_size_arg, *min_size_arg;
static char tmp_partialdir[] = ".~tmp~";
-@@ -424,6 +425,7 @@ void usage(enum logcode F)
+@@ -423,6 +424,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," --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");
-@@ -645,6 +647,7 @@ static struct poptOption long_options[] = {
+@@ -644,6 +646,7 @@ static struct poptOption long_options[] = {
{"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 },
{"blocking-io", 0, POPT_ARG_VAL, &blocking_io, 1, 0, 0 },
{"no-blocking-io", 0, POPT_ARG_VAL, &blocking_io, 0, 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
{"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 },
{"server", 0, POPT_ARG_NONE, 0, OPT_SERVER, 0, 0 },
-@@ -1275,6 +1278,13 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1274,6 +1277,13 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/io.c b/io.c
--- a/io.c
+++ b/io.c
-@@ -54,6 +54,7 @@ extern int protocol_version;
+@@ -53,6 +53,7 @@ extern int protocol_version;
extern int remove_source_files;
extern int preserve_hard_links;
extern struct stats stats;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -112,6 +112,7 @@ size_t bwlimit_writemax = 0;
+@@ -111,6 +111,7 @@ size_t bwlimit_writemax = 0;
int ignore_existing = 0;
int ignore_non_existing = 0;
int need_messages_from_generator = 0;
int max_delete = INT_MIN;
OFF_T max_size = 0;
OFF_T min_size = 0;
-@@ -424,6 +425,8 @@ void usage(enum logcode F)
+@@ -423,6 +424,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," --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");
-@@ -446,7 +449,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -445,7 +448,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_SERVER, OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -626,6 +629,8 @@ static struct poptOption long_options[] = {
+@@ -625,6 +628,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 },
-@@ -1260,6 +1265,36 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1259,6 +1264,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. */
-@@ -1919,6 +1954,15 @@ void server_options(char **args, int *argc_p)
+@@ -1918,6 +1953,15 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
--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
-@@ -2058,6 +2060,19 @@ transfer was too fast, it will wait before sending the next data block. The
+@@ -2094,6 +2096,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.
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
#define PTR_SIZE (sizeof (struct file_struct *))
int io_error;
-@@ -630,6 +633,24 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -632,6 +635,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(struct file_list *flist,
int xflags, int f)
{
-@@ -698,6 +719,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -700,6 +721,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
}
#endif
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -183,6 +183,8 @@ int logfile_format_has_i = 0;
+@@ -182,6 +182,8 @@ int logfile_format_has_i = 0;
int logfile_format_has_o_or_i = 0;
int always_checksum = 0;
int list_only = 0;
#define MAX_BATCH_NAME_LEN 256 /* Must be less than MAXPATHLEN-13 */
char *batch_name = NULL;
-@@ -431,6 +433,7 @@ void usage(enum logcode F)
+@@ -430,6 +432,7 @@ void usage(enum logcode F)
#ifdef ICONV_OPTION
rprintf(F," --iconv=CONVERT_SPEC request charset conversion of filenames\n");
#endif
rprintf(F," -4, --ipv4 prefer IPv4\n");
rprintf(F," -6, --ipv6 prefer IPv6\n");
rprintf(F," --version print version number\n");
-@@ -633,6 +636,7 @@ static struct poptOption long_options[] = {
+@@ -632,6 +635,7 @@ static struct poptOption long_options[] = {
{"iconv", 0, POPT_ARG_STRING, &iconv_opt, 0, 0, 0 },
{"no-iconv", 0, POPT_ARG_NONE, 0, OPT_NO_ICONV, 0, 0 },
#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 },
-@@ -1686,6 +1690,31 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1685,6 +1689,31 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
am_starting_up = 0;
return 1;
-@@ -2069,6 +2098,12 @@ void server_options(char **args, int *argc_p)
+@@ -2068,6 +2097,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
-@@ -2122,6 +2123,22 @@ daemon uses the charset specified in its "charset" configuration parameter
+@@ -2158,6 +2159,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: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/syscall.c b/syscall.c
--- a/syscall.c
+++ b/syscall.c
./configure (optional if already run)
make
-based-on: 54f00c3f89fc147f2f9cba89d26a5bb1d20e783b
+based-on: c463617443f999befe1b20cc5b3ffb484dee025b
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
extern char curr_dir[MAXPATHLEN];
-@@ -777,7 +778,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -779,7 +780,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
uid = (uid_t)read_varint(f);
if (xflags & XMIT_USER_NAME_FOLLOWS)
uid = recv_user_name(f, uid);
uid = match_uid(uid);
}
}
-@@ -789,7 +790,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -791,7 +792,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
gid_flags = 0;
if (xflags & XMIT_GROUP_NAME_FOLLOWS)
gid = recv_group_name(f, gid, &gid_flags);
gid = match_gid(gid, &gid_flags);
}
}
-@@ -2309,8 +2310,13 @@ struct file_list *recv_file_list(int f)
+@@ -2313,8 +2314,13 @@ struct file_list *recv_file_list(int f)
int64 start_read;
int save_verbose = verbose;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -166,6 +166,8 @@ char *rsync_path = RSYNC_PATH;
+@@ -165,6 +165,8 @@ char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
char backup_dir_buf[MAXPATHLEN];
char *sockopts = NULL;
int rsync_port = 0;
int compare_dest = 0;
int copy_dest = 0;
-@@ -384,6 +386,9 @@ void usage(enum logcode F)
+@@ -383,6 +385,9 @@ void usage(enum logcode F)
rprintf(F," --delay-updates put all updated files into place at transfer's end\n");
rprintf(F," -m, --prune-empty-dirs prune empty directory chains from the file-list\n");
rprintf(F," --numeric-ids don't map uid/gid values by user/group name\n");
rprintf(F," --timeout=SECONDS set I/O timeout in seconds\n");
rprintf(F," --contimeout=SECONDS set daemon connection timeout in seconds\n");
rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n");
-@@ -446,7 +451,7 @@ enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -445,7 +450,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_SERVER, OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -622,6 +627,9 @@ static struct poptOption long_options[] = {
+@@ -621,6 +626,9 @@ static struct poptOption long_options[] = {
{"no-s", 0, POPT_ARG_VAL, &protect_args, 0, 0, 0},
{"numeric-ids", 0, POPT_ARG_VAL, &numeric_ids, 1, 0, 0 },
{"no-numeric-ids", 0, POPT_ARG_VAL, &numeric_ids, 0, 0, 0 },
{"timeout", 0, POPT_ARG_INT, &io_timeout, 0, 0, 0 },
{"no-timeout", 0, POPT_ARG_VAL, &io_timeout, 0, 0, 0 },
{"contimeout", 0, POPT_ARG_INT, &connect_timeout, 0, 0, 0 },
-@@ -1228,6 +1236,43 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1227,6 +1235,43 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
break;
case OPT_HELP:
usage(FINFO);
exit_cleanup(0);
-@@ -2013,6 +2058,18 @@ void server_options(char **args, int *argc_p)
+@@ -2012,6 +2057,18 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--use-qsort";
if (am_sender) {
--timeout=SECONDS set I/O timeout in seconds
--contimeout=SECONDS set daemon connection timeout in seconds
-I, --ignore-times don't skip files that match size and time
-@@ -1645,6 +1648,57 @@ from the source system is used instead. See also the comments on the
+@@ -1681,6 +1684,57 @@ from the source system is used instead. See also the comments on the
the chroot setting affects rsync's ability to look up the names of the
users and groups and what you can do about it.
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)
+@@ -193,13 +193,6 @@ void setup_protocol(int f_out,int f_in)
if (protocol_version < 30) {
if (append_mode == 1)
append_mode = 2;
@@ -647,7 +679,7 @@ void receive_xattr(struct file_struct *file, int f)
return;
}
-
+
- if ((count = read_varint(f)) != 0) {
+ if ((count = read_varint30(f)) != 0) {
(void)EXPAND_ITEM_LIST(&temp_xattr, rsync_xa, count);