X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/f6d530b3fc8d95427a93d51b49ef20f9e3ee5054..b0a04670a254aabe2f5557fedf3459c4537e6d8b:/flist.c diff --git a/flist.c b/flist.c index c0550ecb..f0e557e5 100644 --- a/flist.c +++ b/flist.c @@ -767,7 +767,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist, if (!(xflags & XMIT_SAME_MODE)) mode = from_wire_mode(read_int(f)); - if (chmod_modes && !S_ISLNK(mode)) + if (chmod_modes && !S_ISLNK(mode) && mode) mode = tweak_mode(mode, chmod_modes); if (preserve_uid && !(xflags & XMIT_SAME_UID)) { @@ -1340,7 +1340,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist, if (!file) return NULL; - if (chmod_modes && !S_ISLNK(file->mode)) + if (chmod_modes && !S_ISLNK(file->mode) && file->mode) file->mode = tweak_mode(file->mode, chmod_modes); if (f >= 0) { @@ -2153,7 +2153,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) } /* A dot-dir should not be excluded! */ - if (name_type != DOTDIR_NAME + if (name_type != DOTDIR_NAME && st.st_mode != 0 && is_excluded(fbuf, S_ISDIR(st.st_mode) != 0, ALL_FILTERS)) continue;