X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/332cf6df7c32dbaa47cbfe515121da7bd53974e8..02f0227e87c2922ce9dce075f4c1fad892ee58cc:/generator.c diff --git a/generator.c b/generator.c index f6167df9..db1de189 100644 --- a/generator.c +++ b/generator.c @@ -521,10 +521,10 @@ int unchanged_attrs(const char *fname, struct file_struct *file, statx *sxp) 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 @@ -565,10 +565,10 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre 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)) { @@ -1733,7 +1733,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx) /* 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; @@ -2008,7 +2008,7 @@ void generate_files(int f_out, const char *local_name) 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,