]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Dirs need +rx as well as +w for non-super xfers.
authorWayne Davison <wayned@samba.org>
Sat, 3 Sep 2011 19:40:12 +0000 (12:40 -0700)
committerWayne Davison <wayned@samba.org>
Sat, 10 Sep 2011 20:38:11 +0000 (13:38 -0700)
Partial fix for bug 8242.

generator.c

index da6138ad4e2a489ac042181d33fb50765e6e66cb..91fd6878d1fea609c39f9bded09e64bab955c537 100644 (file)
@@ -1531,12 +1531,13 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                    && 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. */
+               /* We need to ensure that the dirs in the transfer have both
+                * readable and writable permissions during the time we are
+                * putting files within them.  This is then restored to the
+                * former permissions after the transfer is done. */
 #ifdef HAVE_CHMOD
-               if (!am_root && !(file->mode & S_IWUSR) && dir_tweaking) {
-                       mode_t mode = file->mode | S_IWUSR;
+               if (!am_root && (file->mode & S_IRWXU) != S_IRWXU && dir_tweaking) {
+                       mode_t mode = file->mode | S_IRWXU;
                        if (do_chmod(fname, mode) < 0) {
                                rsyserr(FERROR_XFER, errno,
                                        "failed to modify permissions on %s",