if (preserve_perms && !BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
return 0;
- if (am_root && preserve_uid && sxp->st.st_uid != F_UID(file))
+ if (am_root && preserve_uid && sxp->st.st_uid != F_OWNER(file))
return 0;
- if (preserve_gid && F_GID(file) != GID_NONE && sxp->st.st_gid != F_GID(file))
+ if (preserve_gid && !(file->flags & FLAG_SKIP_GROUP) && sxp->st.st_gid != F_GROUP(file))
return 0;
#ifdef SUPPORT_ACLS
iflags |= ITEM_REPORT_TIME;
if (!BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
iflags |= ITEM_REPORT_PERMS;
- if (preserve_uid && am_root && F_UID(file) != sxp->st.st_uid)
+ if (preserve_uid && am_root && F_OWNER(file) != sxp->st.st_uid)
iflags |= ITEM_REPORT_OWNER;
- if (preserve_gid && F_GID(file) != GID_NONE
- && sxp->st.st_gid != F_GID(file))
+ if (preserve_gid && !(file->flags & FLAG_SKIP_GROUP)
+ && sxp->st.st_gid != F_GROUP(file))
iflags |= ITEM_REPORT_GROUP;
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
/* Fix any directory permissions that were modified during the
* transfer and/or re-set any tweaked modified-time values. */
for (i = start, j = 0; i <= end; i++) {
- file = flist->sorted[i];
+ file = flist->files[i];
if (!F_IS_ACTIVE(file) || !S_ISDIR(file->mode)
|| file->flags & FLAG_MISSING_DIR)
continue;
if ((need_retouch_dir_perms || need_retouch_dir_times)
&& dir_tweaking && (!inc_recurse || delete_during == 2))
- touch_up_dirs(inc_recurse ? dir_flist : cur_flist, -1);
+ touch_up_dirs(dir_flist, -1);
if (max_delete >= 0 && deletion_count > max_delete) {
rprintf(FINFO,