extern int copy_links;
extern int copy_unsafe_links;
extern int protocol_version;
-@@ -68,6 +70,7 @@ extern int sanitize_paths;
- extern int munge_symlinks;
+@@ -69,6 +71,7 @@ extern int munge_symlinks;
extern int need_unsorted_flist;
+ extern int sender_symlink_iconv;
extern int unsort_ndx;
+extern char *basis_dir[];
extern struct stats stats;
extern char *filesfrom_host;
-@@ -83,6 +86,12 @@ extern int filesfrom_convert;
+@@ -84,6 +87,12 @@ extern int filesfrom_convert;
extern iconv_t ic_send, ic_recv;
#endif
#define PTR_SIZE (sizeof (struct file_struct *))
int io_error;
-@@ -124,7 +133,11 @@ static char empty_sum[MAX_DIGEST_LEN];
+@@ -125,7 +134,11 @@ static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
static int dir_count = 0;
static void output_flist(struct file_list *flist);
void init_flist(void)
-@@ -338,6 +351,238 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -339,6 +352,238 @@ static void flist_done_allocating(struct file_list *flist)
flist->pool_boundary = ptr;
}
/* Call this with EITHER (1) "file, NULL, 0" to chdir() to the file's
* F_PATHNAME(), or (2) "NULL, dir, dirlen" to chdir() to the supplied dir,
* with dir == NULL taken to be the starting directory, and dirlen < 0
-@@ -1032,7 +1277,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1068,7 +1313,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];
-@@ -1171,9 +1416,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1207,9 +1452,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
-@@ -1250,14 +1502,18 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1286,14 +1538,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) {
-@@ -2177,7 +2433,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2253,7 +2509,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;
}
-@@ -2279,7 +2536,7 @@ struct file_list *recv_file_list(int f)
+@@ -2355,7 +2612,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 */
-@@ -2477,7 +2734,7 @@ void flist_free(struct file_list *flist)
+@@ -2553,7 +2810,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;
-@@ -2528,7 +2785,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2604,7 +2861,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;
-@@ -2544,8 +2801,8 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2620,8 +2877,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);
-@@ -2567,7 +2824,7 @@ static void flist_sort_and_clean(struct file_list *flist, int strip_root)
+@@ -2643,7 +2900,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;
-@@ -712,7 +713,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -713,7 +714,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;
-@@ -721,7 +722,10 @@ int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
+@@ -722,7 +723,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;
}
-@@ -985,7 +989,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -986,7 +990,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;
-@@ -1258,7 +1262,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1259,7 +1263,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;
-@@ -1347,8 +1351,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1348,8 +1352,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);
-@@ -1356,10 +1360,15 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1357,10 +1361,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);
-@@ -1793,7 +1802,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1794,7 +1803,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
-@@ -690,6 +690,10 @@ extern int xattrs_ndx;
+@@ -692,6 +692,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)
-@@ -868,6 +872,13 @@ typedef struct {
+@@ -870,6 +874,13 @@ typedef struct {
char fname[1]; /* has variable size */
} relnamecache;