diff options
author | Wayne Davison <wayned@samba.org> | 2011-09-03 12:40:12 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2011-09-10 13:38:11 -0700 |
commit | b91ab5f9c87b5e725e838bd386fe8e9cc3cb28d6 (patch) | |
tree | b552abb35c0e8460d6f723cd863864310c860ee7 | |
parent | 5340571ab6c29ebe15d4352fcd77d2f2d3ff2fc1 (diff) | |
download | rsync-b91ab5f9c87b5e725e838bd386fe8e9cc3cb28d6.tar.gz |
Dirs need +rx as well as +w for non-super xfers.
Partial fix for bug 8242.
-rw-r--r-- | generator.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/generator.c b/generator.c index da6138ad..91fd6878 100644 --- a/generator.c +++ b/generator.c @@ -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", |