extern int do_xfers;
extern int stdout_format_has_i;
extern int logfile_format_has_i;
+extern int receiver_symlink_times;
extern int am_root;
extern int am_server;
extern int am_daemon;
extern int preserve_devices;
extern int preserve_specials;
extern int preserve_hard_links;
+extern int preserve_executability;
extern int preserve_perms;
extern int preserve_times;
extern int uid_ndx;
int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
{
-#ifndef HAVE_LUTIMES
+#if !defined HAVE_LUTIMES || !defined HAVE_UTIMES
if (S_ISLNK(file->mode)) {
;
} else
if (preserve_perms && !BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
return 0;
+ if (preserve_executability && ((sxp->st.st_mode & 0111 ? 1 : 0) ^ (file->mode & 0111 ? 1 : 0)))
+ return 0;
+
if (am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file))
return 0;
{
if (statret >= 0) { /* A from-dest-dir statret can == 1! */
int keep_time = !preserve_times ? 0
- : S_ISDIR(file->mode) ? preserve_times > 1
- : !S_ISLNK(file->mode);
+ : S_ISDIR(file->mode) ? preserve_times > 1 :
+#if defined HAVE_LUTIMES && defined HAVE_UTIMES
+ (receiver_symlink_times && !(file->flags & FLAG_TIME_FAILED)) ||
+#endif
+ !S_ISLNK(file->mode);
if (S_ISREG(file->mode) && F_LENGTH(file) != sxp->st.st_size)
iflags |= ITEM_REPORT_SIZE;
;
} else
#endif
- if (!BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
+ if ((preserve_perms || preserve_executability)
+ && !BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
iflags |= ITEM_REPORT_PERMS;
if (uid_ndx && am_root && (uid_t)F_OWNER(file) != sxp->st.st_uid)
iflags |= ITEM_REPORT_OWNER;
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)) {
+ if (!maybe_ATTRS_REPORT && (verbose > 1 || stdout_format_has_i > 1)) {
itemize(cmpbuf, file, ndx, 1, sxp,
ITEM_LOCAL_CHANGE | ITEM_XNAME_FOLLOWS,
0, "");