./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/acls.c b/acls.c
--- a/acls.c
+++ b/acls.c
static int calc_sacl_entries(const rsync_acl *racl)
{
/* A System ACL always gets user/group/other permission entries. */
-@@ -579,6 +592,96 @@ int get_acl(const char *fname, stat_x *sxp)
+@@ -574,6 +587,94 @@ int get_acl(const char *fname, stat_x *sxp)
return 0;
}
+ do {
+ if (!racl) {
+ racl = new(rsync_acl);
-+ if (!racl)
-+ out_of_memory("send_acl");
+ *racl = empty_rsync_acl;
+ if (type == SMB_ACL_TYPE_ACCESS) {
+ rsync_acl_fake_perms(racl, sxp->st.st_mode);
/* === Send functions === */
/* Send the ida list over the file descriptor. */
-@@ -654,6 +757,11 @@ static void send_rsync_acl(int f, rsync_acl *racl, SMB_ACL_TYPE_T type,
+@@ -649,6 +750,11 @@ static void send_rsync_acl(int f, rsync_acl *racl, SMB_ACL_TYPE_T type,
* This also frees the ACL data. */
void send_acl(int f, stat_x *sxp)
{
if (!sxp->acc_acl) {
sxp->acc_acl = create_racl();
rsync_acl_fake_perms(sxp->acc_acl, sxp->st.st_mode);
-@@ -671,6 +779,160 @@ void send_acl(int f, stat_x *sxp)
+@@ -666,6 +772,159 @@ void send_acl(int f, stat_x *sxp)
}
}
+ sizeof (id_access), id_access_sorter);
+ }
+#endif
-+ if (!(racl->names.idas = new_array(id_access, temp_ida_list.count)))
-+ out_of_memory("unpack_smb_acl");
++ racl->names.idas = new_array(id_access, temp_ida_list.count);
+ memcpy(racl->names.idas, temp_ida_list.items,
+ temp_ida_list.count * sizeof (id_access));
+ } else
/* === Receive functions === */
static uint32 recv_acl_access(int f, uchar *name_follows_ptr)
-@@ -792,6 +1054,11 @@ static int recv_rsync_acl(int f, item_list *racl_list, SMB_ACL_TYPE_T type, mode
+@@ -782,6 +1041,11 @@ static int recv_rsync_acl(int f, item_list *racl_list, SMB_ACL_TYPE_T type, mode
/* Receive the ACL info the sender has included for this file-list entry. */
void receive_acl(int f, struct file_struct *file)
{
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -536,6 +536,13 @@ void setup_protocol(int f_out,int f_in)
+@@ -579,6 +579,13 @@ void setup_protocol(int f_out,int f_in)
protocol_version);
exit_cleanup(RERR_PROTOCOL);
}
Fix a bug that could lose some bits when stripping some (supposedly)
superfluous ACL info.
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
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: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
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
-@@ -966,7 +966,8 @@ static struct poptOption long_options[] = {
+@@ -971,7 +971,8 @@ static struct poptOption long_options[] = {
{"no-i", 0, POPT_ARG_VAL, &itemize_changes, 0, 0, 0 },
{"bwlimit", 0, POPT_ARG_STRING, &bwlimit_arg, OPT_BWLIMIT, 0, 0 },
{"no-bwlimit", 0, POPT_ARG_VAL, &bwlimit, 0, 0, 0 },
{"no-backup", 0, POPT_ARG_VAL, &make_backups, 0, 0, 0 },
{"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
{"suffix", 0, POPT_ARG_STRING, &backup_suffix, 0, 0, 0 },
-@@ -2726,6 +2727,10 @@ void server_options(char **args, int *argc_p)
+@@ -2727,6 +2728,10 @@ void server_options(char **args, int *argc_p)
}
if (am_sender) {
--backup-dir=DIR make backups into hierarchy based in DIR
--suffix=SUFFIX backup suffix (default ~ w/o --backup-dir)
--update, -u skip files that are newer on the receiver
-@@ -841,6 +842,13 @@ your home directory (remove the '=' for that).
+@@ -842,6 +843,13 @@ your home directory (remove the '=' for that).
trailing inclusion/exclusion of `*`, the auto-added rule would never be
reached).
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -157,10 +157,14 @@ int no_detach
+@@ -158,10 +158,14 @@ int no_detach
int write_batch = 0;
int read_batch = 0;
int backup_dir_len = 0;
char *tmpdir = NULL;
char *partial_dir = NULL;
char *basis_dir[MAX_BASIS_DIRS+1];
-@@ -173,7 +177,9 @@ char *password_file = NULL;
+@@ -174,7 +178,9 @@ char *password_file = NULL;
char *early_input_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
char *sockopts = NULL;
char *usermap = NULL;
char *groupmap = NULL;
-@@ -970,7 +976,9 @@ static struct poptOption long_options[] = {
+@@ -975,7 +981,9 @@ static struct poptOption long_options[] = {
{"backup-deleted", 0, POPT_ARG_VAL, &make_backups, 1, 0, 0 },
{"no-backup", 0, POPT_ARG_VAL, &make_backups, 0, 0, 0 },
{"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
{"list-only", 0, POPT_ARG_VAL, &list_only, 2, 0, 0 },
{"read-batch", 0, POPT_ARG_STRING, &batch_name, OPT_READ_BATCH, 0, 0 },
{"write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_WRITE_BATCH, 0, 0 },
-@@ -2190,6 +2198,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2191,6 +2199,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
tmpdir = sanitize_path(NULL, tmpdir, NULL, 0, SP_DEFAULT);
if (backup_dir)
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, SP_DEFAULT);
}
if (daemon_filter_list.head && !am_sender) {
filter_rule_list *elp = &daemon_filter_list;
-@@ -2211,6 +2221,14 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2212,6 +2222,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)
-@@ -2222,6 +2240,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2223,6 +2241,20 @@ int parse_arguments(int *argc_p, const char ***argv_p)
backup_suffix);
return 0;
}
if (backup_dir) {
size_t len;
make_backups = 1; /* --backup-dir implies --backup */
-@@ -2258,6 +2290,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2259,6 +2291,34 @@ int parse_arguments(int *argc_p, const char ***argv_p)
"P *%s", backup_suffix);
parse_filter_str(&filter_list, backup_dir_buf, rule_template(0), 0);
}
if (preserve_times) {
preserve_times = PRESERVE_FILE_TIMES;
-@@ -2701,6 +2761,10 @@ void server_options(char **args, int *argc_p)
+@@ -2702,6 +2762,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) {
-@@ -2709,6 +2773,14 @@ void server_options(char **args, int *argc_p)
+@@ -2710,6 +2774,14 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/errcode.h b/errcode.h
--- a/errcode.h
+++ b/errcode.h
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -208,8 +208,11 @@ static void wait_process_with_flush(pid_t pid, int *exit_code_ptr)
+@@ -209,8 +209,11 @@ static void wait_process_with_flush(pid_t pid, int *exit_code_ptr)
*exit_code_ptr = RERR_TERMINATED;
else
*exit_code_ptr = RERR_WAITCHILD;
}
void write_del_stats(int f)
-@@ -1592,6 +1595,14 @@ void remember_children(UNUSED(int val))
+@@ -1577,6 +1580,14 @@ void remember_children(UNUSED(int val))
break;
}
}
}
#endif
#ifndef HAVE_SIGACTION
-@@ -1647,6 +1658,12 @@ static void rsync_panic_handler(UNUSED(int whatsig))
+@@ -1632,6 +1643,12 @@ static void rsync_panic_handler(UNUSED(int whatsig))
}
#endif
int main(int argc,char *argv[])
{
-@@ -1671,6 +1688,11 @@ int main(int argc,char *argv[])
+@@ -1656,6 +1673,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
-@@ -526,7 +526,17 @@ int is_a_socket(int fd)
+@@ -522,7 +522,17 @@ int is_a_socket(int fd)
static void sigchld_handler(UNUSED(int val))
{
#ifdef WNOHANG
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
extern int io_timeout;
extern int no_detach;
extern int write_batch;
-@@ -1016,6 +1018,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -1015,6 +1017,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
} else if (am_root < 0) /* Treat --fake-super from client as --super. */
am_root = 2;
static void output_flist(struct file_list *flist);
void init_flist(void)
-@@ -326,6 +348,238 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -322,6 +344,235 @@ static void flist_done_allocating(struct file_list *flist)
flist->pool_boundary = ptr;
}
+{
+ int slot, slots = am_sender ? 1 : basis_dir_cnt + 1;
+
-+ if (!csum_cache) {
++ if (!csum_cache)
+ csum_cache = new_array0(struct csum_cache, slots);
-+ if (!csum_cache)
-+ out_of_memory("reset_checksum_cache");
-+ }
+
+ for (slot = 0; slot < slots; slot++) {
+ struct file_list *flist = csum_cache[slot].flist;
/* 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
-@@ -1154,7 +1408,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1150,7 +1401,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];
-@@ -1300,9 +1554,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1296,9 +1547,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
-@@ -1320,11 +1581,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1316,11 +1574,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
extra_len += EXTRA_LEN;
#endif
#if EXTRA_ROUNDING > 0
if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
-@@ -1411,8 +1669,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1405,8 +1660,14 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2633,7 +2897,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2621,7 +2882,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
/* The --relative option sends paths with a leading slash, so we need
* to specify the strip_root option here. We rejected leading slashes
* for a non-relative transfer in recv_file_entry(). */
if (protocol_version < 30) {
/* Recv the io_error flag */
-@@ -2884,7 +3148,7 @@ void flist_free(struct file_list *flist)
+@@ -2871,7 +3132,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;
-@@ -2935,7 +3199,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2922,7 +3183,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;
-@@ -2951,8 +3215,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2938,8 +3199,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);
-@@ -2974,7 +3238,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2961,7 +3222,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
}
flist->high = prev_i;
diff --git a/hlink.c b/hlink.c
--- a/hlink.c
+++ b/hlink.c
-@@ -408,7 +408,7 @@ int hard_link_check(struct file_struct *file, int ndx, char *fname,
+@@ -406,7 +406,7 @@ int hard_link_check(struct file_struct *file, int ndx, char *fname,
}
break;
}
diff --git a/loadparm.c b/loadparm.c
--- a/loadparm.c
+++ b/loadparm.c
-@@ -173,6 +173,7 @@ typedef struct {
+@@ -174,6 +174,7 @@ typedef struct {
BOOL temp_dir_EXP;
BOOL uid_EXP;
int max_connections;
int max_verbosity;
int syslog_facility;
-@@ -290,6 +291,7 @@ static const all_vars Defaults = {
+@@ -291,6 +292,7 @@ static const all_vars Defaults = {
/* temp_dir_EXP; */ False,
/* uid_EXP; */ False,
/* max_connections; */ 0,
/* max_verbosity; */ 1,
/* syslog_facility; */ LOG_DAEMON,
-@@ -392,6 +394,13 @@ static struct enum_list enum_facilities[] = {
+@@ -393,6 +395,13 @@ static struct enum_list enum_facilities[] = {
{ -1, NULL }
};
static struct parm_struct parm_table[] =
{
{"address", P_STRING, P_GLOBAL,&Vars.g.bind_address, NULL,0},
-@@ -407,6 +416,7 @@ static struct parm_struct parm_table[] =
+@@ -408,6 +417,7 @@ static struct parm_struct parm_table[] =
{"auth users", P_STRING, P_LOCAL, &Vars.l.auth_users, NULL,0},
{"charset", P_STRING, P_LOCAL, &Vars.l.charset, NULL,0},
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -118,6 +118,7 @@ size_t bwlimit_writemax = 0;
+@@ -119,6 +119,7 @@ size_t bwlimit_writemax = 0;
int ignore_existing = 0;
int ignore_non_existing = 0;
int need_messages_from_generator = 0;
int max_delete = INT_MIN;
OFF_T max_size = -1;
OFF_T min_size = -1;
-@@ -778,7 +779,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -782,7 +783,7 @@ enum {OPT_SERVER = 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_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT,
OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS,
OPT_REFUSED_BASE = 9000};
-@@ -929,6 +930,7 @@ static struct poptOption long_options[] = {
+@@ -934,6 +935,7 @@ static struct poptOption long_options[] = {
{"no-c", 0, POPT_ARG_VAL, &always_checksum, 0, 0, 0 },
{"checksum-choice", 0, POPT_ARG_STRING, &checksum_choice, 0, 0, 0 },
{"cc", 0, POPT_ARG_STRING, &checksum_choice, 0, 0, 0 },
{"block-size", 'B', POPT_ARG_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 },
-@@ -1768,6 +1770,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1757,6 +1759,23 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
break;
case OPT_INFO:
arg = poptGetOptArg(pc);
parse_output_words(info_words, info_levels, arg, USER_PRIORITY);
-@@ -2042,6 +2061,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2043,6 +2062,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
#endif
--archive, -a archive mode; equals -rlptgoD (no -H,-A,-X)
--no-OPTION turn off an implied OPTION (e.g. --no-D)
--recursive, -r recurse into directories
-@@ -683,6 +684,8 @@ your home directory (remove the '=' for that).
+@@ -684,6 +685,8 @@ your home directory (remove the '=' for that).
file that has the same size as the corresponding sender's file: files with
either a changed size or a changed checksum are selected for transfer.
Note that rsync always verifies that each _transferred_ file was correctly
reconstructed on the receiving side by checking a whole-file checksum that
is generated as the file is transferred, but that automatic
-@@ -693,6 +696,38 @@ your home directory (remove the '=' for that).
+@@ -694,6 +697,38 @@ your home directory (remove the '=' for that).
can be overridden using either the `--checksum-choice` option or an
environment variable that is discussed in that option's section.
} *csum_cache = NULL;
static void flist_sort_and_clean(struct file_list *flist, int flags);
-@@ -348,7 +357,79 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -344,7 +353,79 @@ static void flist_done_allocating(struct file_list *flist)
flist->pool_boundary = ptr;
}
{
int slot, slots = am_sender ? 1 : basis_dir_cnt + 1;
-@@ -362,6 +443,9 @@ void reset_checksum_cache()
+@@ -355,6 +436,9 @@ void reset_checksum_cache()
struct file_list *flist = csum_cache[slot].flist;
if (flist) {
/* Reset the pool memory and empty the file-list array. */
pool_free_old(flist->file_pool,
pool_boundary(flist->file_pool, 0));
-@@ -372,6 +456,10 @@ void reset_checksum_cache()
+@@ -365,6 +449,10 @@ void reset_checksum_cache()
flist->low = 0;
flist->high = -1;
flist->next = NULL;
}
}
-@@ -379,7 +467,7 @@ void reset_checksum_cache()
+@@ -372,7 +460,7 @@ void reset_checksum_cache()
static int add_checksum(struct file_list *flist, const char *dirname,
const char *basename, int basename_len, OFF_T file_length,
time_t mtime, uint32 ctime, uint32 inode,
{
struct file_struct *file;
int alloc_len, extra_len;
-@@ -396,7 +484,7 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -389,7 +477,7 @@ static int add_checksum(struct file_list *flist, const char *dirname,
if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
extra_len = (extra_len | (EXTRA_ROUNDING * EXTRA_LEN)) + EXTRA_LEN;
#endif
bp = pool_alloc(flist->file_pool, alloc_len, "add_checksum");
memset(bp, 0, extra_len + FILE_STRUCT_LEN);
-@@ -405,7 +493,14 @@ static int add_checksum(struct file_list *flist, const char *dirname,
+@@ -398,7 +486,14 @@ static int add_checksum(struct file_list *flist, const char *dirname,
bp += FILE_STRUCT_LEN;
memcpy(bp, basename, basename_len);
file->mode = S_IFREG;
file->modtime = mtime;
file->len32 = (uint32)file_length;
-@@ -434,10 +529,11 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -427,10 +522,11 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
char line[MAXPATHLEN+1024], fbuf[MAXPATHLEN], sum[MAX_DIGEST_LEN];
FILE *fp;
char *cp;
int dlen = dirname ? strlcpy(fbuf, dirname, sizeof fbuf) : 0;
if (dlen >= (int)(sizeof fbuf - 1 - RSYNCSUMS_LEN))
-@@ -458,7 +554,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -451,7 +547,7 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
while (fgets(line, sizeof line, fp)) {
cp = line;
if (checksum_type == 5) {
if (*cp == '=')
while (*++cp == '=') {}
else
-@@ -469,7 +565,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -462,7 +558,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
}
if (*cp == '=') {
} else {
for (i = 0; i < flist_csum_len*2; i++, cp++) {
int x;
-@@ -487,13 +590,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -480,13 +583,14 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
else
sum[i/2] = x << 4;
}
if (*cp == '=')
while (*++cp == '=') {}
else
-@@ -543,24 +647,112 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
+@@ -536,24 +640,112 @@ static void read_checksums(int slot, struct file_list *flist, const char *dirnam
continue;
strlcpy(fbuf+dlen, cp, sizeof fbuf - dlen);
read_checksums(slot, flist, file->dirname);
}
-@@ -572,12 +764,31 @@ void get_cached_checksum(int slot, const char *fname, struct file_struct *file,
+@@ -565,12 +757,31 @@ void get_cached_checksum(int slot, const char *fname, struct file_struct *file,
&& (checksum_files & CSF_LAX
|| (F_CTIME(fp) == (uint32)stp->st_ctime
&& F_INODE(fp) == (uint32)stp->st_ino))) {
}
/* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
-@@ -1509,6 +1720,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1502,6 +1713,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;
}
-@@ -1555,13 +1768,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1548,13 +1761,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' */
-@@ -1671,7 +1884,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1662,7 +1875,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
if (flist && checksum_files)
else
file_checksum(thisname, &st, tmp_sum);
if (sender_keeps_checksum)
-@@ -2064,6 +2277,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -2054,6 +2267,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". */
-@@ -2733,6 +2949,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2719,6 +2935,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
}
if (itemizing)
itemize(fnamecmp, file, ndx, statret, &sx, 0, 0, NULL);
#ifdef SUPPORT_HARD_LINKS
-@@ -2279,6 +2284,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2277,6 +2282,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];
-@@ -2373,6 +2379,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2371,6 +2377,9 @@ void generate_files(int f_out, const char *local_name)
wait_for_receiver();
}
diff --git a/loadparm.c b/loadparm.c
--- a/loadparm.c
+++ b/loadparm.c
-@@ -398,6 +398,10 @@ static struct enum_list enum_csum_modes[] = {
+@@ -399,6 +399,10 @@ static struct enum_list enum_csum_modes[] = {
{ CSF_IGNORE_FILES, "none" },
{ CSF_LAX_MODE, "lax" },
{ CSF_STRICT_MODE, "strict" },
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -1772,7 +1772,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1761,7 +1761,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
case OPT_SUMFILES:
arg = poptGetOptArg(pc);
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -707,9 +707,13 @@ your home directory (remove the '=' for that).
+@@ -708,9 +708,13 @@ your home directory (remove the '=' for that).
The MODE value is either "lax", for relaxed checking (which compares size
and mtime), "strict" (which also compares ctime and inode), or "none" to
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1321,7 +1321,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1317,7 +1317,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
#endif
if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
typedef struct {
char *datum, *name;
-@@ -264,7 +270,9 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+@@ -259,7 +265,9 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
|| (am_root < 0
&& (strcmp(name+RPRE_LEN+1, XSTAT_SUFFIX) == 0
|| strcmp(name+RPRE_LEN+1, XACC_ACL_SUFFIX) == 0
continue;
}
-@@ -1130,6 +1138,38 @@ int del_def_xattr_acl(const char *fname)
+@@ -1118,6 +1126,38 @@ int del_def_xattr_acl(const char *fname)
}
#endif
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
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
-@@ -779,7 +779,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -783,7 +783,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG,
OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS,
OPT_REFUSED_BASE = 9000};
-@@ -933,6 +933,7 @@ static struct poptOption long_options[] = {
+@@ -938,6 +938,7 @@ static struct poptOption long_options[] = {
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
{"fuzzy", 'y', POPT_ARG_NONE, 0, 'y', 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -1193,6 +1194,9 @@ static void set_refuse_options(void)
+@@ -1198,6 +1199,9 @@ static void set_refuse_options(void)
#ifndef SUPPORT_HARD_LINKS
parse_one_refuse_match(0, "link-dest", list_end);
#endif
#ifndef ICONV_OPTION
parse_one_refuse_match(0, "iconv", list_end);
#endif
-@@ -1356,6 +1360,8 @@ char *alt_dest_opt(int type)
+@@ -1363,6 +1367,8 @@ char *alt_dest_opt(int type)
return "--copy-dest";
case LINK_DEST:
return "--link-dest";
default:
assert(0);
}
-@@ -1731,6 +1737,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1720,6 +1726,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
want_dest_type = LINK_DEST;
goto set_dest_dir;
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -421,6 +421,7 @@ detailed description below for a complete description.
+@@ -422,6 +422,7 @@ detailed description below for a complete description.
--compare-dest=DIR also compare destination files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
--compress, -z compress file data during the transfer
--compress-choice=STR choose the compression algorithm (aka --zc)
--compress-level=NUM explicitly set compression level (aka --zl)
-@@ -2254,6 +2255,17 @@ your home directory (remove the '=' for that).
+@@ -2282,6 +2283,17 @@ your home directory (remove the '=' for that).
specified (or implied by `-a`). You can work-around this bug by avoiding
the `-o` option when sending to an old rsync.
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/loadparm.c b/loadparm.c
--- a/loadparm.c
+++ b/loadparm.c
-@@ -119,6 +119,7 @@ typedef struct {
+@@ -120,6 +120,7 @@ typedef struct {
char *auth_users;
char *charset;
char *comment;
char *dont_compress;
char *early_exec;
char *exclude;
-@@ -148,6 +149,7 @@ typedef struct {
+@@ -149,6 +150,7 @@ typedef struct {
BOOL auth_users_EXP;
BOOL charset_EXP;
BOOL comment_EXP;
BOOL dont_compress_EXP;
BOOL early_exec_EXP;
BOOL exclude_EXP;
-@@ -173,6 +175,7 @@ typedef struct {
+@@ -174,6 +176,7 @@ typedef struct {
BOOL temp_dir_EXP;
BOOL uid_EXP;
int max_connections;
int max_verbosity;
int syslog_facility;
-@@ -237,6 +240,7 @@ static const all_vars Defaults = {
+@@ -238,6 +241,7 @@ static const all_vars Defaults = {
/* auth_users; */ NULL,
/* charset; */ NULL,
/* comment; */ NULL,
/* dont_compress; */ DEFAULT_DONT_COMPRESS,
/* early_exec; */ NULL,
/* exclude; */ NULL,
-@@ -265,6 +269,7 @@ static const all_vars Defaults = {
+@@ -266,6 +270,7 @@ static const all_vars Defaults = {
/* auth_users_EXP; */ False,
/* charset_EXP; */ False,
/* comment_EXP; */ False,
/* dont_compress_EXP; */ False,
/* early_exec_EXP; */ False,
/* exclude_EXP; */ False,
-@@ -290,6 +295,7 @@ static const all_vars Defaults = {
+@@ -291,6 +296,7 @@ static const all_vars Defaults = {
/* temp_dir_EXP; */ False,
/* uid_EXP; */ False,
/* max_connections; */ 0,
/* max_verbosity; */ 1,
/* syslog_facility; */ LOG_DAEMON,
-@@ -408,6 +414,8 @@ static struct parm_struct parm_table[] =
+@@ -409,6 +415,8 @@ static struct parm_struct parm_table[] =
{"auth users", P_STRING, P_LOCAL, &Vars.l.auth_users, NULL,0},
{"charset", P_STRING, P_LOCAL, &Vars.l.charset, NULL,0},
{"comment", P_STRING, P_LOCAL, &Vars.l.comment, NULL,0},
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -74,6 +74,8 @@ int delete_during = 0;
+@@ -75,6 +75,8 @@ int delete_during = 0;
int delete_before = 0;
int delete_after = 0;
int delete_excluded = 0;
int remove_source_files = 0;
int one_file_system = 0;
int protocol_version = PROTOCOL_VERSION;
-@@ -1011,6 +1013,8 @@ static struct poptOption long_options[] = {
+@@ -1016,6 +1018,8 @@ static struct poptOption long_options[] = {
{"outbuf", 0, POPT_ARG_STRING, &outbuf_mode, 0, 0, 0 },
{"remote-option", 'M', POPT_ARG_STRING, 0, 'M', 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -440,6 +440,8 @@ detailed description below for a complete description.
+@@ -441,6 +441,8 @@ detailed description below for a complete description.
--address=ADDRESS bind address for outgoing socket to daemon
--port=PORT specify double-colon alternate port number
--sockopts=OPTIONS specify custom TCP options
diff --git a/socket.c b/socket.c
--- a/socket.c
+++ b/socket.c
-@@ -39,6 +39,8 @@ extern char *sockopts;
+@@ -40,6 +40,8 @@ extern char *sockopts;
extern int default_af_hint;
extern int connect_timeout;
extern int pid_file_fd;
#ifdef HAVE_SIGACTION
static struct sigaction sigact;
-@@ -165,6 +167,37 @@ static void contimeout_handler(UNUSED(int val))
+@@ -166,6 +168,37 @@ static void contimeout_handler(UNUSED(int val))
connect_timeout = -1;
}
/* Open a socket to a tcp remote host with the specified port.
*
* Based on code from Warren. Proxy support by Stephen Rothwell.
-@@ -273,6 +306,7 @@ int open_socket_out(char *host, int port, const char *bind_addr, int af_hint)
+@@ -272,6 +305,7 @@ int open_socket_out(char *host, int port, const char *bind_addr, int af_hint)
alarm(connect_timeout);
}
set_socket_options(s, sockopts);
while (connect(s, res->ai_addr, res->ai_addrlen) < 0) {
if (connect_timeout < 0)
-@@ -444,6 +478,7 @@ static int *open_socket_in(int type, int port, const char *bind_addr,
+@@ -440,6 +474,7 @@ static int *open_socket_in(int type, int port, const char *bind_addr,
continue;
}
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
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
-@@ -50,6 +50,7 @@ int append_mode = 0;
+@@ -51,6 +51,7 @@ int append_mode = 0;
int keep_dirlinks = 0;
int copy_dirlinks = 0;
int copy_links = 0;
int write_devices = 0;
int preserve_links = 0;
int preserve_hard_links = 0;
-@@ -853,6 +854,7 @@ static struct poptOption long_options[] = {
+@@ -857,6 +858,7 @@ static struct poptOption long_options[] = {
{"no-D", 0, POPT_ARG_NONE, 0, OPT_NO_D, 0, 0 },
{"devices", 0, POPT_ARG_VAL, &preserve_devices, 1, 0, 0 },
{"no-devices", 0, POPT_ARG_VAL, &preserve_devices, 0, 0, 0 },
{"write-devices", 0, POPT_ARG_VAL, &write_devices, 1, 0, 0 },
{"no-write-devices", 0, POPT_ARG_VAL, &write_devices, 0, 0, 0 },
{"specials", 0, POPT_ARG_VAL, &preserve_specials, 1, 0, 0 },
-@@ -1149,6 +1151,7 @@ static void set_refuse_options(void)
+@@ -1154,6 +1156,7 @@ static void set_refuse_options(void)
|| strcmp("iconv", longName) == 0
|| strcmp("no-iconv", longName) == 0
|| strcmp("checksum-seed", longName) == 0
|| strcmp("write-devices", longName) == 0 /* disable wild-match (it gets refused below) */
|| strcmp("log-format", longName) == 0 /* aka out-format (NOT log-file-format) */
|| strcmp("sender", longName) == 0
-@@ -1160,6 +1163,7 @@ static void set_refuse_options(void)
+@@ -1165,6 +1168,7 @@ static void set_refuse_options(void)
assert(list_end != NULL);
if (am_daemon) { /* Refused by default, but can be accepted via a negated exact match. */
parse_one_refuse_match(0, "write-devices", list_end);
}
-@@ -2890,6 +2894,9 @@ void server_options(char **args, int *argc_p)
+@@ -2896,6 +2900,9 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
diff --git a/sender.c b/sender.c
--- a/sender.c
+++ b/sender.c
-@@ -366,6 +366,9 @@ void send_files(int f_in, int f_out)
+@@ -362,6 +362,9 @@ void send_files(int f_in, int f_out)
exit_cleanup(RERR_FILEIO);
}
int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
int sender_symlink_iconv = 0; /* sender should convert symlink content */
-@@ -462,6 +463,8 @@ void setup_protocol(int f_out,int f_in)
+@@ -505,6 +506,8 @@ void setup_protocol(int f_out,int f_in)
* aligned for direct int64-pointer memory access. */
if (preserve_atimes)
atimes_ndx = (file_extra_cnt += EXTRA64_CNT);
if (am_sender) /* This is most likely in the in64 union as well. */
pathname_ndx = (file_extra_cnt += PTR_EXTRA_CNT);
else
-@@ -627,6 +630,10 @@ void setup_protocol(int f_out,int f_in)
+@@ -670,6 +673,10 @@ void setup_protocol(int f_out,int f_in)
want_xattr_optim = protocol_version >= 31 && !(compat_flags & CF_AVOID_XATTR_OPTIM);
proper_seed_order = compat_flags & CF_CHKSUM_SEED_FIX ? 1 : 0;
xfer_flags_as_varint = compat_flags & CF_VARINT_FLIST_FLAGS ? 1 : 0;
extern int relative_paths;
extern int implied_dirs;
extern int ignore_perishable;
-@@ -382,6 +383,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -378,6 +379,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
int ndx, int first_ndx)
{
static time_t modtime, atime;
static mode_t mode;
#ifdef SUPPORT_FILEFLAGS
static uint32 fileflags;
-@@ -498,6 +502,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -494,6 +498,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
else
atime = F_ATIME(file);
}
#ifdef SUPPORT_HARD_LINKS
if (tmp_dev != -1) {
-@@ -585,6 +596,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -581,6 +592,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
}
if (xflags & XMIT_MOD_NSEC)
write_varint(f, F_MOD_NSEC(file));
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
#ifdef SUPPORT_FILEFLAGS
-@@ -681,6 +696,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -677,6 +692,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags)
{
static int64 modtime, atime;
static mode_t mode;
#ifdef SUPPORT_FILEFLAGS
static uint32 fileflags;
-@@ -794,6 +812,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -790,6 +808,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
mode = first->mode;
if (atimes_ndx && !S_ISDIR(mode))
atime = F_ATIME(first);
#ifdef SUPPORT_FILEFLAGS
if (preserve_fileflags)
fileflags = F_FFLAGS(first);
-@@ -834,6 +856,21 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -830,6 +852,21 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
modtime_nsec = read_varint(f);
else
modtime_nsec = 0;
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
if (atimes_ndx && !S_ISDIR(mode) && !(xflags & XMIT_SAME_ATIME)) {
-@@ -1023,6 +1060,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -1019,6 +1056,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
}
if (atimes_ndx && !S_ISDIR(mode))
F_ATIME(file) = atime;
if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
-@@ -1426,6 +1467,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1420,6 +1461,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
file->flags |= FLAG_OWNED_BY_US;
if (atimes_ndx && !S_ISDIR(file->mode))
F_ATIME(file) = st.st_atime;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -64,6 +64,7 @@ int preserve_uid = 0;
+@@ -65,6 +65,7 @@ int preserve_uid = 0;
int preserve_gid = 0;
int preserve_times = 0;
int preserve_atimes = 0;
int update_only = 0;
int open_noatime = 0;
int cvs_exclude = 0;
-@@ -664,6 +665,11 @@ static void print_capabilities(enum logcode f)
+@@ -668,6 +669,11 @@ static void print_capabilities(enum logcode f)
#endif
"file-flags",
"*" /* All options after this point are hidden w/o -V -V */
#ifndef HAVE_SIMD
"no "
-@@ -842,6 +848,9 @@ static struct poptOption long_options[] = {
+@@ -846,6 +852,9 @@ static struct poptOption long_options[] = {
{"no-U", 0, POPT_ARG_VAL, &preserve_atimes, 0, 0, 0 },
{"open-noatime", 0, POPT_ARG_VAL, &open_noatime, 1, 0, 0 },
{"no-open-noatime", 0, POPT_ARG_VAL, &open_noatime, 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 },
-@@ -1222,6 +1231,9 @@ static void set_refuse_options(void)
+@@ -1227,6 +1236,9 @@ static void set_refuse_options(void)
parse_one_refuse_match(0, "force-uchange", list_end);
parse_one_refuse_match(0, "force-schange", list_end);
#endif
/* Now we use the descrip values to actually mark the options for refusal. */
for (op = long_options; op != list_end; op++) {
-@@ -2569,6 +2581,10 @@ void server_options(char **args, int *argc_p)
+@@ -2570,6 +2582,10 @@ void server_options(char **args, int *argc_p)
if (preserve_atimes > 1)
argstr[x++] = 'U';
}
--omit-dir-times, -O omit directories from --times
--omit-link-times, -J omit symlinks from --times
--super receiver attempts super-user activities
-@@ -1370,6 +1371,11 @@ your home directory (remove the '=' for that).
+@@ -1371,6 +1372,11 @@ your home directory (remove the '=' for that).
mounted to avoid updating the atime on read access even without the
O_NOATIME flag being set.
0. `--omit-dir-times`, `-O`
This tells rsync to omit directories when it is preserving modification
-@@ -2606,7 +2612,7 @@ your home directory (remove the '=' for that).
+@@ -2633,7 +2639,7 @@ your home directory (remove the '=' for that).
output of other verbose messages).
The "%i" escape has a cryptic output that is 11 letters long. The general
of update being done, **X** is replaced by the file-type, and the other
letters represent attributes that may be output if they are being modified.
-@@ -2663,6 +2669,8 @@ your home directory (remove the '=' for that).
+@@ -2690,6 +2696,8 @@ your home directory (remove the '=' for that).
happens when a symlink or directory is updated.
- The `a` means that the ACL information changed.
- The `x` means that the extended attribute information changed.
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
-@@ -264,6 +264,8 @@ static void add_rule(filter_rule_list *listp, const char *pat, unsigned int pat_
+@@ -263,6 +263,8 @@ static void add_rule(filter_rule_list *listp, const char *pat, unsigned int pat_
+ }
- if (!(lp = new_array0(filter_rule_list, 1)))
- out_of_memory("add_rule");
+ lp = new_array0(filter_rule_list, 1);
+ if (rule->rflags & FILTRULE_CVS_IGNORE)
+ cp = "CVS";
if (asprintf(&lp->debug_type, " [per-dir %s]", cp) < 0)
out_of_memory("add_rule");
rule->u.mergelist = lp;
-@@ -533,6 +535,14 @@ void *push_local_filters(const char *dir, unsigned int dirlen)
+@@ -526,6 +528,14 @@ void *push_local_filters(const char *dir, unsigned int dirlen)
set_filter_dir(dir, dirlen);
}
if (strlcpy(dirbuf + dirbuf_len, ex->pattern,
MAXPATHLEN - dirbuf_len) < MAXPATHLEN - dirbuf_len) {
parse_filter_file(lp, dirbuf, ex,
-@@ -1166,6 +1176,7 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
+@@ -1157,6 +1167,7 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
char line[BIGPATHBUFLEN];
char *eob = line + sizeof line - 1;
BOOL word_split = (template->rflags & FILTRULE_WORD_SPLIT) != 0;
if (!fname || !*fname)
return;
-@@ -1212,6 +1223,24 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
+@@ -1203,6 +1214,24 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
}
break;
}
if (word_split && isspace(ch))
break;
if (eol_nulls? !ch : (ch == '\n' || ch == '\r'))
-@@ -1221,13 +1250,14 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
+@@ -1212,13 +1241,14 @@ void parse_filter_file(filter_rule_list *listp, const char *fname, const filter_
else
overflow = 1;
}
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
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
-@@ -111,6 +111,7 @@ int safe_symlinks = 0;
+@@ -112,6 +112,7 @@ int safe_symlinks = 0;
int copy_unsafe_links = 0;
int munge_symlinks = 0;
int size_only = 0;
int daemon_bwlimit = 0;
int bwlimit = 0;
int fuzzy_basis = 0;
-@@ -880,6 +881,7 @@ static struct poptOption long_options[] = {
+@@ -884,6 +885,7 @@ static struct poptOption long_options[] = {
{"chmod", 0, POPT_ARG_STRING, 0, OPT_CHMOD, 0, 0 },
{"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 },
{"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 },
{"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 },
{"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
-@@ -2777,6 +2779,9 @@ void server_options(char **args, int *argc_p)
+@@ -2783,6 +2785,9 @@ void server_options(char **args, int *argc_p)
else if (missing_args == 1 && !am_sender)
args[ac++] = "--ignore-missing-args";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -415,6 +415,7 @@ detailed description below for a complete description.
+@@ -416,6 +416,7 @@ detailed description below for a complete description.
--contimeout=SECONDS set daemon connection timeout in seconds
--ignore-times, -I don't skip files that match size and time
--size-only skip files that match in size
--modify-window=NUM, -@ set the accuracy for mod-time comparisons
--temp-dir=DIR, -T create temporary files in directory DIR
--fuzzy, -y find similar file for basis if no dest file
-@@ -645,6 +646,14 @@ your home directory (remove the '=' for that).
+@@ -646,6 +647,14 @@ your home directory (remove the '=' for that).
after using another mirroring system which may not preserve timestamps
exactly.
./configure
make
-based-on: 89827e49bcc0296d93aab73a53bb8c7c88baf202
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
diff --git a/checksum.c b/checksum.c
--- a/checksum.c
+++ b/checksum.c
-@@ -36,6 +36,7 @@ extern int whole_file;
+@@ -40,6 +40,7 @@ extern int whole_file;
extern int checksum_seed;
extern int protocol_version;
extern int proper_seed_order;
extern const char *checksum_choice;
struct name_num_obj valid_checksums = {
-@@ -329,6 +330,8 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
+@@ -386,6 +387,8 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
MD5_Update(&m5, (uchar *)map_ptr(buf, i, remainder), remainder);
MD5_Final((uchar *)sum, &m5);
break;
}
case CSUM_MD4:
-@@ -368,6 +371,8 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
+@@ -425,6 +428,8 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
mdfour_update(&m, (uchar *)map_ptr(buf, i, remainder), remainder);
mdfour_result(&m, (uchar *)sum);
extern char *bind_address;
extern char *config_file;
extern char *logfile_format;
-@@ -810,6 +813,11 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -809,6 +812,11 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
log_init(1);
#ifdef HAVE_PUTENV
if ((*lp_early_exec(i) || *lp_prexfer_exec(i) || *lp_postxfer_exec(i))
&& !getenv("RSYNC_NO_XFER_EXEC")) {
-@@ -1004,6 +1012,8 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -1003,6 +1011,8 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
am_server = 1; /* Don't let someone try to be tricky. */
quiet = 0;
new file mode 100644
--- /dev/null
+++ b/db.c
-@@ -0,0 +1,1943 @@
+@@ -0,0 +1,1941 @@
+/*
+ * Routines to access extended file info via DB.
+ *
+ return NULL;
+ }
+
-+ if (!(n = (struct name_list *)malloc(sizeof (struct name_list) + len)))
-+ out_of_memory("new_name");
++ n = (struct name_list *)new_array(char, sizeof (struct name_list) + len);
+
+ memcpy(n->name, basename, blen);
+ if (filename) {
+ if (cnt) {
+ int j;
+
-+ if (!(sortbuf = new_array(struct name_list *, cnt)))
-+ out_of_memory("get_sorted_names");
++ sortbuf = new_array(struct name_list *, cnt);
+ for (j = 0; j < cnt; j++) {
+ sortbuf[j] = names;
+ names = names->next;
extern int eol_nulls;
extern int atimes_ndx;
extern int relative_paths;
-@@ -1320,11 +1321,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1316,11 +1317,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
extra_len += EXTRA_LEN;
#endif
#if EXTRA_ROUNDING > 0
if (extra_len & (EXTRA_ROUNDING * EXTRA_LEN))
-@@ -1411,8 +1409,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1405,8 +1403,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
return NULL;
}
if (unsort_ndx)
F_NDX(file) = stats.num_dirs;
-@@ -2101,6 +2103,9 @@ void send_extra_file_list(int f, int at_least)
+@@ -2091,6 +2093,9 @@ void send_extra_file_list(int f, int at_least)
finish:
if (io_error != save_io_error && protocol_version == 30 && !ignore_errors)
send_msg_int(MSG_IO_ERROR, io_error);
}
struct file_list *send_file_list(int f, int argc, char *argv[])
-@@ -2124,6 +2129,13 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2114,6 +2119,13 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
| (eol_nulls || reading_remotely ? RL_EOL_NULLS : 0);
int implied_dot_dir = 0;
rprintf(FLOG, "building file list\n");
if (show_filelist_progress)
start_filelist_progress("building file list");
-@@ -2469,6 +2481,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2458,6 +2470,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
rprintf(FINFO, "[%s] flist_eof=1\n", who_am_i());
}
return memcmp(sum, F_SUM(file), flist_csum_len) == 0;
}
-@@ -2241,6 +2243,13 @@ void generate_files(int f_out, const char *local_name)
+@@ -2239,6 +2241,13 @@ void generate_files(int f_out, const char *local_name)
: "enabled");
}
dflt_perms = (ACCESSPERMS & ~orig_umask);
do {
-@@ -2366,6 +2375,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2364,6 +2373,9 @@ void generate_files(int f_out, const char *local_name)
wait_for_receiver();
}
extern int io_error;
extern int batch_fd;
extern int eol_nulls;
-@@ -1486,6 +1488,32 @@ static void read_a_msg(void)
+@@ -1482,6 +1484,32 @@ static void read_a_msg(void)
if (am_sender)
maybe_send_keepalive(time(NULL), MSK_ALLOW_FLUSH);
break;
case MSG_DELETED:
if (msg_bytes >= sizeof data)
goto overflow;
-@@ -1637,6 +1665,7 @@ static void read_a_msg(void)
+@@ -1633,6 +1661,7 @@ static void read_a_msg(void)
* with a duplicate exit message. */
_exit_cleanup(val, __FILE__, 0 - __LINE__);
default:
diff --git a/loadparm.c b/loadparm.c
--- a/loadparm.c
+++ b/loadparm.c
-@@ -119,6 +119,7 @@ typedef struct {
+@@ -120,6 +120,7 @@ typedef struct {
char *auth_users;
char *charset;
char *comment;
char *dont_compress;
char *early_exec;
char *exclude;
-@@ -148,6 +149,7 @@ typedef struct {
+@@ -149,6 +150,7 @@ typedef struct {
BOOL auth_users_EXP;
BOOL charset_EXP;
BOOL comment_EXP;
BOOL dont_compress_EXP;
BOOL early_exec_EXP;
BOOL exclude_EXP;
-@@ -178,6 +180,7 @@ typedef struct {
+@@ -179,6 +181,7 @@ typedef struct {
int syslog_facility;
int timeout;
BOOL fake_super;
BOOL forward_lookup;
BOOL ignore_errors;
-@@ -237,6 +240,7 @@ static const all_vars Defaults = {
+@@ -238,6 +241,7 @@ static const all_vars Defaults = {
/* auth_users; */ NULL,
/* charset; */ NULL,
/* comment; */ NULL,
/* dont_compress; */ DEFAULT_DONT_COMPRESS,
/* early_exec; */ NULL,
/* exclude; */ NULL,
-@@ -265,6 +269,7 @@ static const all_vars Defaults = {
+@@ -266,6 +270,7 @@ static const all_vars Defaults = {
/* auth_users_EXP; */ False,
/* charset_EXP; */ False,
/* comment_EXP; */ False,
/* dont_compress_EXP; */ False,
/* early_exec_EXP; */ False,
/* exclude_EXP; */ False,
-@@ -295,6 +300,7 @@ static const all_vars Defaults = {
+@@ -296,6 +301,7 @@ static const all_vars Defaults = {
/* syslog_facility; */ LOG_DAEMON,
/* timeout; */ 0,
/* fake_super; */ False,
/* forward_lookup; */ True,
/* ignore_errors; */ False,
-@@ -408,6 +414,8 @@ static struct parm_struct parm_table[] =
+@@ -409,6 +415,8 @@ static struct parm_struct parm_table[] =
{"auth users", P_STRING, P_LOCAL, &Vars.l.auth_users, NULL,0},
{"charset", P_STRING, P_LOCAL, &Vars.l.charset, NULL,0},
{"comment", P_STRING, P_LOCAL, &Vars.l.comment, NULL,0},
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -35,6 +35,7 @@ extern int am_root;
+@@ -36,6 +36,7 @@ extern int am_root;
extern int am_server;
extern int am_sender;
extern int am_daemon;
extern int inc_recurse;
extern int blocking_io;
extern int always_checksum;
-@@ -53,6 +54,7 @@ extern int copy_unsafe_links;
+@@ -54,6 +55,7 @@ extern int copy_unsafe_links;
extern int keep_dirlinks;
extern int preserve_hard_links;
extern int protocol_version;
extern int file_total;
extern int recurse;
extern int xfer_dirs;
-@@ -88,6 +90,7 @@ extern char *logfile_format;
+@@ -89,6 +91,7 @@ extern char *logfile_format;
extern char *filesfrom_host;
extern char *partial_dir;
extern char *rsync_path;
extern char *shell_cmd;
extern char *password_file;
extern char *backup_dir;
-@@ -1205,6 +1208,9 @@ void start_server(int f_in, int f_out, int argc, char *argv[])
+@@ -1198,6 +1201,9 @@ void start_server(int f_in, int f_out, int argc, char *argv[])
if (am_daemon && io_timeout && protocol_version >= 31)
send_msg_int(MSG_IO_TIMEOUT, io_timeout);
if (am_sender) {
keep_dirlinks = 0; /* Must be disabled on the sender. */
if (need_messages_from_generator)
-@@ -1496,6 +1502,9 @@ static int start_client(int argc, char *argv[])
+@@ -1481,6 +1487,9 @@ static int start_client(int argc, char *argv[])
else
env_port = rsync_port;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -85,6 +85,7 @@ int am_root = 0; /* 0 = normal, 1 = root, 2 = --super, -1 = --fake-super */
+@@ -86,6 +86,7 @@ int am_root = 0; /* 0 = normal, 1 = root, 2 = --super, -1 = --fake-super */
int am_server = 0;
int am_sender = 0;
int am_starting_up = 1;
int relative_paths = -1;
int implied_dirs = 1;
int missing_args = 0; /* 0 = FERROR_XFER, 1 = ignore, 2 = delete */
-@@ -98,6 +99,7 @@ int use_qsort = 0;
+@@ -99,6 +100,7 @@ int use_qsort = 0;
char *files_from = NULL;
int filesfrom_fd = -1;
char *filesfrom_host = NULL;
int eol_nulls = 0;
int protect_args = -1;
int human_readable = 1;
-@@ -105,6 +107,9 @@ int recurse = 0;
+@@ -106,6 +108,9 @@ int recurse = 0;
int allow_inc_recurse = 1;
int xfer_dirs = -1;
int am_daemon = 0;
int connect_timeout = 0;
int keep_partial = 0;
int safe_symlinks = 0;
-@@ -282,6 +287,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
+@@ -287,6 +292,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
DEBUG_WORD(CHDIR, W_CLI|W_SRV, "Debug when the current directory changes"),
DEBUG_WORD(CONNECT, W_CLI, "Debug connection events (levels 1-2)"),
DEBUG_WORD(CMD, W_CLI, "Debug commands+options that are issued (levels 1-2)"),
DEBUG_WORD(DEL, W_REC, "Debug delete actions (levels 1-3)"),
DEBUG_WORD(DELTASUM, W_SND|W_REC, "Debug delta-transfer checksumming (levels 1-4)"),
DEBUG_WORD(DUP, W_REC, "Debug weeding of duplicate names"),
-@@ -657,6 +663,16 @@ static void print_capabilities(enum logcode f)
+@@ -661,6 +667,16 @@ static void print_capabilities(enum logcode f)
#endif
"prealloc",
"*" /* All options after this point are hidden w/o -V -V */
#ifndef HAVE_SIMD
"no "
-@@ -779,6 +795,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -783,6 +799,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG,
OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT,
OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS,
OPT_REFUSED_BASE = 9000};
-@@ -929,6 +946,10 @@ static struct poptOption long_options[] = {
+@@ -934,6 +951,10 @@ static struct poptOption long_options[] = {
{"no-c", 0, POPT_ARG_VAL, &always_checksum, 0, 0, 0 },
{"checksum-choice", 0, POPT_ARG_STRING, &checksum_choice, 0, 0, 0 },
{"cc", 0, POPT_ARG_STRING, &checksum_choice, 0, 0, 0 },
{"block-size", 'B', POPT_ARG_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 },
-@@ -1020,6 +1041,9 @@ static struct poptOption long_options[] = {
+@@ -1025,6 +1046,9 @@ static struct poptOption long_options[] = {
{"dparam", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
{"detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
{"no-detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
{0,0,0,0, 0, 0, 0}
};
-@@ -1060,6 +1084,39 @@ static struct poptOption long_daemon_options[] = {
+@@ -1065,6 +1089,39 @@ static struct poptOption long_daemon_options[] = {
{0,0,0,0, 0, 0, 0}
};
static char err_buf[200];
-@@ -1185,6 +1242,8 @@ static void set_refuse_options(void)
+@@ -1190,6 +1247,8 @@ static void set_refuse_options(void)
parse_one_refuse_match(0, "iconv", list_end);
#endif
parse_one_refuse_match(0, "log-file*", list_end);
}
#ifndef SUPPORT_ATIMES
-@@ -1326,6 +1385,102 @@ static void create_refuse_error(int which)
+@@ -1333,6 +1392,102 @@ static void create_refuse_error(int which)
snprintf(err_buf + n, sizeof err_buf - n, " (-%c)\n", op->shortName);
}
/* This is used to make sure that --daemon & --server cannot be aliased to
* something else. These options have always disabled popt aliases for the
* parsing of a daemon or server command-line, but we have to make sure that
-@@ -1382,6 +1537,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1389,6 +1544,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
return 0;
}
set_refuse_options();
#ifdef ICONV_OPTION
-@@ -1500,6 +1661,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1507,6 +1668,12 @@ int parse_arguments(int *argc_p, const char ***argv_p)
am_daemon = 1;
return 1;
case OPT_MODIFY_WINDOW:
/* The value has already been set by popt, but
* we need to remember that we're using a
-@@ -1574,6 +1741,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1579,6 +1746,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
preserve_devices = preserve_specials = 0;
break;
#define NDX_DONE -1
#define NDX_FLIST_EOF -2
#define NDX_DEL_STATS -3
-@@ -1347,7 +1351,8 @@ extern short info_levels[], debug_levels[];
+@@ -1353,7 +1357,8 @@ extern short info_levels[], debug_levels[];
#define DEBUG_CHDIR (DEBUG_BIND+1)
#define DEBUG_CONNECT (DEBUG_CHDIR+1)
#define DEBUG_CMD (DEBUG_CONNECT+1)
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -934,7 +934,9 @@ static struct poptOption long_options[] = {
+@@ -939,7 +939,9 @@ static struct poptOption long_options[] = {
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
{"fuzzy", 'y', POPT_ARG_NONE, 0, 'y', 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -2763,8 +2765,14 @@ void server_options(char **args, int *argc_p)
+@@ -2764,8 +2766,14 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -419,6 +419,8 @@ detailed description below for a complete description.
+@@ -420,6 +420,8 @@ detailed description below for a complete description.
--temp-dir=DIR, -T create temporary files in directory DIR
--fuzzy, -y find similar file for basis if no dest file
--detect-renamed try to find renamed files to speed the xfer
--compare-dest=DIR also compare destination files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
-@@ -2187,6 +2189,17 @@ your home directory (remove the '=' for that).
+@@ -2215,6 +2217,17 @@ your home directory (remove the '=' for that).
otential alternate-basis files will be removed as the transfer progresses.
This option conflicts with `--inplace` and `--append`.
a file that can't use it, while missing out on giving it to a file
that could use it.
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/backup.c b/backup.c
--- a/backup.c
+++ b/backup.c
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len, int flags);
-@@ -2635,6 +2677,25 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2623,6 +2665,23 @@ struct file_list *recv_file_list(int f, int dir_ndx)
* for a non-relative transfer in recv_file_entry(). */
flist_sort_and_clean(flist, relative_paths);
+ int j = flist->used;
+ the_fattr_list.used = j;
+ the_fattr_list.files = new_array(struct file_struct *, j);
-+ if (!the_fattr_list.files)
-+ out_of_memory("recv_file_list");
+ memcpy(the_fattr_list.files, flist->files,
+ j * sizeof (struct file_struct *));
+ qsort(the_fattr_list.files, j,
if (delete_before && !solo_file && cur_flist->used > 0)
do_delete_pass();
if (delete_during == 2) {
-@@ -2232,7 +2389,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2230,7 +2387,7 @@ void generate_files(int f_out, const char *local_name)
}
info_levels[INFO_FLIST] = info_levels[INFO_PROGRESS] = 0;
whole_file = 0;
if (DEBUG_GTE(FLIST, 1)) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -2268,7 +2425,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2266,7 +2423,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));
}
-@@ -2315,7 +2472,21 @@ void generate_files(int f_out, const char *local_name)
+@@ -2313,7 +2470,21 @@ void generate_files(int f_out, const char *local_name)
} while ((cur_flist = cur_flist->next) != NULL);
if (delete_during)
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -86,6 +86,7 @@ int am_server = 0;
+@@ -87,6 +87,7 @@ int am_server = 0;
int am_sender = 0;
int am_starting_up = 1;
int relative_paths = -1;
int implied_dirs = 1;
int missing_args = 0; /* 0 = FERROR_XFER, 1 = ignore, 2 = delete */
int numeric_ids = 0;
-@@ -933,6 +934,7 @@ static struct poptOption long_options[] = {
+@@ -938,6 +939,7 @@ static struct poptOption long_options[] = {
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
{"fuzzy", 'y', POPT_ARG_NONE, 0, 'y', 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -2349,7 +2351,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2350,7 +2352,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
inplace = 1;
}
partial_dir = tmp_partialdir;
if (inplace) {
-@@ -2358,6 +2360,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2359,6 +2361,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;
}
-@@ -2760,6 +2763,8 @@ void server_options(char **args, int *argc_p)
+@@ -2761,6 +2764,8 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -418,6 +418,7 @@ detailed description below for a complete description.
+@@ -419,6 +419,7 @@ detailed description below for a complete description.
--modify-window=NUM, -@ set the accuracy for mod-time comparisons
--temp-dir=DIR, -T create temporary files in directory DIR
--fuzzy, -y find similar file for basis if no dest file
--compare-dest=DIR also compare destination files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
-@@ -2170,6 +2171,22 @@ your home directory (remove the '=' for that).
+@@ -2198,6 +2199,22 @@ your home directory (remove the '=' for that).
fuzzy-match files, so either use `--delete-after` or specify some filename
exclusions if you need to prevent this.
ret = -ret - 1;
else
ret++;
-@@ -1171,6 +1171,32 @@ char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr)
+@@ -1162,6 +1162,32 @@ char *normalize_path(char *path, BOOL force_newbuf, unsigned int *len_ptr)
return path;
}
/**
* Return a quoted string with the full pathname of the indicated filename.
* The string " (in MODNAME)" may also be appended. The returned pointer
-@@ -1264,7 +1290,7 @@ int handle_partial_dir(const char *fname, int create)
+@@ -1255,7 +1281,7 @@ int handle_partial_dir(const char *fname, int create)
}
statret = -1;
}
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -24,6 +24,7 @@
+@@ -25,6 +25,7 @@
#include "latest-year.h"
#include <popt.h>
extern int module_id;
extern int local_server;
extern int sanitize_paths;
-@@ -954,6 +955,8 @@ static struct poptOption long_options[] = {
+@@ -959,6 +960,8 @@ static struct poptOption long_options[] = {
{"partial-dir", 0, POPT_ARG_STRING, &partial_dir, 0, 0, 0 },
{"delay-updates", 0, POPT_ARG_VAL, &delay_updates, 1, 0, 0 },
{"no-delay-updates", 0, POPT_ARG_VAL, &delay_updates, 0, 0, 0 },
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -406,6 +406,7 @@ detailed description below for a complete description.
+@@ -407,6 +407,7 @@ detailed description below for a complete description.
--partial keep partially transferred files
--partial-dir=DIR put a partially transferred file into DIR
--delay-updates put all updated files into place at end
--prune-empty-dirs, -m prune empty directory chains from file-list
--numeric-ids don't map uid/gid values by user/group name
--usermap=STRING custom username mapping
-@@ -2882,6 +2883,16 @@ your home directory (remove the '=' for that).
+@@ -2909,6 +2910,16 @@ your home directory (remove the '=' for that).
update algorithm that is even more atomic (it uses `--link-dest` and a
parallel hierarchy of files).
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
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
-@@ -63,6 +63,7 @@ int preserve_uid = 0;
+@@ -64,6 +64,7 @@ int preserve_uid = 0;
int preserve_gid = 0;
int preserve_times = 0;
int preserve_atimes = 0;
int update_only = 0;
int open_noatime = 0;
int cvs_exclude = 0;
-@@ -884,6 +885,7 @@ static struct poptOption long_options[] = {
+@@ -888,6 +889,7 @@ static struct poptOption long_options[] = {
{"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 },
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
int sender_symlink_iconv = 0; /* sender should convert symlink content */
-@@ -468,6 +470,8 @@ void setup_protocol(int f_out,int f_in)
+@@ -511,6 +513,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)
-@@ -623,6 +627,10 @@ void setup_protocol(int f_out,int f_in)
+@@ -666,6 +670,10 @@ void setup_protocol(int f_out,int f_in)
want_xattr_optim = protocol_version >= 31 && !(compat_flags & CF_AVOID_XATTR_OPTIM);
proper_seed_order = compat_flags & CF_CHKSUM_SEED_FIX ? 1 : 0;
xfer_flags_as_varint = compat_flags & CF_VARINT_FLIST_FLAGS ? 1 : 0;
extern int delete_during;
extern int missing_args;
extern int eol_nulls;
-@@ -382,6 +383,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -378,6 +379,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
{
static time_t modtime, atime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -425,6 +429,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -421,6 +425,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
xflags |= XMIT_SAME_MODE;
else
mode = file->mode;
if (preserve_devices && IS_DEVICE(mode)) {
if (protocol_version < 28) {
-@@ -575,6 +587,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -571,6 +583,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
write_varint(f, F_MOD_NSEC(file));
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (atimes_ndx && !S_ISDIR(mode) && !(xflags & XMIT_SAME_ATIME))
write_varlong(f, atime, 4);
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
-@@ -666,6 +682,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -662,6 +678,9 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
{
static int64 modtime, atime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -775,6 +794,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -771,6 +790,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
mode = first->mode;
if (atimes_ndx && !S_ISDIR(mode))
atime = F_ATIME(first);
if (preserve_uid)
uid = F_OWNER(first);
if (preserve_gid)
-@@ -826,6 +849,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -822,6 +845,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
if (chmod_modes && !S_ISLNK(mode) && mode)
mode = tweak_mode(mode, chmod_modes);
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
-@@ -984,6 +1011,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -980,6 +1007,10 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
}
#endif
file->mode = mode;
if (preserve_uid)
F_OWNER(file) = uid;
if (preserve_gid) {
-@@ -1383,6 +1414,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1377,6 +1408,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
}
#endif
file->mode = st.st_mode;
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -27,6 +27,9 @@
+@@ -28,6 +28,9 @@
#include <locale.h>
#endif
#include <popt.h>
extern int dry_run;
extern int list_only;
-@@ -53,6 +56,7 @@ extern int copy_unsafe_links;
+@@ -54,6 +57,7 @@ extern int copy_unsafe_links;
extern int keep_dirlinks;
extern int preserve_hard_links;
extern int protocol_version;
extern int file_total;
extern int recurse;
extern int xfer_dirs;
-@@ -951,6 +955,22 @@ static int do_recv(int f_in, int f_out, char *local_name)
+@@ -944,6 +948,22 @@ static int do_recv(int f_in, int f_out, char *local_name)
* points to an identical file won't be replaced by the referent. */
copy_links = copy_dirlinks = copy_unsafe_links = 0;
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -56,6 +56,7 @@ int preserve_hard_links = 0;
+@@ -57,6 +57,7 @@ int preserve_hard_links = 0;
int preserve_acls = 0;
int preserve_xattrs = 0;
int preserve_perms = 0;
int preserve_executability = 0;
int preserve_devices = 0;
int preserve_specials = 0;
-@@ -92,6 +93,7 @@ int numeric_ids = 0;
+@@ -93,6 +94,7 @@ int numeric_ids = 0;
int msgs2stderr = 0;
int allow_8bit_chars = 0;
int force_delete = 0;
int io_timeout = 0;
int prune_empty_dirs = 0;
int use_qsort = 0;
-@@ -657,6 +659,11 @@ static void print_capabilities(enum logcode f)
+@@ -661,6 +663,11 @@ static void print_capabilities(enum logcode f)
#endif
"prealloc",
"*" /* All options after this point are hidden w/o -V -V */
#ifndef HAVE_SIMD
"no "
-@@ -818,6 +825,8 @@ static struct poptOption long_options[] = {
+@@ -822,6 +829,8 @@ static struct poptOption long_options[] = {
{"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 },
{"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"executability", 'E', POPT_ARG_NONE, &preserve_executability, 0, 0, 0 },
{"acls", 'A', POPT_ARG_NONE, 0, 'A', 0, 0 },
{"no-acls", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 },
-@@ -911,6 +920,12 @@ static struct poptOption long_options[] = {
+@@ -916,6 +925,12 @@ static struct poptOption long_options[] = {
{"remove-source-files",0,POPT_ARG_VAL, &remove_source_files, 1, 0, 0 },
{"force", 0, POPT_ARG_VAL, &force_delete, 1, 0, 0 },
{"no-force", 0, POPT_ARG_VAL, &force_delete, 0, 0, 0 },
{"ignore-errors", 0, POPT_ARG_VAL, &ignore_errors, 1, 0, 0 },
{"no-ignore-errors", 0, POPT_ARG_VAL, &ignore_errors, 0, 0, 0 },
{"max-delete", 0, POPT_ARG_INT, &max_delete, 0, 0, 0 },
-@@ -1199,6 +1214,14 @@ static void set_refuse_options(void)
+@@ -1204,6 +1219,14 @@ static void set_refuse_options(void)
#ifndef HAVE_SETVBUF
parse_one_refuse_match(0, "outbuf", list_end);
#endif
/* Now we use the descrip values to actually mark the options for refusal. */
for (op = long_options; op != list_end; op++) {
-@@ -2651,6 +2674,9 @@ void server_options(char **args, int *argc_p)
+@@ -2652,6 +2675,9 @@ void server_options(char **args, int *argc_p)
if (xfer_dirs && !recurse && delete_mode && am_sender)
args[ac++] = "--no-r";
if (do_compression && do_compression_level != CLVL_NOT_SPECIFIED) {
if (asprintf(&arg, "--compress-level=%d", do_compression_level) < 0)
goto oom;
-@@ -2754,6 +2780,16 @@ void server_options(char **args, int *argc_p)
+@@ -2755,6 +2781,16 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--delete-excluded";
if (force_delete)
args[ac++] = "--force";
--max-delete=NUM don't delete more than NUM files
--max-size=SIZE don't transfer any file larger than SIZE
--min-size=SIZE don't transfer any file smaller than SIZE
-@@ -702,6 +706,8 @@ your home directory (remove the '=' for that).
+@@ -703,6 +707,8 @@ your home directory (remove the '=' for that).
Note that `-a` **does not preserve hardlinks**, because finding
multiply-linked files is expensive. You must separately specify `-H`.
0. `--no-OPTION`
-@@ -1040,7 +1046,7 @@ your home directory (remove the '=' for that).
+@@ -1041,7 +1047,7 @@ your home directory (remove the '=' for that).
Without this option, if the sending side has replaced a directory with a
symlink to a directory, the receiving side will delete anything that is in
the way of the new symlink, including a directory hierarchy (as long as
See also `--keep-dirlinks` for an analogous option for the receiving side.
-@@ -1226,6 +1232,29 @@ your home directory (remove the '=' for that).
+@@ -1227,6 +1233,29 @@ your home directory (remove the '=' for that).
those used by `--fake-super`) unless you repeat the option (e.g. `-XX`).
This "copy all xattrs" mode cannot be used with `--fake-super`.
0. `--chmod=CHMOD`
This option tells rsync to apply one or more comma-separated "chmod" modes
-@@ -1685,7 +1714,7 @@ your home directory (remove the '=' for that).
+@@ -1687,7 +1716,7 @@ your home directory (remove the '=' for that).
option a step farther: each missing arg will become a deletion request of
the corresponding destination file on the receiving side (should it exist).
If the destination file is a non-empty directory, it will only be
that, this option is independent of any other type of delete processing.
The missing source files are represented by special file-list entries which
-@@ -1696,15 +1725,16 @@ your home directory (remove the '=' for that).
+@@ -1698,15 +1727,16 @@ your home directory (remove the '=' for that).
Tells `--delete` to go ahead and delete files even when there are I/O
errors.
0. `--max-delete=NUM`
-@@ -2576,7 +2606,7 @@ your home directory (remove the '=' for that).
+@@ -2603,7 +2633,7 @@ your home directory (remove the '=' for that).
output of other verbose messages).
The "%i" escape has a cryptic output that is 11 letters long. The general
int preserve_times = 0;
int preserve_xattrs = 0;
int preserve_perms = 0;
-@@ -109,3 +111,23 @@ filter_rule_list daemon_filter_list;
+@@ -110,3 +112,23 @@ filter_rule_list daemon_filter_list;
{
return cst ? 0 : 0;
}
diff --git a/xattrs.c b/xattrs.c
--- a/xattrs.c
+++ b/xattrs.c
-@@ -1216,7 +1216,7 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
+@@ -1204,7 +1204,7 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
mode = (fst.st_mode & _S_IFMT) | (fmode & ACCESSPERMS)
| (S_ISDIR(fst.st_mode) ? 0700 : 0600);
if (fst.st_mode != mode)
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
-@@ -45,10 +45,13 @@ filter_rule_list filter_list = { .debug_type = "" };
+@@ -46,10 +46,13 @@ filter_rule_list filter_list = { .debug_type = "" };
filter_rule_list cvs_filter_list = { .debug_type = " [global CVS]" };
filter_rule_list daemon_filter_list = { .debug_type = " [daemon]" };
#define SLASH_WILD3_SUFFIX "/***"
-@@ -127,8 +130,27 @@ static void teardown_mergelist(filter_rule *ex)
+@@ -128,8 +131,27 @@ static void teardown_mergelist(filter_rule *ex)
mergelist_cnt--;
}
if (ex->rflags & FILTRULE_PERDIR_MERGE)
teardown_mergelist(ex);
free(ex->pattern);
-@@ -730,7 +752,9 @@ static void report_filter_result(enum logcode code, char const *name,
+@@ -723,7 +745,9 @@ static void report_filter_result(enum logcode code, char const *name,
/* This function is used to check if a file should be included/excluded
* from the list of files based on its name and type etc. The value of
int name_is_excluded(const char *fname, int name_flags, int filter_level)
{
if (daemon_filter_list.head && check_filter(&daemon_filter_list, FLOG, fname, name_flags) < 0) {
-@@ -739,6 +763,9 @@ int name_is_excluded(const char *fname, int name_flags, int filter_level)
+@@ -732,6 +756,9 @@ int name_is_excluded(const char *fname, int name_flags, int filter_level)
return 1;
}
if (filter_level != ALL_FILTERS)
return 0;
-@@ -749,7 +776,8 @@ int name_is_excluded(const char *fname, int name_flags, int filter_level)
+@@ -742,7 +769,8 @@ int name_is_excluded(const char *fname, int name_flags, int filter_level)
}
/* Return -1 if file "name" is defined to be excluded by the specified
int check_filter(filter_rule_list *listp, enum logcode code,
const char *name, int name_flags)
{
-@@ -772,10 +800,12 @@ int check_filter(filter_rule_list *listp, enum logcode code,
+@@ -765,10 +793,12 @@ int check_filter(filter_rule_list *listp, enum logcode code,
}
if (rule_matches(name, ent, name_flags)) {
report_filter_result(code, name, ent, name_flags, listp->debug_type);
return 0;
}
-@@ -792,9 +822,46 @@ static const uchar *rule_strcmp(const uchar *str, const char *rule, int rule_len
+@@ -785,9 +815,45 @@ static const uchar *rule_strcmp(const uchar *str, const char *rule, int rule_len
return NULL;
}
+ if (!parse_chmod(modestr, &modes))
+ return NULL;
+
-+ if (!(chmod = new(struct filter_chmod_struct)))
-+ out_of_memory("make_chmod_struct");
++ chmod = new(struct filter_chmod_struct);
+ chmod->ref_cnt = 1;
+ chmod->modestr = modestr;
+ chmod->modes = modes;
/* Gets the next include/exclude rule from *rulestr_ptr and advances
* *rulestr_ptr to point beyond it. Stores the pattern's start (within
-@@ -809,6 +876,7 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
+@@ -802,6 +868,7 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
const char **pat_ptr, unsigned int *pat_len_ptr)
{
const uchar *s = (const uchar *)*rulestr_ptr;
filter_rule *rule;
unsigned int len;
-@@ -828,6 +896,12 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
+@@ -820,6 +887,12 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
/* Inherit from the template. Don't inherit FILTRULES_SIDES; we check
* that later. */
rule->rflags = template->rflags & FILTRULES_FROM_CONTAINER;
/* Figure out what kind of a filter rule "s" is pointing at. Note
* that if FILTRULE_NO_PREFIXES is set, the rule is either an include
-@@ -973,11 +1047,63 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
+@@ -965,11 +1038,63 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr,
goto invalid;
rule->rflags |= FILTRULE_EXCLUDE_SELF;
break;
case 'p':
rule->rflags |= FILTRULE_PERISHABLE;
break;
-@@ -1292,6 +1418,23 @@ char *get_rule_prefix(filter_rule *rule, const char *pat, int for_xfer,
+@@ -1283,6 +1408,23 @@ char *get_rule_prefix(filter_rule *rule, const char *pat, int for_xfer,
else if (am_sender)
return NULL;
}
#ifdef ICONV_OPTION
extern int filesfrom_convert;
-@@ -1182,7 +1183,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1178,7 +1179,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
} else if (readlink_stat(thisname, &st, linkname) != 0) {
int save_errno = errno;
/* See if file is excluded before reporting an error. */
&& (is_excluded(thisname, 0, filter_level)
|| is_excluded(thisname, 1, filter_level))) {
if (ignore_perishable && save_errno != ENOENT)
-@@ -1227,6 +1228,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1223,6 +1224,12 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
if (filter_level == NO_FILTERS)
goto skip_filters;
if (S_ISDIR(st.st_mode)) {
if (!xfer_dirs) {
-@@ -1445,12 +1452,23 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1439,12 +1446,23 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
int flags, int filter_level)
{
struct file_struct *file;
file->mode = tweak_mode(file->mode, chmod_modes);
if (f >= 0) {
-@@ -2355,7 +2373,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2345,7 +2363,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
struct file_struct *file;
file = send_file_name(f, flist, fbuf, &st,
FLAG_TOP_DIR | FLAG_CONTENT_DIR | flags,
if (!file)
continue;
if (inc_recurse) {
-@@ -2369,7 +2387,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2359,7 +2377,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
} else
send_if_directory(f, flist, file, fbuf, len, flags);
} else
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -1249,7 +1249,9 @@ your home directory (remove the '=' for that).
+@@ -1250,7 +1250,9 @@ your home directory (remove the '=' for that).
> --chmod=D2775,F664
It is also legal to specify multiple `--chmod` options, as each additional
See the `--perms` and `--executability` options for how the resulting
permission value can be applied to the files in the transfer.
-@@ -2512,6 +2514,10 @@ your home directory (remove the '=' for that).
+@@ -2539,6 +2541,10 @@ your home directory (remove the '=' for that).
If you specify "`--chown=foo:bar`", this is exactly the same as specifying
"`--usermap=*:foo --groupmap=*:bar`", only easier.
0. `--timeout=SECONDS`
This option allows you to set a maximum I/O timeout in seconds. If no data
-@@ -3458,6 +3464,15 @@ The following modifiers are accepted after a "`+`" or "`-`":
+@@ -3485,6 +3491,15 @@ The following modifiers are accepted after a "`+`" or "`-`":
rules that exclude things like "CVS" and "`*.o`" are marked as perishable,
and will not prevent a directory that was removed on the source from being
deleted on the destination.
- An `x` indicates that a rule affects xattr names in xattr copy/delete
operations (and is thus ignored when matching file/dir names). If no
xattr-matching rules are specified, a default xattr filtering rule is used
-@@ -3515,6 +3530,12 @@ The following modifiers are accepted after a merge or dir-merge rule:
+@@ -3542,6 +3557,12 @@ The following modifiers are accepted after a merge or dir-merge rule:
rules in the file must not specify sides (via a modifier or a rule prefix
such as `hide`).
diff --git a/util.c b/util.c
--- a/util.c
+++ b/util.c
-@@ -889,6 +889,25 @@ size_t stringjoin(char *dest, size_t destsize, ...)
+@@ -884,6 +884,25 @@ size_t stringjoin(char *dest, size_t destsize, ...)
return ret;
}
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -68,6 +68,7 @@ int open_noatime = 0;
+@@ -69,6 +69,7 @@ int open_noatime = 0;
int cvs_exclude = 0;
int dry_run = 0;
int do_xfers = 1;
int ignore_times = 0;
int delete_mode = 0;
int delete_during = 0;
-@@ -989,6 +990,7 @@ static struct poptOption long_options[] = {
+@@ -994,6 +995,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 },
-@@ -2840,6 +2842,9 @@ void server_options(char **args, int *argc_p)
+@@ -2846,6 +2848,9 @@ void server_options(char **args, int *argc_p)
args[ac++] = tmpdir;
}
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -407,6 +407,7 @@ detailed description below for a complete description.
+@@ -408,6 +408,7 @@ detailed description below for a complete description.
--partial-dir=DIR put a partially transferred file into DIR
--delay-updates put all updated files into place at end
--prune-empty-dirs, -m prune empty directory chains from file-list
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1625,6 +1625,9 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+@@ -1619,6 +1619,9 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
sx.st.st_mode = file->mode;
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -30,6 +30,10 @@
+@@ -31,6 +31,10 @@
#ifdef SUPPORT_FORCE_CHANGE
#include <sys/sysctl.h>
#endif
extern int dry_run;
extern int list_only;
-@@ -55,6 +59,7 @@ extern int copy_dirlinks;
+@@ -56,6 +60,7 @@ extern int copy_dirlinks;
extern int copy_unsafe_links;
extern int keep_dirlinks;
extern int preserve_hard_links;
extern int protocol_version;
extern int force_change;
extern int file_total;
-@@ -111,6 +116,7 @@ int daemon_over_rsh = 0;
+@@ -112,6 +117,7 @@ int daemon_over_rsh = 0;
mode_t orig_umask = 0;
int batch_gen_fd = -1;
int sender_keeps_checksum = 0;
int raw_argc, cooked_argc;
char **raw_argv, **cooked_argv;
-@@ -667,6 +673,43 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, in
- return 0; /* not reached */
+@@ -662,6 +668,43 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, in
+ return pid;
}
+#ifdef SUPPORT_HFS_COMPRESSION
/* The receiving side operates in one of two modes:
*
* 1. it receives any number of files into a destination directory,
-@@ -725,6 +768,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
+@@ -720,6 +763,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
exit_cleanup(RERR_FILESELECT);
}
filesystem_dev = st.st_dev; /* ensures --force works right w/-x */
return NULL;
}
if (file_total > 1) {
-@@ -784,7 +830,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
+@@ -779,7 +825,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
full_fname(dest_path));
exit_cleanup(RERR_FILESELECT);
}
return NULL;
}
-@@ -804,6 +852,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
+@@ -799,6 +847,9 @@ static char *get_local_name(struct file_list *flist, char *dest_path)
full_fname(dest_path));
exit_cleanup(RERR_FILESELECT);
}
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -55,6 +55,7 @@ int preserve_links = 0;
+@@ -56,6 +56,7 @@ int preserve_links = 0;
int preserve_hard_links = 0;
int preserve_acls = 0;
int preserve_xattrs = 0;
int preserve_perms = 0;
int preserve_fileflags = 0;
int preserve_executability = 0;
-@@ -935,6 +936,10 @@ static struct poptOption long_options[] = {
+@@ -940,6 +941,10 @@ static struct poptOption long_options[] = {
{"no-force-change", 0, POPT_ARG_VAL, &force_change, 0, 0, 0 },
{"force-uchange", 0, POPT_ARG_VAL, &force_change, USR_IMMUTABLE, 0, 0 },
{"force-schange", 0, POPT_ARG_VAL, &force_change, SYS_IMMUTABLE, 0, 0 },
{"ignore-errors", 0, POPT_ARG_VAL, &ignore_errors, 1, 0, 0 },
{"no-ignore-errors", 0, POPT_ARG_VAL, &ignore_errors, 0, 0, 0 },
{"max-delete", 0, POPT_ARG_INT, &max_delete, 0, 0, 0 },
-@@ -1234,6 +1239,10 @@ static void set_refuse_options(void)
+@@ -1239,6 +1244,10 @@ static void set_refuse_options(void)
#ifndef SUPPORT_CRTIMES
parse_one_refuse_match(0, "crtimes", list_end);
#endif
/* Now we use the descrip values to actually mark the options for refusal. */
for (op = long_options; op != list_end; op++) {
-@@ -2077,6 +2086,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2078,6 +2087,15 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
#endif
if (block_size) {
/* We may not know the real protocol_version at this point if this is the client
* option parsing, but we still want to check it so that the client can specify
-@@ -2693,6 +2711,11 @@ void server_options(char **args, int *argc_p)
+@@ -2694,6 +2712,11 @@ void server_options(char **args, int *argc_p)
if (preserve_fileflags)
args[ac++] = "--fileflags";
--owner, -o preserve owner (super-user only)
--group, -g preserve group
--devices preserve device files (super-user only)
-@@ -1256,6 +1258,47 @@ your home directory (remove the '=' for that).
+@@ -1257,6 +1259,47 @@ your home directory (remove the '=' for that).
receiving side. It does not try to affect user flags. This option
overrides `--force-change` and `--force-uchange`.
int preserve_executability = 0;
+int preserve_hfs_compression = 0;
int open_noatime = 0;
+ size_t max_alloc = 1024*1024*1024;
char *partial_dir;
- char *module_dir;
diff --git a/xattrs.c b/xattrs.c
--- a/xattrs.c
+++ b/xattrs.c
typedef struct {
char *datum, *name;
size_t datum_len, name_len;
-@@ -184,7 +200,7 @@ static ssize_t get_xattr_names(const char *fname)
+@@ -180,7 +196,7 @@ static ssize_t get_xattr_names(const char *fname)
/* On entry, the *len_ptr parameter contains the size of the extra space we
* should allocate when we create a buffer for the data. On exit, it contains
* the length of the datum. */
{
size_t datum_len = sys_lgetxattr(fname, name, NULL, 0);
size_t extra_len = *len_ptr;
-@@ -193,7 +209,7 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
+@@ -189,7 +205,7 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
*len_ptr = datum_len;
if (datum_len == (size_t)-1) {
return NULL;
rsyserr(FERROR_XFER, errno,
"get_xattr_data: lgetxattr(%s,\"%s\",0) failed",
-@@ -201,6 +217,15 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
+@@ -197,6 +213,15 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
return NULL;
}
if (!datum_len && !extra_len)
extra_len = 1; /* request non-zero amount of memory */
if (datum_len + extra_len < datum_len)
-@@ -229,7 +254,31 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
+@@ -224,7 +249,31 @@ static char *get_xattr_data(const char *fname, const char *name, size_t *len_ptr
return ptr;
}
{
ssize_t list_len, name_len;
size_t datum_len, name_offset;
-@@ -238,7 +287,8 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+@@ -233,7 +282,8 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
int user_only = am_sender ? 0 : !am_root;
#endif
rsync_xa *rxa;
/* This puts the name list into the "namebuf" buffer. */
if ((list_len = get_xattr_names(fname)) < 0)
-@@ -269,11 +319,15 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+@@ -264,11 +314,15 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
}
datum_len = name_len; /* Pass extra size to get_xattr_data() */
name_offset = 1 + MAX_DIGEST_LEN;
sum_init(-1, checksum_seed);
sum_update(ptr, datum_len);
-@@ -282,7 +336,9 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
- if (!(ptr = new_array(char, name_offset + name_len)))
- out_of_memory("rsync_xal_get");
+@@ -276,7 +330,9 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+
+ ptr = new_array(char, name_offset + name_len);
*ptr = XSTATE_ABBREV;
- sum_end(ptr + 1);
+ checksum_xattr_data(ptr+1, datum, datum_len, sxp);
} else
name_offset = datum_len;
-@@ -328,7 +384,7 @@ int get_xattr(const char *fname, stat_x *sxp)
+@@ -322,7 +378,7 @@ int get_xattr(const char *fname, stat_x *sxp)
} else if (IS_MISSING_FILE(sxp->st))
return 0;
free_xattr(sxp);
return -1;
}
-@@ -365,6 +421,8 @@ int copy_xattrs(const char *source, const char *dest)
+@@ -359,6 +415,8 @@ int copy_xattrs(const char *source, const char *dest)
datum_len = 0;
if (!(ptr = get_xattr_data(source, name, &datum_len, 0)))
return -1;
if (sys_lsetxattr(dest, name, ptr, datum_len) < 0) {
int save_errno = errno ? errno : EINVAL;
rsyserr(FERROR_XFER, errno,
-@@ -455,6 +513,7 @@ static int find_matching_xattr(const item_list *xalp)
+@@ -449,6 +507,7 @@ static int find_matching_xattr(const item_list *xalp)
}
return -1;
}
/* Store *xalp on the end of rsync_xal_l */
-@@ -671,11 +730,13 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
+@@ -663,11 +722,13 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
/* Re-read the long datum. */
if (!(ptr = get_xattr_data(fname, rxa->name, &len, 0))) {
write_varint(f_out, len); /* length might have changed! */
write_bigbuf(f_out, ptr, len);
free(ptr);
-@@ -962,7 +1023,7 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
+@@ -950,7 +1011,7 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
int user_only = am_root <= 0;
#endif
size_t name_len;
/* This puts the current name list into the "namebuf" buffer. */
if ((list_len = get_xattr_names(fname)) < 0)
-@@ -975,7 +1036,10 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
+@@ -963,7 +1024,10 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
int sum_len;
/* See if the fnamecmp version is identical. */
len = name_len = rxas[i].name_len;
still_abbrev:
if (am_generator)
continue;
-@@ -984,6 +1048,8 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
+@@ -972,6 +1036,8 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
ret = -1;
continue;
}
if (len != rxas[i].datum_len) {
free(ptr);
goto still_abbrev;
-@@ -1061,6 +1127,10 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
+@@ -1049,6 +1115,10 @@ static int rsync_xal_set(const char *fname, item_list *xalp,
}
}
return ret;
}
-@@ -1109,7 +1179,7 @@ char *get_xattr_acl(const char *fname, int is_access_acl, size_t *len_p)
+@@ -1097,7 +1167,7 @@ char *get_xattr_acl(const char *fname, int is_access_acl, size_t *len_p)
{
const char *name = is_access_acl ? XACC_ACL_ATTR : XDEF_ACL_ATTR;
*len_p = 0; /* no extra data alloc needed from get_xattr_data() */
}
int set_xattr_acl(const char *fname, int is_access_acl, const char *buf, size_t buf_len)
-@@ -1252,11 +1322,33 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
+@@ -1240,11 +1310,33 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
return 0;
}
return ret;
}
-@@ -1265,6 +1357,9 @@ int x_lstat(const char *fname, STRUCT_STAT *fst, STRUCT_STAT *xst)
+@@ -1253,6 +1345,9 @@ int x_lstat(const char *fname, STRUCT_STAT *fst, STRUCT_STAT *xst)
int ret = do_lstat(fname, fst);
if ((ret < 0 || get_stat_xattr(fname, -1, fst, xst) < 0) && xst)
xst->st_mode = 0;
return ret;
}
-@@ -1273,6 +1368,9 @@ int x_fstat(int fd, STRUCT_STAT *fst, STRUCT_STAT *xst)
+@@ -1261,6 +1356,9 @@ int x_fstat(int fd, STRUCT_STAT *fst, STRUCT_STAT *xst)
int ret = do_fstat(fd, fst);
if ((ret < 0 || get_stat_xattr(NULL, fd, fst, xst) < 0) && xst)
xst->st_mode = 0;
- Make this code handle multibyte character encodings, and honor the
--iconv setting when converting case.
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/exclude.c b/exclude.c
--- a/exclude.c
+++ b/exclude.c
#include "rsync.h"
+#include "ifuncs.h"
#include "default-cvsignore.h"
+ #include "ifuncs.h"
- extern int am_server;
-@@ -691,16 +692,15 @@ static int rule_matches(const char *fname, filter_rule *ex, int name_flags)
+@@ -684,16 +685,15 @@ static int rule_matches(const char *fname, filter_rule *ex, int name_flags)
if (litmatch_array(pattern, strings, slash_handling))
return ret_match;
} else if (anchored_match) {
extern int ignore_errors;
extern int numeric_ids;
extern int quiet;
-@@ -3124,6 +3125,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -3111,6 +3112,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;
-@@ -3234,7 +3236,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -3221,7 +3223,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
if (type1 != type2)
return type1 == t_PATH ? 1 : -1;
}
diff --git a/ifuncs.h b/ifuncs.h
--- a/ifuncs.h
+++ b/ifuncs.h
-@@ -104,3 +104,38 @@ free_stat_x(stat_x *sx_p)
- }
- #endif
+@@ -109,3 +109,38 @@ static inline char *my_strdup(const char *str, const char *file, int line)
+ memcpy(buf, str, len);
+ return buf;
}
+
+static inline int
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -123,6 +123,7 @@ OFF_T max_size = -1;
+@@ -124,6 +124,7 @@ OFF_T max_size = -1;
OFF_T min_size = -1;
int ignore_errors = 0;
int modify_window = 0;
int blocking_io = -1;
int checksum_seed = 0;
int inplace = 0;
-@@ -974,6 +975,8 @@ static struct poptOption long_options[] = {
+@@ -979,6 +980,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},
-@@ -2790,6 +2793,9 @@ void server_options(char **args, int *argc_p)
+@@ -2796,6 +2799,9 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -437,6 +437,7 @@ detailed description below for a complete description.
+@@ -438,6 +438,7 @@ detailed description below for a complete description.
--from0, -0 all *-from/filter files are delimited by 0s
--protect-args, -s no space-splitting; wildcard chars only
--copy-as=USER[:GROUP] specify user & optional group for the copy
--address=ADDRESS bind address for outgoing socket to daemon
--port=PORT specify double-colon alternate port number
--sockopts=OPTIONS specify custom TCP options
-@@ -2118,6 +2119,12 @@ your home directory (remove the '=' for that).
+@@ -2146,6 +2147,12 @@ your home directory (remove the '=' for that).
> sudo rsync -aive lsh -M--copy-as=joe src/ lh:dest/
./configure
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
{
int i, modlen;
char line[BIGPATHBUFLEN];
-@@ -330,6 +330,17 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
+@@ -329,6 +329,17 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
continue;
}
if (strcmp(line,"@RSYNCD: OK") == 0)
break;
-@@ -686,7 +697,12 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -685,7 +696,12 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
}
read_only = lp_read_only(i); /* may also be overridden by auth_server() */
new file mode 100644
--- /dev/null
+++ b/gss-auth.c
-@@ -0,0 +1,342 @@
+@@ -0,0 +1,334 @@
+/*
+ * GSSAPI authentication.
+ *
+ OM_uint32 min_stat;
+
+ buffer = new_array(char, (strlen(host) + 2 + strlen(RSYNC_GSS_SERVICE)));
-+ if (!(buffer))
-+ out_of_memory("auth_gss_client");
+
+ sprintf(buffer, "%s@%s", RSYNC_GSS_SERVICE, host);
+
+ gss_buffer_desc gssname;
+ OM_uint32 maj_stat, min_stat;
+
-+ if (!(gssname.value = strdup(name)))
-+ out_of_memory("import_gss_name");
++ gssname.value = strdup(name);
+ gssname.length = strlen(name) +1 ;
+
+ maj_stat = gss_import_name(&min_stat, &gssname, type, gss_name);
+ return NULL;
+ }
+
-+ if (exported_name.length > 0) {
-+ if (!(exported = strdup(exported_name.value)))
-+ out_of_memory("export_name");
-+ }
++ if (exported_name.length > 0)
++ exported = strdup(exported_name.value);
+
+ free_gss_buffer(&exported_name);
+
+ error_gss(maj_stat, min_stat, "canonizing name");
+ return NULL;
+ }
-+ if (exported_name.length > 0) {
-+ if (!(cn = strdup(exported_name.value)))
-+ out_of_memory("auth_server");
-+ }
++ if (exported_name.length > 0)
++ cn = strdup(exported_name.value);
+
+ free_gss_name(&output_name);
+ free_gss_buffer(&exported_name);
+{
+ token->length = read_int(fd);
+ if (token->length > 0) {
-+ if (!(token->value = new_array(char, token->length)))
-+ out_of_memory("recv_gss_token");
++ token->value = new_array(char, token->length);
+ read_buf(fd, token->value, token->length);
+ }
+}
diff --git a/loadparm.c b/loadparm.c
--- a/loadparm.c
+++ b/loadparm.c
-@@ -190,6 +190,7 @@ typedef struct {
+@@ -191,6 +191,7 @@ typedef struct {
BOOL strict_modes;
BOOL transfer_logging;
BOOL use_chroot;
BOOL write_only;
} local_vars;
-@@ -307,6 +308,7 @@ static const all_vars Defaults = {
+@@ -308,6 +309,7 @@ static const all_vars Defaults = {
/* strict_modes; */ True,
/* transfer_logging; */ False,
/* use_chroot; */ True,
/* write_only; */ False,
}
};
-@@ -450,6 +452,7 @@ static struct parm_struct parm_table[] =
+@@ -451,6 +453,7 @@ static struct parm_struct parm_table[] =
{"transfer logging", P_BOOL, P_LOCAL, &Vars.l.transfer_logging, NULL,0},
{"uid", P_STRING, P_LOCAL, &Vars.l.uid, NULL,0},
{"use chroot", P_BOOL, P_LOCAL, &Vars.l.use_chroot, NULL,0},
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -1537,7 +1537,7 @@ static int start_client(int argc, char *argv[])
+@@ -1522,7 +1522,7 @@ static int start_client(int argc, char *argv[])
* remote shell command, we need to do the RSYNCD protocol first */
if (daemon_over_rsh) {
int tmpret;
./configure
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
diff --git a/checksum.c b/checksum.c
--- a/checksum.c
+++ b/checksum.c
-@@ -36,6 +36,8 @@ extern int whole_file;
+@@ -40,6 +40,8 @@ extern int whole_file;
extern int checksum_seed;
extern int protocol_version;
extern int proper_seed_order;
extern const char *checksum_choice;
struct name_num_obj valid_checksums = {
-@@ -385,7 +387,7 @@ static union {
+@@ -444,7 +446,7 @@ static union {
MD4_CTX m4;
#endif
MD5_CTX m5;
#ifdef SUPPORT_XXHASH
static XXH64_state_t* xxh64_state;
#endif
-@@ -409,6 +411,8 @@ void sum_init(int csum_type, int seed)
+@@ -483,6 +485,8 @@ void sum_init(int csum_type, int seed)
#endif
case CSUM_MD5:
MD5_Init(&ctx.m5);
break;
case CSUM_MD4:
#ifdef USE_OPENSSL
-@@ -451,6 +455,8 @@ void sum_update(const char *p, int32 len)
+@@ -533,6 +537,8 @@ void sum_update(const char *p, int32 len)
#endif
case CSUM_MD5:
MD5_Update(&ctx.m5, (uchar *)p, len);
break;
case CSUM_MD4:
#ifdef USE_OPENSSL
-@@ -505,6 +511,8 @@ int sum_end(char *sum)
+@@ -598,6 +604,8 @@ int sum_end(char *sum)
#endif
case CSUM_MD5:
MD5_Final((uchar *)sum, &ctx.m5);
extern char *logfile_format;
extern char *files_from;
extern char *tmpdir;
-@@ -666,6 +667,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -665,6 +666,9 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
return -1;
}
diff --git a/loadparm.c b/loadparm.c
--- a/loadparm.c
+++ b/loadparm.c
-@@ -130,6 +130,7 @@ typedef struct {
+@@ -131,6 +131,7 @@ typedef struct {
char *include;
char *include_from;
char *incoming_chmod;
char *lock_file;
char *log_file;
char *log_format;
-@@ -159,6 +160,7 @@ typedef struct {
+@@ -160,6 +161,7 @@ typedef struct {
BOOL include_EXP;
BOOL include_from_EXP;
BOOL incoming_chmod_EXP;
BOOL lock_file_EXP;
BOOL log_file_EXP;
BOOL log_format_EXP;
-@@ -248,6 +250,7 @@ static const all_vars Defaults = {
+@@ -249,6 +251,7 @@ static const all_vars Defaults = {
/* include; */ NULL,
/* include_from; */ NULL,
/* incoming_chmod; */ NULL,
/* lock_file; */ DEFAULT_LOCK_FILE,
/* log_file; */ NULL,
/* log_format; */ "%o %h [%a] %m (%u) %f %l",
-@@ -276,6 +279,7 @@ static const all_vars Defaults = {
+@@ -277,6 +280,7 @@ static const all_vars Defaults = {
/* include_EXP; */ False,
/* include_from_EXP; */ False,
/* incoming_chmod_EXP; */ False,
/* lock_file_EXP; */ False,
/* log_file_EXP; */ False,
/* log_format_EXP; */ False,
-@@ -423,6 +427,7 @@ static struct parm_struct parm_table[] =
+@@ -424,6 +428,7 @@ static struct parm_struct parm_table[] =
{"include from", P_STRING, P_LOCAL, &Vars.l.include_from, NULL,0},
{"include", P_STRING, P_LOCAL, &Vars.l.include, NULL,0},
{"incoming chmod", P_STRING, P_LOCAL, &Vars.l.incoming_chmod, NULL,0},
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -164,6 +164,7 @@ char *backup_suffix = NULL;
+@@ -165,6 +165,7 @@ char *backup_suffix = NULL;
char *tmpdir = NULL;
char *partial_dir = NULL;
char *basis_dir[MAX_BASIS_DIRS+1];
char *config_file = NULL;
char *shell_cmd = NULL;
char *logfile_name = NULL;
-@@ -221,7 +222,7 @@ static const char *debug_verbosity[] = {
+@@ -226,7 +227,7 @@ static const char *debug_verbosity[] = {
/*2*/ "BIND,CMD,CONNECT,DEL,DELTASUM,DUP,FILTER,FLIST,ICONV",
/*3*/ "ACL,BACKUP,CONNECT2,DELTASUM2,DEL2,EXIT,FILTER2,FLIST2,FUZZY,GENR,OWN,RECV,SEND,TIME",
/*4*/ "CMD2,DELTASUM3,DEL3,EXIT2,FLIST3,ICONV2,OWN2,PROTO,TIME2",
};
#define MAX_VERBOSITY ((int)(sizeof debug_verbosity / sizeof debug_verbosity[0]) - 1)
-@@ -291,6 +292,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
+@@ -296,6 +297,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
DEBUG_WORD(FUZZY, W_REC, "Debug fuzzy scoring (levels 1-2)"),
DEBUG_WORD(GENR, W_REC, "Debug generator functions"),
DEBUG_WORD(HASH, W_SND|W_REC, "Debug hashtable code"),
DEBUG_WORD(HLINK, W_SND|W_REC, "Debug hard-link actions (levels 1-3)"),
DEBUG_WORD(ICONV, W_CLI|W_SRV, "Debug iconv character conversions (levels 1-2)"),
DEBUG_WORD(IO, W_CLI|W_SRV, "Debug I/O routines (levels 1-4)"),
-@@ -778,7 +780,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -782,7 +784,7 @@ enum {OPT_SERVER = 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_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT,
OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS,
OPT_REFUSED_BASE = 9000};
-@@ -933,6 +935,7 @@ static struct poptOption long_options[] = {
+@@ -938,6 +940,7 @@ static struct poptOption long_options[] = {
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
{"fuzzy", 'y', POPT_ARG_NONE, 0, 'y', 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -1179,6 +1182,9 @@ static void set_refuse_options(void)
+@@ -1184,6 +1187,9 @@ static void set_refuse_options(void)
ref = cp + 1;
}
if (am_daemon) {
#ifdef ICONV_OPTION
if (!*lp_charset(module_id))
-@@ -1880,6 +1886,21 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1869,6 +1875,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. */
-@@ -2189,6 +2210,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2190,6 +2211,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
tmpdir = sanitize_path(NULL, tmpdir, NULL, 0, SP_DEFAULT);
if (backup_dir)
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, SP_DEFAULT);
}
if (daemon_filter_list.head && !am_sender) {
filter_rule_list *elp = &daemon_filter_list;
-@@ -2865,6 +2888,12 @@ void server_options(char **args, int *argc_p)
+@@ -2871,6 +2894,12 @@ void server_options(char **args, int *argc_p)
} else if (inplace)
args[ac++] = "--inplace";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -421,6 +421,7 @@ detailed description below for a complete description.
+@@ -422,6 +422,7 @@ detailed description below for a complete description.
--compare-dest=DIR also compare destination files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
--compress, -z compress file data during the transfer
--compress-choice=STR choose the compression algorithm (aka --zc)
--compress-level=NUM explicitly set compression level (aka --zl)
-@@ -2254,6 +2255,50 @@ your home directory (remove the '=' for that).
+@@ -2282,6 +2283,50 @@ your home directory (remove the '=' for that).
specified (or implied by `-a`). You can work-around this bug by avoiding
the `-o` option when sending to an old rsync.
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -1356,7 +1356,8 @@ extern short info_levels[], debug_levels[];
+@@ -1362,7 +1362,8 @@ extern short info_levels[], debug_levels[];
#define DEBUG_FUZZY (DEBUG_FLIST+1)
#define DEBUG_GENR (DEBUG_FUZZY+1)
#define DEBUG_HASH (DEBUG_GENR+1)
fast fallback for the case where xxHash libraries are not available at
build time.
-based-on: 1bdf68b905b246ef4eb2959ba5e266005f761a8c
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
case CSUM_MD5: {
MD5_CTX m5;
uchar seedbuf[4];
-@@ -375,6 +390,21 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
+@@ -373,6 +388,21 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
break;
}
#endif
case CSUM_MD5: {
MD5_CTX m5;
-@@ -447,6 +477,7 @@ static union {
+@@ -445,6 +475,7 @@ static union {
#endif
MD5_CTX m5;
} ctx;
#ifdef SUPPORT_XXHASH
static XXH64_state_t* xxh64_state;
#endif
-@@ -483,6 +514,9 @@ void sum_init(int csum_type, int seed)
+@@ -481,6 +512,9 @@ void sum_init(int csum_type, int seed)
XXH3_128bits_reset(xxh3_state);
break;
#endif
case CSUM_MD5:
MD5_Init(&ctx.m5);
break;
-@@ -533,6 +567,9 @@ void sum_update(const char *p, int32 len)
+@@ -531,6 +565,9 @@ void sum_update(const char *p, int32 len)
XXH3_128bits_update(xxh3_state, p, len);
break;
#endif
case CSUM_MD5:
MD5_Update(&ctx.m5, (uchar *)p, len);
break;
-@@ -598,6 +635,9 @@ int sum_end(char *sum)
+@@ -596,6 +633,9 @@ int sum_end(char *sum)
break;
}
#endif
diff --git a/match.c b/match.c
--- a/match.c
+++ b/match.c
-@@ -166,6 +166,8 @@ static void hash_search(int f,struct sum_struct *s,
+@@ -164,6 +164,8 @@ static void hash_search(int f,struct sum_struct *s,
if (DEBUG_GTE(DELTASUM, 3))
rprintf(FINFO, "sum=%.8x k=%ld\n", sum, (long)k);
offset = aligned_offset = aligned_i = 0;
end = len + 1 - s->sums[s->count-1].len;
-@@ -228,7 +230,7 @@ static void hash_search(int f,struct sum_struct *s,
+@@ -226,7 +228,7 @@ static void hash_search(int f,struct sum_struct *s,
if (!done_csum2) {
map = (schar *)map_ptr(buf,offset,l);
done_csum2 = 1;
}
-@@ -270,7 +272,7 @@ static void hash_search(int f,struct sum_struct *s,
+@@ -268,7 +270,7 @@ static void hash_search(int f,struct sum_struct *s,
sum = get_checksum1((char *)map, l);
if (sum != s->sums[i].sum1)
goto check_want_i;
if (memcmp(sum2, s->sums[i].sum2, s->s2length) != 0)
goto check_want_i;
/* OK, we have a re-alignment match. Bump the offset
-@@ -337,6 +339,8 @@ static void hash_search(int f,struct sum_struct *s,
+@@ -335,6 +337,8 @@ static void hash_search(int f,struct sum_struct *s,
matched(f, s, buf, offset - s->blength, -2);
} while (++offset < end);
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/authenticate.c b/authenticate.c
--- a/authenticate.c
+++ b/authenticate.c
-@@ -226,7 +226,7 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
+@@ -227,7 +227,7 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
char *users = lp_auth_users(module);
char challenge[MAX_DIGEST_LEN*2];
char line[BIGPATHBUFLEN];
else {
gid_t *gid_array = gid_list.items;
auth_uid_groups_cnt = gid_list.count;
-- if ((auth_uid_groups = new_array(char *, auth_uid_groups_cnt)) == NULL)
-+ if ((auth_uid_groups = new_array(const char *, auth_uid_groups_cnt)) == NULL)
- out_of_memory("auth_server");
+- auth_uid_groups = new_array(char *, auth_uid_groups_cnt);
++ auth_uid_groups = new_array(const char *, auth_uid_groups_cnt);
for (j = 0; j < auth_uid_groups_cnt; j++)
auth_uid_groups[j] = gid_to_group(gid_array[j]);
-@@ -314,7 +314,7 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
+ }
+@@ -313,7 +313,7 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
else if (opt_ch == 'd')
err = "denied by rule";
else {
err = check_secret(module, line, group, challenge, pass);
}
-@@ -325,7 +325,7 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
+@@ -324,7 +324,7 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
int j;
for (j = 0; j < auth_uid_groups_cnt; j++) {
if (auth_uid_groups[j])
#ifdef HAVE_SIGACTION
static struct sigaction sigact;
-@@ -811,7 +813,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -810,7 +812,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
log_init(1);
#ifdef HAVE_PUTENV
&& !getenv("RSYNC_NO_XFER_EXEC")) {
set_env_num("RSYNC_PID", (long)getpid());
-@@ -873,6 +875,45 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -872,6 +874,45 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
return -1;
}
}
}
#endif
-@@ -1119,6 +1160,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -1118,6 +1159,44 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
return 0;
}
diff --git a/loadparm.c b/loadparm.c
--- a/loadparm.c
+++ b/loadparm.c
-@@ -134,6 +134,7 @@ typedef struct {
+@@ -135,6 +135,7 @@ typedef struct {
char *log_file;
char *log_format;
char *name;
char *outgoing_chmod;
char *path;
char *postxfer_exec;
-@@ -163,6 +164,7 @@ typedef struct {
+@@ -164,6 +165,7 @@ typedef struct {
BOOL log_file_EXP;
BOOL log_format_EXP;
BOOL name_EXP;
BOOL outgoing_chmod_EXP;
BOOL path_EXP;
BOOL postxfer_exec_EXP;
-@@ -252,6 +254,7 @@ static const all_vars Defaults = {
+@@ -253,6 +255,7 @@ static const all_vars Defaults = {
/* log_file; */ NULL,
/* log_format; */ "%o %h [%a] %m (%u) %f %l",
/* name; */ NULL,
/* outgoing_chmod; */ NULL,
/* path; */ NULL,
/* postxfer_exec; */ NULL,
-@@ -280,6 +283,7 @@ static const all_vars Defaults = {
+@@ -281,6 +284,7 @@ static const all_vars Defaults = {
/* log_file_EXP; */ False,
/* log_format_EXP; */ False,
/* name_EXP; */ False,
/* outgoing_chmod_EXP; */ False,
/* path_EXP; */ False,
/* postxfer_exec_EXP; */ False,
-@@ -431,6 +435,7 @@ static struct parm_struct parm_table[] =
+@@ -432,6 +436,7 @@ static struct parm_struct parm_table[] =
{"max verbosity", P_INTEGER,P_LOCAL, &Vars.l.max_verbosity, NULL,0},
{"munge symlinks", P_BOOL, P_LOCAL, &Vars.l.munge_symlinks, NULL,0},
{"name", P_STRING, P_LOCAL, &Vars.l.name, NULL,0},
diff --git a/t_stub.c b/t_stub.c
--- a/t_stub.c
+++ b/t_stub.c
-@@ -35,6 +35,7 @@ int preserve_executability = 0;
- int open_noatime = 0;
+@@ -36,6 +36,7 @@ int open_noatime = 0;
+ size_t max_alloc = 1024*1024*1024;
char *partial_dir;
char *module_dir;
+pid_t namecvt_pid;
filter_rule_list daemon_filter_list;
void rprintf(UNUSED(enum logcode code), const char *format, ...)
-@@ -85,6 +86,11 @@ filter_rule_list daemon_filter_list;
+@@ -86,6 +87,11 @@ filter_rule_list daemon_filter_list;
return;
}
extern gid_t our_gid;
extern char *usermap;
extern char *groupmap;
-@@ -97,19 +98,27 @@ static struct idlist *add_to_list(struct idlist **root, id_t id, union name_or_i
+@@ -95,19 +96,27 @@ static struct idlist *add_to_list(struct idlist **root, id_t id, union name_or_i
}
/* turn a uid into a user name */
return strdup(grp->gr_name);
return NULL;
}
-@@ -117,32 +126,54 @@ char *gid_to_group(gid_t gid)
+@@ -115,32 +124,54 @@ char *gid_to_group(gid_t gid)
/* Parse a user name or (optionally) a number into a uid */
int user_to_uid(const char *name, uid_t *uid_p, BOOL num_ok)
{
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/access.c b/access.c
--- a/access.c
+++ b/access.c
-@@ -19,6 +19,7 @@
- */
+@@ -20,6 +20,7 @@
#include "rsync.h"
+ #include "ifuncs.h"
+#include <netdb.h>
static int allow_forward_dns;
-@@ -33,6 +34,9 @@ static int match_hostname(const char **host_ptr, const char *addr, const char *t
+@@ -34,6 +35,9 @@ static int match_hostname(const char **host_ptr, const char *addr, const char *t
if (!host || !*host)
return 0;
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
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
-@@ -75,6 +75,7 @@ int delete_before = 0;
+@@ -76,6 +76,7 @@ int delete_before = 0;
int delete_after = 0;
int delete_excluded = 0;
int remove_source_files = 0;
int one_file_system = 0;
int protocol_version = PROTOCOL_VERSION;
int sparse_files = 0;
-@@ -839,6 +840,7 @@ static struct poptOption long_options[] = {
+@@ -843,6 +844,7 @@ static struct poptOption long_options[] = {
{"omit-link-times", 'J', POPT_ARG_VAL, &omit_link_times, 1, 0, 0 },
{"no-omit-link-times",0, POPT_ARG_VAL, &omit_link_times, 0, 0, 0 },
{"no-J", 0, POPT_ARG_VAL, &omit_link_times, 0, 0, 0 },
{"modify-window", '@', POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
{"super", 0, POPT_ARG_VAL, &am_root, 2, 0, 0 },
{"no-super", 0, POPT_ARG_VAL, &am_root, 0, 0, 0 },
-@@ -2258,6 +2260,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2259,6 +2261,9 @@ int parse_arguments(int *argc_p, const char ***argv_p)
parse_filter_str(&filter_list, backup_dir_buf, rule_template(0), 0);
}
if (preserve_times) {
preserve_times = PRESERVE_FILE_TIMES;
if (!omit_dir_times)
-@@ -2510,6 +2515,8 @@ void server_options(char **args, int *argc_p)
+@@ -2511,6 +2516,8 @@ void server_options(char **args, int *argc_p)
argstr[x++] = 'O';
if (omit_link_times)
argstr[x++] = 'J';
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
--sparse, -S turn sequences of nulls into sparse blocks
-@@ -1364,6 +1365,11 @@ your home directory (remove the '=' for that).
+@@ -1365,6 +1366,11 @@ your home directory (remove the '=' for that).
This tells rsync to omit symlinks when it is preserving modification times
(see `--times`).
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
extern uid_t our_uid;
extern struct stats stats;
extern char *filesfrom_host;
-@@ -1789,6 +1790,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1782,6 +1783,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
-@@ -114,6 +114,7 @@ int size_only = 0;
+@@ -115,6 +115,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;
-@@ -964,6 +965,7 @@ static struct poptOption long_options[] = {
+@@ -969,6 +970,7 @@ static struct poptOption long_options[] = {
{"itemize-changes", 'i', POPT_ARG_NONE, 0, 'i', 0, 0 },
{"no-itemize-changes",0, POPT_ARG_VAL, &itemize_changes, 0, 0, 0 },
{"no-i", 0, POPT_ARG_VAL, &itemize_changes, 0, 0, 0 },
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -456,6 +456,7 @@ detailed description below for a complete description.
+@@ -457,6 +457,7 @@ detailed description below for a complete description.
--early-input=FILE use FILE for daemon's early exec input
--list-only list the files instead of copying them
--bwlimit=RATE limit socket I/O bandwidth
TODO: the configure changes should abort if the user requests --enable-slp
and we can't honor that request.
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
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
-@@ -1407,6 +1407,13 @@ int daemon_main(void)
+@@ -1405,6 +1405,13 @@ int daemon_main(void)
* address too. In fact, why not just do getnameinfo on the
* local address??? */
diff --git a/loadparm.c b/loadparm.c
--- a/loadparm.c
+++ b/loadparm.c
-@@ -107,6 +107,9 @@ typedef struct {
+@@ -108,6 +108,9 @@ typedef struct {
int listen_backlog;
int rsync_port;
BOOL proxy_protocol;
} global_vars;
-@@ -403,6 +406,9 @@ static struct parm_struct parm_table[] =
+@@ -404,6 +407,9 @@ static struct parm_struct parm_table[] =
{"pid file", P_STRING, P_GLOBAL,&Vars.g.pid_file, NULL,0},
{"port", P_INTEGER,P_GLOBAL,&Vars.g.rsync_port, NULL,0},
{"proxy protocol", P_BOOL, P_LOCAL, &Vars.g.proxy_protocol, NULL,0},
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -1377,6 +1377,18 @@ static int start_client(int argc, char *argv[])
+@@ -1362,6 +1362,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
-@@ -657,6 +657,11 @@ static void print_capabilities(enum logcode f)
+@@ -661,6 +661,11 @@ static void print_capabilities(enum logcode f)
#endif
"prealloc",
diff --git a/socket.c b/socket.c
--- a/socket.c
+++ b/socket.c
-@@ -538,6 +538,16 @@ void start_accept_loop(int port, int (*fn)(int, int))
+@@ -534,6 +534,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;
-@@ -565,14 +575,25 @@ void start_accept_loop(int port, int (*fn)(int, int))
+@@ -561,14 +571,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
-@@ -585,7 +606,18 @@ void start_accept_loop(int port, int (*fn)(int, int))
+@@ -581,7 +602,18 @@ void start_accept_loop(int port, int (*fn)(int, int))
fds = deffds;
#endif
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/syscall.c b/syscall.c
--- a/syscall.c
+++ b/syscall.c
-- Matt McCutchen <hashproduct@gmail.com>
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -35,6 +35,7 @@ extern filter_rule_list filter_list;
+@@ -36,6 +36,7 @@ extern filter_rule_list filter_list;
extern filter_rule_list daemon_filter_list;
int make_backups = 0;
/**
* If 1, send the whole file as literal data rather than trying to
-@@ -967,6 +968,7 @@ static struct poptOption long_options[] = {
+@@ -972,6 +973,7 @@ static struct poptOption long_options[] = {
{"bwlimit", 0, POPT_ARG_STRING, &bwlimit_arg, OPT_BWLIMIT, 0, 0 },
{"no-bwlimit", 0, POPT_ARG_VAL, &bwlimit, 0, 0, 0 },
{"backup", 'b', POPT_ARG_VAL, &make_backups, 1, 0, 0 },
{"no-backup", 0, POPT_ARG_VAL, &make_backups, 0, 0, 0 },
{"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
{"suffix", 0, POPT_ARG_STRING, &backup_suffix, 0, 0, 0 },
-@@ -2768,6 +2770,8 @@ void server_options(char **args, int *argc_p)
+@@ -2769,6 +2771,8 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}
+ args[ac++] = "--source-backup";
}
- /* --delete-missing-args needs the cooperation of both sides, but
+ if (max_alloc_arg && max_alloc != DEFAULT_MAX_ALLOC) {
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
--delete-before receiver deletes before xfer, not during
-@@ -1576,6 +1577,16 @@ your home directory (remove the '=' for that).
+@@ -1578,6 +1579,16 @@ your home directory (remove the '=' for that).
Starting with 3.1.0, rsync will skip the sender-side removal (and output an
error) if the file's size or modify time has not stayed unchanged.
extern int inplace;
extern int inplace_partial;
extern int batch_fd;
-@@ -131,6 +132,7 @@ void successful_send(int ndx)
+@@ -127,6 +128,7 @@ void successful_send(int ndx)
struct file_struct *file;
struct file_list *flist;
STRUCT_STAT st;
if (!remove_source_files)
return;
-@@ -155,7 +157,11 @@ void successful_send(int ndx)
+@@ -151,7 +153,11 @@ void successful_send(int ndx)
return;
}
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
diff --git a/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -181,7 +181,7 @@ int shell_exec(const char *cmd)
+@@ -182,7 +182,7 @@ int shell_exec(const char *cmd)
}
/* Wait for a process to exit, calling io_flush while waiting. */
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -111,6 +111,7 @@ int safe_symlinks = 0;
+@@ -112,6 +112,7 @@ int safe_symlinks = 0;
int copy_unsafe_links = 0;
int munge_symlinks = 0;
int size_only = 0;
int daemon_bwlimit = 0;
int bwlimit = 0;
int fuzzy_basis = 0;
-@@ -170,6 +171,8 @@ char *logfile_name = NULL;
+@@ -171,6 +172,8 @@ char *logfile_name = NULL;
char *logfile_format = NULL;
char *stdout_format = NULL;
char *password_file = NULL;
char *early_input_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
-@@ -880,6 +883,7 @@ static struct poptOption long_options[] = {
+@@ -884,6 +887,7 @@ static struct poptOption long_options[] = {
{"chmod", 0, POPT_ARG_STRING, 0, OPT_CHMOD, 0, 0 },
{"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 },
{"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 },
{"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 },
{"no-one-file-system",0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"no-x", 0, POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
-@@ -1008,6 +1012,8 @@ static struct poptOption long_options[] = {
+@@ -1013,6 +1017,8 @@ static struct poptOption long_options[] = {
{"early-input", 0, POPT_ARG_STRING, &early_input_file, 0, 0, 0 },
{"blocking-io", 0, POPT_ARG_VAL, &blocking_io, 1, 0, 0 },
{"no-blocking-io", 0, POPT_ARG_VAL, &blocking_io, 0, 0, 0 },
{"outbuf", 0, POPT_ARG_STRING, &outbuf_mode, 0, 0, 0 },
{"remote-option", 'M', POPT_ARG_STRING, 0, 'M', 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
-@@ -2393,6 +2399,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2394,6 +2400,16 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
if (files_from) {
char *h, *p;
int q;
-@@ -2777,6 +2793,25 @@ void server_options(char **args, int *argc_p)
+@@ -2783,6 +2799,25 @@ void server_options(char **args, int *argc_p)
else if (missing_args == 1 && !am_sender)
args[ac++] = "--ignore-missing-args";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -415,6 +415,7 @@ detailed description below for a complete description.
+@@ -416,6 +416,7 @@ detailed description below for a complete description.
--contimeout=SECONDS set daemon connection timeout in seconds
--ignore-times, -I don't skip files that match size and time
--size-only skip files that match in size
--modify-window=NUM, -@ set the accuracy for mod-time comparisons
--temp-dir=DIR, -T create temporary files in directory DIR
--fuzzy, -y find similar file for basis if no dest file
-@@ -459,6 +460,8 @@ detailed description below for a complete description.
+@@ -460,6 +461,8 @@ detailed description below for a complete description.
--write-batch=FILE write a batched update to FILE
--only-write-batch=FILE like --write-batch but w/o updating dest
--read-batch=FILE read a batched update from FILE
--protocol=NUM force an older protocol version to be used
--iconv=CONVERT_SPEC request charset conversion of filenames
--checksum-seed=NUM set block/file checksum seed (advanced)
-@@ -3102,6 +3105,36 @@ your home directory (remove the '=' for that).
+@@ -3129,6 +3132,36 @@ your home directory (remove the '=' for that).
`--write-batch`. If _FILE_ is `-`, the batch data will be read from
standard input. See the "BATCH MODE" section for details.
extern struct stats stats;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
-@@ -204,6 +205,26 @@ void send_files(int f_in, int f_out)
+@@ -200,6 +201,26 @@ void send_files(int f_in, int f_out)
int f_xfer = write_batch < 0 ? batch_fd : f_out;
int save_io_error = io_error;
int ndx, j;
if (DEBUG_GTE(SEND, 1))
rprintf(FINFO, "send_files starting\n");
-@@ -338,6 +359,7 @@ void send_files(int f_in, int f_out)
+@@ -334,6 +355,7 @@ void send_files(int f_in, int f_out)
exit_cleanup(RERR_PROTOCOL);
}
fd = do_open(fname, O_RDONLY, 0);
if (fd == -1) {
if (errno == ENOENT) {
-@@ -357,6 +379,33 @@ void send_files(int f_in, int f_out)
+@@ -353,6 +375,33 @@ void send_files(int f_in, int f_out)
continue;
}
/* map the local file */
if (do_fstat(fd, &st) != 0) {
io_error |= IOERR_GENERAL;
-@@ -408,6 +457,8 @@ void send_files(int f_in, int f_out)
+@@ -404,6 +453,8 @@ void send_files(int f_in, int f_out)
}
}
close(fd);
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/fileio.c b/fileio.c
--- a/fileio.c
+++ b/fileio.c
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -78,6 +78,7 @@ int remove_source_files = 0;
+@@ -79,6 +79,7 @@ int remove_source_files = 0;
int one_file_system = 0;
int protocol_version = PROTOCOL_VERSION;
int sparse_files = 0;
int preallocate_files = 0;
int do_compression = 0;
int do_compression_level = CLVL_NOT_SPECIFIED;
-@@ -892,6 +893,7 @@ static struct poptOption long_options[] = {
+@@ -897,6 +898,7 @@ static struct poptOption long_options[] = {
{"sparse", 'S', POPT_ARG_VAL, &sparse_files, 1, 0, 0 },
{"no-sparse", 0, POPT_ARG_VAL, &sparse_files, 0, 0, 0 },
{"no-S", 0, POPT_ARG_VAL, &sparse_files, 0, 0, 0 },
{"preallocate", 0, POPT_ARG_NONE, &preallocate_files, 0, 0, 0},
{"inplace", 0, POPT_ARG_VAL, &inplace, 1, 0, 0 },
{"no-inplace", 0, POPT_ARG_VAL, &inplace, 0, 0, 0 },
-@@ -2684,6 +2686,12 @@ void server_options(char **args, int *argc_p)
+@@ -2685,6 +2687,12 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
--preallocate allocate dest files before writing them
--write-devices write to devices as files (implies --inplace)
--dry-run, -n perform a trial run with no changes made
-@@ -1436,6 +1437,18 @@ your home directory (remove the '=' for that).
+@@ -1437,6 +1438,18 @@ your home directory (remove the '=' for that).
opposed to allocated sequences of null bytes) if the kernel version and
filesystem type support creating holes in the allocated data.
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/io.c b/io.c
--- a/io.c
+++ b/io.c
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -118,6 +118,7 @@ size_t bwlimit_writemax = 0;
+@@ -119,6 +119,7 @@ size_t bwlimit_writemax = 0;
int ignore_existing = 0;
int ignore_non_existing = 0;
int need_messages_from_generator = 0;
int max_delete = INT_MIN;
OFF_T max_size = -1;
OFF_T min_size = -1;
-@@ -781,6 +782,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -785,6 +786,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG,
OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT,
OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS,
OPT_REFUSED_BASE = 9000};
static struct poptOption long_options[] = {
-@@ -989,6 +991,8 @@ static struct poptOption long_options[] = {
+@@ -994,6 +996,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 },
-@@ -1880,6 +1884,36 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1869,6 +1873,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. */
-@@ -2696,6 +2730,15 @@ void server_options(char **args, int *argc_p)
+@@ -2697,6 +2731,15 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -456,6 +456,8 @@ detailed description below for a complete description.
+@@ -457,6 +457,8 @@ detailed description below for a complete description.
--early-input=FILE use FILE for daemon's early exec input
--list-only list the files instead of copying them
--bwlimit=RATE limit socket I/O bandwidth
--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
-@@ -3071,6 +3073,22 @@ your home directory (remove the '=' for that).
+@@ -3098,6 +3100,22 @@ your home directory (remove the '=' for that).
buffered, while other can show up as very slow when the flushing of the
output buffer occurs. This may be fixed in a future version.
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
#define NORMAL_NAME 0
#define SLASH_ENDING_NAME 1
#define DOTDIR_NAME 2
-@@ -662,6 +665,23 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -658,6 +661,23 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
stats.total_size += F_LENGTH(file);
}
static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags)
{
static int64 modtime, atime;
-@@ -727,9 +747,13 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -723,9 +743,13 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
outbuf.len = 0;
}
thisname[outbuf.len] = '\0';
if (*thisname
&& (clean_fname(thisname, CFN_REFUSE_DOT_DOT_DIRS) < 0 || (!relative_paths && *thisname == '/'))) {
rprintf(FERROR, "ABORTING due to unsafe pathname from sender: %s\n", thisname);
-@@ -2489,6 +2513,15 @@ struct file_list *recv_file_list(int f, int dir_ndx)
+@@ -2478,6 +2502,15 @@ struct file_list *recv_file_list(int f, int dir_ndx)
parse_name_map(usermap, True);
if (groupmap)
parse_name_map(groupmap, False);
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -201,6 +201,7 @@ int logfile_format_has_i = 0;
+@@ -206,6 +206,7 @@ int logfile_format_has_i = 0;
int logfile_format_has_o_or_i = 0;
int always_checksum = 0;
int list_only = 0;
#define MAX_BATCH_NAME_LEN 256 /* Must be less than MAXPATHLEN-13 */
char *batch_name = NULL;
-@@ -994,6 +995,7 @@ static struct poptOption long_options[] = {
+@@ -999,6 +1000,7 @@ static struct poptOption long_options[] = {
{"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
{"iconv", 0, POPT_ARG_STRING, &iconv_opt, 0, 0, 0 },
{"no-iconv", 0, POPT_ARG_NONE, 0, OPT_NO_ICONV, 0, 0 },
{"ipv4", '4', POPT_ARG_VAL, &default_af_hint, AF_INET, 0, 0 },
{"ipv6", '6', POPT_ARG_VAL, &default_af_hint, AF_INET6, 0, 0 },
{"8-bit-output", '8', POPT_ARG_VAL, &allow_8bit_chars, 1, 0, 0 },
-@@ -2439,6 +2441,24 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -2440,6 +2442,24 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
}
am_starting_up = 0;
return 1;
-@@ -2882,6 +2902,12 @@ void server_options(char **args, int *argc_p)
+@@ -2888,6 +2908,12 @@ void server_options(char **args, int *argc_p)
if (relative_paths && !implied_dirs && (!am_sender || protocol_version >= 30))
args[ac++] = "--no-implied-dirs";
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -461,6 +461,7 @@ detailed description below for a complete description.
+@@ -462,6 +462,7 @@ detailed description below for a complete description.
--read-batch=FILE read a batched update from FILE
--protocol=NUM force an older protocol version to be used
--iconv=CONVERT_SPEC request charset conversion of filenames
--checksum-seed=NUM set block/file checksum seed (advanced)
--ipv4, -4 prefer IPv4
--ipv6, -6 prefer IPv6
-@@ -3144,6 +3145,25 @@ your home directory (remove the '=' for that).
+@@ -3171,6 +3172,25 @@ your home directory (remove the '=' for that).
free to specify just the local charset for a daemon transfer (e.g.
`--iconv=utf8`).
./configure (optional if already run)
make
-based-on: a8fc8fc2d22ba7243b96decb91c586682a05e4a1
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/syscall.c b/syscall.c
--- a/syscall.c
+++ b/syscall.c
diff --git a/compat.c b/compat.c
--- a/compat.c
+++ b/compat.c
-@@ -543,13 +543,6 @@ void setup_protocol(int f_out,int f_in)
+@@ -586,13 +586,6 @@ void setup_protocol(int f_out,int f_in)
protocol_version);
exit_cleanup(RERR_PROTOCOL);
}
#define RSYNC_XAL_INITIAL 5
#define RSYNC_XAL_LIST_INITIAL 100
-@@ -272,7 +274,7 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
+@@ -267,7 +269,7 @@ static int rsync_xal_get(const char *fname, item_list *xalp)
if (!(ptr = get_xattr_data(fname, name, &datum_len, 0)))
return -1;
/* For large datums, we store a flag and a checksum. */
name_offset = 1 + MAX_DIGEST_LEN;
sum_init(-1, checksum_seed);
-@@ -438,7 +440,7 @@ static int find_matching_xattr(const item_list *xalp)
+@@ -432,7 +434,7 @@ static int find_matching_xattr(const item_list *xalp)
|| rxas1[j].datum_len != rxas2[j].datum_len
|| strcmp(rxas1[j].name, rxas2[j].name))
break;
if (memcmp(rxas1[j].datum + 1,
rxas2[j].datum + 1,
MAX_DIGEST_LEN) != 0)
-@@ -508,13 +510,22 @@ int send_xattr(int f, stat_x *sxp)
+@@ -500,13 +502,22 @@ int send_xattr(int f, stat_x *sxp)
{
int ndx = find_matching_xattr(sxp->xattr);
for (rxa = sxp->xattr->items; count--; rxa++) {
size_t name_len = rxa->name_len;
const char *name = rxa->name;
-@@ -533,8 +544,8 @@ int send_xattr(int f, stat_x *sxp)
+@@ -525,8 +536,8 @@ int send_xattr(int f, stat_x *sxp)
name_len += UPRE_LEN;
}
#endif
#ifndef HAVE_LINUX_XATTRS
if (name_len > rxa->name_len) {
write_buf(f, USER_PREFIX, UPRE_LEN);
-@@ -542,7 +553,7 @@ int send_xattr(int f, stat_x *sxp)
+@@ -534,7 +545,7 @@ int send_xattr(int f, stat_x *sxp)
}
#endif
write_buf(f, name, name_len);
write_buf(f, rxa->datum + 1, MAX_DIGEST_LEN);
else
write_bigbuf(f, rxa->datum, rxa->datum_len);
-@@ -593,7 +604,7 @@ int xattr_diff(struct file_struct *file, stat_x *sxp, int find_all)
+@@ -585,7 +596,7 @@ int xattr_diff(struct file_struct *file, stat_x *sxp, int find_all)
cmp = rec_cnt ? strcmp(snd_rxa->name, rec_rxa->name) : -1;
if (cmp > 0)
same = 0;
same = cmp == 0 && snd_rxa->datum_len == rec_rxa->datum_len
&& memcmp(snd_rxa->datum + 1, rec_rxa->datum + 1,
MAX_DIGEST_LEN) == 0;
-@@ -639,6 +650,9 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
+@@ -631,6 +642,9 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
int cnt, prior_req = 0;
rsync_xa *rxa;
glst += F_XATTR(file);
lst = &glst->xa_items;
-@@ -698,6 +712,9 @@ int recv_xattr_request(struct file_struct *file, int f_in)
+@@ -690,6 +704,9 @@ int recv_xattr_request(struct file_struct *file, int f_in)
rsync_xa *rxa;
int rel_pos, cnt, num, got_xattr_data = 0;
if (F_XATTR(file) < 0) {
rprintf(FERROR, "recv_xattr_request: internal data error!\n");
exit_cleanup(RERR_PROTOCOL);
-@@ -784,7 +801,22 @@ void receive_xattr(int f, struct file_struct *file)
+@@ -774,7 +791,22 @@ void receive_xattr(int f, struct file_struct *file)
#else
int need_sort = 1;
#endif
if (ndx < 0 || (size_t)ndx > rsync_xal_l.count) {
rprintf(FERROR, "receive_xattr: xa index %d out of"
-@@ -797,7 +829,7 @@ void receive_xattr(int f, struct file_struct *file)
+@@ -787,7 +819,7 @@ void receive_xattr(int f, struct file_struct *file)
return;
}
(void)EXPAND_ITEM_LIST(&temp_xattr, rsync_xa, count);
temp_xattr.count = 0;
}
-@@ -805,9 +837,10 @@ void receive_xattr(int f, struct file_struct *file)
+@@ -795,9 +827,10 @@ void receive_xattr(int f, struct file_struct *file)
for (num = 1; num <= count; num++) {
char *ptr, *name;
rsync_xa *rxa;
./configure (optional if already run)
make
-based-on: 1bdf68b905b246ef4eb2959ba5e266005f761a8c
+based-on: fe2ef556d9ef11e5dd549e19a06a7a924f7ddfa1
diff --git a/checksum.c b/checksum.c
--- a/checksum.c
+++ b/checksum.c
diff --git a/rsync.1.md b/rsync.1.md
--- a/rsync.1.md
+++ b/rsync.1.md
-@@ -1474,6 +1474,8 @@ your home directory (remove the '=' for that).
+@@ -1475,6 +1475,8 @@ your home directory (remove the '=' for that).
The checksum options that you may be able to use are:
- `auto` (the default)