extern int preserve_acls;
extern int preserve_xattrs;
extern int need_messages_from_generator;
extern int preserve_acls;
extern int preserve_xattrs;
extern int need_messages_from_generator;
+int uid_ndx, gid_ndx, atimes_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
+int uid_ndx, gid_ndx, atimes_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
-
-@@ -134,6 +135,8 @@ void setup_protocol(int f_out,int f_in)
+ int sender_symlink_iconv = 0; /* sender should convert symlink content */
+@@ -137,6 +138,8 @@ void setup_protocol(int f_out,int f_in)
-@@ -384,7 +385,7 @@ int change_pathname(struct file_struct *file, const char *dir, int dirlen)
-
- static void send_file_entry(int f, const char *fname, struct file_struct *file, int ndx, int first_ndx)
+@@ -393,7 +394,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+ #endif
+ int ndx, int first_ndx)
{
- static time_t modtime;
+ static time_t modtime, atime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
{
- static time_t modtime;
+ static time_t modtime, atime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
-@@ -458,6 +459,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -467,6 +468,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
-@@ -529,6 +537,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -538,6 +546,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
}
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
}
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
-@@ -615,7 +625,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -622,7 +632,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
-@@ -749,6 +759,16 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -756,6 +766,16 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
-@@ -878,6 +898,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -905,6 +925,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
-@@ -1226,6 +1248,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1277,6 +1299,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;
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;
-@@ -1002,6 +1006,8 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -1015,6 +1019,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 (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)) {
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,
+@@ -1200,6 +1206,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
-@@ -2016,7 +2025,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
+@@ -2056,7 +2065,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)
- set_modtime(fname, file->modtime, file->mode);
+ set_times(fname, file->modtime, file->modtime, file->mode);
}
STRUCT_STAT st;
if (link_stat(fname, &st, 0) == 0
&& cmp_time(st.st_mtime, file->modtime) != 0)
- set_modtime(fname, file->modtime, file->mode);
+ set_times(fname, file->modtime, file->modtime, file->mode);
}
-@@ -650,7 +650,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
+@@ -660,7 +660,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';
c[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
c[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
c[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
-@@ -566,7 +585,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,
/* Change permissions before putting the file into place. */
set_file_attrs(fnametmp, file, NULL, fnamecmp,
-@@ -593,7 +612,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,
do_set_file_attrs:
set_file_attrs(fnametmp, file, NULL, fnamecmp,
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
--super receiver attempts super-user activities
--fake-super store/recover privileged attrs using xattrs
-S, --sparse handle sparse files efficiently
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).
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
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
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).
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).
diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
--- a/testsuite/rsync.fns
+++ b/testsuite/rsync.fns
diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
--- a/testsuite/rsync.fns
+++ b/testsuite/rsync.fns
# We can just write everything to stdout/stderr, because the
# wrapper hides it unless there is a problem.
# We can just write everything to stdout/stderr, because the
# wrapper hides it unless there is a problem.
-@@ -105,6 +105,8 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst)
+@@ -107,6 +107,8 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst)
static void failed(char const *what, char const *where)
{
fprintf(stderr, PROGRAM ": %s %s: %s\n",
static void failed(char const *what, char const *where)
{
fprintf(stderr, PROGRAM ": %s %s: %s\n",
-@@ -112,12 +114,29 @@ static void failed(char const *what, char const *where)
+@@ -114,12 +116,29 @@ static void failed(char const *what, char const *where)
(long)minor(buf.st_rdev));
} else /* NB: use double for size since it might not fit in a long. */
printf("%12.0f", (double)buf.st_size);
(long)minor(buf.st_rdev));
} else /* NB: use double for size since it might not fit in a long. */
printf("%12.0f", (double)buf.st_size);
static struct poptOption long_options[] = {
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
+ {"atimes", 'U', POPT_ARG_NONE, &display_atimes, 0, 0, 0},
static struct poptOption long_options[] = {
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
+ {"atimes", 'U', POPT_ARG_NONE, &display_atimes, 0, 0, 0},
+ {"link-times", 'l', POPT_ARG_NONE, &link_times, 0, 0, 0 },
+ {"link-owner", 'L', POPT_ARG_NONE, &link_owner, 0, 0, 0 },
- {"fake-super", 'f', POPT_ARG_VAL, &am_root, -1, 0, 0 },
- #endif
-@@ -197,6 +209,7 @@ static void tls_usage(int ret)
+@@ -203,6 +215,7 @@ static void tls_usage(int ret)
fprintf(F,"usage: " PROGRAM " [OPTIONS] FILE ...\n");
fprintf(F,"Trivial file listing program for portably checking rsync\n");
fprintf(F,"\nOptions:\n");
+ fprintf(F," -U, --atimes display access (last-used) times\n");
fprintf(F,"usage: " PROGRAM " [OPTIONS] FILE ...\n");
fprintf(F,"Trivial file listing program for portably checking rsync\n");
fprintf(F,"\nOptions:\n");
+ fprintf(F," -U, --atimes display access (last-used) times\n");
-@@ -130,9 +130,13 @@ int set_modtime(const char *fname, time_t modtime, mode_t mode)
+@@ -131,9 +131,13 @@ int set_modtime(const char *fname, time_t modtime, mode_t mode)
-@@ -141,7 +145,7 @@ int set_modtime(const char *fname, time_t modtime, mode_t mode)
+@@ -142,7 +146,7 @@ int set_modtime(const char *fname, time_t modtime, mode_t mode)
-@@ -155,12 +159,12 @@ int set_modtime(const char *fname, time_t modtime, mode_t mode)
+@@ -156,12 +160,12 @@ int set_modtime(const char *fname, time_t modtime, mode_t mode)