From ba35ba06c9964d67fd7712f1b103e6d527f30c46 Mon Sep 17 00:00:00 2001
From: Wayne Davison <wayned@samba.org>
Date: Mon, 30 May 2011 08:24:27 -0700
Subject: [PATCH] Fix unwritable directory issue due to misordered chmod call.
---
generator.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/generator.c b/generator.c
index 4f74597..88a762a 100644
--- a/generator.c
+++ b/generator.c
@@ -1523,6 +1523,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)
+ && verbose && 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. */
@@ -1538,14 +1546,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)
- && verbose && 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) {
--
1.7.6.4