Fix unwritable directory issue due to misordered chmod call.

This commit is contained in:
Wayne Davison
2011-05-30 08:24:27 -07:00
parent 582aead623
commit cb0db58fb3

View File

@@ -1354,6 +1354,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
}
#ifdef SUPPORT_XATTRS
if (preserve_xattrs && statret == 1)
copy_xattrs(fnamecmpbuf, fname);
#endif
if (set_file_attrs(fname, file, real_ret ? NULL : &real_sx, NULL, 0)
&& INFO_GTE(NAME, 1) && code != FNONE && f_out != -1)
rprintf(code, "%s/\n", fname);
/* We need to ensure that the dirs in the transfer have writable
* permissions during the time we are putting files within them.
* This is then fixed after the transfer is done. */
@@ -1369,14 +1377,6 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs && statret == 1)
copy_xattrs(fnamecmpbuf, fname);
#endif
if (set_file_attrs(fname, file, real_ret ? NULL : &real_sx, NULL, 0)
&& INFO_GTE(NAME, 1) && code != FNONE && f_out != -1)
rprintf(code, "%s/\n", fname);
if (real_ret != 0 && one_file_system)
real_sx.st.st_dev = filesystem_dev;
if (inc_recurse) {