aboutsummaryrefslogtreecommitdiffstats
path: root/generator.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2009-11-28 21:46:42 -0800
committerWayne Davison <wayned@samba.org>2009-11-28 21:46:42 -0800
commit24079e988fc31af4eba56cd2701fdc5a4154980d (patch)
tree224e63dfac37c253e555aebd796e11bc0a982a8c /generator.c
parent8a68cad1f77ac40f3834f7449ef794e37cba7914 (diff)
downloadandroid_external_rsync-24079e988fc31af4eba56cd2701fdc5a4154980d.tar.gz
android_external_rsync-24079e988fc31af4eba56cd2701fdc5a4154980d.tar.bz2
android_external_rsync-24079e988fc31af4eba56cd2701fdc5a4154980d.zip
Don't (wrongly) retouch dir permissions with --fake-super.
(Patch from Matt.)
Diffstat (limited to 'generator.c')
-rw-r--r--generator.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/generator.c b/generator.c
index 8038feb2..b5db0754 100644
--- a/generator.c
+++ b/generator.c
@@ -1892,6 +1892,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
static int counter = 0;
struct file_struct *file;
char *fname;
+ BOOL fix_dir_perms;
int i, start, end;
if (ndx < 0) {
@@ -1912,11 +1913,13 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
rprintf(FINFO, "touch_up_dirs: %s (%d)\n",
NS(fname), i);
}
+ /* Be sure not to retouch permissions with --fake-super. */
+ fix_dir_perms = !am_root && !(file->mode & S_IWUSR);
if (!F_IS_ACTIVE(file) || file->flags & FLAG_MISSING_DIR
- || (!need_retouch_dir_times && file->mode & S_IWUSR))
+ || !(need_retouch_dir_times || fix_dir_perms))
continue;
fname = f_name(file, NULL);
- if (!(file->mode & S_IWUSR))
+ if (fix_dir_perms)
do_chmod(fname, file->mode);
if (need_retouch_dir_times) {
STRUCT_STAT st;