diff options
author | Wayne Davison <wayned@samba.org> | 2014-04-20 14:35:55 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2014-04-20 14:41:54 -0700 |
commit | adc600cbe21bdabc3cfd5e7a01d54390ebd885cb (patch) | |
tree | 20ca4df4f4c93988f8ed3d6079254f5b72b60936 | |
parent | 43d6d0c5ba63e3a69717702a1d58ea6a04192bb4 (diff) | |
download | rsync-adc600cbe21bdabc3cfd5e7a01d54390ebd885cb.tar.gz rsync-adc600cbe21bdabc3cfd5e7a01d54390ebd885cb.tar.bz2 rsync-adc600cbe21bdabc3cfd5e7a01d54390ebd885cb.zip |
Check F_IS_ACTIVE() in a few more spots.
The code needs to ignore flist entries that were marked inactive (by
either duplicate removal or empty-dir pruning) in a few more spots.
-rw-r--r-- | generator.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/generator.c b/generator.c index cd7205ee..53e9fbe5 100644 --- a/generator.c +++ b/generator.c @@ -356,6 +356,9 @@ static void do_delete_pass(void) for (j = 0; j < cur_flist->used; j++) { struct file_struct *file = cur_flist->sorted[j]; + if (!F_IS_ACTIVE(file)) + continue; + f_name(file, fbuf); if (!(file->flags & FLAG_CONTENT_DIR)) { @@ -753,6 +756,9 @@ static struct file_struct *find_fuzzy(struct file_struct *file, struct file_list for (j = 0; j < dirlist->used; j++) { struct file_struct *fp = dirlist->files[j]; + if (!F_IS_ACTIVE(fp)) + continue; + if (!S_ISREG(fp->mode) || !F_LENGTH(fp) || fp->flags & FLAG_FILE_SENT) continue; @@ -778,6 +784,9 @@ static struct file_struct *find_fuzzy(struct file_struct *file, struct file_list int len, suf_len; uint32 dist; + if (!F_IS_ACTIVE(fp)) + continue; + if (!S_ISREG(fp->mode) || !F_LENGTH(fp) || fp->flags & FLAG_FILE_SENT) continue; @@ -2016,6 +2025,8 @@ static void touch_up_dirs(struct file_list *flist, int ndx) * transfer and/or re-set any tweaked modified-time values. */ for (i = start; i <= end; i++, counter++) { file = flist->files[i]; + if (!F_IS_ACTIVE(file)) + continue; if (!S_ISDIR(file->mode) || (!implied_dirs && file->flags & FLAG_IMPLIED_DIR)) continue; @@ -2026,8 +2037,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx) } /* Be sure not to retouch permissions with --fake-super. */ fix_dir_perms = !am_root && !(file->mode & S_IWUSR); - if (!F_IS_ACTIVE(file) || file->flags & FLAG_MISSING_DIR - || !(need_retouch_dir_times || fix_dir_perms)) + if (file->flags & FLAG_MISSING_DIR || !(need_retouch_dir_times || fix_dir_perms)) continue; fname = f_name(file, NULL); if (fix_dir_perms) |