if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
-@@ -882,6 +902,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -895,6 +915,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
F_GROUP(file) = gid;
file->flags |= gid_flags;
}
if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
-@@ -1230,6 +1252,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1241,6 +1263,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
F_OWNER(file) = st.st_uid;
if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
F_GROUP(file) = st.st_gid;
#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
if (S_ISLNK(file->mode)) {
;
-@@ -1002,6 +1006,8 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -1014,6 +1018,8 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
if (link_dest) {
if (!hard_link_one(file, fname, cmpbuf, 1))
goto try_a_copy;
if (preserve_hard_links && F_IS_HLINKED(file))
finish_hard_link(file, fname, ndx, &sxp->st, itemizing, code, j);
if (!maybe_ATTRS_REPORT && (verbose > 1 || stdout_format_has_i > 1)) {
-@@ -1187,6 +1193,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1199,6 +1205,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
static void list_file_entry(struct file_struct *f)
{
char permbuf[PERMSTRING_SIZE];
double len;
if (!F_IS_ACTIVE(f)) {
-@@ -1201,14 +1208,16 @@ static void list_file_entry(struct file_struct *f)
+@@ -1213,14 +1220,16 @@ static void list_file_entry(struct file_struct *f)
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
f_name(f, NULL));
}
}
-@@ -2029,7 +2038,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -2052,7 +2061,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
STRUCT_STAT st;
if (link_stat(fname, &st, 0) == 0
&& cmp_time(st.st_mtime, file->modtime) != 0)
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
-@@ -650,7 +650,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
+@@ -656,7 +656,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
c[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
c[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
c[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
}
change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
-@@ -569,7 +588,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -570,7 +589,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
/* Change permissions before putting the file into place. */
set_file_attrs(fnametmp, file, NULL, fnamecmp,
/* move tmp file over real file */
if (verbose > 2)
-@@ -596,7 +615,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -597,7 +616,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
do_set_file_attrs:
set_file_attrs(fnametmp, file, NULL, fnamecmp,
/* These flags are used in the live flist data. */
-@@ -152,6 +153,7 @@
+@@ -151,6 +152,7 @@
#define ATTRS_REPORT (1<<0)
#define ATTRS_SKIP_MTIME (1<<1)
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -626,12 +628,14 @@ extern int file_extra_cnt;
+@@ -627,12 +629,14 @@ extern int file_extra_cnt;
extern int inc_recurse;
extern int uid_ndx;
extern int gid_ndx;
diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
--- a/testsuite/rsync.fns
+++ b/testsuite/rsync.fns
-@@ -192,6 +192,10 @@ checkit() {
+@@ -215,6 +215,10 @@ checkit() {
# We can just write everything to stdout/stderr, because the
# wrapper hides it unless there is a problem.
echo "Running: \"$1\""
eval "$1"
status=$?
-@@ -199,10 +203,13 @@ checkit() {
+@@ -222,10 +226,13 @@ checkit() {
failed="YES";
fi
unmake_file(file);
return 0;
}
-@@ -358,7 +383,17 @@ static int keep_backup(const char *fname)
+@@ -356,7 +381,17 @@ static int keep_backup(const char *fname)
/* main backup switch routine */
int make_backup(const char *fname)
{
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
-@@ -82,6 +82,7 @@ struct {
+@@ -83,6 +83,7 @@ struct {
{ RERR_TERMINATED , "sibling process terminated abnormally" },
{ RERR_SIGNAL1 , "received SIGUSR1" },
{ RERR_SIGNAL , "received SIGINT, SIGTERM, or SIGHUP" },
}
/* This function gets called from all 3 processes. We want the client side
-@@ -1314,6 +1317,14 @@ RETSIGTYPE remember_children(UNUSED(int val))
+@@ -1315,6 +1318,14 @@ RETSIGTYPE remember_children(UNUSED(int val))
break;
}
}
}
#endif
#ifndef HAVE_SIGACTION
-@@ -1372,6 +1383,12 @@ static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig))
+@@ -1373,6 +1384,12 @@ static RETSIGTYPE rsync_panic_handler(UNUSED(int whatsig))
}
#endif
int main(int argc,char *argv[])
{
-@@ -1394,6 +1411,11 @@ int main(int argc,char *argv[])
+@@ -1395,6 +1412,11 @@ int main(int argc,char *argv[])
SIGACTMASK(SIGFPE, rsync_panic_handler);
SIGACTMASK(SIGABRT, rsync_panic_handler);
SIGACTMASK(SIGBUS, rsync_panic_handler);
/* 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
-@@ -1014,7 +1259,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1032,7 +1277,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];
-@@ -1164,9 +1409,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1171,9 +1416,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
-@@ -1239,14 +1491,18 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1250,14 +1502,18 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
/* This code is only used by the receiver when it is building
* a list of files for a delete pass. */
if (keep_dirlinks && linkname_len && flist) {
-@@ -2159,7 +2415,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2177,7 +2433,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
* file-list to check if this is a 1-file xfer. */
send_extra_file_list(f, 1);
}
return flist;
}
-@@ -2261,7 +2518,7 @@ struct file_list *recv_file_list(int f)
+@@ -2279,7 +2536,7 @@ struct file_list *recv_file_list(int f)
else if (f >= 0)
recv_id_list(f, flist);
if (protocol_version < 30) {
/* Recv the io_error flag */
-@@ -2459,7 +2716,7 @@ void flist_free(struct file_list *flist)
+@@ -2477,7 +2734,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;
-@@ -2510,7 +2767,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2528,7 +2785,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;
-@@ -2526,8 +2783,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2544,8 +2801,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);
-@@ -2549,7 +2806,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2567,7 +2824,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
}
flist->high = prev_i;
extern int remove_source_files;
extern int delay_updates;
extern int update_only;
-@@ -709,7 +710,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -712,7 +713,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
/* Perform our quick-check heuristic for determining if a file is unchanged. */
{
if (st->st_size != F_LENGTH(file))
return 0;
-@@ -718,7 +719,10 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
+@@ -721,7 +722,10 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
of the file time to determine whether to sync */
if (always_checksum > 0 && S_ISREG(st->st_mode)) {
char sum[MAX_DIGEST_LEN];
return memcmp(sum, F_SUM(file), checksum_len) == 0;
}
-@@ -972,7 +976,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -984,7 +988,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
match_level = 1;
/* FALL THROUGH */
case 1:
continue;
best_match = j;
match_level = 2;
-@@ -1245,7 +1249,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1257,7 +1261,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
* --ignore-non-existing, daemon exclude, or mkdir failure. */
static struct file_struct *skip_dir = NULL;
static struct file_list *fuzzy_dirlist = NULL;
struct file_struct *fuzzy_file = NULL;
int fd = -1, f_copy = -1;
stat_x sx, real_sx;
-@@ -1334,8 +1338,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1346,8 +1350,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
flist_free(fuzzy_dirlist);
fuzzy_dirlist = NULL;
}
#ifdef SUPPORT_ACLS
if (!preserve_perms)
dflt_perms = default_perms_for_dir(dn);
-@@ -1343,10 +1347,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1355,10 +1359,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
parent_dirname = dn;
}
statret = link_stat(fname, &sx.st, keep_dirlinks && is_dir);
-@@ -1775,7 +1784,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1792,7 +1801,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
;
else if (fnamecmp_type == FNAMECMP_FUZZY)
;
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -686,6 +686,10 @@ extern int xattrs_ndx;
+@@ -687,6 +687,10 @@ extern int xattrs_ndx;
#define F_SUM(f) ((char*)OPT_EXTRA(f, LEN64_BUMP(f) + HLINK_BUMP(f) \
+ SUM_EXTRA_CNT - 1))
/* Some utility defines: */
#define F_IS_ACTIVE(f) (f)->basename[0]
#define F_IS_HLINKED(f) ((f)->flags & FLAG_HLINKED)
-@@ -864,6 +868,13 @@ typedef struct {
+@@ -865,6 +869,13 @@ typedef struct {
char fname[1]; /* has variable size */
} relnamecache;
}
/* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
-@@ -1364,6 +1575,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
- if (excl_ret) {
+@@ -1371,6 +1582,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++;
+ if (S_ISREG(st.st_mode))
return NULL;
}
-@@ -1410,13 +1623,13 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1417,13 +1630,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' */
-@@ -1498,7 +1711,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1509,7 +1722,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
if (always_checksum && am_sender && S_ISREG(st.st_mode)) {
if (flist && checksum_files)
else
file_checksum(thisname, st.st_size, tmp_sum);
}
-@@ -1824,6 +2037,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1839,6 +2052,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". */
-@@ -2417,6 +2633,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2435,6 +2651,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
}
} else
flist_eof = 1;
static const char *solo_file = NULL;
/* For calling delete_item() and delete_dir_contents(). */
-@@ -720,7 +721,7 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st, int slot
+@@ -723,7 +724,7 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st, int slot
if (always_checksum > 0 && S_ISREG(st->st_mode)) {
char sum[MAX_DIGEST_LEN];
if (checksum_files && slot >= 0)
else
file_checksum(fn, st->st_size, sum);
return memcmp(sum, F_SUM(file), checksum_len) == 0;
-@@ -1353,7 +1354,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1365,7 +1366,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fuzzy_dirlist = get_dirlist(fnamecmpbuf, -1, 1);
}
if (checksum_files) {
}
need_new_dirscan = 0;
}
-@@ -1498,6 +1500,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1515,6 +1517,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
else
change_local_filter_dir(fname, strlen(fname), F_DEPTH(file));
}
goto cleanup;
}
-@@ -1790,6 +1793,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1807,6 +1810,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
handle_partial_dir(partialptr, PDIR_DELETE);
}
set_file_attrs(fname, file, &sx, NULL, maybe_ATTRS_REPORT);
if (itemizing)
itemize(fnamecmp, file, ndx, statret, &sx, 0, 0, NULL);
#ifdef SUPPORT_HARD_LINKS
-@@ -2217,6 +2222,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2243,6 +2248,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];
-@@ -2297,6 +2303,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2323,6 +2329,9 @@ void generate_files(int f_out, const char *local_name)
wait_for_receiver();
}
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -870,6 +870,8 @@ typedef struct {
+@@ -871,6 +871,8 @@ typedef struct {
#define CSF_ENABLE (1<<1)
#define CSF_LAX (1<<2)
diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -1239,7 +1239,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1250,7 +1250,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
-@@ -718,7 +718,8 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
+@@ -721,7 +721,8 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
of the file time to determine whether to sync */
if (always_checksum > 0 && S_ISREG(st->st_mode)) {
char sum[MAX_DIGEST_LEN];
continue;
}
-@@ -886,6 +894,39 @@ int del_def_xattr_acl(const char *fname)
+@@ -891,6 +899,39 @@ int del_def_xattr_acl(const char *fname)
}
#endif
extern int preserve_specials;
extern int preserve_hard_links;
extern int preserve_executability;
-@@ -1670,7 +1671,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1687,7 +1688,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
-@@ -909,6 +932,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -922,6 +945,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
F_GROUP(file) = gid;
file->flags |= gid_flags;
}
if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
-@@ -1261,6 +1286,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1272,6 +1297,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
F_OWNER(file) = st.st_uid;
if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
F_GROUP(file) = st.st_gid;
#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
if (S_ISLNK(file->mode)) {
;
-@@ -1210,6 +1225,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1222,6 +1237,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
static void list_file_entry(struct file_struct *f)
{
char permbuf[PERMSTRING_SIZE];
double len;
if (!F_IS_ACTIVE(f)) {
-@@ -1224,14 +1240,16 @@ static void list_file_entry(struct file_struct *f)
+@@ -1236,14 +1252,16 @@ static void list_file_entry(struct file_struct *f)
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
f_name(f, NULL));
}
}
-@@ -1323,6 +1341,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1335,6 +1353,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
return;
}
}
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
-@@ -653,7 +653,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
+@@ -659,7 +659,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
c[8] = !(iflags & ITEM_REPORT_FFLAGS) ? '.' : 'f';
c[9] = !(iflags & ITEM_REPORT_ACL) ? '.' : 'a';
c[10] = !(iflags & ITEM_REPORT_XATTR) ? '.' : 'x';
change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
change_gid = gid_ndx && !(file->flags & FLAG_SKIP_GROUP)
-@@ -618,7 +626,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -619,7 +627,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
/* Change permissions before putting the file into place. */
set_file_attrs(fnametmp, file, NULL, fnamecmp,
ATTRS_DELAY_IMMUTABLE
/* move tmp file over real file */
if (verbose > 2)
-@@ -649,7 +657,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -650,7 +658,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
do_set_file_attrs:
set_file_attrs(fnametmp, file, NULL, fnamecmp,
#define XMIT_SAME_FLAGS (1<<14) /* protocols ?? - now */
/* These flags are used in the live flist data. */
-@@ -154,6 +155,7 @@
+@@ -153,6 +154,7 @@
#define ATTRS_REPORT (1<<0)
#define ATTRS_SKIP_MTIME (1<<1)
#define ATTRS_DELAY_IMMUTABLE (1<<2)
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -170,7 +172,7 @@
+@@ -169,7 +171,7 @@
#define FNAMECMP_FUZZY 0x83
/* For use by the itemize_changes code */
#define ITEM_REPORT_CHANGE (1<<1)
#define ITEM_REPORT_SIZE (1<<2) /* regular files only */
#define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */
-@@ -651,6 +653,7 @@ extern int file_extra_cnt;
+@@ -652,6 +654,7 @@ extern int file_extra_cnt;
extern int inc_recurse;
extern int uid_ndx;
extern int gid_ndx;
extern int fileflags_ndx;
extern int acls_ndx;
extern int xattrs_ndx;
-@@ -658,6 +661,7 @@ extern int xattrs_ndx;
+@@ -659,6 +662,7 @@ extern int xattrs_ndx;
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
#define EXTRA_LEN (sizeof (union file_extras))
#define PTR_EXTRA_CNT ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN)
#define DEV_EXTRA_CNT 2
#define DIRNODE_EXTRA_CNT 3
#define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN)
-@@ -916,6 +920,7 @@ typedef struct {
+@@ -917,6 +921,7 @@ typedef struct {
typedef struct {
STRUCT_STAT st;
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -149,6 +149,7 @@
+@@ -148,6 +148,7 @@
#define XFLG_ANCHORED2ABS (1<<2) /* leading slash indicates absolute */
#define XFLG_ABS_IF_SLASH (1<<3) /* leading or interior slash is absolute */
#define XFLG_DIR2WILD3 (1<<4) /* dir/ match gets trailing *** added */
+makepath "$chkdir/bar/down/to/CVS"
rm "$chkdir"/foo/file1
rm "$chkdir"/bar/down/to/bar/baz/*.deep
-+cp -p "$fromdir"/bar/down/to/D "$chkdir"/bar/down/to/D
-+cp -p "$fromdir"/bar/down/to/not.good "$chkdir"/bar/down/to/not.good
-+cp -p "$fromdir"/bar/down/to/CVS/Entries "$chkdir"/bar/down/to/CVS/Entries
- cp -p "$fromdir"/bar/down/to/foo/*.junk "$chkdir"/bar/down/to/foo
- cp -p "$fromdir"/bar/down/to/foo/to "$chkdir"/bar/down/to/foo
++cp_touch "$fromdir"/bar/down/to/D "$chkdir"/bar/down/to/D
++cp_touch "$fromdir"/bar/down/to/not.good "$chkdir"/bar/down/to/not.good
++cp_touch "$fromdir"/bar/down/to/CVS/Entries "$chkdir"/bar/down/to/CVS/Entries
+ cp_touch "$fromdir"/bar/down/to/foo/*.junk "$chkdir"/bar/down/to/foo
+ cp_touch "$fromdir"/bar/down/to/foo/to "$chkdir"/bar/down/to/foo
extern int size_only;
extern OFF_T max_size;
extern OFF_T min_size;
-@@ -711,6 +712,9 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -714,6 +715,9 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
/* Perform our quick-check heuristic for determining if a file is unchanged. */
int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
{
extern int keep_partial;
extern int got_xfer_error;
+extern int use_db;
- extern int progress_is_active;
extern char *partial_dir;
extern char *logfile_name;
-@@ -128,6 +129,12 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
+
+@@ -124,6 +125,12 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
/* FALLTHROUGH */
#include "case_N.h"
extern int eol_nulls;
extern int relative_paths;
extern int implied_dirs;
-@@ -1239,14 +1240,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1250,14 +1251,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(bp + basename_len, linkname, linkname_len);
#endif
/* This code is only used by the receiver when it is building
* a list of files for a delete pass. */
if (keep_dirlinks && linkname_len && flist) {
-@@ -1862,6 +1865,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -1877,6 +1880,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
| (eol_nulls || reading_remotely ? RL_EOL_NULLS : 0);
int implied_dot_dir = 0;
extern int append_mode;
extern int make_backups;
extern int csum_length;
-@@ -718,7 +719,8 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
+@@ -721,7 +722,8 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
of the file time to determine whether to sync */
if (always_checksum > 0 && S_ISREG(st->st_mode)) {
char sum[MAX_DIGEST_LEN];
return memcmp(sum, F_SUM(file), checksum_len) == 0;
}
-@@ -2174,6 +2176,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2197,6 +2199,9 @@ void generate_files(int f_out, const char *local_name)
: "enabled");
}
extern char *shell_cmd;
extern char *batch_name;
extern char *password_file;
-@@ -1490,6 +1492,9 @@ int main(int argc,char *argv[])
+@@ -1491,6 +1493,9 @@ int main(int argc,char *argv[])
exit_cleanup(RERR_SYNTAX);
}
diff = u_strcmp(fmid->basename, f->basename);
if (diff == 0) {
good_match = mid;
-@@ -1967,6 +1969,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1984,6 +1986,21 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
fnamecmp = partialptr;
fnamecmp_type = FNAMECMP_PARTIAL_DIR;
statret = 0;
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len, int flags);
-@@ -2263,6 +2305,25 @@ struct file_list *recv_file_list(int f)
+@@ -2281,6 +2323,25 @@ struct file_list *recv_file_list(int f)
flist_sort_and_clean(flist, relative_paths);
if (do_progress && !am_server)
rprintf(FINFO, " \r");
-@@ -1213,6 +1361,7 @@ static void list_file_entry(struct file_struct *f)
+@@ -1225,6 +1373,7 @@ static void list_file_entry(struct file_struct *f)
}
}
static int phase = 0;
static int dflt_perms;
-@@ -1484,9 +1633,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1501,9 +1650,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
else if (delete_during && f_out != -1 && !phase
&& !(file->flags & FLAG_MISSING_DIR)) {
change_local_filter_dir(fname, strlen(fname), F_DEPTH(file));
}
goto cleanup;
-@@ -1764,8 +1916,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1781,8 +1933,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
#endif
rsyserr(FERROR_XFER, stat_errno, "recv_generator: failed to stat %s",
full_fname(fname));
goto cleanup;
-@@ -2155,6 +2313,12 @@ void generate_files(int f_out, const char *local_name)
+@@ -2178,6 +2336,12 @@ void generate_files(int f_out, const char *local_name)
if (verbose > 2)
rprintf(FINFO, "generator starting pid=%ld\n", (long)getpid());
if (delete_before && !solo_file && cur_flist->used > 0)
do_delete_pass();
if (delete_during == 2) {
-@@ -2165,7 +2329,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2188,7 +2352,7 @@ void generate_files(int f_out, const char *local_name)
}
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -2204,7 +2368,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2230,7 +2394,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));
}
-@@ -2248,7 +2412,21 @@ void generate_files(int f_out, const char *local_name)
+@@ -2274,7 +2438,21 @@ void generate_files(int f_out, const char *local_name)
} while ((cur_flist = cur_flist->next) != NULL);
if (delete_during)
extern int ignore_existing;
extern int ignore_non_existing;
extern int inplace;
-@@ -1705,6 +1706,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1722,6 +1723,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
fnamecmp = fname;
fnamecmp_type = FNAMECMP_FNAME;
-@@ -2065,6 +2073,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2088,6 +2096,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
ignore_existing = -ignore_existing;
ignore_non_existing = -ignore_non_existing;
update_only = -update_only;
always_checksum = -always_checksum;
size_only = -size_only;
append_mode = -append_mode;
-@@ -2090,6 +2099,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2113,6 +2122,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
ignore_existing = -ignore_existing;
ignore_non_existing = -ignore_non_existing;
update_only = -update_only;
diff --git a/cleanup.c b/cleanup.c
--- a/cleanup.c
+++ b/cleanup.c
-@@ -47,7 +47,13 @@ void close_all(void)
+@@ -46,7 +46,13 @@ void close_all(void)
int fd;
int ret;
STRUCT_STAT st;
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
-@@ -876,6 +899,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
- OPT_EXTRA(file, 0)->unum = (uint32)(file_length >> 32);
+@@ -889,6 +912,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
}
+ #endif
file->mode = mode;
+#ifdef SUPPORT_FILEFLAGS
+ if (preserve_fileflags)
if (preserve_uid)
F_OWNER(file) = uid;
if (preserve_gid) {
-@@ -1226,6 +1253,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
- OPT_EXTRA(file, 0)->unum = (uint32)(st.st_size >> 32);
+@@ -1237,6 +1264,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
}
+ #endif
file->mode = st.st_mode;
+#if defined SUPPORT_FILEFLAGS || defined SUPPORT_FORCE_CHANGE
+ if (fileflags_ndx)
if (uid_ndx) /* Check uid_ndx instead of preserve_uid for del support */
F_OWNER(file) = st.st_uid;
if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
+@@ -1355,6 +1386,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
+ #endif
+ #ifdef SUPPORT_XATTRS
+ if (preserve_xattrs) {
++ sx.st.st_mode = file->mode;
+ sx.xattr = NULL;
+ if (get_xattr(fname, &sx) < 0) {
+ io_error |= IOERR_GENERAL;
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
if (!ACL_READY(*sxp))
-@@ -1429,6 +1452,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1438,6 +1461,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
file->mode = dest_mode(file->mode, sx.st.st_mode,
dflt_perms, statret == 0);
}
if (statret != 0 && basis_dir[0] != NULL) {
int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &sx,
itemizing, code);
-@@ -1464,10 +1491,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1478,10 +1505,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
/* We need to ensure that the dirs in the transfer have writable
* permissions during the time we are putting files within them.
* This is then fixed after the transfer is done. */
rsyserr(FERROR_XFER, errno,
"failed to modify permissions on %s",
full_fname(fname));
-@@ -1502,6 +1534,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1516,6 +1548,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
file->mode = dest_mode(file->mode, sx.st.st_mode, dflt_perms,
exists);
}
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links && F_HLINK_NOT_FIRST(file)
-@@ -2028,13 +2064,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -2047,13 +2083,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
continue;
fname = f_name(file, NULL);
if (!(file->mode & S_IWUSR))
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
-@@ -650,7 +650,7 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
+@@ -656,7 +656,7 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
c[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
c[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
c[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
/* These flags are used in the live flist data. */
-@@ -152,6 +153,7 @@
+@@ -151,6 +152,7 @@
#define ATTRS_REPORT (1<<0)
#define ATTRS_SKIP_MTIME (1<<1)
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -178,6 +180,7 @@
+@@ -177,6 +179,7 @@
#define ITEM_REPORT_GROUP (1<<6)
#define ITEM_REPORT_ACL (1<<7)
#define ITEM_REPORT_XATTR (1<<8)
#define ITEM_BASIS_TYPE_FOLLOWS (1<<11)
#define ITEM_XNAME_FOLLOWS (1<<12)
#define ITEM_IS_NEW (1<<13)
-@@ -458,6 +461,28 @@ typedef unsigned int size_t;
+@@ -457,6 +460,28 @@ typedef unsigned int size_t;
#endif
#endif
/* Find a variable that is either exactly 32-bits or longer.
* If some code depends on 32-bit truncation, it will need to
* take special action in a "#if SIZEOF_INT32 > 4" section. */
-@@ -626,6 +651,7 @@ extern int file_extra_cnt;
+@@ -627,6 +652,7 @@ extern int file_extra_cnt;
extern int inc_recurse;
extern int uid_ndx;
extern int gid_ndx;
extern int acls_ndx;
extern int xattrs_ndx;
-@@ -663,6 +689,11 @@ extern int xattrs_ndx;
+@@ -664,6 +690,11 @@ extern int xattrs_ndx;
/* When the associated option is on, all entries will have these present: */
#define F_OWNER(f) REQ_EXTRA(f, uid_ndx)->unum
#define F_GROUP(f) REQ_EXTRA(f, gid_ndx)->unum
diff --git a/xattrs.c b/xattrs.c
--- a/xattrs.c
+++ b/xattrs.c
-@@ -972,7 +981,7 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
+@@ -281,6 +281,10 @@ int get_xattr(const char *fname, stat_x *sxp)
+ {
+ sxp->xattr = new(item_list);
+ *sxp->xattr = empty_xattr;
++
++ if (IS_SPECIAL(sxp->st.st_mode) || IS_DEVICE(sxp->st.st_mode))
++ return 0;
++
+ if (rsync_xal_get(fname, sxp->xattr) < 0) {
+ free_xattr(sxp);
+ return -1;
+@@ -861,6 +865,11 @@ int set_xattr(const char *fname, const struct file_struct *file,
+ return -1;
+ }
+
++ if (IS_SPECIAL(sxp->st.st_mode) || IS_DEVICE(sxp->st.st_mode)) {
++ errno = ENOTSUP;
++ return -1;
++ }
++
+ ndx = F_XATTR(file);
+ return rsync_xal_set(fname, lst + ndx, fnamecmp, sxp);
+ }
+@@ -977,7 +986,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)
extern int ignore_errors;
extern int numeric_ids;
extern int recurse;
-@@ -2700,6 +2701,7 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -2718,6 +2719,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;
-@@ -2810,7 +2812,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
+@@ -2828,7 +2830,15 @@ int f_name_cmp(const struct file_struct *f1, const struct file_struct *f2)
if (type1 != type2)
return type1 == t_PATH ? 1 : -1;
}
+ if ((always_checksum || link_by_hash_dir) && S_ISREG(mode))
extra_len += SUM_EXTRA_CNT * EXTRA_LEN;
- if (file_length > 0xFFFFFFFFu && S_ISREG(mode))
+ #if SIZEOF_INT64 >= 8
diff --git a/hashlink.c b/hashlink.c
new file mode 100644
--- /dev/null
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct chmod_mode_struct *daemon_chmod_modes;
#ifdef ICONV_OPTION
-@@ -574,8 +575,15 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -575,8 +576,15 @@ int finish_transfer(const char *fname, const char *fnametmp,
/* move tmp file over real file */
if (verbose > 2)
rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -824,6 +824,14 @@ struct stats {
+@@ -825,6 +825,14 @@ struct stats {
int num_transferred_files;
};
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
-@@ -57,6 +57,9 @@ extern char curr_dir[];
+@@ -58,6 +58,9 @@ extern char curr_dir[];
extern char *module_dir;
extern unsigned int module_dirlen;
static int log_initialised;
static int logfile_was_closed;
static FILE *logfile_fp;
-@@ -622,6 +625,19 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
+@@ -628,6 +631,19 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
snprintf(buf2, sizeof buf2, fmt, (double)b);
n = buf2;
break;
iflags |= ITEM_REPORT_GROUP;
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
-@@ -1422,7 +1425,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1434,7 +1437,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
real_sx = sx;
if (file->flags & FLAG_DIR_CREATED)
statret = -1;
+#endif
extern int keep_partial;
extern int got_xfer_error;
- extern int progress_is_active;
-@@ -125,6 +128,14 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
+ extern char *partial_dir;
+@@ -121,6 +124,14 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
code, file, line);
}
#define SYMLINK_PREFIX "/rsyncd-munged/"
#define SYMLINK_PREFIX_LEN ((int)sizeof SYMLINK_PREFIX - 1)
-@@ -543,6 +544,11 @@ typedef unsigned int size_t;
+@@ -544,6 +545,11 @@ typedef unsigned int size_t;
# define SIZEOF_INT64 SIZEOF_OFF_T
#endif
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -608,6 +608,13 @@ struct ht_int64_node {
+@@ -609,6 +609,13 @@ struct ht_int64_node {
#define ACLS_NEED_MASK 1
#endif
extern struct stats stats;
extern char *filesfrom_host;
-@@ -1557,6 +1558,9 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
+@@ -1572,6 +1573,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/main.c b/main.c
--- a/main.c
+++ b/main.c
-@@ -1120,6 +1120,18 @@ static int start_client(int argc, char *argv[])
+@@ -1121,6 +1121,18 @@ static int start_client(int argc, char *argv[])
if (!read_batch) { /* for read_batch, NO source is specified */
char *path = check_for_hostspec(argv[0], &shell_machine, &rsync_port);
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -191,6 +191,10 @@
+@@ -190,6 +190,10 @@
#define SIGNIFICANT_ITEM_FLAGS (~(\
ITEM_BASIS_TYPE_FOLLOWS | ITEM_XNAME_FOLLOWS | ITEM_LOCAL_CHANGE))
extern int size_only;
extern OFF_T max_size;
extern OFF_T min_size;
-@@ -711,7 +712,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -714,7 +715,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
/* Perform our quick-check heuristic for determining if a file is unchanged. */
int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
{
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -135,6 +135,7 @@
+@@ -134,6 +134,7 @@
#define IOERR_DEL_LIMIT (1<<2)
#define MAX_ARGS 1000
gid = match_gid(gid, &gid_flags);
}
}
-@@ -2170,8 +2171,13 @@ struct file_list *recv_file_list(int f)
+@@ -2188,8 +2189,13 @@ struct file_list *recv_file_list(int f)
int dstart, flags;
int64 start_read;
same = cmp == 0 && snd_rxa->datum_len == rec_rxa->datum_len
&& memcmp(snd_rxa->datum + 1, rec_rxa->datum + 1,
MAX_DIGEST_LEN) == 0;
-@@ -512,6 +523,9 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
+@@ -514,6 +525,9 @@ void send_xattr_request(const char *fname, struct file_struct *file, int f_out)
int cnt, prior_req = 0;
rsync_xa *rxa;
lst += F_XATTR(file);
for (rxa = lst->items, cnt = lst->count; cnt--; rxa++) {
if (rxa->datum_len <= MAX_FULL_DATUM)
-@@ -566,6 +580,9 @@ int recv_xattr_request(struct file_struct *file, int f_in)
+@@ -570,6 +584,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_STREAMIO);
-@@ -627,7 +644,22 @@ void receive_xattr(struct file_struct *file, int f)
+@@ -632,7 +649,22 @@ void receive_xattr(struct file_struct *file, int f)
#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"
-@@ -640,7 +672,7 @@ void receive_xattr(struct file_struct *file, int f)
+@@ -645,7 +677,7 @@ void receive_xattr(struct file_struct *file, int f)
return;
}
(void)EXPAND_ITEM_LIST(&temp_xattr, rsync_xa, count);
temp_xattr.count = 0;
}
-@@ -648,9 +680,10 @@ void receive_xattr(struct file_struct *file, int f)
+@@ -653,9 +685,10 @@ void receive_xattr(struct file_struct *file, int f)
for (num = 1; num <= count; num++) {
char *ptr, *name;
rsync_xa *rxa;