#endif
/* These index values are for the file-list's extra-attribute array. */
--int uid_ndx, gid_ndx, acls_ndx, xattrs_ndx;
-+int uid_ndx, gid_ndx, atimes_ndx, acls_ndx, xattrs_ndx;
- #ifdef ICONV_OPTION
- int ic_ndx;
+-int uid_ndx, gid_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
++int uid_ndx, gid_ndx, atimes_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
-@@ -125,6 +126,8 @@ void setup_protocol(int f_out,int f_in)
+ #ifdef ICONV_OPTION
+ int filesfrom_convert = 0;
+@@ -124,6 +125,8 @@ void setup_protocol(int f_out,int f_in)
uid_ndx = ++file_extra_cnt;
if (preserve_gid)
gid_ndx = ++file_extra_cnt;
extern int relative_paths;
extern int implied_dirs;
extern int file_extra_cnt;
-@@ -334,6 +335,7 @@ int push_pathname(const char *dir, int l
+@@ -338,6 +339,7 @@ int push_pathname(const char *dir, int l
static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ndx)
{
static time_t modtime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
-@@ -440,6 +442,13 @@ static void send_file_entry(int f, struc
+@@ -444,6 +446,13 @@ static void send_file_entry(int f, struc
xflags |= XMIT_SAME_TIME;
else
modtime = file->modtime;
#ifdef SUPPORT_HARD_LINKS
if (tmp_dev != 0) {
-@@ -513,6 +522,8 @@ static void send_file_entry(int f, struc
+@@ -517,6 +526,8 @@ static void send_file_entry(int f, struc
}
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (uid_ndx && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -599,7 +610,7 @@ static void send_file_entry(int f, struc
+@@ -603,7 +614,7 @@ static void send_file_entry(int f, struc
static struct file_struct *recv_file_entry(struct file_list *flist,
int xflags, int f)
{
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
-@@ -732,6 +743,16 @@ static struct file_struct *recv_file_ent
+@@ -736,6 +747,16 @@ static struct file_struct *recv_file_ent
}
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
-@@ -860,6 +881,8 @@ static struct file_struct *recv_file_ent
+@@ -864,6 +885,8 @@ static struct file_struct *recv_file_ent
F_GROUP(file) = gid;
file->flags |= gid_flags;
}
+ if (atimes_ndx)
-+ F_ATIME(file) = (time_t)atime;
- #ifdef ICONV_OPTION
- if (ic_ndx)
++ F_ATIME(file) = (uint32)atime;
+ if (unsort_ndx)
F_NDX(file) = flist->used + flist->ndx_start;
+
@@ -1186,6 +1209,8 @@ struct file_struct *make_file(const char
F_OWNER(file) = st.st_uid;
if (gid_ndx)
F_GROUP(file) = st.st_gid;
+ if (atimes_ndx)
-+ F_ATIME(file) = st.st_atime;
++ F_ATIME(file) = (uint32)st.st_atime;
if (basename != thisname)
file->dirname = lastdir;
extern int uid_ndx;
extern int gid_ndx;
extern int delete_mode;
-@@ -562,6 +563,9 @@ void itemize(const char *fnamecmp, struc
+@@ -568,6 +569,9 @@ void itemize(const char *fnamecmp, struc
&& (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
|| (keep_time && cmp_time(file->modtime, sxp->st.st_mtime) != 0))
iflags |= ITEM_REPORT_TIME;
#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
if (S_ISLNK(file->mode)) {
;
-@@ -884,6 +888,8 @@ static int try_dests_reg(struct file_str
+@@ -923,6 +927,8 @@ static int try_dests_reg(struct file_str
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 (itemizing && (verbose > 1 || stdout_format_has_i > 1)) {
-@@ -1080,6 +1086,7 @@ static int try_dests_non(struct file_str
+@@ -1113,6 +1119,7 @@ static int try_dests_non(struct file_str
static void list_file_entry(struct file_struct *f)
{
char permbuf[PERMSTRING_SIZE];
double len;
if (!F_IS_ACTIVE(f)) {
-@@ -1094,14 +1101,16 @@ static void list_file_entry(struct file_
+@@ -1127,14 +1134,16 @@ static void list_file_entry(struct file_
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
f_name(f, NULL));
}
}
-@@ -1851,7 +1860,7 @@ static void touch_up_dirs(struct file_li
+@@ -1884,7 +1893,7 @@ static void touch_up_dirs(struct file_li
if (!(file->mode & S_IWUSR))
do_chmod(fname, file->mode);
if (need_retouch_dir_times)
extern int preserve_times;
extern int am_root;
extern int am_server;
-@@ -340,6 +341,7 @@ int set_file_attrs(const char *fname, st
+@@ -343,6 +344,7 @@ int set_file_attrs(const char *fname, st
int updated = 0;
stat_x sx2;
int change_uid, change_gid;
mode_t new_mode = file->mode;
int inherit;
-@@ -380,18 +382,36 @@ int set_file_attrs(const char *fname, st
+@@ -383,18 +385,36 @@ int set_file_attrs(const char *fname, st
set_stat_xattr(fname, file);
#endif
#define FULL_FLUSH 1
#define NORMAL_FLUSH 0
-@@ -602,6 +604,7 @@ extern int file_extra_cnt;
+@@ -608,6 +610,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;
-@@ -639,6 +642,7 @@ extern int xattrs_ndx;
+@@ -645,6 +648,7 @@ 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
+#define F_ATIME(f) REQ_EXTRA(f, atimes_ndx)->unum
#define F_ACL(f) REQ_EXTRA(f, acls_ndx)->num
#define F_XATTR(f) REQ_EXTRA(f, xattrs_ndx)->num
- #define F_NDX(f) REQ_EXTRA(f, ic_ndx)->num
+ #define F_NDX(f) REQ_EXTRA(f, unsort_ndx)->num
--- old/rsync.yo
+++ new/rsync.yo
@@ -349,6 +349,7 @@ to the detailed description below for a
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
-@@ -965,6 +966,12 @@ it is preserving modification times (see
+@@ -973,6 +974,12 @@ it is preserving modification times (see
the directories on the receiving side, it is a good idea to use bf(-O).
This option is inferred if you use bf(--backup) without bf(--backup-dir).
dit(bf(--super)) This tells the receiving side to attempt super-user
activities even if the receiving rsync wasn't run by the super-user. These
activities include: preserving users via the bf(--owner) option, preserving
-@@ -1646,8 +1653,10 @@ quote(itemization(
+@@ -1654,8 +1661,10 @@ quote(itemization(
sender's value (requires bf(--owner) and super-user privileges).
it() A bf(g) means the group is different and is being updated to the
sender's value (requires bf(--group) and the authority to set the group).
t[1].tv_usec = 0;
@@ -154,12 +158,12 @@ int set_modtime(const char *fname, time_
return utimes(fname, t);
- #elif defined HAVE_UTIMBUF
+ #elif defined HAVE_STRUCT_UTIMBUF
struct utimbuf tbuf;
- tbuf.actime = time(NULL);
+ tbuf.actime = atime;
extern int protect_args;
extern int preserve_uid;
extern int preserve_gid;
-@@ -108,6 +109,7 @@ void set_allow_inc_recurse(void)
+@@ -107,6 +108,7 @@ void set_allow_inc_recurse(void)
allow_inc_recurse = 0;
else if (!am_sender
&& (delete_before || delete_after
+extern int detect_renamed;
extern int protocol_version;
extern int sanitize_paths;
- extern struct stats stats;
-@@ -113,6 +114,8 @@ static int64 tmp_dev, tmp_ino;
+ extern int need_unsorted_flist;
+@@ -117,6 +118,8 @@ static int64 tmp_dev, tmp_ino;
#endif
static char tmp_sum[MAX_DIGEST_LEN];
static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
static int dir_count = 0;
-@@ -252,6 +255,45 @@ static int is_excluded(char *fname, int
+@@ -256,6 +259,45 @@ static int is_excluded(char *fname, int
return 0;
}
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len, int flags);
-@@ -2154,6 +2196,25 @@ struct file_list *recv_file_list(int f)
+@@ -2169,6 +2211,25 @@ struct file_list *recv_file_list(int f)
clean_flist(flist, relative_paths);
extern int whole_file;
extern int list_only;
extern int read_batch;
-@@ -95,6 +96,7 @@ extern char *backup_suffix;
+@@ -96,6 +97,7 @@ extern char *backup_suffix;
extern int backup_suffix_len;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct filter_list_struct server_filter_list;
+extern struct file_list the_fattr_list;
- #ifdef ICONV_OPTION
- extern int ic_ndx;
- #endif
-@@ -105,6 +107,7 @@ int maybe_ATTRS_REPORT = 0;
+
+ int ignore_perishable = 0;
+ int non_perishable_cnt = 0;
+@@ -103,6 +105,7 @@ int maybe_ATTRS_REPORT = 0;
static dev_t dev_zero;
static int deletion_count = 0; /* used to implement --max-delete */
static int deldelay_size = 0, deldelay_cnt = 0;
static char *deldelay_buf = NULL;
static int deldelay_fd = -1;
-@@ -114,7 +117,8 @@ static int need_retouch_dir_times;
+@@ -112,7 +115,8 @@ static int need_retouch_dir_times;
static int need_retouch_dir_perms;
static const char *solo_file = NULL;
#define DEL_RECURSE (1<<1) /* recurse */
#define DEL_DIR_IS_EMPTY (1<<2) /* internal delete_FUNCTIONS use only */
-@@ -136,11 +140,121 @@ static int is_backup_file(char *fn)
+@@ -134,11 +138,121 @@ static int is_backup_file(char *fn)
return k > 0 && strcmp(fn+k, backup_suffix) == 0;
}
*/
static enum delret delete_item(char *fbuf, int mode, char *replace, int flags)
{
-@@ -162,6 +276,8 @@ static enum delret delete_item(char *fbu
+@@ -160,6 +274,8 @@ static enum delret delete_item(char *fbu
goto check_ret;
/* OK: try to delete the directory. */
}
if (!replace && max_delete >= 0 && ++deletion_count > max_delete)
return DR_AT_LIMIT;
-@@ -208,6 +324,8 @@ static enum delret delete_item(char *fbu
+@@ -206,6 +322,8 @@ static enum delret delete_item(char *fbu
* its contents, otherwise just checks for content. Returns DR_SUCCESS or
* DR_NOT_EMPTY. Note that fname must point to a MAXPATHLEN buffer! (The
* buffer is used for recursion, but returned unchanged.)
*/
static enum delret delete_dir_contents(char *fname, int flags)
{
-@@ -227,7 +345,9 @@ static enum delret delete_dir_contents(c
+@@ -225,7 +343,9 @@ static enum delret delete_dir_contents(c
save_filters = push_local_filters(fname, dlen);
non_perishable_cnt = 0;
ret = non_perishable_cnt ? DR_NOT_EMPTY : DR_SUCCESS;
if (!dirlist->used)
-@@ -264,6 +384,8 @@ static enum delret delete_dir_contents(c
+@@ -262,6 +382,8 @@ static enum delret delete_dir_contents(c
if (S_ISDIR(fp->mode)
&& delete_dir_contents(fname, flags | DEL_RECURSE) != DR_SUCCESS)
ret = DR_NOT_EMPTY;
if (delete_item(fname, fp->mode, NULL, flags) != DR_SUCCESS)
ret = DR_NOT_EMPTY;
}
-@@ -416,13 +538,18 @@ static void do_delayed_deletions(char *d
+@@ -414,13 +536,18 @@ static void do_delayed_deletions(char *d
* all the --delete-WHEN options. Note that the fbuf pointer must point to a
* MAXPATHLEN buffer with the name of the directory in it (the functions we
* call will append names onto the end, but the old dir value will be restored
if (!fbuf) {
change_local_filter_dir(NULL, 0, 0);
-@@ -432,21 +559,28 @@ static void delete_in_dir(char *fbuf, st
+@@ -430,21 +557,28 @@ static void delete_in_dir(char *fbuf, st
if (verbose > 2)
rprintf(FINFO, "delete_in_dir(%s)\n", fbuf);
if (one_file_system) {
if (file->flags & FLAG_TOP_DIR)
filesystem_dev = *fs_dev;
-@@ -456,6 +590,14 @@ static void delete_in_dir(char *fbuf, st
+@@ -454,6 +588,14 @@ static void delete_in_dir(char *fbuf, st
dirlist = get_dirlist(fbuf, dlen, 0);
/* If an item in dirlist is not found in flist, delete it
* from the filesystem. */
for (i = dirlist->used; i--; ) {
-@@ -468,16 +610,25 @@ static void delete_in_dir(char *fbuf, st
+@@ -466,16 +608,25 @@ static void delete_in_dir(char *fbuf, st
f_name(fp, NULL));
continue;
}
flist_free(dirlist);
}
-@@ -507,9 +658,9 @@ static void do_delete_pass(void)
+@@ -505,9 +656,9 @@ static void do_delete_pass(void)
|| !S_ISDIR(st.st_mode))
continue;
if (do_progress && !am_server)
rprintf(FINFO, " \r");
-@@ -1106,6 +1257,7 @@ static void list_file_entry(struct file_
+@@ -1139,6 +1290,7 @@ static void list_file_entry(struct file_
}
}
static int phase = 0;
static int dflt_perms;
-@@ -1350,8 +1502,12 @@ static void recv_generator(char *fname,
+@@ -1383,8 +1535,12 @@ static void recv_generator(char *fname,
}
}
else if (delete_during && f_out != -1 && !phase && dry_run < 2
goto cleanup;
}
-@@ -1629,8 +1785,14 @@ static void recv_generator(char *fname,
+@@ -1662,8 +1818,14 @@ static void recv_generator(char *fname,
goto cleanup;
}
#endif
rsyserr(FERROR, stat_errno, "recv_generator: failed to stat %s",
full_fname(fname));
goto cleanup;
-@@ -1966,6 +2128,12 @@ void generate_files(int f_out, const cha
+@@ -2000,6 +2162,12 @@ void generate_files(int f_out, const cha
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) {
-@@ -1976,7 +2144,7 @@ void generate_files(int f_out, const cha
+@@ -2010,7 +2178,7 @@ void generate_files(int f_out, const cha
}
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -2014,7 +2182,7 @@ void generate_files(int f_out, const cha
+@@ -2048,7 +2216,7 @@ void generate_files(int f_out, const cha
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
} else
dirdev = MAKEDEV(0, 0);
}
}
}
-@@ -2059,7 +2227,21 @@ void generate_files(int f_out, const cha
+@@ -2091,7 +2259,21 @@ void generate_files(int f_out, const cha
} while ((cur_flist = cur_flist->next) != NULL);
if (delete_during)
--compare-dest=DIR also compare received files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
-@@ -1430,6 +1431,21 @@ Note that the use of the bf(--delete) op
+@@ -1438,6 +1439,21 @@ Note that the use of the bf(--delete) op
fuzzy-match files, so either use bf(--delete-after) or specify some
filename exclusions if you need to prevent this.
files against doing transfers (if the files are missing in the destination
--- old/util.c
+++ new/util.c
-@@ -1030,6 +1030,32 @@ int handle_partial_dir(const char *fname
+@@ -1042,6 +1042,32 @@ int handle_partial_dir(const char *fname
return 1;
}
#endif
/* These index values are for the file-list's extra-attribute array. */
--int uid_ndx, gid_ndx, acls_ndx, xattrs_ndx;
-+int uid_ndx, gid_ndx, fileflags_ndx, acls_ndx, xattrs_ndx;
- #ifdef ICONV_OPTION
- int ic_ndx;
+-int uid_ndx, gid_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
++int uid_ndx, gid_ndx, fileflags_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
-@@ -125,6 +126,8 @@ void setup_protocol(int f_out,int f_in)
+ #ifdef ICONV_OPTION
+ int filesfrom_convert = 0;
+@@ -124,6 +125,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_xattrs)
--- old/configure.in
+++ new/configure.in
-@@ -557,7 +557,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd
+@@ -544,7 +544,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd
memmove lchown vsnprintf snprintf vasprintf asprintf setsid glob strpbrk \
strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \
setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
extern int uid_ndx;
extern int gid_ndx;
extern int eol_nulls;
-@@ -335,6 +336,9 @@ static void send_file_entry(int f, struc
+@@ -339,6 +340,9 @@ static void send_file_entry(int f, struc
{
static time_t modtime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -393,6 +397,12 @@ static void send_file_entry(int f, struc
+@@ -397,6 +401,12 @@ static void send_file_entry(int f, struc
xflags |= XMIT_SAME_MODE;
else
mode = file->mode;
if ((preserve_devices && IS_DEVICE(mode))
|| (preserve_specials && IS_SPECIAL(mode))) {
-@@ -513,6 +523,10 @@ static void send_file_entry(int f, struc
+@@ -517,6 +527,10 @@ static void send_file_entry(int f, struc
}
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (uid_ndx && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -601,6 +615,9 @@ static struct file_struct *recv_file_ent
+@@ -605,6 +619,9 @@ static struct file_struct *recv_file_ent
{
static int64 modtime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -732,9 +749,12 @@ static struct file_struct *recv_file_ent
+@@ -736,9 +753,12 @@ static struct file_struct *recv_file_ent
}
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
if (uid_ndx && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
-@@ -854,6 +874,10 @@ static struct file_struct *recv_file_ent
+@@ -858,6 +878,10 @@ static struct file_struct *recv_file_ent
OPT_EXTRA(file, 0)->unum = (uint32)(file_length >> 32);
}
file->mode = mode;
if (gid_ndx)
--- old/generator.c
+++ new/generator.c
-@@ -114,6 +114,14 @@ static int need_retouch_dir_times;
+@@ -112,6 +112,14 @@ static int need_retouch_dir_times;
static int need_retouch_dir_perms;
static const char *solo_file = NULL;
/* For calling delete_item() and delete_dir_contents(). */
#define DEL_RECURSE (1<<1) /* recurse */
#define DEL_DIR_IS_EMPTY (1<<2) /* internal delete_FUNCTIONS use only */
-@@ -129,7 +137,6 @@ enum delret {
+@@ -127,7 +135,6 @@ enum delret {
/* Forward declaration for delete_item(). */
static enum delret delete_dir_contents(char *fname, int flags);
static int is_backup_file(char *fn)
{
int k = strlen(fn) - backup_suffix_len;
-@@ -142,17 +149,20 @@ static int is_backup_file(char *fn)
+@@ -140,17 +147,20 @@ static int is_backup_file(char *fn)
* Note that fbuf must point to a MAXPATHLEN buffer if the mode indicates it's
* a directory! (The buffer is used for recursion, but returned unchanged.)
*/
if (S_ISDIR(mode) && !(flags & DEL_DIR_IS_EMPTY)) {
ignore_perishable = 1;
/* If DEL_RECURSE is not set, this just reports emptiness. */
-@@ -264,7 +274,7 @@ static enum delret delete_dir_contents(c
+@@ -262,7 +272,7 @@ static enum delret delete_dir_contents(c
if (S_ISDIR(fp->mode)
&& delete_dir_contents(fname, flags | DEL_RECURSE) != DR_SUCCESS)
ret = DR_NOT_EMPTY;
ret = DR_NOT_EMPTY;
}
-@@ -320,8 +330,9 @@ static int remember_delete(struct file_s
-
+@@ -318,8 +328,9 @@ static int remember_delete(struct file_s
+
while (1) {
len = snprintf(deldelay_buf + deldelay_cnt,
- deldelay_size - deldelay_cnt,
if ((deldelay_cnt += len) <= deldelay_size)
break;
if (deldelay_fd < 0 && !start_delete_delay_temp())
-@@ -334,7 +345,7 @@ static int remember_delete(struct file_s
+@@ -332,7 +343,7 @@ static int remember_delete(struct file_s
return 1;
}
{
static int read_pos = 0;
int j, len, mode;
-@@ -376,12 +387,12 @@ static int read_delay_line(char *buf)
+@@ -374,12 +385,12 @@ static int read_delay_line(char *buf)
bp = deldelay_buf + read_pos;
len = j - read_pos - (past_space - bp) + 1; /* count the '\0' */
read_pos = j + 1;
-@@ -399,15 +410,15 @@ static int read_delay_line(char *buf)
+@@ -397,15 +408,15 @@ static int read_delay_line(char *buf)
static void do_delayed_deletions(char *delbuf)
{
if (deldelay_fd >= 0)
close(deldelay_fd);
}
-@@ -474,7 +485,7 @@ static void delete_in_dir(char *fbuf, st
+@@ -472,7 +483,7 @@ static void delete_in_dir(char *fbuf, st
if (!remember_delete(fp, delbuf))
break;
} else
}
}
-@@ -1263,7 +1274,7 @@ static void recv_generator(char *fname,
+@@ -1296,7 +1307,7 @@ static void recv_generator(char *fname,
* full later (right before we handle its contents). */
if (statret == 0
&& (S_ISDIR(sx.st.st_mode)
goto cleanup; /* Any errors get reported later. */
if (do_mkdir(fname, file->mode & 0700) == 0)
file->flags |= FLAG_DIR_CREATED;
-@@ -1275,7 +1286,7 @@ static void recv_generator(char *fname,
+@@ -1308,7 +1319,7 @@ static void recv_generator(char *fname,
* we need to delete it. If it doesn't exist, then
* (perhaps recursively) create it. */
if (statret == 0 && !S_ISDIR(sx.st.st_mode)) {
goto skipping_dir_contents;
statret = -1;
}
-@@ -1404,7 +1415,7 @@ static void recv_generator(char *fname,
+@@ -1437,7 +1448,7 @@ static void recv_generator(char *fname,
}
/* Not the right symlink (or not a symlink), so
* delete it. */
goto cleanup;
} else if (basis_dir[0] != NULL) {
int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &sx,
-@@ -1483,7 +1494,7 @@ static void recv_generator(char *fname,
+@@ -1516,7 +1527,7 @@ static void recv_generator(char *fname,
goto return_with_success;
goto cleanup;
}
goto cleanup;
} else if (basis_dir[0] != NULL) {
int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &sx,
-@@ -1574,7 +1585,7 @@ static void recv_generator(char *fname,
+@@ -1607,7 +1618,7 @@ static void recv_generator(char *fname,
fnamecmp_type = FNAMECMP_FNAME;
if (statret == 0 && !S_ISREG(sx.st.st_mode)) {
/* These flags are used in the live flist data. */
-@@ -435,6 +436,10 @@ typedef unsigned int size_t;
+@@ -441,6 +442,10 @@ 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. */
-@@ -602,6 +607,7 @@ extern int file_extra_cnt;
+@@ -608,6 +613,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;
-@@ -639,6 +645,7 @@ extern int xattrs_ndx;
+@@ -645,6 +651,7 @@ 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
+#define F_FFLAGS(f) REQ_EXTRA(f, fileflags_ndx)->unum
#define F_ACL(f) REQ_EXTRA(f, acls_ndx)->num
#define F_XATTR(f) REQ_EXTRA(f, xattrs_ndx)->num
- #define F_NDX(f) REQ_EXTRA(f, ic_ndx)->num
+ #define F_NDX(f) REQ_EXTRA(f, unsort_ndx)->num
--- old/rsync.yo
+++ new/rsync.yo
@@ -338,6 +338,7 @@ to the detailed description below for a
dit(--no-OPTION) You may turn off one or more implied options by prefixing
the option name with "no-". Not all options may be prefixed with a "no-":
-@@ -900,6 +903,13 @@ super-user copies all namespaces except
+@@ -908,6 +911,13 @@ super-user copies all namespaces except
the user.* namespace. To be able to backup and restore non-user namespaces as
a normal user, see the bf(--fake-super) option.
popt/popthelp.o popt/poptparse.o
--- old/flist.c
+++ new/flist.c
-@@ -65,6 +65,7 @@ extern int protocol_version;
- extern int sanitize_paths;
+@@ -67,6 +67,7 @@ extern int need_unsorted_flist;
+ extern int unsort_ndx;
extern struct stats stats;
extern char *filesfrom_host;
+extern char *link_by_hash_dir;
- #ifdef ICONV_OPTION
- extern char *iconv_opt;
- #endif
-@@ -818,7 +819,7 @@ static struct file_struct *recv_file_ent
+
+ extern char curr_dir[MAXPATHLEN];
+
+@@ -815,7 +816,7 @@ static struct file_struct *recv_file_ent
extra_len += (S_ISDIR(mode) ? 2 : 1) * EXTRA_LEN;
#endif
+ mdfour_update(&mdfour_data, (uchar*)map, len);
}
- if (updating_basis) {
+ if (updating_basis_or_equiv) {
@@ -299,6 +308,8 @@ static int receive_data(int f_in, char *
}
}
static void handle_delayed_updates(char *local_name)
-@@ -667,7 +678,7 @@ int recv_files(int f_in, char *local_nam
+@@ -673,7 +684,7 @@ int recv_files(int f_in, char *local_nam
/* recv file data */
recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
--- old/flist.c
+++ new/flist.c
-@@ -63,6 +63,7 @@ extern int copy_links;
- extern int copy_unsafe_links;
- extern int protocol_version;
+@@ -65,6 +65,7 @@ extern int protocol_version;
extern int sanitize_paths;
+ extern int need_unsorted_flist;
+ extern int unsort_ndx;
+extern unsigned long sleep_asec;
extern struct stats stats;
extern char *filesfrom_host;
-@@ -1465,6 +1466,9 @@ static void send_directory(int f, struct
+@@ -1480,6 +1481,9 @@ static void send_directory(int f, struct
}
send_file_name(f, flist, fbuf, NULL, flags, filter_level);
--- old/flist.c
+++ new/flist.c
-@@ -63,6 +63,8 @@ extern int copy_links;
- extern int copy_unsafe_links;
- extern int protocol_version;
- extern int sanitize_paths;
-+extern char *usermap;
-+extern char *groupmap;
+@@ -67,6 +67,7 @@ extern int need_unsorted_flist;
+ extern int unsort_ndx;
extern struct stats stats;
extern char *filesfrom_host;
++extern char *usermap, *groupmap;
+
+ extern char curr_dir[MAXPATHLEN];
-@@ -733,7 +735,7 @@ static struct file_struct *recv_file_ent
+@@ -747,7 +748,7 @@ static struct file_struct *recv_file_ent
uid = (uid_t)read_varint(f);
if (xflags & XMIT_USER_NAME_FOLLOWS)
uid = recv_user_name(f, uid);
uid = match_uid(uid);
}
}
-@@ -745,7 +747,7 @@ static struct file_struct *recv_file_ent
+@@ -759,7 +760,7 @@ static struct file_struct *recv_file_ent
gid_flags = 0;
if (xflags & XMIT_GROUP_NAME_FOLLOWS)
gid = recv_group_name(f, gid, &gid_flags);
gid = match_gid(gid, &gid_flags);
}
}
-@@ -2045,8 +2047,13 @@ struct file_list *recv_file_list(int f)
+@@ -2076,8 +2077,13 @@ struct file_list *recv_file_list(int f)
int dstart, flags;
int64 start_read;
{"timeout", 0, POPT_ARG_INT, &io_timeout, 0, 0, 0 },
{"no-timeout", 0, POPT_ARG_VAL, &io_timeout, 0, 0, 0 },
{"rsh", 'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 },
-@@ -1935,6 +1941,18 @@ void server_options(char **args, int *ar
- args[ac++] = "--no-i-r";
+@@ -1931,6 +1937,18 @@ void server_options(char **args, int *ar
+ args[ac++] = "--use-qsort";
if (am_sender) {
+ if (usermap) {
--- old/rsync.yo
+++ new/rsync.yo
-@@ -379,6 +379,8 @@ to the detailed description below for a
+@@ -378,6 +378,8 @@ to the detailed description below for a
--delay-updates put all updated files into place at end
-m, --prune-empty-dirs prune empty directory chains from file-list
--numeric-ids don't map uid/gid values by user/group name
--timeout=TIME set I/O timeout in seconds
-I, --ignore-times don't skip files that match size and time
--size-only skip files that match in size
-@@ -1553,6 +1555,46 @@ from the source system is used instead.
+@@ -1566,6 +1568,46 @@ from the source system is used instead.
the chroot setting affects rsync's ability to look up the names of the
users and groups and what you can do about it.